Data packet processing method, device, electronic device and computer readable storage medium
By establishing a sequence table in the PDCP layer and determining the packet location based on the sequence number and superframe number, the problem of low packet transmission efficiency in the prior art is solved, and the fast sorting and efficient transmission of data packets are realized.
Patent Information
- Application Number
- CN202411964132.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In the NR communication protocol, when the PDCP layer transmits data packets to the SDAP layer, it needs to reorder the data packets, but the existing reordering algorithm is inefficient when processing large amounts of data, resulting in abandonment and retransmission of data packets, reducing the efficiency of packet transmission.
By establishing a sequence table, quickly determine the position number of the data packets in the sequence table based on the sequence number and superframe number of the data packets, and fill in the sequence table, thereby achieving quick sorting of data packets.
It improves the efficiency of PDCP packet transmission, reduces the abandonment and retransmission of data packets, and improves the overall data transmission performance.
Smart Images

Figure CN119402436B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and specifically to a data packet processing method, device, electronic device, and computer-readable storage medium. Background Art
[0002] In the NR (New Radio) communication protocol, PDCP (Packet Data Convergence Protocol) is a very important layer for data transmission. When the PDCP layer transmits data packets upward to the SDAP (Service Data Adaptation Protocol) layer, the data packets need to be reordered.
[0003] The reordering algorithm in the related art performs sorting based on the reordering window and the reordering timer (t-Reordering). After the reordering timer expires, the data packets that have not entered the sorting will be discarded. When there is a large amount of data, the reordering algorithm will not have time to process the data, and the unsorted data packets will be abandoned. The abandoned data packets need to be retransmitted, resulting in low data packet transmission efficiency. Summary of the invention
[0004] The embodiments of the present application provide a data packet processing method, device, electronic device and computer-readable storage medium, which can quickly sort data packets through a sequence table to improve the PDCP data packet transmission efficiency.
[0005] In a first aspect, an embodiment of the present application provides a data packet processing method, including:
[0006] In response to the PDCP layer receiving multiple data packets, parsing the sequence number and superframe number of each of the data packets;
[0007] Determine, according to a sequence number and a superframe number of a first data packet, a position number of the first data packet in a sequence table, wherein the first data packet belongs to the plurality of data packets;
[0008] Fill the first data packet into the sequence table according to the position number of the first data packet.
[0009] In one embodiment, before determining the position number of the first data packet in the sequence table according to the sequence number and the superframe number of the first data packet, the method further includes:
[0010] The sequence table is established according to the sequence number and super frame number of each data packet.
[0011] In one embodiment, establishing the sequence table according to the sequence number and superframe number of each of the data packets includes:
[0012] Obtaining the maximum value of the sequence numbers of the data packets;
[0013] Obtaining a maximum value of the super frame numbers of the data packets;
[0014] Determine the length of the sequence table according to the maximum value of the sequence number and the maximum value of the superframe number;
[0015] A sequence list is established according to the length of the sequence list.
[0016] In one embodiment, determining the position number of the first data packet in the sequence table according to the sequence number and the superframe number of the first data packet includes:
[0017] Obtaining the maximum value of the sequence numbers of the data packets;
[0018] The position number of the first data packet in the sequence table is determined according to the sequence number and superframe number of the first data packet and the maximum value of the sequence number.
[0019] In one embodiment, determining the position number of the first data packet in the sequence table according to the sequence number and superframe number of the first data packet and the maximum sequence number includes:
[0020] The position number N of the first data packet in the sequence table is determined according to the following formula:
[0021] N=HFN * (SN_MAX + 1) + SN + 1;
[0022] HFN is the superframe number of the first data packet, SN_MAX is the maximum value of the sequence number, and SN is the sequence number of the first data packet.
[0023] In one embodiment, after filling the first data packet into the sequence table according to the position number of the first data packet, the method further includes:
[0024] Determine, according to the sequence number and the superframe number of the second data packet, a position number of the second data packet in the sequence table, wherein the second data packet belongs to the plurality of data packets;
[0025] When the position numbers of the second data packet and the first data packet in the sequence table are the same, the second data packet is discarded.
[0026] In one embodiment, after filling the first data packet into the sequence table according to the position number of the first data packet, the method further includes:
[0027] Check whether there is an empty position in the sequence table;
[0028] When there is an idle position in the sequence table, a data retransmission request is initiated.
[0029] In one embodiment, after filling the first data packet into the sequence table, the method further includes:
[0030] transmitting the sequence table to a reordering window;
[0031] Executing a reordering algorithm on the data packets in the sequence table in the reordering window;
[0032] The reordered data packets are transmitted to the SDAP layer.
[0033] In one embodiment, before establishing the sequence table according to the sequence number and superframe number of each of the data packets, the method further comprises:
[0034] Integrity verification is performed on the multiple data packets according to the sequence numbers and superframe numbers of the multiple data packets.
[0035] In a second aspect, an embodiment of the present application provides a data packet processing device, including:
[0036] A parsing module, configured to parse out a sequence number and a superframe number of each of the data packets in response to the PDCP layer receiving multiple data packets;
[0037] a determination module, configured to determine a position number of the first data packet in the sequence table according to a sequence number and a superframe number of the first data packet, wherein the first data packet belongs to the plurality of data packets;
[0038] A filling module is used to fill the first data packet into the sequence table according to the position number of the first data packet.
[0039] In one embodiment, before determining the position number of the first data packet in the sequence table according to the sequence number and the superframe number of the first data packet, the method further includes:
[0040] The establishing module is used to establish the sequence table according to the sequence number and super frame number of each data packet.
[0041] In one embodiment, the establishment module includes:
[0042] A first acquisition unit, used to acquire a maximum value of sequence numbers among the sequence numbers of the data packets;
[0043] A second acquisition unit, used for acquiring a maximum value of the super frame numbers of the super frame numbers of the data packets;
[0044] A length determination unit, used to determine the length of the sequence table according to the maximum value of the sequence number and the maximum value of the superframe number;
[0045] The establishing unit is used to establish a sequence list according to the length of the sequence list.
[0046] In one embodiment, the determining module includes:
[0047] A third obtaining unit, used to obtain a maximum sequence number among the sequence numbers of the data packets;
[0048] The number determination unit is used to determine the position number of the first data packet in the sequence table according to the sequence number and super frame number of the first data packet and the maximum value of the sequence number.
[0049] In one embodiment, the number determination unit is specifically used to:
[0050] The position number N of the first data packet in the sequence table is determined according to the following formula:
[0051] N=HFN * (SN_MAX + 1) + SN + 1;
[0052] HFN is the superframe number of the first data packet, SN_MAX is the maximum value of the sequence number, and SN is the sequence number of the first data packet.
[0053] In one embodiment, after filling the first data packet into the sequence table according to the position number of the first data packet, the method further includes:
[0054] a position number determination module, configured to determine a position number of the second data packet in the sequence table according to a sequence number and a superframe number of the second data packet, wherein the second data packet belongs to the plurality of data packets;
[0055] A discarding module is used to discard the second data packet when the position number of the second data packet and the first data packet in the sequence table is the same.
[0056] In one embodiment, after filling the first data packet into the sequence table according to the position number of the first data packet, the device further comprises:
[0057] A checking module, used for checking whether there is an empty position in the sequence table;
[0058] The retransmission module is used to initiate a data retransmission request when there is an idle position in the sequence table.
[0059] In one embodiment, after filling the first data packet into the sequence table, the apparatus further comprises:
[0060] A first transmission module, used for transmitting the sequence table to the reordering window;
[0061] An execution module, configured to execute a reordering algorithm on the data packets in the sequence table in the reordering window;
[0062] The second transmission module is used to transmit the reordered data packets to the SDAP layer.
[0063] In one of the embodiments, before establishing the sequence table according to the sequence number and the superframe number of each of the data packets, the apparatus further comprises:
[0064] The integrity verification module is used to verify the integrity of the multiple data packets according to the sequence numbers and super frame numbers of the multiple data packets.
[0065] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps in the above-mentioned data packet processing method when executed by the processor.
[0066] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned data packet processing method are implemented.
[0067] In a fifth aspect, the embodiments of the present application further provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.
[0068] In summary, the beneficial effect of the present application is that after parsing the sequence number and superframe number of the data packet, the position number of the first data packet in the sequence table can be determined according to the sequence number and superframe number of the first data packet, and the first data packet can be filled into the sequence table according to the position number. In this way, the data packets can be quickly sorted by the sequence number and superframe number of the data packet. When the reordering algorithm is subsequently executed based on the data packet, the reordering can be completed quickly, thereby improving the data packet transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0070] Figure 1 is a schematic diagram of a reordering algorithm of the related art;
[0071] Figure 2 It is a schematic diagram of the steps of a data packet processing method provided by an embodiment of the present application;
[0072] Figure 3 It is a schematic diagram of the steps of a data packet processing method provided by an embodiment of the present application;
[0073] Figure 4 It is a flowchart of a data packet processing method provided by an embodiment of the present application;
[0074] Figure 5 It is a flowchart of a data packet processing method provided by an embodiment of the present application;
[0075] Figure 6 It is a flowchart of a data packet processing method provided by an embodiment of the present application;
[0076] Figure 7 It is a processing diagram of a sequence table provided in an embodiment of the present application;
[0077] Figure 8 It is a structural diagram of a data packet processing device provided by an embodiment of the present application;
[0078] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0079] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0080] Figure 1 It is a schematic diagram of a reordering algorithm of the related art. Figure 1 RX_deliv is used to describe the process by which a network device successfully receives and delivers a data packet from a network interface to its intended destination; RX_next represents the next data packet received by the network interface before passing it to a higher-layer protocol; and RX_reord is used to describe the process by which a network device reorders out-of-order data packets so that they are passed to higher-layer protocols in the correct order. In the related art, after receiving a data packet, the PDCP layer parses the sequence number (SN), hyperframe number (HFN), and count value (COUNT) of the data packet, and then performs a reordering algorithm based on the sequence number, hyperframe number, and count value of the data packet. During the reordering process, the reordering window is used to sort the data packets. If the data packets that are sorted first do not arrive on time, the reordering timer will be enabled. If the data packet still does not arrive at the reordering window before the timer expires, the sorted data packet will be transmitted to the SDAP layer. After the data packet is transmitted to the SDAP layer, it will be discarded even if the data packet arrives again.
[0081] In one embodiment, Figure 2 As shown, a data packet processing method is provided. Although a logical order is shown in the step diagram, in some cases, the steps shown or described may be performed in an order different from that shown in the figure. Specifically, the data packet processing method can be applied to a terminal or a server, wherein the terminal may include but is not limited to one or more of a smart phone, a tablet computer, a portable computer, a desktop computer, and a vehicle-mounted computer. The server may be a physical server or a cloud server that provides various cloud services. It is worth noting that the present application does not limit the number of terminals or servers. According to the implementation requirements, there may be any number of terminals or servers. For example, the server may be a single server or a server cluster consisting of multiple servers, and so on.
[0082] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0083] according to Figure 2The data packet processing method shown in the figure includes at least steps S110 to S130, which are described in detail as follows:
[0084] In step S110, in response to the PDCP layer receiving multiple data packets, the sequence number and superframe number of each of the data packets are parsed.
[0085] The PDCP layer is part of the data link layer in the NR mobile communication standard. The PDCP layer transfers data downward to the RLC (Radio Link Control Protocol) layer and upward to the SDAP layer. Due to the inherent limitations of the wireless channel, data packets may arrive at the PDCP layer out of order, so data packets need to be reordered at the PDCP layer.
[0086] By decompressing the data packet, the sequence number and superframe number of the data packet can be parsed. The sequence number of the data packet is a 32-bit unsigned integer used to identify and sort the data packets. The superframe number of the data packet is used to identify the superframe and subframe in which the data packet is transmitted or received. The superframe number can limit the number of bits of the transmission sequence number.
[0087] Each data packet is assigned a unique sequence number during transmission. The PDCP protocol sorts and reassembles the data packets according to the sequence number to ensure the orderly transmission of data. In PDCP data transmission, the sequence number and superframe number both start from 0 and increase. Whenever the sequence number reaches the maximum value, the sequence number will loop back to 0 and the superframe number will increase by 1. The sequence number and superframe number of the data packet jointly identify the data packet to ensure the uniqueness of the data packet.
[0088] In one embodiment, the integrity of the data packet is verified based on the sequence number and superframe number of the data packet. The integrity verification can be achieved by performing a sequence number check based on the sequence number of the data packet. When the PDCP layer receives the data packet, it recalculates the sequence number checksum and compares it with the received checksum. If the checksum does not match, it indicates that the data packet is damaged and the PDCP layer will discard the data packet.
[0089] In step S120, the position number of the first data packet in the sequence table is determined according to the sequence number and super frame number of the first data packet.
[0090] The first data packet belongs to the multiple data packets; the first data packet can be any data packet among the multiple data packets.
[0091] Each position in the sequence list is in order, and each position in the sequence list can be numbered in sequence. Each data packet can be distinguished according to the sequence number and superframe number of the data packet. According to the sequence number and superframe number of the first data packet, the sequence number of the first data packet can be determined, and according to the sequence number of the first data packet, the position number of the first data packet in the sequence list can be determined.
[0092] In step S130, the first data packet is filled into the sequence table according to the position number of the first data packet.
[0093] Fill the first data packet into the sequence table according to the position number of the first data packet.
[0094] By adopting the technical solution of the embodiment of the present application, the sequence number and superframe number of the data packet are parsed, and the position number of the first data packet in the sequence table can be determined according to the sequence number and superframe number of the first data packet, and the first data packet is filled into the sequence table according to the position number. In this way, the data packets can be quickly sorted by the sequence number and superframe number of the data packet. When the reordering algorithm is subsequently executed based on the data packet, the reordering can be completed quickly, thereby improving the data packet transmission efficiency.
[0095] Based on the above technical solution, before establishing the sequence table according to the sequence numbers and superframe numbers of each of the data packets, the method may further include: performing integrity verification on the multiple data packets according to the sequence numbers and superframe numbers of the multiple data packets.
[0096] The data types and value ranges of the sequence numbers and superframe numbers of the plurality of data packets may be obtained. It is checked whether the sequence number of each of the data packets conforms to the data type of the sequence number of the data packet, and whether the sequence number of the data packet is within the value range of the sequence number of the data packet. It is checked whether the superframe number of each of the data packets conforms to the data type of the superframe number of the data packet, and whether the superframe number of the data packet is within the value range of the superframe number of the data packet.
[0097] If the sequence number or superframe number of the data packet does not conform to the corresponding data type, or is not within the corresponding value range, it proves that an error occurred in the transmission or parsing stage of the data packet, and the data integrity cannot be guaranteed. If the sequence number and superframe number of the data packet both conform to the corresponding data type and are within the corresponding value range, it proves that the data packet has passed the integrity verification.
[0098] In this way, by verifying the integrity of the data packet, the integrity of the data packet can be guaranteed, thereby ensuring that an accurate sequence table can be established based on the sequence number and superframe number of the data packet to quickly sort the data packet, thereby improving the data packet transmission efficiency.
[0099] Based on the above technical solution, before determining the position number of the first data packet in the sequence table according to the sequence number and super frame number of the first data packet, the method may further include: establishing the sequence table according to the sequence number and super frame number of each of the data packets.
[0100] A sequence list is an ordered data structure that stores elements in order. Each element in the sequence list can be accessed through an index, which indicates the position of the element in the sequence list. The sequence list can be a hash table or an ordered array, etc.
[0101] The sequence table must ensure that each non-repetitive data packet can be stored completely, so the length of the sequence table can be determined according to the number of data packets, thereby establishing the sequence table. The number of data packets can be determined according to the sequence number and superframe number of each data packet.
[0102] In one embodiment, duplicate data packets are directly excluded based on the sequence number and superframe number of each data packet, and the total number of non-duplicate data packets is counted, and the total number of non-duplicate data packets is determined as the length of the sequence table, thereby establishing a sequence table.
[0103] In another embodiment, establishing the sequence table according to the sequence numbers and superframe numbers of each of the data packets may include: obtaining the maximum value of the sequence numbers among the sequence numbers of each of the data packets; obtaining the maximum value of the superframe numbers among the superframe numbers of each of the data packets; determining the length of the sequence table according to the maximum value of the sequence number and the maximum value of the superframe number; and establishing the sequence table according to the length of the sequence table.
[0104] Because in PDCP data transmission, the sequence number and super frame number both increase from 0. Whenever the sequence number reaches the maximum value, the sequence number will cycle back to 0 and the super frame number will increase by 1. The sequence number and the super frame number jointly identify the data packet, which can ensure the uniqueness of the data packet.
[0105] Therefore, the maximum value of the sequence number in the sequence number of each data packet and the maximum value of the super frame number in the super frame number can be directly obtained, and the total number of non-repetitive data packets can be determined based on the maximum value of the sequence number and the maximum value of the super frame number. The total number of non-repetitive data packets is determined as the length of the sequence table, thereby establishing a sequence table.
[0106] The length L of the sequence table can be determined by the formula L=(HFN_MAX + 1) * (SN_MAX + 1); wherein HFN_MAX is the maximum value of the superframe number, and SN_MAX is the maximum value of the sequence number.
[0107] In this way, there is no need to determine whether the data packet is repeated. The length of the sequence table can be quickly determined based on the sequence number and superframe number, thereby improving efficiency.
[0108] Based on the above technical solution, as an embodiment, determining the position number of the first data packet in the sequence table according to the sequence number and superframe number of the first data packet may include: obtaining the maximum sequence number among the sequence numbers of each of the data packets; determining the position number of the first data packet in the sequence table according to the sequence number and superframe number of the first data packet and the maximum sequence number.
[0109] In one embodiment, the position number corresponding to the first position in the sequence list is 1, and the position numbers of the remaining positions are incremented by 1. Then, the position number N of the data packet in the sequence list can be determined according to the following formula:
[0110] N=HFN * (SN_MAX + 1) + SN + 1;
[0111] HFN is the superframe number of the data packet, SN_MAX is the maximum value of the sequence number, and SN is the sequence number of the data packet.
[0112] In another embodiment, the position number corresponding to the first position in the sequence list is 0, and the position numbers of the remaining positions are incremented by 1. Then, the position number N of the data packet in the sequence list can be determined according to the following formula:
[0113] N = HFN * (SN_MAX + 1) + SN;
[0114] HFN is the superframe number of the data packet, SN_MAX is the maximum value of the sequence number, and SN is the sequence number of the data packet.
[0115] By adopting the technical solution of the embodiment of the present application, the position number of the first data packet in the sequence table can be determined according to the serial number and super frame number of the first data packet, and the position numbers determined according to the serial numbers and super frame numbers of different data packets are different. Subsequently, the data packets are filled into the sequence table according to the position numbers, thereby realizing the sorting of the data packets.
[0116] Based on the above technical solution, Figure 3 As shown, as an embodiment, after filling the first data packet into the sequence table according to the position number of the first data packet, the method may further include steps S140 to S150.
[0117] In step S140, the position number of the second data packet in the sequence table is determined according to the sequence number and the super frame number of the second data packet.
[0118] In step S150, when the position numbers of the second data packet and the first data packet in the sequence table are the same, the second data packet is discarded.
[0119] Wherein, the second data packet belongs to the plurality of data packets. When the second data packet among the plurality of data packets and the first data packet among the plurality of data packets have the same corresponding position in the sequence table, the second data packet is discarded.
[0120] The position numbers determined by the sequence numbers and superframe numbers of different data packets are different. When the second data packet arrives, it is determined that the first data packet already exists at the position corresponding to the second data packet, which proves that the first data packet and the second data packet have the same sequence number and superframe number, and the first data packet and the second data packet are the same data packet. Therefore, one of the data packets can be directly discarded. For simple operation, the second data packet that arrives later can be directly discarded.
[0121] In this way, by filling the data packets into the sequence table, on the one hand, the data packets can be sorted, and on the other hand, the duplicate data packets can be deduplicated.
[0122] Based on the above technical solution, Figure 4 As shown, as an embodiment, the method may further include steps S160 to S170.
[0123] In step S160, it is checked whether there is an empty position in the sequence table.
[0124] In step S170, when there is an idle position in the sequence table, a data retransmission request is initiated.
[0125] The length of the sequence table is determined by the maximum value of the sequence number and the maximum value of the superframe number. The length of the sequence table is consistent with the total number of non-repeated data packets. Therefore, when there is an idle position in the sequence table, it proves that the data packet corresponding to the idle position has not been received. A data retransmission request can be initiated to the bottom layer to ensure that each data packet has been filled in the sequence table when reordering.
[0126] In one embodiment, it is possible to periodically check whether there is an idle position in the sequence list. When it is checked that there is an idle position in the sequence list, a data retransmission request is initiated. When it is checked that there is no idle position in the sequence list, a subsequent reordering algorithm is executed.
[0127] By adopting the technical solution of the embodiment of the present application, it is possible to quickly check whether a data packet has been received through the sequence table, and if a data packet has not been received, initiate a data retransmission request to the bottom layer, thereby ensuring that each data packet has been filled in the sequence table when reordering.
[0128] Based on the above technical solution, Figure 5 As shown, as an embodiment, after filling the data packet into the sequence table, the method may further include steps S180 to S210.
[0129] In step S180, the sequence table is transmitted to the reordering window;
[0130] In step S190, a reordering algorithm is executed on the data packets in the sequence table in the reordering window;
[0131] In step S210, the reordered data packets are transmitted to the SDAP layer.
[0132] After each position in the sequence list is filled with data packets, the sequence list is transmitted to the reordering window, and the reordering window executes a reordering algorithm on the data packets in the sequence list.
[0133] The reordering algorithm checks whether the sequence number of the data packet is within the expected range. If the sequence number of the data packet is not within the expected range, the data packet is discarded. If the sequence number of the data packet is within the expected range, the superframe number of the data packet is checked to see if it matches the superframe number of the currently processed superframe. If not, the data packet is discarded. If it matches, the data packet is placed in the buffer, and the data packets in the buffer are sorted by sequence number.
[0134] When the related technology reorders data packets, if there are lost data packets, it is necessary to wait for the lost data packets to arrive. When all the lost data packets arrive, the PDCP layer takes the data packets out of the buffer and reassembles them in sequence, and transmits the reassembled data packets to the SDAP layer.
[0135] In one embodiment of the present application, the reordering window performs a reordering algorithm on the data packets in the sequence table. Because the sequence table is established based on the maximum value of the sequence number and the maximum value of the superframe number, the position number in the sequence table corresponds to the sequence number and the superframe number of the data packet. Therefore, the reordering window performs a reordering algorithm on the data packets in the sequence table. The sequence number of the data packet in the sequence table is within the expected range, and the superframe number matches the superframe number of the currently processed superframe, so the data packet in the sequence table can be placed in the buffer. Because the data packets in the sequence table are sorted, when the buffer sorts the data packets, the sorting can be completed quickly so that the sorted data packets can be subsequently transmitted to the SDAP layer.
[0136] By adopting the technical solution of the embodiment of the present application, each data packet is filled in the sequence table, so there is no data packet loss, and because each data packet in the sequence table is sorted, the reordering of the data packets can be completed quickly when reordering is performed.
[0137] In one embodiment, because the sequence table has already implemented the sequencing of the data packets, the data packets in the sequence table can be directly transmitted to the SDAP layer without executing a re-sequencing algorithm.
[0138] Figure 6 is a flow chart of a data packet processing method provided by an embodiment of the present application, such as Figure 6 As shown, in step S601, the PDCP layer receives a data packet. In step S602, the SN and HFN of the data packet are parsed. After receiving the data packet, the PDCP layer parses the data packet to obtain the sequence number and super frame number of the data packet. In step S603, integrity verification is performed. In step S604, a sequence table is established. A sequence table is established according to the sequence number and super frame number of the data packet. In step S605, the data packet is filled into the sequence table according to the SN and HFN. The data packet is filled into the sequence table according to the sequence number and super frame number of the data packet. In step S606, it is determined whether the data packet is repeated or lost. When the data packet is repeated or lost, step S607 is executed; when the data packet is not repeated or lost, step S608 is executed. In step S607, the lost data packet applies for retransmission request, and the repeated data packet is discarded. By checking whether the sequence table really contains data packet loss, if there is data packet loss, the data packet is quickly requested to be retransmitted. If there is data packet duplication, the data packet is discarded. In step S608, reordering is performed based on the sequence table. In step S609, the reordered data packets are transmitted to the SDAP layer.
[0139] Figure 7 is a schematic diagram of processing a sequence table provided in an embodiment of the present application. As an embodiment, Figure 7 As shown, in response to the PDCP layer receiving multiple data packets, the sequence number and super frame number of each data packet are parsed.
[0140] According to the sequence number and superframe number of each data packet, the sequence table is established, and the length of the sequence table is determined specifically according to the maximum value of the sequence number and the maximum value of the superframe number. Among them, the maximum value of the sequence number SN_MAX is 7, and the maximum value of the superframe number HFN_MAX is 2. It can be determined that the length of the sequence table is L=(SN_MAX+1)*(HFN_MAX+1)=24; in this embodiment, the position number of the sequence table increases in sequence from 0. According to the length of the sequence table and the position number of the sequence table, the original state of the established sequence table can be determined, and the original state of the sequence table is the state in which the data packet has not been filled.
[0141] According to the sequence number and the superframe number of the first data packet, the position number of the first data packet in the sequence table is determined, wherein the first data packet belongs to the multiple data packets; according to the position number of the first data packet, the first data packet is filled into the sequence table. Wherein, filling the data packet into the sequence table is actually filling the COUNT value of the data packet into the sequence table, and the COUNT value of the data packet is equal to HFN * (SN_MAX + 1) + SN.
[0142] For example, when the HFN of the first data packet is 0 and the SN is 0, the COUNT value of the data packet is 0, and the position number of the data packet in the sequence table is N=HFN * (SN_MAX + 1) + SN=0; Figure 7 As shown, the COUNT value "0" of the first data packet can be filled into the cell with position number 0 in the sequence table, and the result is Figure 7 A sequence table filled with "0".
[0143] When the HFN of another first data packet is 1 and the SN is 2, the position number of the data packet in the sequence table is N=HFN *(SN_MAX + 1) + SN=10; Figure 7 As shown, the COUNT value "10" of the first data packet can be filled into the cell with position number 10 in the sequence table that has been filled with "0", and the result is Figure 7 A sequential table of "0" and "10" is filled in.
[0144] When the HFN of another first data packet is 0 and the SN is 4, the position number of the data packet in the sequence table is N=HFN*(SN_MAX+1)+SN=4; Figure 7 As shown, the COUNT value "4" of the first data packet can be filled into the cell with position number 4 in the sequence table that has been filled with "0" and "10", and the result is Figure 7 A sequential table with "0", "10" and "4" filled in.
[0145] According to the sequence number and superframe number of the second data packet, the position number of the second data packet in the sequence table is determined, wherein the second data packet belongs to the plurality of data packets; when the position number of the second data packet and the first data packet in the sequence table is the same, the second data packet is discarded. When data packets with the same sequence number and the same superframe number are received repeatedly, the data packets are duplicated, and the duplicated data packets are discarded. Figure 7 In the fifth sequence table drawn from top to bottom, when the data packet with position number 10 is received for the second time, there is already a data packet in the cell corresponding to the position number. If the data packet with position number 10 received for the second time is also filled into the sequence table, data packet duplication will occur. At this time, the data packet with position number 10 can be discarded.
[0146] Check whether there is an idle position in the sequence table; if there is an idle position in the sequence table, initiate a data retransmission request. Check whether there is an idle position in the sequence table. If there is an idle position, it means that the data packet is missing. Request retransmission of the missing data packet before executing the reordering algorithm. When executing the reordering algorithm, ensure that each data packet has arrived. Figure 7In the sixth sequence table drawn from top to bottom, when the reordering is executed, it is found that there is no data packet in the cell with position number 15, which proves that the data packet is missing. At this time, the retransmission mechanism can be triggered to ensure that the corresponding data packet exists in the cell with position number 15 when the reordering is performed.
[0147] The sequence table is transmitted to the reordering window; and a reordering algorithm is executed on the data packets in the sequence table in the reordering window. The reordering algorithm is executed based on the sequence table, and there is no data missing or reordering timeout, and the reordering algorithm can be completed quickly, thereby improving data transmission efficiency. Figure 7 The first row in the table corresponding to the reordering algorithm represents the data packets that have been arranged in the order of 0 to 23 in the sequence table. Therefore, when the reordering algorithm is performed based on the sequence table, the data packets in the reordering window are also ordered data packets, so the reordering algorithm can be completed quickly. Among them, the second row in the table corresponding to the reordering algorithm represents the sequence number of the data packet, and the HFN shown in the interval on the table represents the super frame number of each data packet in the interval.
[0148] In order to better implement the data packet processing method of the present application, the present application also provides a data packet processing device based on the above data packet processing method. The meanings of the terms are the same as those in the above data packet processing method, and the specific implementation details can refer to the description in the method embodiment.
[0149] See also Figure 8 , Figure 8 : is a schematic diagram of the structure of a data packet processing device provided in an embodiment of the present application, the data packet processing device comprising:
[0150] The parsing module 801 is used to parse out the sequence number and superframe number of each data packet in response to the PDCP layer receiving multiple data packets;
[0151] A determination module 802, configured to determine a position number of a first data packet in a sequence table according to a sequence number and a superframe number of the first data packet, wherein the first data packet belongs to the plurality of data packets;
[0152] The filling module 803 is used to fill the first data packet into the sequence table according to the position number of the first data packet.
[0153] In one embodiment, before determining the position number of the first data packet in the sequence table according to the sequence number and the superframe number of the first data packet, the method further includes:
[0154] The establishing module is used to establish the sequence table according to the sequence number and super frame number of each data packet.
[0155] In one embodiment, the establishment module includes:
[0156] A first acquisition unit, used to acquire a maximum value of sequence numbers among the sequence numbers of the data packets;
[0157] A second acquisition unit, used for acquiring a maximum value of the super frame numbers of the super frame numbers of the data packets;
[0158] A length determination unit, used to determine the length of the sequence table according to the maximum value of the sequence number and the maximum value of the superframe number;
[0159] The establishing unit is used to establish a sequence list according to the length of the sequence list.
[0160] In one embodiment, the determining module 802 includes:
[0161] A third obtaining unit, used to obtain a maximum sequence number among the sequence numbers of the data packets;
[0162] The number determination unit is used to determine the position number of the first data packet in the sequence table according to the sequence number and super frame number of the first data packet and the maximum value of the sequence number.
[0163] In one embodiment, the number determination unit is specifically used to:
[0164] The position number N of the first data packet in the sequence table is determined according to the following formula:
[0165] N=HFN * (SN_MAX + 1) + SN + 1;
[0166] HFN is the superframe number of the first data packet, SN_MAX is the maximum value of the sequence number, and SN is the sequence number of the first data packet.
[0167] In one embodiment, after filling the first data packet into the sequence table according to the position number of the first data packet, the method further includes:
[0168] a position number determination module, configured to determine a position number of the second data packet in the sequence table according to a sequence number and a superframe number of the second data packet, wherein the second data packet belongs to the plurality of data packets;
[0169] A discarding module is used to discard the second data packet when the position number of the second data packet and the first data packet in the sequence table is the same.
[0170] In one embodiment, after filling the first data packet into the sequence table according to the position number of the first data packet, the device further comprises:
[0171] A checking module, used for checking whether there is an empty position in the sequence table;
[0172] The retransmission module is used to initiate a data retransmission request when there is an idle position in the sequence table.
[0173] In one embodiment, after filling the first data packet into the sequence table, the apparatus further comprises:
[0174] A first transmission module, used for transmitting the sequence table to the reordering window;
[0175] An execution module, configured to execute a reordering algorithm on the data packets in the sequence table in the reordering window;
[0176] The second transmission module is used to transmit the reordered data packets to the SDAP layer.
[0177] In one of the embodiments, before establishing the sequence table according to the sequence number and the superframe number of each of the data packets, the apparatus further comprises:
[0178] The integrity verification module is used to verify the integrity of the multiple data packets according to the sequence numbers and super frame numbers of the multiple data packets.
[0179] By adopting the technical solution of the embodiment of the present application, the sequence number and superframe number of the data packet are parsed, and the position number of the first data packet in the sequence table can be determined according to the sequence number and superframe number of the first data packet, and the first data packet is filled into the sequence table according to the position number. In this way, the data packets can be quickly sorted by the sequence number and superframe number of the data packet. When the reordering algorithm is subsequently executed based on the data packet, the reordering can be completed quickly, thereby improving the data packet transmission efficiency.
[0180] For the specific definition of the data packet processing device, please refer to the definition of the data packet processing method above, which will not be repeated here. Each module in the above-mentioned data packet processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0181] In addition, the present application also provides an electronic device, such as Fig. 9 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:
[0182] The electronic device may include one or more processors 901 of processing cores and one or more computer-readable storage media memories 902 and other components. Those skilled in the art will appreciate that Fig. 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0183] The processor 901 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 902, and calling data stored in the memory 902, so as to monitor the electronic device as a whole. Optionally, the processor 901 may include one or more processing cores; preferably, the processor 901 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 901.
[0184] The memory 902 can be used to store software programs and modules. The processor 901 executes various functional applications and data processing by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 902 may also include a memory controller to provide the processor 901 with access to the memory 902.
[0185] In one embodiment, the electronic device further includes a power supply 903 for supplying power to various components. Preferably, the power supply 903 can be logically connected to the processor 901 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 903 can also include any components such as one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, and power status indicators.
[0186] In one embodiment, the electronic device may further include an input unit 904, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0187] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 901 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 902 according to the following instructions, and the processor 901 will run the application programs stored in the memory 902, thereby implementing the steps in any one of the data packet processing methods provided in the embodiments of the present application.
[0188] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0189] In one embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any embodiment of the present application is implemented.
[0190] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present application is implemented.
[0191] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which implement the method described in any embodiment of the present application when executed by a processor.
[0192] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0193] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0194] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any data packet processing method provided in the present application.
[0195] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0196] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0197] Since the instructions stored in the computer-readable storage medium can execute the steps in any data packet processing method provided in the present application, the beneficial effects that can be achieved by any data packet processing method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0198] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0199] The above is a detailed introduction to a data packet processing method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A data packet processing method, characterized in that: include: In response to the PDCP layer receiving multiple data packets, parsing the sequence number and superframe number of each of the data packets; Determine, according to a sequence number and a superframe number of a first data packet, a position number of the first data packet in a sequence table, wherein the first data packet belongs to the plurality of data packets; Filling the first data packet into the sequence table according to the position number of the first data packet; The step of determining the position number of the first data packet in the sequence table according to the sequence number and the superframe number of the first data packet includes: Obtaining the maximum value of the sequence numbers of the data packets; The position number of the first data packet in the sequence table is determined according to the sequence number and superframe number of the first data packet and the maximum value of the sequence number.
2. A data packet processing method according to claim 1, characterized in that: Before determining the position number of the first data packet in the sequence table according to the sequence number and the superframe number of the first data packet, the method further includes: The sequence table is established according to the sequence number and super frame number of each data packet.
3. A data packet processing method according to claim 2, characterized in that: The step of establishing the sequence table according to the sequence number and the superframe number of each of the data packets comprises: Obtaining the maximum value of the sequence numbers of the data packets; Obtaining a maximum value of the super frame numbers of the data packets; Determine the length of the sequence table according to the maximum value of the sequence number and the maximum value of the superframe number; A sequence list is established according to the length of the sequence list.
4. A data packet processing method according to claim 1, characterized in that: Determining the position number of the first data packet in the sequence table according to the sequence number and the superframe number of the first data packet and the maximum sequence number includes: The position number N of the first data packet in the sequence table is determined according to the following formula: N=HFN * (SN_MAX + 1) + SN + 1; HFN is the superframe number of the first data packet, SN_MAX is the maximum value of the sequence number, and SN is the sequence number of the first data packet.
5. A data packet processing method according to claim 1, characterized in that: After filling the first data packet into the sequence table according to the position number of the first data packet, the method further includes: Determine, according to the sequence number and the superframe number of the second data packet, a position number of the second data packet in the sequence table, wherein the second data packet belongs to the plurality of data packets; When the position numbers of the second data packet and the first data packet in the sequence table are the same, the second data packet is discarded.
6. A data packet processing method according to claim 1, characterized in that: After filling the first data packet into the sequence table according to the position number of the first data packet, the method further includes: Check whether there is an empty position in the sequence table; When there is an idle position in the sequence table, a data retransmission request is initiated.
7. A data packet processing method according to claim 1, characterized in that: After filling the first data packet into the sequence table, the method further includes: transmitting the sequence table to a reordering window; Executing a reordering algorithm on the data packets in the sequence table in the reordering window; The reordered data packets are transmitted to the SDAP layer.
8. A data packet processing method according to claim 2, characterized in that: Before establishing the sequence table according to the sequence number and superframe number of each of the data packets, the method further comprises: Integrity verification is performed on the multiple data packets according to the sequence numbers and superframe numbers of the multiple data packets.
9. A data packet processing device, characterized in that: include: A parsing module, configured to parse out a sequence number and a superframe number of each of the data packets in response to the PDCP layer receiving multiple data packets; a determination module, configured to determine a position number of the first data packet in the sequence table according to a sequence number and a superframe number of the first data packet, wherein the first data packet belongs to the plurality of data packets; A filling module, used for filling the first data packet into the sequence table according to the position number of the first data packet; Wherein, the determination module is specifically used for: Obtaining the maximum value of the sequence numbers of the data packets; The position number of the first data packet in the sequence table is determined according to the sequence number and superframe number of the first data packet and the maximum value of the sequence number.
10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in a data packet processing method as described in any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the data packet processing method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Adjustment method and device for reordering window
CN107920036A
Method and apparatus for detecting and correcting PDCP hyper frame number (HFN) desynchronization
US20150280905A1