A method (200, 201, 202, 203, 204) implemented at a terminal device (102, 103, 104, 105), comprising: receiving, from a network device, a scheduling configuration for a device to device, D2D, transmission of the terminal device; receiving, from the network device, an uplink scheduling grant for a cellular uplink transmission in a same time resource overlapping with the D2D transmission; determining a scheduling priority for the D2D transmission relative to the cellular uplink transmission based on at least one of: a first comparison between an associated priority of the scheduling configuration and a first priority threshold, and a transmission restriction, wherein said determining a scheduling priority for the D2D transmission relative to a cellular uplink transmission comprises: determining a first scheduling priority for a first set of D2D packet data with a priority equal to or higher than the first priority threshold, a second scheduling priority lower than the first scheduling priority for the uplink cellular transmission, and a third scheduling priority lower than the second priority for a second set of D2D packet data with a priority lower than the first priority threshold; performing at least one of the D2D transmission and the cellular uplink transmission based on the determined scheduling priority, wherein performing at least one of the D2D transmission and the cellular uplink transmission based on the determined scheduling priority includes: allocating at least one of resources and transmission power for the first set of D2D packet data, the uplink cellular transmission, and the second set of D2D packet data, in a descending scheduling priority order until at least one of available resource and transmission power budget of the terminal device is exhausted; and performing transmission according to the allocated at least one of resources and transmission power. receiving, from a network device, a scheduling configuration for a device to device, D2D, transmission of the terminal device; receiving, from the network device, an uplink scheduling grant for a cellular uplink transmission in a same time resource overlapping with the D2D transmission; determining a scheduling priority for the D2D transmission relative to the cellular uplink transmission based on at least one of: a first comparison between an associated priority of the scheduling configuration and a first priority threshold, and a transmission restriction, wherein said determining a scheduling priority for the D2D transmission relative to a cellular uplink transmission comprises: determining a first scheduling priority for a first set of D2D packet data with a priority equal to or higher than the first priority threshold, a second scheduling priority lower than the first scheduling priority for the uplink cellular transmission, and a third scheduling priority lower than the second priority for a second set of D2D packet data with a priority lower than the first priority threshold; performing at least one of the D2D transmission and the cellular uplink transmission based on the determined scheduling priority, wherein performing at least one of the D2D transmission and the cellular uplink transmission based on the determined scheduling priority includes: allocating at least one of resources and transmission power for the first set of D2D packet data, the uplink cellular transmission, and the second set of D2D packet data, in a descending scheduling priority order until at least one of available resource and transmission power budget of the terminal device is exhausted; and performing transmission according to the allocated at least one of resources and transmission power. allocating at least one of resources and transmission power for the first set of D2D packet data, the uplink cellular transmission, and the second set of D2D packet data, in a descending scheduling priority order until at least one of available resource and transmission power budget of the terminal device is exhausted; and performing transmission according to the allocated at least one of resources and transmission power.