A method for selecting a carrier, applied to Device-to-Device communication, comprising: determining, by a terminal device, a carrier for transmitting a data packet with at least one first data packet priority from at least one first carrier according to first configuration information, wherein data packet priorities of the at least one first data packet priority are different from each other, the first configuration information indicates a first correspondence between at least one first carrier priority and the at least one first carrier, and the at least one first carrier priority is used for instructing the terminal device to preferentially transmit, on a carrier with a higher carrier priority, the data packet with the at least one first data packet priority, wherein the first correspondence is used for a first service, the first service corresponds to at least one second carrier, and the at least one second carrier is a subset of the at least one first carrier, wherein the determining, by the terminal device, the carrier for transmitting the data packet with the at least one first data packet priority according to the first configuration information, comprises: determining, by the terminal device, a second correspondence between the at least one first data packet priority and the at least one second carrier according to the first correspondence; and determining, by the terminal device, the carrier for transmitting the data packet with the at least one first data packet priority according to the second correspondence, wherein the determining, by the terminal device, the second correspondence between the at least one first data packet priority and the at least one second carrier according to the first correspondence, comprises: determining, by the terminal device, the second correspondence according to second configuration information, wherein the second configuration information indicates a third correspondence from a correspondence between carrier priorities and carriers, and at least one carrier corresponding to a target service, to a correspondence between data packet priorities and carriers. determining, by a terminal device, a carrier for transmitting a data packet with at least one first data packet priority from at least one first carrier according to first configuration information, wherein data packet priorities of the at least one first data packet priority are different from each other, the first configuration information indicates a first correspondence between at least one first carrier priority and the at least one first carrier, and the at least one first carrier priority is used for instructing the terminal device to preferentially transmit, on a carrier with a higher carrier priority, the data packet with the at least one first data packet priority, wherein the first correspondence is used for a first service, the first service corresponds to at least one second carrier, and the at least one second carrier is a subset of the at least one first carrier, wherein the determining, by the terminal device, the carrier for transmitting the data packet with the at least one first data packet priority according to the first configuration information, comprises: determining, by the terminal device, a second correspondence between the at least one first data packet priority and the at least one second carrier according to the first correspondence; and determining, by the terminal device, the carrier for transmitting the data packet with the at least one first data packet priority according to the second correspondence, wherein the determining, by the terminal device, the second correspondence between the at least one first data packet priority and the at least one second carrier according to the first correspondence, comprises: determining, by the terminal device, the second correspondence according to second configuration information, wherein the second configuration information indicates a third correspondence from a correspondence between carrier priorities and carriers, and at least one carrier corresponding to a target service, to a correspondence between data packet priorities and carriers. determining, by the terminal device, a second correspondence between the at least one first data packet priority and the at least one second carrier according to the first correspondence; and determining, by the terminal device, the carrier for transmitting the data packet with the at least one first data packet priority according to the second correspondence, wherein the determining, by the terminal device, the second correspondence between the at least one first data packet priority and the at least one second carrier according to the first correspondence, comprises: determining, by the terminal device, the second correspondence according to second configuration information, wherein the second configuration information indicates a third correspondence from a correspondence between carrier priorities and carriers, and at least one carrier corresponding to a target service, to a correspondence between data packet priorities and carriers.