1. A method of operating an electronic device based on optical object recognition comprising: executing an optical recognition function; recognizing an object outside the electronic device via an optical sensor; computing outward form information regarding the recognized object based on stored outward form information in a database; identifying the recognized object based on the computed outward form information regarding the object; searching for an Internet of Things (IoT) target device related to the identified object; recommending an IoT action related to the identified object; automatically preparing for and executing the IoT action; and performing voice feedback regarding the IoT action and the IoT target device.