A random access method, wherein the method comprises: receiving, by a terminal device, first indication information from a network device, wherein the first indication information indicates at least one synchronization signal/physical broadcast channel block SSB group, each of the at least one SSB group comprises at least one SSB, and each SSB group corresponds to one random access mode; and sending, by the terminal device, a random access signal to the network device based on a random access mode corresponding to a target SSB group, wherein the target SSB group is one of the at least one SSB group, and the target SSB group is an SSB group corresponding to a random access resource used by the terminal device; wherein the at least one SSB group further comprises a third SSB group and a fourth SSB group, the third SSB group corresponds to a third random access mode, and the fourth SSB group corresponds to a fourth random access mode; and the method further comprises: receiving, by the terminal device, second indication information from the network device, wherein the second indication information indicates a second threshold and a third threshold; and the second threshold corresponds to the third SSB group, the third threshold corresponds to the fourth SSB group, and the second threshold is different from the third threshold; the third random access mode is that the terminal device selects, based on a relationship between a reference signal received power and the second threshold, one uplink carrier from a plurality of uplink carriers to send the random access signal to the network device; and the fourth random access mode is that the terminal device selects, based on a relationship between a reference signal received power and the third threshold, one uplink carrier from the plurality of uplink carriers to send the random access signal to the network device. receiving, by a terminal device, first indication information from a network device, wherein the first indication information indicates at least one synchronization signal/physical broadcast channel block SSB group, each of the at least one SSB group comprises at least one SSB, and each SSB group corresponds to one random access mode; and sending, by the terminal device, a random access signal to the network device based on a random access mode corresponding to a target SSB group, wherein the target SSB group is one of the at least one SSB group, and the target SSB group is an SSB group corresponding to a random access resource used by the terminal device; wherein the at least one SSB group further comprises a third SSB group and a fourth SSB group, the third SSB group corresponds to a third random access mode, and the fourth SSB group corresponds to a fourth random access mode; and the method further comprises: receiving, by the terminal device, second indication information from the network device, wherein the second indication information indicates a second threshold and a third threshold; and the second threshold corresponds to the third SSB group, the third threshold corresponds to the fourth SSB group, and the second threshold is different from the third threshold; the third random access mode is that the terminal device selects, based on a relationship between a reference signal received power and the second threshold, one uplink carrier from a plurality of uplink carriers to send the random access signal to the network device; and the fourth random access mode is that the terminal device selects, based on a relationship between a reference signal received power and the third threshold, one uplink carrier from the plurality of uplink carriers to send the random access signal to the network device. receiving, by the terminal device, second indication information from the network device, wherein the second indication information indicates a second threshold and a third threshold; and the second threshold corresponds to the third SSB group, the third threshold corresponds to the fourth SSB group, and the second threshold is different from the third threshold; the third random access mode is that the terminal device selects, based on a relationship between a reference signal received power and the second threshold, one uplink carrier from a plurality of uplink carriers to send the random access signal to the network device; and the fourth random access mode is that the terminal device selects, based on a relationship between a reference signal received power and the third threshold, one uplink carrier from the plurality of uplink carriers to send the random access signal to the network device.