A communication method, comprising: sending, by a source access network device, a radio resource control, RRC, release message to user equipment, UE; deleting, by the source access network device, an RRC encryption key, a user plane encryption key, and a user plane integrity protection key, and storing an RRC integrity protection key and first indication information, wherein the first indication information indicates a user plane security protection method used before the source access network device and the UE enter an inactive state from a connected state, and the user plane security protection method indicates whether user plane encryption protection is enabled and/or whether user plane integrity protection is enabled; receiving, by a target access network device, a radio resource control, RRC, resume request from the UE, wherein the RRC resume request comprises inactive-radio network temporary identifier, I-RNTI; sending, by the target access network device, a context information obtaining request comprising the I-RNTI to the source access network device, receiving, by the target access network device, a context information obtaining response from the source access network device; wherein the context information obtaining response comprises the first indication information; and when the user plane security protection method indicated by the first indication information can be supported, activating, by the target access network device, user plane security between the target access network device and the UE by using the user plane security protection method indicated by the first indication information. sending, by a source access network device, a radio resource control, RRC, release message to user equipment, UE; deleting, by the source access network device, an RRC encryption key, a user plane encryption key, and a user plane integrity protection key, and storing an RRC integrity protection key and first indication information, wherein the first indication information indicates a user plane security protection method used before the source access network device and the UE enter an inactive state from a connected state, and the user plane security protection method indicates whether user plane encryption protection is enabled and/or whether user plane integrity protection is enabled; receiving, by a target access network device, a radio resource control, RRC, resume request from the UE, wherein the RRC resume request comprises inactive-radio network temporary identifier, I-RNTI; sending, by the target access network device, a context information obtaining request comprising the I-RNTI to the source access network device, receiving, by the target access network device, a context information obtaining response from the source access network device; wherein the context information obtaining response comprises the first indication information; and when the user plane security protection method indicated by the first indication information can be supported, activating, by the target access network device, user plane security between the target access network device and the UE by using the user plane security protection method indicated by the first indication information. <EOS>