A method for transmitting a signal, wherein the method comprises: obtaining, by a first UE, transmission resource configuration information of a Device to Device, D2D, signal from a network side after establishing a Radio Resource Control, RRC, connection with the network side; and transmitting, by the first UE, the D2D signal according to the transmission resource configuration information; the method further comprises: if the first UE is switched to a new cell during transmitting a D2D signal and the first UE is idle or connected while transmitting the D2D signal, then judging, by the first UE, whether the new cell belongs to a valid area, where the obtained transmission resource configuration information is applicable, after being switched to the new cell, and if so, then continuing with transmitting the D2D signal according to the transmission resource configuration information; otherwise, stopping the D2D signal from being transmitted; or if the first UE is switched to a new cell during transmitting a D2D signal and first UE is connected while transmitting the D2D signal, then continuing, by the first UE, with transmitting the D2D signal according to new transmission resource configuration information carried in a handover command received in a handover procedure after being switched to the new cell. obtaining, by a first UE, transmission resource configuration information of a Device to Device, D2D, signal from a network side after establishing a Radio Resource Control, RRC, connection with the network side; and transmitting, by the first UE, the D2D signal according to the transmission resource configuration information; the method further comprises: if the first UE is switched to a new cell during transmitting a D2D signal and the first UE is idle or connected while transmitting the D2D signal, then judging, by the first UE, whether the new cell belongs to a valid area, where the obtained transmission resource configuration information is applicable, after being switched to the new cell, and if so, then continuing with transmitting the D2D signal according to the transmission resource configuration information; otherwise, stopping the D2D signal from being transmitted; or if the first UE is switched to a new cell during transmitting a D2D signal and first UE is connected while transmitting the D2D signal, then continuing, by the first UE, with transmitting the D2D signal according to new transmission resource configuration information carried in a handover command received in a handover procedure after being switched to the new cell. if the first UE is switched to a new cell during transmitting a D2D signal and the first UE is idle or connected while transmitting the D2D signal, then judging, by the first UE, whether the new cell belongs to a valid area, where the obtained transmission resource configuration information is applicable, after being switched to the new cell, and if so, then continuing with transmitting the D2D signal according to the transmission resource configuration information; otherwise, stopping the D2D signal from being transmitted; or if the first UE is switched to a new cell during transmitting a D2D signal and first UE is connected while transmitting the D2D signal, then continuing, by the first UE, with transmitting the D2D signal according to new transmission resource configuration information carried in a handover command received in a handover procedure after being switched to the new cell.