A wireless communication method, characterized by comprising: obtaining (S1110, S1210), by a terminal device, configuration information of random access resources; determining, by the terminal device, a first retransmission number according to the configuration information and first information; and determining, by the terminal device, a second retransmission number according to the configuration information and second information; wherein the first retransmission number is a number of retransmission of physical random access channel, PRACH; the second retransmission number is a number of retransmission of physical uplink shared channel, PUSCH; and the PRACH and the PUSCH are carried in a message Msg A of two-step random access; or determining, by the terminal device, a third retransmission number according to the configuration information and first information; and determining, by the terminal device, a fourth retransmission number according to the configuration information and second information; wherein the third retransmission number is a number of retransmission of PRACH of contention-based four-step random access, and the fourth retransmission number is a number of retransmission of PUSCH of the contention-based four-step random access; or determining, by the terminal device, a fifth retransmission number according to the configuration information and first information; and determining, by the terminal device, a sixth retransmission number according to the fifth retransmission number; wherein the fifth retransmission number is a number of retransmission of PRACH, the sixth retransmission number is a number of retransmission of PUSCH, and the PRACH and the PUSCH are carried in the Msg A of the two-step random access; or, the fifth retransmission number is a number of retransmission of PRACH of contention-based four-step random access, and the sixth retransmission number is a number of retransmission of the PUSCH of the contention-based four-step random access; wherein the first information comprises at least one of a type, a capability and a reference-signal receiving-power, RSRP, measurement result of the terminal device; the second information comprises at least one of the type, the capability and the RSRP measurement result of the terminal device; and the RSRP measurement result is a RSRP measurement result obtained by the terminal device performing RSRP measurement on a synchronization signal block, SSB. obtaining (S1110, S1210), by a terminal device, configuration information of random access resources; determining, by the terminal device, a first retransmission number according to the configuration information and first information; and determining, by the terminal device, a second retransmission number according to the configuration information and second information; wherein the first retransmission number is a number of retransmission of physical random access channel, PRACH; the second retransmission number is a number of retransmission of physical uplink shared channel, PUSCH; and the PRACH and the PUSCH are carried in a message Msg A of two-step random access; or determining, by the terminal device, a third retransmission number according to the configuration information and first information; and determining, by the terminal device, a fourth retransmission number according to the configuration information and second information; wherein the third retransmission number is a number of retransmission of PRACH of contention-based four-step random access, and the fourth retransmission number is a number of retransmission of PUSCH of the contention-based four-step random access; or determining, by the terminal device, a fifth retransmission number according to the configuration information and first information; and determining, by the terminal device, a sixth retransmission number according to the fifth retransmission number; wherein the fifth retransmission number is a number of retransmission of PRACH, the sixth retransmission number is a number of retransmission of PUSCH, and the PRACH and the PUSCH are carried in the Msg A of the two-step random access; or, the fifth retransmission number is a number of retransmission of PRACH of contention-based four-step random access, and the sixth retransmission number is a number of retransmission of the PUSCH of the contention-based four-step random access; wherein the first information comprises at least one of a type, a capability and a reference-signal receiving-power, RSRP, measurement result of the terminal device; the second information comprises at least one of the type, the capability and the RSRP measurement result of the terminal device; and the RSRP measurement result is a RSRP measurement result obtained by the terminal device performing RSRP measurement on a synchronization signal block, SSB.