A data transmission method for uplink data transmission in a grant-free transmission mode when a terminal device moves from a coverage area of a source network device to a coverage area of a target network device, wherein in the grant-free transmission mode the uplink data is sent by a terminal device to a target base station through grant-free transmission, the method comprising: receiving, by the target network device, data sent by the target base station, wherein the data is sent by the terminal device to the target base station, and the data comprises identification information of the terminal device; if the target network device acknowledges, by using the identification information, that the terminal device has not been registered with the target network device, obtaining, by the target network device, user information of the terminal device; and after the target network device obtains the user information of the terminal device, sending, by the target network device, the data to a gateway; wherein the target network device is a target network device-target user plane and the target network device obtains the user information of the terminal device includes: the target network device-target user plane sends a user information request to a target network device-control plane, and the target network device-target user plane receives a user information response sent by the target network device-control plane or the target network device-target user plane sends a user information request to a source network device-source user plane, and the target network device-target user plane receives a user information response sent by the source network device-source user plane. receiving, by the target network device, data sent by the target base station, wherein the data is sent by the terminal device to the target base station, and the data comprises identification information of the terminal device; if the target network device acknowledges, by using the identification information, that the terminal device has not been registered with the target network device, obtaining, by the target network device, user information of the terminal device; and after the target network device obtains the user information of the terminal device, sending, by the target network device, the data to a gateway; wherein the target network device is a target network device-target user plane and the target network device obtains the user information of the terminal device includes: the target network device-target user plane sends a user information request to a target network device-control plane, and the target network device-target user plane receives a user information response sent by the target network device-control plane or the target network device-target user plane sends a user information request to a source network device-source user plane, and the target network device-target user plane receives a user information response sent by the source network device-source user plane. the target network device-target user plane sends a user information request to a target network device-control plane, and the target network device-target user plane receives a user information response sent by the target network device-control plane or the target network device-target user plane sends a user information request to a source network device-source user plane, and the target network device-target user plane receives a user information response sent by the source network device-source user plane.