With reference to the first aspect, in an implementation of the first aspect, before the first target cell is determined, the method further includes: receiving a handover message sent by the first network device, where the handover message includes the identifier of the second target cell; and stopping the process of determining the first target cell, and performing a handover based on the handover message. That the handover is completed includes: The terminal device is successfully handed over to the second target cell.
In other words, the terminal device attempts to hand over to the second target cell based on the handover message, and if the terminal device is successfully handed over to the second target cell, the handover is completed.
For example, the handover message may include information related to a random access channel-less handover (RACH-less HO). In this case, the terminal device does not perform the RACH procedure with the second target cell. That is, the terminal device skips the RACH procedure, and directly sends an RRC reconfiguration complete message to the second target cell, to complete the handover. The information related to the RACH-less HO may include indication information of the RACH-less HO, a timing advance (TA) value, an uplink grant (UL grant), and/or the like.
For another example, the handover message may not include information related to a RACH-less HO. In this case, the terminal device performs a RACH procedure with the second target cell based on random access resource information included in the handover message. After the RACH procedure succeeds, the terminal device sends an RRC reconfiguration complete message to the second target cell, to complete the handover.