A resource configuration method, wherein the method comprises: obtaining, by a terminal device, quantity information of subframes comprised in a first resource, configuration information of at least one set of synchronization resources, bitmap information, and configuration information of a time division duplex, TDD, system, wherein the first resource is a set of at least one subframe, the synchronization resource comprises at least one synchronization subframe, the TDD system comprises a downlink subframe and a special subframe; determining, by the terminal device, a quantity of reserved subframes in the first resource and a time domain location of the reserved subframes in the first resource based on the quantity information of subframes comprised in a first resource, the configuration information of the at least one set of synchronization resources, the bitmap information, and the configuration information of the TDD system; wherein the at least one synchronization subframe, the reserved subframes, the downlink subframe, and the special subframe are not used for device-to-device, D2D, data transmission; determining, by the terminal device, a second resource based on the quantity information of subframes comprised in a first resource, the configuration information of the at least one set of synchronization resources, the configuration information of the TDD system, the quantity information of reserved subframes, and the time domain location information of the reserved subframes in the first resource, wherein the second resource is a set of candidate subframes for the D2D data transmission; and performing, by the terminal device, the D2D data transmission based on the bitmap information and the second resource. obtaining, by a terminal device, quantity information of subframes comprised in a first resource, configuration information of at least one set of synchronization resources, bitmap information, and configuration information of a time division duplex, TDD, system, wherein the first resource is a set of at least one subframe, the synchronization resource comprises at least one synchronization subframe, the TDD system comprises a downlink subframe and a special subframe; determining, by the terminal device, a quantity of reserved subframes in the first resource and a time domain location of the reserved subframes in the first resource based on the quantity information of subframes comprised in a first resource, the configuration information of the at least one set of synchronization resources, the bitmap information, and the configuration information of the TDD system; wherein the at least one synchronization subframe, the reserved subframes, the downlink subframe, and the special subframe are not used for device-to-device, D2D, data transmission; determining, by the terminal device, a second resource based on the quantity information of subframes comprised in a first resource, the configuration information of the at least one set of synchronization resources, the configuration information of the TDD system, the quantity information of reserved subframes, and the time domain location information of the reserved subframes in the first resource, wherein the second resource is a set of candidate subframes for the D2D data transmission; and performing, by the terminal device, the D2D data transmission based on the bitmap information and the second resource.