A network access method, comprising: receiving, by an access device, a first message from a terminal device, wherein the first message is used to indicate that the terminal device is a first type terminal device, the first type terminal device has a capability of accessing a first core network, the access device is connected to two different types of core networks, the two different types of core networks are a New Radio Access Technology, NR, system and a Long Term Evolution, LTE, system, and the two different types of core networks comprise the first core network; determining, by the access device based on the first message, that a type of the terminal device is the first type; and determining, by the access device based on the type of the terminal device, that a target core network to be accessed by the terminal device is the first core network so that in a scenario in which the LTE system and the NR system coexist, the access device accurately connects the terminal device to the respective target core network, wherein the first message is a preamble sequence; and the determining, by the access device based on the first message, that the type of the terminal device is the first type comprises: determining, by the access device based on a correspondence between the preamble sequence and the first type terminal device, that the type of the terminal device is the first type by: determining, by the access device based on a time-frequency resource of the preamble sequence and a correspondence between the time-frequency resource and the first-type terminal device, that the type of the terminal device is the first type. receiving, by an access device, a first message from a terminal device, wherein the first message is used to indicate that the terminal device is a first type terminal device, the first type terminal device has a capability of accessing a first core network, the access device is connected to two different types of core networks, the two different types of core networks are a New Radio Access Technology, NR, system and a Long Term Evolution, LTE, system, and the two different types of core networks comprise the first core network; determining, by the access device based on the first message, that a type of the terminal device is the first type; and determining, by the access device based on the type of the terminal device, that a target core network to be accessed by the terminal device is the first core network so that in a scenario in which the LTE system and the NR system coexist, the access device accurately connects the terminal device to the respective target core network, wherein the first message is a preamble sequence; and the determining, by the access device based on the first message, that the type of the terminal device is the first type comprises: determining, by the access device based on a correspondence between the preamble sequence and the first type terminal device, that the type of the terminal device is the first type by: determining, by the access device based on a time-frequency resource of the preamble sequence and a correspondence between the time-frequency resource and the first-type terminal device, that the type of the terminal device is the first type.