A random access method, comprising: receiving, by a terminal device, configuration information sent by a network device, wherein the configuration information is used to configure a first random access resource set and a second random access resource set, the first random access resource set comprises at least one physical random access channel, PRACH, time-frequency resource, at least one random access preamble, and at least one physical uplink shared channel, PUSCH, time-frequency resource, and the second random access resource set comprises at least one PRACH time-frequency resource, at least one random access preamble, and at least one PUSCH time-frequency resource; and when a timing advance, TA, is valid when random access is initiated, sending, by the terminal device, a first random access preamble and first uplink data to the network device by using a resource in the first random access resource set, wherein the first random access preamble is a random access preamble in the first random access resource set, the first random access preamble is carried on a first PRACH time-frequency resource in the first random access resource set, and the first uplink data is carried on a first PUSCH time-frequency resource; or when a TA is invalid when random access is initiated, sending, by the terminal device, a second random access preamble and second uplink data to the network device by using a resource in the second random access resource set, wherein the second random access preamble is a random access preamble in the second random access resource set, the second random access preamble is carried on a second PRACH time-frequency resource in the second random access resource set, and the second uplink data is carried on a second PUSCH time-frequency resource in the second random access resource set; - wherein any PUSCH time-frequency resource in the first random access resource set is different from any PUSCH time-frequency resource in the second random access resource set; and/or - wherein any PRACH time-frequency resource in the first random access resource set is different from any PRACH time-frequency resource in the second random access resource set; or any random access preamble in the first random access resource set is different from any random access preamble in the second random access resource set. receiving, by a terminal device, configuration information sent by a network device, wherein the configuration information is used to configure a first random access resource set and a second random access resource set, the first random access resource set comprises at least one physical random access channel, PRACH, time-frequency resource, at least one random access preamble, and at least one physical uplink shared channel, PUSCH, time-frequency resource, and the second random access resource set comprises at least one PRACH time-frequency resource, at least one random access preamble, and at least one PUSCH time-frequency resource; and when a timing advance, TA, is valid when random access is initiated, sending, by the terminal device, a first random access preamble and first uplink data to the network device by using a resource in the first random access resource set, wherein the first random access preamble is a random access preamble in the first random access resource set, the first random access preamble is carried on a first PRACH time-frequency resource in the first random access resource set, and the first uplink data is carried on a first PUSCH time-frequency resource; or when a TA is invalid when random access is initiated, sending, by the terminal device, a second random access preamble and second uplink data to the network device by using a resource in the second random access resource set, wherein the second random access preamble is a random access preamble in the second random access resource set, the second random access preamble is carried on a second PRACH time-frequency resource in the second random access resource set, and the second uplink data is carried on a second PUSCH time-frequency resource in the second random access resource set; - wherein any PUSCH time-frequency resource in the first random access resource set is different from any PUSCH time-frequency resource in the second random access resource set; and/or - wherein any PRACH time-frequency resource in the first random access resource set is different from any PRACH time-frequency resource in the second random access resource set; or any random access preamble in the first random access resource set is different from any random access preamble in the second random access resource set. - wherein any PUSCH time-frequency resource in the first random access resource set is different from any PUSCH time-frequency resource in the second random access resource set; and/or - wherein any PRACH time-frequency resource in the first random access resource set is different from any PRACH time-frequency resource in the second random access resource set; or any random access preamble in the first random access resource set is different from any random access preamble in the second random access resource set.