An electronic device comprising: a communication interface; an input interface configured to receive an input as a control command for a target electronic device from a user for controlling the target electronic device through an Internet of Things; and a controller, said electronic device being characterized in that: the controller is configured to: perform a network check to obtain whether the electronic device is connected to the same network as the target electronic device upon receiving the control command; and control the target electronic device according to whether the electronic device is connected to the same network as the target electronic device, wherein the controller is configured to control the target electronic device through a local area network, LAN, according to the control command if the electronic device is connected to the same network as the target electronic device, and wherein the controller is configured to transmit a signal to request that the target electronic device be controlled according to the control command to a relay server if the electronic device is not connected to the same network as the target electronic device. a communication interface; an input interface configured to receive an input as a control command for a target electronic device from a user for controlling the target electronic device through an Internet of Things; and a controller, said electronic device being characterized in that: the controller is configured to: perform a network check to obtain whether the electronic device is connected to the same network as the target electronic device upon receiving the control command; and control the target electronic device according to whether the electronic device is connected to the same network as the target electronic device, wherein the controller is configured to control the target electronic device through a local area network, LAN, according to the control command if the electronic device is connected to the same network as the target electronic device, and wherein the controller is configured to transmit a signal to request that the target electronic device be controlled according to the control command to a relay server if the electronic device is not connected to the same network as the target electronic device. the controller is configured to: perform a network check to obtain whether the electronic device is connected to the same network as the target electronic device upon receiving the control command; and control the target electronic device according to whether the electronic device is connected to the same network as the target electronic device, perform a network check to obtain whether the electronic device is connected to the same network as the target electronic device upon receiving the control command; and control the target electronic device according to whether the electronic device is connected to the same network as the target electronic device, wherein the controller is configured to control the target electronic device through a local area network, LAN, according to the control command if the electronic device is connected to the same network as the target electronic device, and wherein the controller is configured to transmit a signal to request that the target electronic device be controlled according to the control command to a relay server if the electronic device is not connected to the same network as the target electronic device.