Communication method and communications apparatus
Embodiments of this application relate to the field of communications technologies, and in particular, to a communication method and a communications apparatus. The solution includes: sending, by a source access network device, a first data packet of a terminal to a target access network device; and when the source access network device determines that the target access network device has received the first data packet, sending, by the source access network device, a first message to the terminal, where the first message is used to indicate the terminal to hand over to the target access network device.
1. A method, comprising:
sending, by a source access network device, a first data packet of a terminal to a target access network device;
determining, by the source access network device, that the target access network device has received the first data packet;
after determining that the target access network device has received the first data packet, sending, by the source access network device, a first message to the terminal, wherein the first message indicates to the terminal to hand over to the target access network device;
sending, by the source access network device, sequence number (SN) status information to the target access network device, wherein the SN status information is used by the target access network device to send a data packet to the terminal; and
sending, by the source access network device, a data packet that carries no SN status information to the target access network device, wherein a sequence number of the data packet that carries no SN status information is determinable by the target access network device based on the SN status information.
2. The method according to claim 1 , further comprising:
sending, by the target access network device, first information, wherein the first information indicates that the handover of the terminal to the target access network device is allowed; and
receiving, by the source access network device, the first information from the target access network device.
3. The method according to claim 2 , wherein before sending, by the source access network device, the first data packet to the target access network device, the method further comprises:
determining, by the source access network device based on the first information, that the target access network device allows the handover of the terminal to the target access network device.
4. The method according to claim 1 , wherein the first data packet comprises a replicated data packet, and the method further comprises:
obtaining, by the source access network device, the replicated data packet; or
in response to a condition under which the terminal hands over between access network devices being satisfied, obtaining, by the source access network device, the replicated data packet.
5. The method according to claim 4 , wherein obtaining, by the source access network device, the replicated data packet comprises:
replicating, by the source access network device, a data packet satisfying a preset condition in at least one data packet of the terminal, to obtain the replicated data packet, wherein the data packet satisfying the preset condition comprises at least one of the following cases: a data packet using a preset quality of service (QOS) flow, a data packet on a preset session, a data packet whose packet loss rate is less than or equal to a preset threshold, or a data packet on a preset radio bearer; or
replicating, by the source access network device, a random data packet of the terminal to obtain the replicated data packet.
6. The method according to claim 1 , further comprising:
receiving, by the target access network device, the SN status information from the source access network device;
obtaining, by the target access network device, a second data packet based on the SN status information and the data packet that carries no SN and that is from the source access network device, wherein the data packet that carries no SN is a data packet in the first data packet or a data packet of the terminal in the source access network device; and
sending, by the target access network device, the second data packet to the terminal.
7. The method according to claim 1 , wherein determining, by the source access network device, that the target access network device has received the first data packet comprises:
receiving, by the source access network device, a second message from the target access network device, wherein the second message indicates that the target access network device has received the first data packet; or
determining, by the source access network device based on latency information, that the target access network device has received the first data packet.
8. The method according to claim 7 , further comprising:
determining, by the source access network device, the latency information based on QoS information of the first data packet; or
obtaining, by the source access network device, the latency information from a session management function network element.
9. The method according to claim 1 , further comprising:
receiving, by the target access network device, the first data packet of the terminal from the source access network device; and
in response to the terminal successfully handing over from the source access network device to the target access network device, sending, by the target access network device, the first data packet to the terminal.
10. A communication system, comprising:
a source access network device; and
a target access network device;
wherein the source access network device is configured to:
send a first data packet of a terminal to the target access network device;
determine that the target access network device has received the first data packet;
after determining that the target access network device has received the first data packet, send a first message to the terminal, wherein the first message indicates to the terminal to hand over to the target access network device;
send sequence number (SN) status information to the target access network device, wherein the SN status information is used by the target access network device to send a data packet to the terminal; and
send a data packet that carries no SN status information to the target access network device, wherein a sequence number of the data packet that carries no SN status information is determinable by the target access network device based on the SN status information; and
wherein the target access network device is configured to:
receive the first data packet of the terminal from the source access network device; and
when the terminal successfully hands over from the source access network device to the target access network device, send the first data packet to the terminal.
11. The system according to claim 10 , wherein:
the target access network device is further configured to send first information to the source access network device, wherein the first information indicates that a handover of a terminal to the target access network device is allowed; and
the source access network device is further configured to receive the first information.
12. The system according to claim 11 , wherein the source access network device is further configured to:
before sending a first message to the terminal, determine, based on the first information, that the target access network device allows the handover of the terminal to the target access network device.
13. The system according to claim 10 , wherein the first data packet comprises a replicated data packet, and the source access network device is further configured to:
obtain the replicated data packet; or
in response to a condition under which the terminal hands over between the access network devices being satisfied, obtain the replicated data packet.
14. The system according to claim 13 , wherein the source access network device is further configured to:
replicate a data packet satisfying a preset condition in at least one data packet of the terminal, to obtain the replicated data packet, wherein the data packet satisfying the preset condition comprises at least one of the following cases: a data packet using a preset quality of service (QOS) flow, a data packet on a preset session, a data packet whose packet loss rate is less than or equal to a preset threshold, or a data packet on a preset radio bearer; or
replicate a random data packet of the terminal to obtain the replicated data packet.
15. The system according to claim 10 , wherein:
the target access network device is further configured to:
receive the SN status information from the source access network device;
obtain a second data packet based on the SN status information and the data packet that carries no SN and that is from the source access network device, wherein the data packet that carries no SN is a data packet in the first data packet or a data packet of the terminal in the source access network device; and
send the second data packet to the terminal.
16. The system according to claim 10 , wherein:
the target access network device is further configured to send a second message to the source access network device, wherein the second message indicates that the target access network device has received the first data packet, and the source access network device is further configured to: receive the second message; or
the source access network device is further configured to determine, based on latency information, that the target access network device has received the first data packet.
17. The system according to claim 16 , wherein the source access network device is further configured to:
determine the latency information based on QoS information of the first data packet; or
obtain the latency information from a session management function network element.
18. A communication apparatus, comprising:
a processor; and
a non-transitory memory, wherein the non-transitory memory is configured to store instructions; and
wherein the processor is configured to run the instructions stored in the non-transitory memory to implement the following:
sending a first data packet of a terminal to a target access network device;
determining that the target access network device has received the first data packet;
after determining that the target access network device has received the first data packet, sending a first message to the terminal, wherein the first message indicates to the terminal to hand over to the target access network device;
sending sequence number (SN) status information to a target access network device, wherein the SN status information is used by the target access network device to send a data packet to a terminal; and
sending a data packet that carries no SN status information to the target access network device, wherein a sequence number of the data packet that carries no SN status information is determinable by the target access network device based on the SN status information.
19. The apparatus according to claim 18 , wherein the processor is configured to run the instructions stored in the non-transitory memory to further implement the following:
receive first information from the target access network device, wherein the first information indicates that the handover of the terminal to the target access network device is allowed.
20. The apparatus according to claim 19 , wherein the processor is configured to run the instructions stored in the non-transitory memory to further implement the following:
determine, based on the first information, that the target access network device allows the handover of the terminal to the target access network device.