Communication method and apparatus
A communication method includes a terminal device sending M compressed data packets. The M compressed data packets are obtained by compressing M data packets based on a first buffer. The terminal device reestablishes a PDCP layer without resetting the first buffer. The terminal device then sends N compressed data packets. The N compressed data packets are a part or all of the M compressed data packets. When reestablishing the PDCP layer, the terminal device does not reset the first buffer. In this case, if the terminal device needs to retransmit a data packet, the terminal device may retransmit a previously obtained compressed data packet, and does not need to compress the data packet again.
1 . A method applied to a terminal device or chip for the terminal device, and comprising:
obtaining M compressed data packets by compressing M data packets based on a first buffer, wherein M is a positive integer;
sending the M compressed data packets;
receiving a first indication information and a second indication information, wherein the first indication information indicates to reestablish a packet data convergence protocol layer, and wherein the second indication information indicates to continue to use the first buffer;
reestablishing the packet data convergence protocol layer without resetting the first buffer; and
sending N compressed data packets,
wherein the N compressed data packets are at least a portion of the M compressed data packets, and
wherein N is a positive integer less than or equal to M.
2 . The method of claim 1 , wherein a first data packet with a smallest sequence number in the N compressed data packets is the same as a second data packet with a smallest sequence number in data packets that are not successfully received by a network device.
3 . The method of claim 1 , further comprising sending capability information indicating that continuing to use the first buffer is supported.
4 . The method of claim 1 , wherein receiving the first indication information and the second indication information comprises
receiving a handover command, wherein the handover command includes the first indication information and the second indication information.
5 . The method of claim 1 , wherein sending the M compressed data packets comprises sending the M compressed data packets to a first network device, and wherein sending the N compressed data packets comprises sending the N compressed data packets to the first network device.
6 . The method of claim 4 , wherein sending the M compressed data packets comprises sending the M compressed data packets to a first network device, wherein the method further comprises:
accessing the first network device before the terminal device performs a cell handover based on the handover command; and
accessing a second network device after the terminal device performs the cell handover,
wherein sending the N compressed data packets comprises sending the N compressed data packets to the second network device.
7 . A method applied to a first network device or a chip for the first network device, and comprising:
receiving K compressed data packets from a terminal device, wherein the K compressed data packets are based on compression of K data packets and based on a first buffer, and wherein K is a positive integer;
sending a first indication information and a second indication information, wherein the first indication information indicates the terminal device to reestablish a packet data convergence protocol layer, and wherein the second indication information indicates the terminal device to continue to use the first buffer;
reestablishing the packet data convergence protocol layer without resetting a second buffer; and
decompressing, using the second buffer, one of the K compressed data packets.
8 . The method of claim 7 , further comprising:
sending the K compressed data packets to a second network device; and
receiving, from the terminal device, an access request before the terminal device performs a cell handover.
9 . The method of claim 8 , further comprising:
sending indication information to the second network device, wherein the indication information indicates content of the second buffer, wherein the content of the second buffer updates a third buffer; and
receiving, from the terminal device, the access request before the terminal device performs the cell handover.
10 . The method of claim 8 , further comprising:
sending, to the second network device, a first message querying whether the terminal device is supported in continuing to use the first buffer;
receiving, from the terminal device, the access request before the terminal device performs the cell handover; and
receiving, from the second network device, a second message indicating that the terminal device is supported in continuing to use the first buffer.
11 . The method of claim 7 , further comprising sending, to the terminal device, a status report indicating that the first network device has received the K compressed data packets.
12 . The method of claim 11 , further comprising receiving N compressed data packets from the terminal device, wherein the N compressed data packets are a part or all of M compressed data packets, wherein the K compressed data packets are a part or all of the M compressed data packets, wherein sequence numbers of the M compressed data packets are consecutive, wherein the M compressed data packets are based on compression of M data packets and based on the first buffer, wherein M is a positive integer, wherein N is a positive integer less than or equal to M, and wherein K is a positive integer less than or equal to M.
13 . The method of claim 12 , wherein a first data packet with a smallest sequence number in the N compressed data packets is the same as a second data packet with a smallest sequence number in data packets that are not successfully received by the first network device.
14 . The method of claim 7 , further comprising receiving, from the terminal device, capability information indicating that the terminal device supports continuing to use the first buffer.
15 . A communication apparatus comprising:
at least one processor; and
at least one memory coupled to the at least one processor and storing programming instructions for execution by the at least one processor to:
obtain M compressed data packets by compressing M data packets based on a first buffer, wherein M is a positive integer;
send the M compressed data packets;
receive a first indication information and a second indication information, wherein the first indication information indicates to reestablish a packet data convergence protocol layer, and wherein the second indication information indicates to continue to use the first buffer;
reestablish the packet data convergence protocol layer without resetting the first buffer; and
send N compressed data packets,
wherein the N compressed data packets are at least a portion of the M compressed data packets, and
wherein N is a positive integer less than or equal to M.
16 . The communication apparatus of claim 15 , wherein a first data packet with a smallest sequence number in the N compressed data packets is the same as a second data packet with a smallest sequence number in data packets that are not successfully received by a network device.
17 . The communication apparatus of claim 15 , wherein the at least one processor is further configured to execute the programming instructions to send capability information indicating that continuing to use the first buffer is supported.
18 . The communication apparatus of claim 15 , wherein the at least one processor is further configured to execute the programming instructions to receive the first indication information and the second indication information by receiving a handover command, wherein the handover command includes the first indication information and the second indication information.
19 . The communication apparatus of claim 18 , wherein the at least one processor is further configured to execute the programming instructions to send the M compressed data packets to a first network device by:
accessing the first network device before the communication apparatus performs a cell handover based on the handover command; and
accessing a second network device after the communication apparatus performs the cell handover, and
wherein the at least one processor to is further configured to execute the programming instructions to send the N compressed data packets by sending the N compressed data packets to the second network device.
20 . The communication apparatus of claim 15 , wherein the at least one processor is further configured to execute the programming instructions to:
send the M compressed data packets by sending the M compressed data packets to a first network device; and
send the N compressed data packets by sending the N compressed data packets to the first network device.