For example, the conditional handover configuration information includes a first RACH resource corresponding to the candidate target cell. There may be a plurality of first RACH resources, and each of the first RACH resources may correspond to at least one candidate target cell. The first RACH resource includes a first dedicated random access resource and/or a first common random access resource. The first dedicated random access resource is associated with the first beam that belongs to the candidate target cell, and the first dedicated random access resource includes a first preamble index and a first time-frequency resource. The first common random access resource includes a second time-frequency resource. Different candidate target cells may be corresponding to different first dedicated random access resources, and different candidate target cells may be corresponding to a same first common random access resource or different first common random access resources. After the terminal device determines the target cell, because the target cell is one of the candidate target cells, the terminal device may determine, based on the first RACH resource, a random access resource used for accessing the target cell, where the random access resource is included in the first RACH resource. Specifically, the terminal device may perform random access by using a dedicated random access resource corresponding to the target cell, and the random access is contention-free random access. In another possible implementation, the terminal device may perform random access by using a common random access resource corresponding to the target cell, and the random access is contention-based random access.
460. The terminal device sends an RRC message to the second network device.