A method for wireless communication performed by a second access network device providing a network service to a first terminal device, comprising: receiving access stratum context identifier information of the first terminal device, wherein the access stratum context identifier information of the first terminal device is configured to identify access stratum context information of the first terminal device that is related to the first terminal device on a first access network device; determining the first access network device according to the access stratum context identifier information of the first terminal device and a first mapping relationship, and obtaining the access stratum context information of the first terminal device from the first access network device, wherein the access stratum context identifier information is a random number which does not directly include an identifier of the first access network device, and the first mapping relationship is a mapping relationship between access stratum context identifier information of at least one terminal device and an identifier of at least one access network device, the at least one terminal device comprising the first terminal device, wherein a number or a bit stream that is in the access stratum context identifier information of the first terminal device and that is configured to identify information about the first access network device is different from a number or a bit stream of an identifier of the first access network device, wherein the first mapping relationship comprises a one-to-one mapping relationship between at least one piece of access stratum context identifier information and the identifier of the at least one access network device, and the at least one piece of access stratum context identifier information comprises the access stratum context identifier information of the first terminal device. receiving access stratum context identifier information of the first terminal device, wherein the access stratum context identifier information of the first terminal device is configured to identify access stratum context information of the first terminal device that is related to the first terminal device on a first access network device; determining the first access network device according to the access stratum context identifier information of the first terminal device and a first mapping relationship, and obtaining the access stratum context information of the first terminal device from the first access network device, wherein the access stratum context identifier information is a random number which does not directly include an identifier of the first access network device, and the first mapping relationship is a mapping relationship between access stratum context identifier information of at least one terminal device and an identifier of at least one access network device, the at least one terminal device comprising the first terminal device, wherein a number or a bit stream that is in the access stratum context identifier information of the first terminal device and that is configured to identify information about the first access network device is different from a number or a bit stream of an identifier of the first access network device, wherein the first mapping relationship comprises a one-to-one mapping relationship between at least one piece of access stratum context identifier information and the identifier of the at least one access network device, and the at least one piece of access stratum context identifier information comprises the access stratum context identifier information of the first terminal device.