A method for resource configuration in device-to-device (D2D) communications, comprising: receiving, by a terminal device (20, 30, 500, 910), a first parameter set transmitted by a network device (10, 600, 920); performing, by the terminal device (20, 30, 500, 910), resource sensing on at least one carrier based on the first parameter set to obtain an available resource set on the at least one carrier, wherein a resource in an available resource set on each carrier can be used to transmit a target service, and the first parameter set comprises at least one of: information about a resource for performing the resource sensing, a condition parameter for determining the available resource set, or a transmission parameter of the target service; and reporting, by the terminal device (20, 30, 500, 910), information about the available resource set on the at least one carrier to the network device (10, 600, 920), wherein the reporting, by the terminal device (20, 30, 500, 910), information about the available resource set on the at least one carrier to a network device (10, 600, 920) comprises: reporting, by the terminal device (20, 30, 500, 910), an index of at least one candidate target resource in the available resource set on the at least one carrier to the network device (10, 600, 920), wherein an index of each candidate target resource in an available resource set on each carrier is used to indicate a location of each candidate target resource in a resource selection window of each carrier, wherein the information about the resource for performing the resource sensing comprises at least one of: information about a resource pool for performing the resource sensing, information about a carrier for performing the resource sensing, information about a subband for performing the resource sensing; and/or the transmission parameter of the target service comprises at least one of: information about a priority of the target service, a transmission period of the target service. receiving, by a terminal device (20, 30, 500, 910), a first parameter set transmitted by a network device (10, 600, 920); performing, by the terminal device (20, 30, 500, 910), resource sensing on at least one carrier based on the first parameter set to obtain an available resource set on the at least one carrier, wherein a resource in an available resource set on each carrier can be used to transmit a target service, and the first parameter set comprises at least one of: information about a resource for performing the resource sensing, a condition parameter for determining the available resource set, or a transmission parameter of the target service; and reporting, by the terminal device (20, 30, 500, 910), information about the available resource set on the at least one carrier to the network device (10, 600, 920), wherein the reporting, by the terminal device (20, 30, 500, 910), information about the available resource set on the at least one carrier to a network device (10, 600, 920) comprises: reporting, by the terminal device (20, 30, 500, 910), an index of at least one candidate target resource in the available resource set on the at least one carrier to the network device (10, 600, 920), wherein an index of each candidate target resource in an available resource set on each carrier is used to indicate a location of each candidate target resource in a resource selection window of each carrier, wherein the information about the resource for performing the resource sensing comprises at least one of: information about a resource pool for performing the resource sensing, information about a carrier for performing the resource sensing, information about a subband for performing the resource sensing; and/or the transmission parameter of the target service comprises at least one of: information about a priority of the target service, a transmission period of the target service. reporting, by the terminal device (20, 30, 500, 910), an index of at least one candidate target resource in the available resource set on the at least one carrier to the network device (10, 600, 920), wherein an index of each candidate target resource in an available resource set on each carrier is used to indicate a location of each candidate target resource in a resource selection window of each carrier, wherein the information about the resource for performing the resource sensing comprises at least one of: information about a resource pool for performing the resource sensing, information about a carrier for performing the resource sensing, information about a subband for performing the resource sensing; and/or the transmission parameter of the target service comprises at least one of: information about a priority of the target service, a transmission period of the target service.