A method of controlling communication of an electronic device, the method comprising: detecting , by a processor of the electronic device, a first peripheral device through a first communication module, of the electronic device, which supports a first communication type; acquiring group information on a group of peripheral devices, to which the first peripheral device belongs based on first identification information of the first peripheral device, wherein the group information is acquired from a database storing a plurality of pieces of group information and wherein each piece of the group information indicates information on the group of peripheral devices; activating , by the processor, a second communication module of the electronic device which supports a second communication type, associated with the acquired group information; detecting , by the processor, a second peripheral device belonging to the group through the second communication module of the electronic device, establishing a first communication connection with the first peripheral device through the first communication module and establishing a second communication connection with the second peripheral device through the second communication module, the method characterized by : detecting a release of the first communication connection through the first communication module after the establishing of the first and second communication connections, and deactivating the second communication module or releasing the second communication connection through the second communication module according to the release of the first communication connection. detecting , by a processor of the electronic device, a first peripheral device through a first communication module, of the electronic device, which supports a first communication type; acquiring group information on a group of peripheral devices, to which the first peripheral device belongs based on first identification information of the first peripheral device, wherein the group information is acquired from a database storing a plurality of pieces of group information and wherein each piece of the group information indicates information on the group of peripheral devices; activating , by the processor, a second communication module of the electronic device which supports a second communication type, associated with the acquired group information; detecting , by the processor, a second peripheral device belonging to the group through the second communication module of the electronic device, establishing a first communication connection with the first peripheral device through the first communication module and establishing a second communication connection with the second peripheral device through the second communication module, the method characterized by : detecting a release of the first communication connection through the first communication module after the establishing of the first and second communication connections, and deactivating the second communication module or releasing the second communication connection through the second communication module according to the release of the first communication connection. detecting a release of the first communication connection through the first communication module after the establishing of the first and second communication connections, and deactivating the second communication module or releasing the second communication connection through the second communication module according to the release of the first communication connection. <EOS>