What is claimed is:1. A communications method, comprising:receiving, by a terminal device, a random access configuration index, wherein there is a correspondence between the random access configuration index and a time domain resource in a random access system frame, and wherein the time domain resource is obtained by dividing the random access system frame into intervals based on an uplink-downlink configuration period, and the time domain resource comprises one or more slots in the intervals of the random access system frame, the uplink-downlink configuration period being 2.5 millisecond (ms) or 5 millisecond, and the time domain resource in the random access system frame comprising slots with slot indexes {17, 19, 37, 39}, or the uplink-downlink configuration period being 2 millisecond and the time domain resource in the random access system frame comprising slots with slot indexes {13, 14, 15, 29, 30, 31, 37 38, 39};determining, by the terminal device, the time domain resource based on the random access configuration index and the correspondence; andcommunicating, by the terminal device, with a network device based on the time domain resource.2. The method according to claim 1, wherein the time domain resource does not overlap a time domain resource of a synchronization channel block.3. The method according to claim 1, wherein the random access configuration index corresponds to one or more of following information: a preamble sequence format, a configuration period parameter, a system frame number, a start symbol, a quantity of slots, or a quantity of physical random access channel occasions (ROs) comprised in one slot.4. The method according to claim 1, wherein the correspondence is pre-determined, with the time domain resource of the correspondence being determined based on the uplink-downlink configuration period and a time domain resource of a synchronization channel block in the random access system frame, wherein the random access system frame is divided into a plurality of time domain intervals based on the uplink-downlink configuration period, and the time domain resource comprises one or more resources in the plurality of time domain intervals excluding the time domain resource of the synchronization channel block.5. The method according to claim 4, wherein the time domain resource is determined by:determining the plurality of time domain intervals based on the uplink-downlink configuration period, wherein each time domain interval comprises N time units, and N is an integer greater than or equal to 1; anddetermining the time domain resource in secondtime units in each time domain interval excluding the time domain resource of the synchronization channel block.6. A communications method, comprising:sending a random access configuration index, wherein the random access configuration index indicates a time domain resource in a random access system frame, wherein the time domain resource is obtained by dividing the random access system frame into intervals based on an uplink-downlink configuration period, and the time domain resource comprises one or more slots in the intervals of the random access system frame, the uplink-downlink configuration period being 2.5 millisecond (ms) or 5 millisecond, and the time domain resource in the random access system frame comprising slots with slot indexes {17, 19, 37, 39}, or the uplink-downlink configuration period being 2 millisecond, and the time domain resource in the random access system frame comprising slots with slot indexes {13, 14, 15, 29, 30, 31, 37 38, 39}; andcommunicating with a terminal device based on the time domain resource.7. The method according to claim 6, wherein the time domain resource does not overlap a time domain resource of a synchronization channel block.8. The method according to claim 6, wherein the random access configuration index corresponds to one or more of following information: a preamble sequence format, a configuration period parameter, a system frame number, a start symbol, a quantity of slots, or a quantity of physical random access channel occasions (ROs) comprised in one slot.9. A communications apparatus, comprising:a transceiver, configured to receive a random access configuration index, wherein there is a correspondence between the random access configuration index and a time domain resource in a random access system frame, wherein the time domain resource is obtained by dividing the random access system frame into intervals based on an uplink-downlink configuration period, and the time domain resource comprises one or more slots in the intervals of the random access system frame, the uplink-downlink configuration period being 2.5 millisecond (ms) or 5 millisecond, and the time domain resource in the random access system frame comprising slots with slot indexes {17, 19, 37, 39}, or the uplink-downlink configuration period being 2 millisecond, and the time domain resource in the random access system frame comprising slots with slot indexes {13, 14, 15, 29, 30, 31, 37, 38, 39}; anda processor, configured to determine the time domain resource based on the random access configuration index and the correspondence; andwherein the transceiver unit is further configured to communicate with a network device based on the time domain resource.10. The apparatus according to claim 9, wherein the time domain resource does not overlap a time domain resource of a synchronization channel block.11. The apparatus according to claim 9, wherein the random access configuration index corresponds to one or more of following information: a preamble sequence format, a configuration period parameter, a system frame number, a start symbol, a quantity of slots, or a quantity of physical random access channel occasions (ROs) comprised in one slot.12. The apparatus according to claim 9, wherein the correspondence is pre-determined, with the time domain resource of the correspondence being determined based on the uplink-downlink configuration period and a time domain resource of a synchronization channel block in the random access system frame, wherein the random access system frame is divided into a plurality of time domain intervals based on the uplink-downlink configuration period, and the time domain resource comprises one or more resources in the plurality of time domain intervals excluding the time domain resource of the synchronization channel block.13. The apparatus according to claim 12, wherein the time domain resource is determined by:determining the plurality of time domain intervals based on the uplink-downlink configuration period, wherein each time domain interval comprises N time units, and N is an integer greater than or equal to 1; anddetermining the time domain resource in secondtime units in each time domain interval excluding the time domain resource of the synchronization channel block.14. A communications apparatus, comprising:a transceiver, configured to send a random access configuration index, wherein the random access configuration index indicates a time domain resource in a random access system frame, wherein the time domain resource is obtained by dividing the random access system frame into intervals based on an uplink-downlink configuration period, and the time domain resource comprises one or more slots in the intervals of the random access system frame, the uplink-downlink configuration period being 2.5 millisecond (ms) or 5 millisecond, and the time domain resource in the random access system frame comprising slots with slot indexes {17, 19, 37, 39}, or the uplink-downlink configuration period being 2 millisecond, and the time domain resource in the random access system frame comprising slots with slot indexes {13, 14, 15, 29, 30, 31, 37 38, 39}; anda processor, configured to communicate with a terminal device based on the time domain resource.