[0043] Method embodiment two
[0044] refer to image 3 , shows a flowchart of Embodiment 2 of a data transmission method of the present invention.
[0045] Step 301, identifying the transmission control protocol TCP thread corresponding to the protocol data unit PDU received by the packet data convergence protocol PDCP layer, and generating the thread identifier corresponding to the TCP thread of the PDU;
[0046] When the packet data convergence protocol PDCP layer receives the protocol data unit PDU, it identifies the transmission control protocol TCP thread corresponding to the transmission of the PDU, and generates a thread identifier corresponding to the TCP thread of the PDU.
[0047] The step 301 includes:
[0048] Step 3011: Analyze the PDU received by the PDCP layer to obtain a TCP data packet; identify the TCP thread corresponding to the PDU according to the quadruple corresponding to the TCP data packet.
[0049] Step 3012: Generate a thread identifier corresponding to the PDU according to the TCP thread corresponding to the PDU and the quadruple.
[0050] When the PDCP layer receives the PDU, it parses the PDU to obtain a TCP data packet, whether the PDCP layer parses the TCP data packet format is a SYN (Synchronize Sequence Numbers, synchronization sequence number) packet, and when the parsed TCP data packet format is SYN, it is determined to submit the The thread of PDU is newly added thread, and according to the quaternion (SrcIP source address, DestIP destination address, SrcPort source port, DstPort purpose port) corresponding to described TCP data packet, identify the TCP thread corresponding to described PDU, according to described A function mapping relationship is established between the TCP thread corresponding to the PDU and the quadruple, and a thread identifier of the TCP thread corresponding to the PDU is generated. For example: when querying a certain thread, four pieces of information need to be input: SrcIP source address, DestIP destination address, SrcPort source port, DstPort destination port. By establishing a functional relationship about the four pieces of information, different pieces of information can be mapped to generate corresponding different thread identifiers, and when querying a thread, only the thread identifier needs to be input without inputting the four pieces of information.
[0051] If the PDU is a PDU in the data exchange process, the PDU is also parsed to obtain a TCP packet, and the TCP thread corresponding to the PDU is identified according to the quadruple group corresponding to the TCP packet, and according to the corresponding TCP thread of the PDU A function mapping relationship is established between the TCP thread and the quadruple, and a thread identifier of the TCP thread corresponding to the PDU is generated. like figure 2 Among them, when the PDCP layer receives PDU3, it analyzes PDU3, and judges that the TCP thread that submits PDU3 is a newly added thread according to the TCP thread that identifies and transmits PDU3 and the parsed quaternion, and generates a thread ID 3; when the PDCP layer receives PDU5, Described PDU5 is the PDU in the data exchange, according to the TCP thread of identification transmission PDU5 and the quaternion that resolves, generate thread identification 3, because PDU3 and PDU5 are transmitted by the same TCP thread, so the quaternion corresponding to PDU3 and PDU5 The information contained in the group is the same, and the thread ID 3 is generated according to the function mapping relationship.
[0052] Step 302: Record the data packet sequence number, feedback packet sequence number, and packet type corresponding to the PDU submitted by the TCP thread last time.
[0053] After the PDCP layer receives the PDU submitted by the TCP thread, it records the data packet sequence number, feedback packet sequence number, and packet type corresponding to the PDU. The data packet sequence number refers to the sequence number of a certain data packet sent by the communication party; the feedback packet sequence number refers to the sequence number of a feedback packet returned to the other party after receiving a certain data packet from the other party. If a data packet sent by the other party is received, a feedback packet must be returned to the other party. After receiving the feedback packet, the other party knows that the data packet has been received by the other party after calculating according to the value in the feedback packet. If no feedback packet is received, it means that the data packet has been lost on the network, and the data packet needs to be resent.
[0054] Step 303, according to the thread ID corresponding to the PDU and the PDU serial number corresponding to the PDU, generate a two-dimensional queue, each queue in the two-dimensional queue contains the PDU serial number and has the same thread ID PDU, each of the queues corresponds to a different thread ID.
[0055] Specifically, after the PDCP layer receives the PDU, on the basis that the PDCP layer identifies different threads corresponding to the PDU and generates a corresponding thread identifier, the PDU and the corresponding thread identifier are two-dimensionalized to generate a two-dimensional queue.
[0056] The two-dimensional queue includes a first dimension and a second dimension, wherein the first dimension represents a PDU sequence number, and the second dimension represents a thread identifier. by figure 2 For example, the two-dimensional queue includes a horizontal axis and a vertical axis, the horizontal axis is the first dimension of the two-dimensional queue, and the vertical axis is the second dimension of the two-dimensional queue. When the PDCP layer receives 9 PDUs, different thread IDs correspond to a queue: queue 1 includes PDU1 and PDU2 with thread ID 1; queue 2 includes PDU3 and PDU5 with thread ID 3; queue 3 includes thread ID 5 PDU6, PDU7 and PDU8; queue 4 includes PDU9 with thread ID 7.
[0057] Each of the two-dimensional queues includes PDUs arranged according to the PDU sequence numbers and having the same thread ID, and each queue corresponds to a different thread ID.
[0058] Step 304. Determine a target queue in the two-dimensional queue, and the target queue includes continuous PDUs.
[0059] Specifically, the step of determining the target queue in the two-dimensional queue includes:
[0060] Step 3041, judging whether each queue in the two-dimensional queue contains missing PDUs;
[0061] Step 3042, determine the queue that does not contain the missing PDU as the target queue.
[0062] like figure 2 As shown, since the PDU4 with the thread ID of 3 has not been received, it is a missing PDU, so it can be determined that queue 2 contains missing PDUs, while queue 1, queue 3, and queue 4 do not contain missing PDUs, so it is determined that the target queue includes queue 1, Queue 3, Queue 4. The target queue can deliver PDUs to the PDCP layer in sequence without waiting for the missing PDU 4 to arrive. After PDU3 in queue 2 is submitted, because PDU4 is missing, PDU5 needs to wait for PDU4 to be received before submitting. Thus, the missing PDU will only affect other PDUs belonging to the same thread, and will not affect the delivery of PDUs from different threads.
[0063] Optionally, the step of judging whether each queue in the two-dimensional queue contains missing PDUs includes:
[0064] Step 3041a, according to the thread identifier corresponding to the current queue, determine the current TCP thread corresponding to the current queue.
[0065] Step 3041b, obtain the first data packet sequence number and the first feedback packet sequence number corresponding to the current PDU to be delivered by the current TCP thread, and the second data packet sequence number and second feedback packet corresponding to the PDU submitted last time by the current TCP thread Package serial number.
[0066] The second packet sequence number and the second feedback packet sequence number corresponding to the PDU submitted by the current TCP thread last time, as described in step 302, record the packet sequence number, Feedback package number and package type.
[0067]Step 3041c, according to the first packet type, the second packet type, the first data packet sequence number, the first feedback packet sequence number, the second data packet sequence number, and the second feedback packet sequence number , to determine whether the current missing PDU belongs to the current TCP thread.
[0068] Described judging whether each queue in the two-dimensional queue contains missing PDUs, includes the following criteria:
[0069] Optionally, if both the first packet type and the second packet type are feedback packets, and the first data packet sequence number is equal to the second data packet sequence number, and the first feedback packet sequence number is greater than or Equal to the second feedback packet sequence number, then determine that the current missing PDU does not belong to the current TCP thread; or
[0070] Optionally, if the first packet type is a data packet, the second packet type is a feedback packet, and if the first data packet sequence number is equal to the second data packet sequence number, and the first feedback packet If the sequence number is greater than or equal to the second feedback packet sequence number, it is determined that the current missing PDU does not belong to the current TCP thread; or
[0071] Optionally, if the first packet type is a feedback packet, the second packet type is a data packet, and if the first feedback packet sequence number is equal to the second data packet sequence number and the data packet length plus one and, and the first feedback packet sequence number is greater than or equal to the second data packet sequence number, then it is determined that the current missing PDU does not belong to the current TCP thread; or
[0072] Optionally, if both the first packet type and the second packet type are data packets, and if the first data packet sequence number is equal to the sum of the second data packet sequence number and the length of the data packet plus one, and the first data packet sequence number is greater than or equal to the second data packet sequence number, then it is determined that the current missing PDU does not belong to the current TCP thread.
[0073] Specifically, if the current i-th PDU is lost, the continuity of the PDU belonging thread after i+1 needs to be judged according to the above conditions. When the above conditions are established, it can be determined that the current missing PDU does not belong to the current TCP thread, and the steps are executed 3041d.