1. A method for controlling an electronic device, the method comprising: obtaining a first plurality of images corresponding to a first location in an external space surrounding the electronic device and a second plurality of images corresponding to a second location in the external space, wherein the obtaining comprises: displaying a capturing guide indicating a direction for the electronic device to be moved; and when a capturing focus of a camera of the electronic device matches the direction, automatically capturing an image corresponding to the direction to be included in the first plurality of images or the second plurality of images; when a difference between a first time of capture for the first plurality of images and a second time of capture for the second plurality of images is smaller than a predetermined value, generating a 3D map of the external space based on the first plurality of images and the second plurality of images; when the difference is equal to or greater than the predetermined value, overwriting previously stored image data with the first plurality of images or the second plurality of images; identifying in the Three-Dimensional (3D) map an area corresponding to a first object and another area corresponding to a second object; determining whether the first object and the second object are each capable of communicatively connecting with the electronic device; when the first object is determined to be capable of communicatively connecting with the electronic device, connecting to the first object to obtain information relating to the first object; displaying at least one of identification information of the first object, an indicator for indicating whether the first object is capable of communicating with the electronic device or not, a control interface for controlling the first object, and operation state information of the first object based on the information relating to the first object on a display; when the second object is determined to be incapable of communicatively connecting with the electronic device: obtaining information relating to the second object; receiving a selection of the second object by a user; and transmitting a control signal to the first object that includes the information relating to the second object.