Electronic device and method for performing peer-to-peer service in the electronic device

By supporting multiple communication solutions in electronic devices and using public keys and shared keys for authentication, the problems of communication solutions identification and man-in-the-middle attacks in existing P2P services are solved, and safe and convenient P2P service execution is achieved.

CN115104283BActive Publication Date: 2025-05-30SAMSUNG ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202180013887.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-02-11
Filing Date
2021-02-09
Publication Date
2025-05-30
Estimated Expiration
2041-02-09

AI Technical Summary

Technical Problem

When using short-distance communication solutions, existing P2P services require users to identify the communication solutions in advance and are vulnerable to attacks by man-in-the-middles, resulting in personal information leakage.

Method used

By enabling support for various communication solutions for external electronic devices in electronic devices, authentication is used to prevent man-in-the-middle attacks and service handover if necessary.

Benefits of technology

It is realized that P2P services are safely executed without the need for the user to identify the communication scheme in advance, prevent personal information leakage, and improve the security of communication connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115104283B_ABST
    Figure CN115104283B_ABST
Patent Text Reader

Abstract

Provided are an electronic device and a method for performing a P2P service in an electronic device. The electronic device includes: a communication module; a processor; a memory; and a security module. The memory may be configured to store instructions that, when executed, cause the processor to receive a public key from an external electronic device when a peer-to-peer (P2P) service is requested, send an authentication certificate chain generated based on the received public key to the external electronic device via the security module, verify the authentication certificate chain received from the external electronic device by using a root authentication certificate stored in the security module, receive encrypted information of the external electronic device from the external electronic device, decrypt the encrypted information of the external electronic device by using a shared key generated according to the verification result of the received authentication certificate chain, and perform a P2P service with the external electronic device via the communication module based on the decrypted information of the external electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to facilitating device search and connection between electronic devices having hybrid heterogeneous communication schemes, and securely performing peer-to-peer (P2P) services with appropriate communication schemes. Background Art

[0002] Generally, electronic devices are equipped with short-range communication technologies such as Bluetooth, Near Field Communication (NFC), or Wireless Fidelity (Wi-Fi), and typical examples of P2P services between electronic devices include file transfer, mobile hotspot connection, or music sharing. To use P2P services, a user can pre-identify what communication scheme is used in the corresponding service. For example, file transfer is subdivided into Bluetooth file transfer, Android Beam using NFC TM , sent to a device by using Bluetooth Low Energy (BLE) and Wi-Fi, or Wi-Fi Direct.

[0003] In the case of P2P services based on short-range communication, users are authenticated by comparing phone numbers. For example, partial data of a hashed phone number can be sent together with a Cyclic Redundancy Check (CRC), and can be compared with hash information stored in a counterpart device, so that according to whether they match, the user can be authenticated.

[0004] The above information is provided only as background information to help understand the present disclosure. No determination has been made, and no assertion is made, as to whether any of the above can be applied as prior art to the present disclosure. Summary of the Invention

[0005] Technical Problem

[0006] Various P2P services can be designed to provide services based on short-range communication schemes, and can include services or communication characteristics that depend on the communication scheme. As a result, for services with the same characteristics, there may be redundant services or communication characteristics for each communication scheme. Therefore, to use a specific P2P service, a user needs to pre-identify what communication scheme is used in the corresponding service.

[0007] In addition, P2P services using short-range communication schemes have the possibility of exposing personal information during authentication between users due to a man-in-the-middle (MITM) attack on the device. The MITM attack device steals data between the electronic devices performing authentication, and the electronic devices can thus identify the MITM attack device as an authenticated external electronic device, enabling the external electronic device to continue connecting and communicating.

[0008] Aspects of the present disclosure at least address the above problems and / or disadvantages and at least provide the following advantages. Thus, when an aspect of the present disclosure will provide a P2P service with an external electronic device, which can be performed through various communication schemes, and provide a service hand over, which can perform a service by considering the attribute information of the external electronic device and the characteristics of the service.

[0009] Aspects of the present disclosure will provide a public key that can be exchanged with an external electronic device to verify a certificate, and a shared key that can be generated to perform authentication regarding the external electronic device, so as to prevent interference by a third party, such as information theft during communication related to P2P communication between electronic devices.

[0010] Technical solutions

[0011] According to an aspect of the present invention, there is provided an electronic device capable of optimizing heating control for a user in an electronic device, and a method of controlling heating based on user feedback in the electronic device. The electronic device may include a communication module, a security module, a processor operably connected to the communication module and the security module, and a memory operably connected to the processor, wherein the memory stores instructions that, when executed, cause the processor to receive a public key from an external electronic device when a peer-to-peer (P2P) service is requested, send an authentication certificate chain generated based on the received public key to the external electronic device through the security module, verify the authentication certificate chain received from the external electronic device by using a root authentication certificate stored in the security module, receive encrypted information about the external electronic device from the external electronic device, decrypt the encrypted information about the external electronic device by using a shared key generated based on the result of verifying the received authentication certificate chain, and perform a P2P service with the external electronic device through the communication module based on the decrypted information about the external electronic device.

[0012] According to another aspect of the present invention, there is provided an electronic device. The electronic device may include at least one communication module, a processor operably connected to the communication module, and a memory operably connected to the processor, wherein the memory stores instructions that, when executed, cause the processor to identify a service request for an external electronic device through the communication module, perform authentication on the external electronic device, control the communication module to establish a connection for a first short-range communication with the external electronic device according to the result of the authentication, receive communication information about the external electronic device through the first short-range communication, identify a second short-range communication for connecting the service to the external electronic device based on the identified communication information, and control the communication module to connect to the external electronic device through the second short-range communication.

[0013] According to another aspect of the present invention, there is provided a method for performing a peer-to-peer (P2P) service in an electronic device. The method includes: when a P2P service is requested, receiving a public key from an external electronic device, sending an authentication certificate chain generated based on the received public key to the external electronic device, verifying the authentication certificate chain received from the external electronic device by using a root authentication certificate stored in a security module, receiving encrypted information about the external electronic device from the external electronic device, decrypting the encrypted information about the external electronic device by using a shared key generated based on the result of verifying the received authentication certificate chain, and performing a P2P service with the external electronic device based on the decrypted information about the external electronic device.

[0014] According to one aspect of the present invention, there is provided a method for performing a peer-to-peer (P2P) service in an electronic device. The method includes: identifying a service request for an external electronic device, performing authentication on the external electronic device, establishing a connection for a first short-range communication with the external electronic device according to the result of the authentication, receiving communication information about the external electronic device through the first short-range communication, identifying a second short-range communication for connecting with the external electronic device based on the identified communication information, and controlling the connection between the external electronic device and the service through the second short-range communication.

[0015] According to various embodiments of the present disclosure, during a P2P service with an external electronic device, the electronic device may perform service handover by considering the attribute information of the external electronic device and the characteristics of the service, so that a communication scheme suitable for the corresponding service can be used.

[0016] According to various embodiments of the present disclosure, authentication may be performed by using a public key generated as a result of mutual authentication between the electronic device and the external electronic device, thereby preventing a man-in-the-middle (MITM) attack and enhancing the security of the communication connection.

[0017] From the following detailed description, other aspects, advantages, and significant features of the present disclosure will become apparent to those skilled in the art, which, in conjunction with the accompanying drawings, discloses various embodiments of the present disclosure. Description of the Drawings

[0018] Through the following description with reference to the accompanying drawings, the above and other aspects, features, and advantages of certain embodiments of the present disclosure will become more apparent, wherein:

[0019] Figure 1 is a block diagram of an electronic device in a network environment according to an embodiment of the present disclosure.

[0020] Figure 2 is a block diagram illustrating an example of an electronic device configuration according to an embodiment of the present disclosure.

[0021] Figure 3It is a flowchart showing an example of an operation for performing authentication for a P2P service in an electronic device according to an embodiment of the present disclosure.

[0022] Figure 4 It is a flowchart showing an example of an operation in which an electronic device performs a P2P service with an external electronic device according to an embodiment of the present disclosure.

[0023] Figure 5 It is a block diagram showing an example of a software configuration according to an embodiment of the present disclosure.

[0024] Figure 6 It is a diagram showing an example of a software structure according to an embodiment of the present disclosure.

[0025] Figure 7 It is a flowchart showing an example of an operation for performing a P2P service in an electronic device according to an embodiment of the present disclosure.

[0026] Figure 8 It is a diagram showing an example of an operation for performing a P2P service in an electronic device according to an embodiment of the present disclosure.

[0027] Figure 9 It is a flowchart showing an example of an operation for performing a P2P service in an electronic device according to an embodiment of the present disclosure.

[0028] Figure 10 It is a flowchart showing an example of an operation for identifying a communication range of a service target device of a P2P service in an electronic device according to an embodiment of the present disclosure.

[0029] Figure 11 It is a flowchart showing an example of an operation for identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0030] Figure 12 It is a diagram showing an example of a screen configuration for identifying whether a P2P service is allowed according to an embodiment of the present disclosure.

[0031] Figure 13 It is a flowchart showing an example of an operation for identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0032] Figure 14 It is a flowchart showing an example of an operation for identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0033] Figure 15 It is a flowchart showing an example of an operation for identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0034] Figure 16 is a flowchart illustrating an example of an operation of performing authentication in a P2P service between electronic devices according to an embodiment of the present disclosure.

[0035] Figure 17 is a flowchart illustrating an example of an operation of performing authentication in a P2P service between electronic devices according to an embodiment of the present disclosure.

[0036] Figure 18 is a flowchart illustrating an example of an operation of performing authentication in a P2P service between electronic devices according to an embodiment of the present disclosure.

[0037] Figure 19 is a flowchart illustrating an example of an operation of performing service handover by performing authentication in a P2P service between electronic devices according to an embodiment of the present disclosure.

[0038] Figure 20 is a diagram illustrating an example of a screen configuration for notifying service handover in a P2P service between electronic devices according to an embodiment of the present disclosure.

[0039] Figure 21 is a flowchart illustrating an example of an operation of discovering a service handover device in a P2P service between electronic devices according to an embodiment of the present disclosure.

[0040] In all the drawings, the same reference numerals are used to denote the same elements. Detailed Description

[0041] The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of various embodiments of the present disclosure defined by the claims and their equivalents. It includes various specific details to aid understanding, but these are only considered exemplary. Thus, those of ordinary skill in the art will recognize that various changes and modifications can be made to the various embodiments described herein without departing from the scope and spirit of the present disclosure. In addition, descriptions of well-known functions and structures may be omitted for clarity and conciseness.

[0042] The terms and words used in the following description and claims are not limited to the documentary meanings, but are used solely by the inventor to achieve a clear and consistent understanding of the disclosure. Thus, it will be apparent to those skilled in the art that the following description of the various embodiments of the present disclosure is provided for illustrative purposes only and is not intended to limit the present disclosure defined by the appended claims and their equivalents.

[0043] It should be understood that the singular forms “a,” “an,” and “the” include plural referents unless the context clearly dictates otherwise. Thus, for example, reference to “a component surface” includes reference to one or more such surfaces.

[0044] The singular form of a noun corresponding to an item can include one or more items unless the relevant context clearly indicates otherwise. As used herein, expressions such as “A or B” or “at least one of A or B” can include all possible combinations of the items listed together. Expressions such as “first,” “second,” “first,” and “second” can modify corresponding elements regardless of their order or importance. These expressions are only used to distinguish the corresponding elements from another element and do not limit these elements. When an element (e.g., a first element) is referred to as being “connected” or “coupled” (operatively or communicatively) to another element (e.g., a second element), it can be directly connected or coupled to the other element or can be connected or coupled to the other element via another element (e.g., a third element).

[0045] Depending on the context, the expression “configured to” used in the present disclosure can be interchangeably used with, for example, “suitable for,” “capable of,” “designed to,” “adapted to,” “made to,” or “able to.” The term “configured to” does not necessarily imply “specially designed to” in hardware. Alternatively, in some cases, the expression “a device configured to” can mean that the device “is able to” together with other devices or components. For example, the phrase “a processor adapted to (or configured to) execute A, B, and C” can mean a dedicated processor (e.g., an embedded processor) solely for performing the corresponding operations, or a general-purpose processor (e.g., a central processing unit (CPU) or an application processor (AP)) that can perform the corresponding operations by executing one or more software programs stored in a memory device.

[0046] An electronic device according to various embodiments of the present disclosure may include at least one of, for example, a smartphone, a tablet personal computer (PC), a mobile phone, a video phone, an e-book reader (e-book reader), a desktop PC, a laptop PC, a netbook computer, a workstation, a server, a personal digital assistant (PDA), a portable multimedia player (PMP), a Moving Picture Experts Group (MPEG-1) Audio Layer 3 (MP3) player, a mobile medical device, a camera, and a wearable device. The wearable device may include at least one of an accessory type (e.g., a watch, a ring, a bracelet, an anklet, a necklace, glasses, contact lenses, or a head-mounted device (HMD)), a fabric or clothing integrated type (e.g., an electronic garment), a body-mounted type (e.g., a skin pad or a tattoo), and a bio-implantable circuit. In some embodiments, the electronic device may include at least one of, for example, a TV, a digital video disc (DVD) player, an audio, a refrigerator, an air conditioner, a vacuum cleaner, an oven, a microwave oven, a washing machine, an air purifier, a set-top box, a home automation control panel, a security control panel, a TV (TV) box (e.g., Samsung HomeSyncTM, Apple TVTM, or Google TVTM), a game console (e.g., XboxTM and PlayStationTM), an electronic dictionary, an electronic key, a camera, and an electronic photo frame.

[0047] According to other embodiments, the electronic device may include at least one of various medical devices (e.g., various portable medical measurement devices (blood glucose monitoring devices, heart rate monitoring devices, blood pressure measurement devices, body temperature measurement devices, etc.), magnetic resonance angiography (MRA), magnetic resonance imaging (MRI), computed tomography (CT) machines, ultrasonic machines, etc.), navigation devices, global positioning system (GPS) receivers, event data recorders (EDRs), flight data recorders (FDRs), vehicle infotainment devices, electronic devices for ships (e.g., ship navigation devices, gyrocompasses, etc.), avionics, safety devices, automotive head units, home or industrial robots, automated teller machines (ATMs) in banks, point of sale (POS) in stores, or Internet of Things devices (e.g., light bulbs, various sensors, electricity or gas meters, sprinkler devices, fire alarms, thermostats, street lights, toasters, sports goods, hot water tanks, heaters, boilers, etc.). According to some embodiments, the electronic device may include at least one of furniture or a part of a building / structure, an electronic board, an electronic signature receiving device, a projector, and various measuring instruments (e.g., water meters, electricity meters, gas meters, radio wave meters, etc.). In various embodiments, the electronic device may be flexible or may be a combination of one or more of the foregoing various devices. The electronic device according to various embodiments of the present disclosure is not limited to the above devices. In various embodiments of the present disclosure, the term "user" may refer to a person using the electronic device or a device using the electronic device (e.g., an artificial intelligence electronic device).

[0048] Hereinafter, an electronic device according to various embodiments of the present disclosure and an electronic device and method for service discovery will be described with reference to the drawings. In the present disclosure, the term user may refer to a person using the electronic device or a device using the electronic device (e.g., an artificial intelligence electronic device).

[0049] Figure 1 is a block diagram showing an electronic device in a network environment according to an embodiment.

[0050] Refer to Figure 1, the electronic device 101 in the network environment 100 can communicate with the external electronic device 102 via the first network 198 (e.g., a short-range wireless communication network), or communicate with the external electronic device 104 or the server 108 via the second network 199 (e.g., a long-range wireless communication network). According to an embodiment, the electronic device 101 can communicate with the external electronic device 104 via the server 108. According to an embodiment, the electronic device 101 can include a processor 120, a memory 130, an input device 150, a sound output device 155, a display device 160, an audio module 170, a sensor module 176, an interface 177, a haptic module 179, a camera module 180, a power management module 188, a battery 189, a communication module 190, a subscriber identity module (SIM) 196, or an antenna module 197. In some embodiments, at least one of the components (e.g., the display device 160 or the camera module 180) can be omitted from the electronic device 101, or one or more other components can be added to the electronic device 101. In some embodiments, some of the components can be implemented as a single integrated circuit. For example, the sensor module 176 (e.g., a fingerprint sensor, an iris sensor, or an illuminance sensor) can be implemented as being embedded in the display device 160 (e.g., a display).

[0051] The processor 120 can run software (e.g., the program 140) to control at least one other component (e.g., a hardware component or a software component) connected to the processor 120 of the electronic device 101, and can perform various data processing or calculations. According to one embodiment, as at least part of the data processing or calculation, the processor 120 can load a command or data received from another component (e.g., the sensor module 176 or the communication module 190) into the volatile memory 132, process the command or data stored in the volatile memory 132, and store the result data in the non-volatile memory 134. According to an embodiment, the processor 120 can include a main processor 121 (e.g., a central processing unit (CPU) or an application processor (AP)) and an auxiliary processor 123 (e.g., a graphics processing unit (GPU), an image signal processor (ISP), a sensor hub processor, or a communication processor (CP)) that is operationally independent of or combined with the main processor 121. Additionally or alternatively, the auxiliary processor 123 can be adapted to consume less power than the main processor 121, or be adapted to be specifically used for a specified function. The auxiliary processor 123 can be implemented as being separate from the main processor 121, or as a part of the main processor 121.

[0052] When the main processor 121 is in an inactive (e.g., sleep) state, the auxiliary processor 123 may control at least some of the functions or states related to at least one of the components of the electronic device 101 (rather than the main processor 121) (e.g., the display device 160, the sensor module 176, or the communication module 190). Or when the main processor 121 is in an active state (e.g., running an application), the auxiliary processor 123 may control at least some of the functions or states related to at least one of the components of the electronic device 101 (e.g., the display device 160, the sensor module 176, or the communication module 190) together with the main processor 121. According to an embodiment, the auxiliary processor 123 (e.g., an image signal processor or a communication processor) may be implemented as part of another component (e.g., the camera module 180 or the communication module 190) that is functionally related to the auxiliary processor 123.

[0053] The memory 130 may store various data used by at least one component of the electronic device 101 (e.g., the processor 120 or the sensor module 176). The various data may include, for example, software (e.g., the program 140) and input data or output data for commands related thereto. The memory 130 may include a volatile memory 132 or a non-volatile memory 134.

[0054] The program 140 may be stored as software in the memory 130, and the program 140 may include, for example, an operating system (OS) 142, middleware 144, or an application 146.

[0055] The input device 150 may receive commands or data from the outside of the electronic device 101 (e.g., a user) to be used by other components of the electronic device 101 (e.g., the processor 120). The input device 150 may include, for example, a microphone, a mouse, a keyboard, or a digital pen (e.g., a stylus).

[0056] The sound output device 155 may output a sound signal to the outside of the electronic device 101. The sound output device 155 may include, for example, a speaker or a receiver. The speaker may be used for general purposes such as playing multimedia or playing a record, and the receiver may be used for incoming calls. According to an embodiment, the receiver may be implemented separately from the speaker or as part of the speaker.

[0057] The display device 160 may visually provide information to the outside of the electronic device 101 (e.g., a user). The display device 160 may include, for example, a display, a holographic device, or a projector, and a control circuit for controlling the corresponding one of the display, the holographic device, and the projector. According to an embodiment, the display device 160 may include a touch circuit adapted to detect a touch or a sensor circuit (e.g., a pressure sensor) adapted to measure the intensity of a force caused by the touch.

[0058] The audio module 170 can convert sound into an electrical signal and vice versa. According to an embodiment, the audio module 170 can obtain sound via the input device 150, or output sound via the sound output device 155 or headphones of an external electronic device (e.g., external electronic device 102) directly (e.g., wired) or wirelessly connected to the electronic device 101.

[0059] The sensor module 176 can detect the operating state of the electronic device 101 (e.g., power or temperature) or the environmental state outside the electronic device 101 (e.g., the state of the user), and then generate an electrical signal or data value corresponding to the detected state. According to an embodiment, the sensor module 176 can include, for example, a gesture sensor, a gyro sensor, an atmospheric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an infrared (IR) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.

[0060] The interface 177 can support one or more specific protocols used to directly (e.g., wired) or wirelessly connect the electronic device 101 to an external electronic device (e.g., external electronic device 102). According to an embodiment, the interface 177 can include, for example, a high-definition multimedia interface (HDMI), a universal serial bus (USB) interface, a secure digital (SD) card interface, or an audio interface.

[0061] The connection terminal 178 can include a connector through which the electronic device 101 can be physically connected to an external electronic device (e.g., external electronic device 102). According to an embodiment, the connection terminal 178 can include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).

[0062] The haptic module 179 can convert an electrical signal into a mechanical stimulus (e.g., vibration or movement) or an electrical stimulus that can be recognized by the user via his sense of touch or kinesthesia. According to an embodiment, the haptic module 179 can include, for example, a motor, a piezoelectric element, or an electrical stimulator.

[0063] The camera module 180 can capture still images or moving images. According to an embodiment, the camera module 180 can include one or more lenses, an image sensor, an image signal processor, or a flash.

[0064] The power management module 188 can manage the power supply to the electronic device 101. According to an embodiment, the power management module 188 can be implemented as at least part of, for example, a power management integrated circuit (PMIC).

[0065] The battery 189 may supply power to at least one component of the electronic device 101. According to an embodiment, the battery 189 may include, for example, a primary battery that is not rechargeable, a rechargeable storage battery, or a fuel cell.

[0066] The communication module 190 may support establishing a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (e.g., the external electronic device 102, the external electronic device 104, or the server 108), and perform communication via the established communication channel. The communication module 190 may include one or more communication processors capable of operating independently of the processor 120 (e.g., an application processor (AP)), and support direct (e.g., wired) communication or wireless communication. According to an embodiment, the communication module 190 may include a wireless communication module 192 (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (e.g., a local area network (LAN) communication module or a power line communication (PLC) module). A corresponding one of these communication modules may communicate with an external electronic device via a first network 198 (e.g., a short-range communication network, such as Bluetooth, Wi-Fi Direct, or Infrared Data Association (IrDA)) or a second network 199 (e.g., a long-range communication network, such as a cellular network, the Internet, or a computer network (e.g., LAN or wide area network (WAN))). These various types of communication modules may be implemented as a single component (e.g., a single chip), or these various types of communication modules may be implemented as multiple separate components (e.g., multiple chips). The wireless communication module 192 may identify and authenticate the electronic device 101 in a communication network (such as the first network 198 or the second network 199) using user information (e.g., an international mobile subscriber identity (IMSI)) stored in the user identification module 196.

[0067] The antenna module 197 may transmit signals or power to the outside of the electronic device 101 (e.g., an external electronic device) or receive signals or power from the outside of the electronic device 101 (e.g., an external electronic device). According to an embodiment, the antenna module 197 may include an antenna including a radiating element formed of a conductive material or a conductive pattern formed in a substrate (e.g., a PCB) or formed on the substrate. According to an embodiment, the antenna module 197 may include a plurality of antennas. In this case, at least one antenna suitable for a communication scheme to be used in a communication network (such as the first network 198 or the second network 199) may be selected from the plurality of antennas by, for example, the communication module 190 (e.g., the wireless communication module 192). Subsequently, signals or power may be transmitted or received between the communication module 190 and an external electronic device via the selected at least one antenna. According to an embodiment, additional components (e.g., a radio frequency integrated circuit (RFIC)) other than the radiating element may be additionally formed as part of the antenna module 197.

[0068] At least some of the above components may be interconnected via an inter-peripheral communication scheme (e.g., a bus, a general-purpose input / output (GPIO), a serial peripheral interface (SPI), or a mobile industry processor interface (MIPI)) and communicatively transmit signals (e.g., commands or data) therebetween.

[0069] According to an embodiment, commands or data may be transmitted or received between the electronic device 101 and an external electronic device 104 via a server 108 connected to a second network 199. Each of the external electronic devices 102 and 104 may be a device of the same type as the electronic device 101 or a device of a different type from the electronic device 101. According to an embodiment, all or some of the operations running on the electronic device 101 may be run on one or more of the external electronic devices 102, the external electronic device 104, or the server 108. For example, if the electronic device 101 is to automatically perform a function or service or is to perform a function or service in response to a request from a user or another device, the electronic device 101 may request one or more of the external electronic devices to perform at least part of the function or service instead of running the function or service, or in addition to running the function or service, the electronic device 101 may also request one or more of the external electronic devices to perform at least part of the function or service. The one or more external electronic devices that receive the request may perform the requested at least part of the function or service, or perform additional functions or additional services related to the request, and transmit the result of the execution to the electronic device 101. The electronic device 101 may provide the result as at least part of a reply to the request with or without further processing of the result. For this purpose, for example, cloud computing technology, distributed computing technology, or client-server computing technology may be used.

[0070] Figure 2 is a block diagram illustrating an example of an electronic device configuration according to an embodiment of the present disclosure.

[0071] Referring to Figure 2 , the electronic device 101 may include a processor 120, a memory 130, a display device 160, a communication module 190, and a security module 220.

[0072] According to various embodiments of the present disclosure, the processor 120 may perform overall operations related to service handover of a P2P service.

[0073] According to various embodiments of the present disclosure, the processor 120 may identify a P2P service trigger according to a user's P2P service request. For example, the P2P service may include a music sharing service or file transfer (e.g., tap to share or synchronize) between electronic devices via short-range communication. The electronic device 101 may identify the P2P service trigger by detecting a specified gesture input (e.g., a tap gesture of the external electronic device 102) or the execution of a specified application.

[0074] According to various embodiments of the present disclosure, the processor 120 may measure the communication range through the short-range communication module 210. For example, the processor 120 may determine whether the service target device is within the communicable range based on the information exchanged between the electronic device 101 and the service target device (e.g., the external electronic device 102). When the external electronic device 102 operates as the host device for service handover, the exchanged information may include the host device name as the host device, the host Bluetooth address, the caster device name, or the connection type with the caster device, and may include the Bluetooth address for the communication connection with the electronic device 101.

[0075] According to various embodiments of the present disclosure, based on the trigger condition of the communication scheme, the operation of measuring the communication range may be omitted. For example, in the case of a specific P2P service (e.g., click to share) triggered by the contact between electronic devices, the operation of measuring the above communication range may be omitted.

[0076] According to various embodiments of the present disclosure, the processor 120 may receive a ranging packet of the external electronic device 102 through the short-range communication module 210 and measure the communication range based on the size or communication strength of the packet.

[0077] According to various embodiments of the present disclosure, when it is determined that the external electronic device 102 is within the communication range, the processor 120 may determine the service handover. For example, a communication scheme in which the P2P service is one of the possible communication schemes may be determined, and the P2P service may be executed through the corresponding communication scheme.

[0078] According to various embodiments of the present disclosure, the processor 120 may send information related to service handover to an application related to the P2P service (e.g., a file transfer application, a quick share application, and a music sharing application) or a module related to the communication scheme (e.g., the Wi-Fi Aware module 211, the Wi-Fi Direct module 212, the Bluetooth module 213, or the NFC module 214).

[0079] According to various embodiments of the present disclosure, the processor 120 may control the display device 160 to display a screen for notifying the user of information related to service handover. For example, the screen may include device information or service information where the P2P service is handed over, and may include items for selecting a permission response or a rejection response for the corresponding service.

[0080] According to various embodiments of the present disclosure, when the electronic device 101 is connected to an external electronic device 102 or a peripheral device of the external electronic device 102 through a short-range communication connection, service handover may include an operation of performing a P2P service through a supported communication scheme or a communication scheme corresponding to specified communication conditions (e.g., communication range or communication quality), or an operation of allowing at least some of the P2P services to be performed in the corresponding peripheral device. For example, the peripheral device may include a device capable of providing a P2P service by being connected to the external electronic device 102 through a short-range communication connection.

[0081] According to various embodiments of the present disclosure, the electronic device 101 may perform service handover to an advanced audio distribution profile (A2DP) device of the external electronic device 102 to output the content of the electronic device 101.

[0082] According to various embodiments of the present disclosure, in order to perform a P2P service with the external electronic device 102, the electronic device may perform a connection using a first communication scheme (e.g., BLE) and perform the P2P service using a second communication scheme (e.g., Wi-Fi Direct).

[0083] According to various embodiments of the present disclosure, the electronic device 101 may maintain the communication scheme previously used when connected to the external electronic device 102 to perform service handover, or may perform service handover using another communication scheme based on additional information received from the external electronic device 102.

[0084] According to various embodiments of the present disclosure, the electronic device 101 may include a communication module 190, a security module 220, a processor 120 operably connected to the communication module 190 and the security module 220, and a memory 130 operably connected to the processor 120, and the memory 130 may store instructions that, when executed, cause the processor 120 to receive a public key from the external electronic device 102 when a P2P service is requested, send an authentication certificate chain generated based on the received public key to the external electronic device through the security module, verify the authentication certificate chain received from the external electronic device by using a root authentication certificate stored in the security module, receive encrypted information about the external electronic device from the external electronic device, decrypt the encrypted information about the external electronic device by using a shared key generated based on the authentication certificate chain verification result, and perform a P2P service with the external electronic device through the communication module based on the decrypted information about the external electronic device.

[0085] According to various embodiments of the present disclosure, the instructions may enable the processor 120 to receive a public key through a Generic Attribute Profile (GATT) connection with an external electronic device 102, and receive encrypted information about the external electronic device 102 through the communication module 190 (or the short-range communication module 210).

[0086] According to various embodiments of the present disclosure, the encrypted information about the external electronic device 102 may include at least a part of the phone number of the external electronic device, and the instructions may enable the processor 120 to decrypt the phone number of the external electronic device 102 with a shared key, and identify the validity of the external electronic device 102 by comparing the decrypted value with the phone number of the external electronic device 102 stored in the memory 130.

[0087] According to various embodiments of the present disclosure, the instructions may enable the processor 120 to generate a shared key according to the Elliptic-curve Diffie-Hellman (ECDH) rule using the same shared key as the external electronic device 102.

[0088] According to various embodiments of the present disclosure, the electronic device 101 may include at least one communication module 190, a processor 120 operably connected to the communication module 190, and a memory 130 operably connected to the processor 120, and the memory 130 may store instructions that, when executed, enable the processor 120 to identify a service request of an external electronic device through the communication module 190, authenticate the external electronic device, control the communication module to establish a connection for a first short-range communication with the external electronic device according to the result of the authentication, receive communication information about the external electronic device through the first short-range communication, identify a second short-range communication for connecting a service to the external electronic device based on the identified communication information, and control the communication module 190 (or the short-range communication module 210) to connect to the external electronic device through the second short-range communication.

[0089] According to various embodiments of the present disclosure, the electronic device 101 may further include a security module 220, and the instructions may enable the processor 120 to send a public key to the external electronic device, receive a chain of authentication certificates generated based on the sent public key from the external electronic device, verify the chain of authentication certificates received from the external electronic device by using a root authentication certificate stored in the security module, control the security module 220 to identify a shared key shared with the external electronic device 102 based on the result of verifying the chain of authentication certificates, decrypt the communication information based on the shared key, and identify information about a previous communication connection with the external electronic device 102 based on the decrypted communication information.

[0090] According to various embodiments of the present disclosure, instructions may enable the processor 120 to identify a randomly generated nonce value and a timestamp of the nonce value, and control the security module 220 to encrypt the nonce value with a shared key.

[0091] According to various embodiments of the present disclosure, instructions may enable the processor 120 to control the communication module 190 (or the short-range communication module 210) to send the encrypted nonce value to the external electronic device 102, identify whether the decrypted communication information corresponds to the identified nonce value based on the identified timestamp value, and when it is determined that the decrypted communication information corresponds to the identified nonce value, identify that a short-range communication has been previously performed with the external electronic device 102.

[0092] According to various embodiments of the present disclosure, instructions may enable the processor 120 to release the connection of the first short-range communication and establish the connection of the second short-range communication.

[0093] According to various embodiments of the present disclosure, instructions may enable the processor 120 to identify service handover information based on identifying the connection of the second short-range communication with the external electronic device 102, and control the communication module 190 (or the short-range communication module 210) to send the service handover information to the P2P service and application. For example, the service handover information may include at least one of configuration information related to a communication scheme through which the P2P service is performed, identification information about at least one peripheral device, and communication information about at least one peripheral device.

[0094] According to various embodiments of the present disclosure, the display 160 may display notification information related to service handover. For example, a list of devices of the external electronic device 102 found according to the discovery of the electronic device may be displayed, and the user may select a device on which to perform the handover.

[0095] According to various embodiments of the present disclosure, the communication module 190 (or the short-range communication module 210) may perform P2P communication with the external electronic device 102 or the external electronic device 104. For example, the short-range communication module 210 may include at least one of a Wi-Fi Aware module 211, a Wi-Fi Direct module 212, a Bluetooth module 213, and an NFC module 214, and may include various other configurations for short-range communication.

[0096] According to various embodiments of the present disclosure, the communication module 190 may include the short-range communication module 210. For example, the short-range communication module 210 may identify a communication scheme determined based on service handover-related information to control at least one of the Wi-Fi Aware module 211, the Wi-Fi Direct module 212, the Bluetooth module 213, and the NFC module 214 to perform P2P communication.

[0097] According to various embodiments of the present disclosure, the electronic device 101 may transmit and receive advertisement data for P2P services. For example, the advertisement data may include a TDS service universally unique identifier (UUID), a TDS advertisement type (AD type), and a transmission block based on the Transmission Discovery Service (TDS) protocol defined in the Bluetooth SIG.

[0098] According to various embodiments of the present disclosure, the electronic device 101 (or the external electronic device 102) may request activation of a service using a corresponding communication scheme by including, in the "transmission data" field of the TDS-based advertisement data, a specific communication scheme required to connect to the external electronic device and related configuration information.

[0099] Table 1 relates to advertisement data based on the TDS protocol.

[0100]

[0101] According to various embodiments of the present disclosure, an electronic device 101 that supports a music sharing service or a click-to-share service may include a TDS UUID and a TDS AD data type as a basis in the advertisement data, and may be configured by including information such as a service identifier for the music sharing service or the click-to-share service in the service data of the "transmission data" field. Table 2 relates to the structure of the advertisement data, in which the "transmission data" field is configured according to various embodiments of the present disclosure.

[0102] [Table 2]

[0103]

[0104] According to various embodiments of the present disclosure, the advertisement data may include information configured or requested by a P2P service or a specific application. For example, the "P2P service ID" field of the advertisement data may include identification information about the requested P2P service, the "Tx power compensation" field of the advertisement data may include a BLE transmission power compensation value for identifying proximity, and the "device ID" field may include electronic device identification information, or the "signature" field may include a shared random numerical value of a specific electronic device. Additionally, the advertisement data may include information such as configuration information about an advertisement period for discovering a BLE device, identification information about a device connected to the BLE, or additional data. Table 3 relates to information about the "type" field included in the advertisement data according to various embodiments of the present disclosure.

[0105] [Table 3]

[0106]

[0107] According to various embodiments of the present disclosure, the short - range communication module 210 may establish a Generic Attribute Profile (GATT) connection with an external electronic device 102. For example, in response to advertisement data from the external electronic device 102, the electronic device 101 may establish a GATT connection with the external electronic device 102. According to various embodiments of the present disclosure, the operation of establishing a GATT connection may include the operation of the electronic device 101 performing service discovery on the GATT services provided by the external electronic device 102. For example, the operation of establishing a GATT connection may include the operation of negotiating the maximum transmission unit (MTU) size to identify the size of data to be sent and received after establishing the GATT connection. Table 4 relates to various examples of the TDS characteristics configured in the data transmitted in the GATT connection according to various embodiments of the present disclosure.

[0108] [Table 4]

[0109] Characteristic Name Requirement Mandatory Attribute Optional Attribute Security Permission TDS Control Point O Write, Indication Write None Key Exchange M Write Reliable Write

[0110] According to various embodiments of the present disclosure, the electronic device 101 may designate TDS as the primary service of the GATT connection and may additionally configure separate characteristics, such as key exchange with the TDS control point, which is a characteristic of TDS and may be applied during data exchange. According to various embodiments of the present disclosure, the electronic device 101 may configure the "key exchange" characteristic of the TDS characteristic to notify the external electronic device 102 of the transmission of data including public keys. According to various embodiments of the present disclosure, in the "Transport Discovery Service" field of the data in the GATT connection, various setting values of the corresponding characteristics may be set. For example, it may include values indicating that a requirement for a specific characteristic is necessary (M) or optional (O). For mandatory or optional attributes, it may include write or indication attributes related to the corresponding attributes. In addition, a value indicating whether security permission is included may be set.

[0111] According to various embodiments of the present disclosure, the short - range communication module 210 may attempt to perform BLE (or LE) pairing with the external electronic device 102. For example, BLE pairing may be selectively performed separately from authentication.

[0112] According to various embodiments of the present disclosure, the communication module 190 (or the short - range communication module 210) may release the GATT connection with the service target device. For example, when the discovery, authentication, or exchange of communication information between the electronic device 101 and the external electronic device 102 is completed, the GATT connection may be released.

[0113] According to various embodiments of the present disclosure, in a case where a GATT reconnection for service transition is required after releasing a GATT connection, the electronic device 101 may set data for a GATT connection including a hash value of a random number exchanged with an external electronic device 102. For example, the random number is encrypted with a public key generated by the security module 220, exchanged with the external electronic device 102, and may be used as a mutual identifier.

[0114] According to various embodiments of the present disclosure, in a case where the electronic device 101 and the external electronic device 102 want to reconnect when the GATT connection is released, the security module 220 may decrypt the random number included in the data advertised from the external electronic device 102, and may authenticate the external electronic device 102 as a previously connected user according to whether the decrypted random number corresponds to the random number sent from the electronic device 101 to the external electronic device 102. For example, the electronic device 101 and the external electronic device 102 may store the random number together with a timestamp when generating the random number to identify whether the received random number is the random number sent from the electronic device.

[0115] Figure 3 It is a flowchart showing an example of an operation of performing authentication for a P2P service in an electronic device according to an embodiment of the present disclosure.

[0116] Referring to Figure 3 According to an embodiment, in operation 311, when requesting a P2P service, the electronic device 101 may receive a public key from the external electronic device 102. For example, the electronic device 101 may receive the public key through a GATT connection with the external electronic device 102 and receive encrypted information about the external electronic device 102. The GATT connection may be established through the communication module 190 of the electronic device 101.

[0117] According to various embodiments of the present disclosure, the encrypted information about the external electronic device 102 may include at least a part of a phone number, and the electronic device 101 may decrypt the phone number of the external electronic device 102 with a shared key and compare the decrypted value with the phone number of the external electronic device 102 stored in the memory 130 to identify the validity of the external electronic device 102.

[0118] According to various embodiments of the present disclosure, according to the elliptic curve Diffie-Hellman (ECDH) rule, a shared key may be generated in the same way as the shared key in the external electronic device 102.

[0119] In operation 312, the electronic device 101 may send an authentication certificate chain generated based on the received public key to the external electronic device 102.

[0120] At operation 313, the electronic device 101 may verify the received certificate chain from the external electronic device 102 based on the root authentication certificate of the security module 220.

[0121] At operation 314, the electronic device 101 may receive encrypted information about the external electronic device 102 from the external electronic device 102. For example, the external electronic device 102 may send the encrypted information about the external electronic device 102 to the electronic device 101 based on the verification result of the certificate chain in the external electronic device 102.

[0122] At operation 315, the electronic device 101 may control the security module 220 to decrypt the encrypted information about the external electronic device 102 using the shared key generated based on the certificate chain verification result to identify the validity of the external electronic device 102.

[0123] According to various embodiments of the present disclosure, when the electronic device 101 sends the public key generated in the electronic device 101 to the external electronic device 102, the electronic device 101 may receive the certificate chain issued for the sent public key from the external electronic device 102. For example, the electronic device 101 may verify the received certificate chain with the root authentication certificate of the security module 220 to verify the external electronic device 102.

[0124] According to various embodiments of the present disclosure, when the validity of the external electronic device 102 is determined based on the verification result of the certificate chain, the electronic device 101 may generate a shared key.

[0125] At operation 316, the electronic device 101 may perform a P2P service with the external electronic device 102 based on the result of determining the validity of the external electronic device 102. For example, the electronic device 101 may perform a P2P service with the external electronic device 102 through the communication module 190 (or the short - range communication module 210).

[0126] Figure 4 It is a flowchart showing an example of an operation according to an embodiment of the present disclosure, in which the electronic device performs a P2P service with an external electronic device.

[0127] Refer to Figure 4 In operation 410, the electronic device 101 may identify a service request for the external electronic device 102.

[0128] In operation 420, the electronic device 101 may establish a first short - range communication connection (e.g., a GATT connection or a BLE connection) with the external electronic device 102 through the communication module 190 (or the short - range communication module 210).

[0129] According to various embodiments of the present disclosure, the electronic device 101 may authenticate the external electronic device 102 by recognizing a service request for the external electronic device 102. For example, the electronic device 101 may send a public key to the external electronic device 102 and receive a chain of authentication certificates generated based on the sent public key from the external electronic device 102.

[0130] According to various embodiments of the present disclosure, the electronic device 101 verifies the chain of authentication certificates received from the external electronic device 102 by using a root authentication certificate stored in the security module 220, and authenticates the external electronic device 102 based on the verification result of the chain of authentication certificates.

[0131] In operation 430, the electronic device 101 may receive communication information for connecting to the external electronic device 102 through a first short-range communication. For example, the electronic device 101 may perform a service handover with the external electronic device 102 based on the communication information.

[0132] In operation 440, the electronic device 101 may identify a second short-range communication (e.g., Wi-Fi Direct, Wi-Fi Aware, or Bluetooth) for connecting to the external electronic device 102 based on the recognized communication information. For example, the electronic device 101 may send service handover-related information including information related to the second short-range communication to the external electronic device 102.

[0133] In operation 450, the electronic device 101 may control to connect to the external electronic device 102 through the second short-range communication. For example, a connection of the second short-range communication may be established after releasing the connection of the first short-range communication.

[0134] According to various embodiments of the present disclosure, the electronic device 101 may control the security module 220 to decrypt the communication information based on the public key, and may identify information about a previous communication connection with the external electronic device based on the decoded communication information.

[0135] According to various embodiments of the present disclosure, the electronic device 101 may identify a randomly generated random value and a timestamp of the random value, encrypt the random value with the public key, and may identify whether the decrypted communication information and the identified random value correspond to each other based on the value of the above-identified timestamp. When it is determined that the decrypted communication information and the identified random value correspond to each other, it may be confirmed that the electronic device 101 has previously performed short-range communication with the external electronic device.

[0136] According to various embodiments of the present disclosure, the electronic device 101 may disconnect the first short-range communication and establish a connection of the second short-range communication.

[0137] According to various embodiments of the present disclosure, the electronic device 101 may identify service handover information based on confirmation of connection of a second short-range communication with an external electronic device 102, and transmit the service handover information to a server or an application related to a P2P service. The service handover information may include at least one of configuration information related to a communication scheme for performing a P2P service, identification information about at least one peripheral device, and communication information about at least one peripheral device.

[0138] Figure 5 is a block diagram illustrating an example of a software configuration according to an embodiment of the present disclosure.

[0139] According to various embodiments of the present disclosure, the electronic device 101 or the external electronic device 102 that performs a P2P service may operate based on an ultra-wideband (UWB) mobile architecture 500.

[0140] Referring to Figure 5 , the UWB mobile architecture 500 may include an application layer 510, a framework 520, a platform 530, a kernel 540, and hardware 550.

[0141] According to various embodiments of the present disclosure, the application layer 510 may include a UWB payment / charging application 510a, a UWB ranging / location application 510b, or a UWB smart key application 510c. The UWB smart key application may send authentication information to an authentication server 501 and receive authentication information from the authentication server 501.

[0142] According to various embodiments of the present disclosure, the UWB ranging / location application may provide a service for discovering an external electronic device 102 in the electronic device 101 and determining whether the external electronic device 102 is within a communication range. For example, the UWB smart key application may manage a key related to authentication between the electronic device 101 and the external electronic device 102 through UWB communication (e.g., a shared key or a public key received from the external electronic device 102).

[0143] According to various embodiments of the present disclosure, the application framework 520 may include a Bluetooth framework 521 including a BLE open application programming interface (API), a UWB framework 522 including a UWB open API, an open multimedia application platform (OMAP) API 523, a Bluetooth service 524 including a BLE service, a UWB service 525, or a security element service 526 including a security element service.

[0144] According to various embodiments of the present disclosure, the UWB service 525 provided in the UWB mobile architecture 500 may include services such as a connection manager 525a, a UWB adapter 525b, security 525c, ranging 525d, location 525e, handover (e.g., BLE) 525f, etc.

[0145] According to various embodiments of the present disclosure, the electronic device 101 may establish a UWB connection with an external electronic device 102 through the connection manager 525a.

[0146] According to various embodiments of the present disclosure, the electronic device 101 may transmit and receive ranging packets for discovering the external electronic device 102 through the ranging 525d service of the UWB service 525. For example, the electronic device 101 may determine whether the external electronic device 102 is within the communication range through the positioning 525e service.

[0147] According to various embodiments of the present disclosure, the electronic device 101 may perform service handover to the external electronic device 102 by using the handover 525f service. For example, the service handover may include determining a communication scheme related to the external electronic device 102 and performing operations of the P2P service with the external electronic device 102 using the determined communication scheme.

[0148] According to various embodiments of the present disclosure, the platform 530 may include a Bluetooth hardware abstraction layer (HAL) 531, a UWB HAL 532, an NFC HAL 533, or an ESE SPI HAL 534.

[0149] The kernel 540 may include a Bluetooth driver 541, a UWB driver 542, an NFC driver 543, or an ESE SPI driver 544.

[0150] The hardware 550 may include a Bluetooth chip 551, a UWB chip 552, an NFC chip 553, or an ESE chip 554.

[0151] Figure 6 is a diagram illustrating an example of a software structure according to an embodiment of the present disclosure.

[0152] Referring to Figure 6 , the mobile architecture 600 may include an application layer 510 and a framework 520.

[0153] According to various embodiments of the present disclosure, the application layer 510 may include a P2P service application 610 and a P2P service control server 620.

[0154] According to various embodiments of the present disclosure, the P2P service application 610 may include applications that provide various services through P2P connections, such as a gallery application that transmits photos using the click-to-share function, a music sharing application, a quick sharing application for fast file transfer, or a click-tracking-based file transfer (e.g., synchronization function) application for file sharing.

[0155] According to various embodiments of the present disclosure, the P2P service control server 620 may be used to perform search, connection, or authentication between devices to support heterogeneous communication schemes, and may include a subscription control 621 server for controlling subscription devices that request authentication, a projector control 622 server for controlling projector devices to be authenticated, or an electronic device DB 623.

[0156] According to various embodiments of the present disclosure, the subscription control 621 server and the projector control 622 server may control P2P devices (e.g., the electronic device 101 or the external electronic device 102) to act as a subscription (or client) or a projector in the application layer 510.

[0157] According to various embodiments of the present disclosure, the electronic device DB 623 may include information about electronic devices related to the P2P service, such as communication schemes, service information, or information about connected peripheral devices (or projector devices) of the electronic devices that execute the P2P service.

[0158] According to various embodiments of the present disclosure, the electronic device DB 623 may include device information, communication information, or authentication information of a host device and a guest device for service handover. For example, the information about the host device may include the name of the host device, the Bluetooth address, information about the projector device, or information about the connection with the projector device. The information about the guest device may include the name or Bluetooth information of the guest device.

[0159] According to various embodiments of the present disclosure, the framework 520 may include a P2P adapter 630. For example, the P2P adapter 630 may be configured by a software development kit (SDK), and may transfer (e.g., inter-process communication) information related to P2P devices between P2P service control servers 620 in the framework 520.

[0160] According to various embodiments of the present disclosure, a P2P service request from the electronic device 101 may be sent to the P2P service application 610. For example, the P2P service control server 620 may control the electronic device 101 to operate as a subscription or projector device based on the information stored in the electronic device DB 623 through the application layer 510.

[0161] According to various embodiments of the present disclosure, by differentiating the operations of the P2P service application 610 and the P2P service control server 620 in the framework 520, the P2P adapter 630 may operate in the form of a demon program in the electronic device 101. For example, the P2P service control server 620 may bind and use the P2P adapter 630 for the P2P service.

[0162] Figure 7It is a flowchart showing an example of an operation of performing a P2P service in an electronic device according to an embodiment of the present disclosure.

[0163] Referring to Figure 7 , at operation 710, the electronic device 101 may identify a P2P service trigger according to a P2P service request from a user. For example, the P2P service may include a music sharing service or a file transfer between electronic devices through short - range communication.

[0164] According to various embodiments of the present disclosure, the electronic device 101 may identify a P2P service trigger according to the detection of a specified gesture input (e.g., a click gesture of an external electronic device 102) or the execution of a specified application.

[0165] At operation 720, the electronic device 101 may discover a service target device for the P2P service.

[0166] According to various embodiments of the present disclosure, the electronic device 101 may generate advertisement data including information configured in a corresponding P2P service or an application for performing the corresponding P2P service, and send the advertisement data to the external electronic device 102. For example, the information set in the application may include information (e.g., application name or application ID) capable of distinguishing the type of the executed application and the P2P service (e.g., file transfer) that can be performed in the application. In an embodiment, the electronic device 101 may identify the external electronic device 102 as a service target device by receiving a response to the advertisement data from at least one external electronic device (e.g., the external electronic device 102).

[0167] At operation 721, the electronic device 101 and the external electronic device 102 may establish a GATT connection. For example, when a short - range communication (e.g., BLE) connection request is included in the response to the advertisement data, the electronic device 101 may establish a GATT connection with the external electronic device 102.

[0168] According to various embodiments of the present disclosure, a GATT connection may be established and released through BLE communication for BLE service discovery.

[0169] At operation 730, the electronic device 101 and the external electronic device 102 may perform BLE pairing through the GATT connection. For example, in the case where the electronic device 101 and the external electronic device 102 have mutually authenticated by exchanging phone number information in a previous connection, the above BLE pairing operation may be omitted.

[0170] In operation 740, the electronic device 101 and the external electronic device 102 may perform authentication. For example, the electronic device 101 and the external electronic device 102 may encrypt the phone number based on public-key encryption. The electronic device 101 and the external electronic device 102 may exchange the encrypted phone number based on the BLE connection, and may decrypt the phone number with the public key to perform authentication on the other device.

[0171] According to various embodiments of the present disclosure, the phone number may be encrypted based on the public key generated by performing the public-key generation operation in Figure 2 the security module 220.

[0172] In operation 741, the electronic device 101 and the external electronic device 102 may exchange communication information. For example, the information is available short-range communication information related to the P2P service requested by the electronic device 101 or the external electronic device 102, and may include a hashed phone number, a CRC, user information of the electronic device, a Bluetooth address, a communication scheme type (e.g., Wi-Fi Aware or Wi-Fi Direct), or additional information about the application or the P2P service.

[0173] According to various embodiments of the present disclosure, the additional information about the application or the P2P service is information required for a specific application or P2P service, may include peripheral device information (e.g., a Bluetooth address or the name of the peripheral device) of the external electronic device 102 for a music sharing application, and account information related to the application may be exchanged for a music streaming application.

[0174] According to various embodiments of the present disclosure, the electronic device 101 may determine the communication scheme for handing over the P2P service by identifying the communication information. For example, the communication information may include information about the communication scheme (e.g., Wi-Fi Direct or UWB) for data transmission that may be performed in the external electronic device 102.

[0175] According to various embodiments of the present disclosure, the electronic device 101 and the external electronic device 102 may determine the communication scheme for performing the P2P service based on the communication information.

[0176] In operation 750, the electronic device 101 and the external electronic device 102 may measure the communication range (or the distance between the electronic device 101 and the external electronic device 102). For example, the electronic device 101 and the external electronic device 102 may determine whether the electronic device 101 and the external electronic device 102 are within the range where they can communicate with each other based on the exchanged information (e.g., the received signal strength indicator (RSSI) of the BLE packet). For example, the electronic device 101 may average the RSSI values of the BLE packets, predict the distance to the external electronic device 102 based on the average value, and identify the range corresponding to the predicted distance as the communication range. Based on the trigger condition of the communication scheme, the operation of measuring the communication range may be omitted.

[0177] According to various embodiments of the present disclosure, the electronic device 101 may identify a communication scheme (e.g., UWB) for measuring the communication range, and measure the communication range of the external electronic device 102 based on the information exchanged through the identified communication scheme. For example, the electronic device 101 may identify, among the communication schemes that can be executed with the external electronic device 102, a communication scheme with a specified communication quality condition within the measured communication range.

[0178] According to various embodiments of the present disclosure, the electronic device 101 may measure the distance to at least one external electronic device 102 through UWB communication, and may identify a communication scheme or a communication order based on the measured distance. For example, the electronic device 101 may identify a preferred communication scheme based on the communication order, and determine the identified communication scheme as the communication scheme for the P2P service with the external electronic device 102.

[0179] According to various embodiments of the present disclosure, the electronic device 101 may perform a service handover to the identified communication scheme, so as to perform the P2P service through the identified communication scheme.

[0180] According to various embodiments of the present disclosure, in the case of a specific P2P service (e.g., click to share) triggered by the contact between the electronic devices 101, the external electronic device 102 may omit the above operation of measuring the communication range.

[0181] In operation 760, in response to the P2P service trigger, the electronic device 101 may notify that the P2P service with the external electronic device 102 can be started within the range where it can communicate with the server and application associated with the corresponding P2P service. For example, the electronic device 101 may identify the communication scheme or the projector device in which the P2P service is executed based on the exchanged communication information.

[0182] According to various embodiments of the present disclosure, the electronic device 101 may notify the server associated with the service to perform a service handover according to the characteristics of the P2P service.

[0183] In operation 770, the electronic device 101 and the external electronic device 102 may release the GATT connection. For example, in the case where a BLE pairing operation is performed thereafter, the electronic device 101 and the external electronic device 102 may re - establish the GATT connection.

[0184] According to various embodiments of the present disclosure, although the GATT connection is described as being established for service handover, various other short - range communication schemes (e.g., Wi - Fi Aware) are also possible. For example, the electronic device 101 may release the GATT connection to reduce power consumption caused by maintaining the GATT connection.

[0185] In operation 780, the electronic device 101 and the external electronic device 102 may perform a P2P service. For example, in the case where the P2P service is a music sharing service, the electronic device 101 may perform a P2P service with the external electronic device 102 (or a projector device) by using a communication scheme determined based on communication information through the music sharing service or a related application.

[0186] According to various embodiments of the present disclosure, in the case where communication with the external electronic device 102 is not possible through the determined communication scheme, the electronic device 101 may control to perform the P2P service by using a predetermined basic communication scheme (e.g., Bluetooth or BLE).

[0187] Figure 8 is a diagram showing an example of operations for performing a P2P service in an electronic device according to an embodiment of the present disclosure.

[0188] Referring to Figure 8 , the electronic device 101 may recognize that the user performs a music sharing application or requests a music sharing service through P2P. For example, when the user selects the specified button 801 on the screen 800a of the music playback application, the electronic device 101 may recognize the request for the music sharing service.

[0189] According to various embodiments of the present disclosure, the electronic device 101 may recognize the external electronic device 102 as a service target device according to a service request. For example, the electronic device 101 may establish a short - range communication connection (e.g., a GATT connection) with the external electronic device 102 through the communication module 190.

[0190] According to various embodiments of the present disclosure, the electronic device 101 may perform authentication on the external electronic device 102. For example, the electronic device 101 and the external electronic device 102 may generate and exchange public keys, and send the issued authentication certificate chain to the other device by using the received public key.

[0191] According to various embodiments of the present disclosure, the electronic device 101 and the external electronic device 102 may verify a received authentication certificate chain by using a stored root authentication certificate. For example, mutual authentication may be completed based on the verification result of the authentication certificate chain.

[0192] According to various embodiments of the present disclosure, when the authentication is completed, the electronic device 101 may receive communication information from the external electronic device 102. For example, the communication information may include communication scheme information that can be connected by the external electronic device 102, information about peripheral devices of the external electronic device 102 (e.g., a Bluetooth speaker 803 communicably connected to the vehicle device 802 or the external electronic device 102), or communication scheme information that can be connected to the peripheral device.

[0193] According to various embodiments of the present disclosure, the external electronic device 102 may display a screen 800b asking the user whether to execute a music sharing service. The screen 800b may include service information (e.g., controlling the vehicle device 802) or items for selecting whether to activate the service (e.g., reject or allow). When the user selects the "allow" item, the external electronic device 102 may activate the music sharing service and send information about whether to activate the service to the electronic device 101.

[0194] According to various embodiments of the present disclosure, when identifying whether the service is activated in the external electronic device 102, the electronic device 101 may determine a communication scheme with the external electronic device 102 for the music sharing service based on the communication information (e.g., BLE or Wi-Fi Aware). For example, when the peripheral device of the external electronic device 102 is identified as a projector device for service handover, the electronic device 101 may determine a communication scheme with the peripheral device for the music sharing service based on the communication information.

[0195] According to various embodiments of the present disclosure, the electronic device 101 may send service handover information including information about the determined communication scheme to the external electronic device 102. For example, the external electronic device 102 may identify the communication scheme based on the service handover information and may activate the music sharing service with the electronic device 101 through the identified communication scheme.

[0196] According to various embodiments of the present disclosure, the external electronic device 102 may cause a peripheral device (e.g., 802 or 803) to execute the music sharing service based on the service handover information. For example, the external electronic device 102 may identify the communication scheme of each peripheral device based on the service handover information and may control a specific peripheral device (e.g., the vehicle device 802) to output music according to the music sharing service through the communication scheme.

[0197] Figure 9It is a flowchart showing an example of operations for performing a P2P service in an electronic device according to an embodiment of the present disclosure.

[0198] Referring to Figure 9 , at operation 910, the electronic device 101 may identify a P2P service trigger.

[0199] At operation 920, the electronic device 101 may discover a service target device to perform the triggered P2P service.

[0200] At operation 921, the electronic device 101 may establish a GATT connection with the external electronic device 102 by discovering the external electronic device 102 as a service target device.

[0201] At operation 930, the electronic device 101 may perform authentication on the external electronic device 102.

[0202] At operation 931, when the authentication of the external electronic device 102 is completed, the electronic device 101 may exchange communication information with the external electronic device 102.

[0203] At operation 940, the electronic device 101 may measure the communication range with the external electronic device 102. For example, the electronic device 101 may determine whether the external electronic device 102 is within the communicable range based on the exchanged communication information.

[0204] According to various embodiments of the present disclosure, in the case of a specific P2P service triggered by contact between the electronic device 101 and the external electronic device 102, the above operation of measuring the communication range may be omitted.

[0205] At operation 950, the electronic device 101 may determine service handover. For example, the electronic device 101 may determine a specific communication scheme in the communication schemes capable of performing the P2P service with the external electronic device 102 based on the exchanged communication information, and may determine to perform the P2P service through the corresponding communication scheme.

[0206] According to various embodiments of the present disclosure, the electronic device 101 may identify a communication scheme that communicates with a specified communication quality (e.g., communication speed) in the communication schemes, and determine service handover to the identified communication scheme. For example, in the case where a communication scheme with the specified communication quality cannot be identified, the electronic device 101 may control to perform the P2P service using a specified communication scheme (e.g., Bluetooth or BLE).

[0207] At operation 951, the electronic device 101 may send service handover related information to the external electronic device 102. For example, the service handover related information may include configuration information related to the communication scheme or the corresponding communication scheme.

[0208] In operation 961, the electronic device 101 may send the recognized service handover related information to a server or an application related to the P2P service to notify the service handover.

[0209] In operation 962, the external electronic device 102 may send the service handover related information received from the electronic device 101 to a server related to the P2P service or an application of the external electronic device 102 related to the P2P service to notify the service handover.

[0210] In operation 970, the electronic device 101 and the external electronic device 102 may release the GATT connection. For example, in the case of performing a BLE pairing operation thereafter, the electronic device 101 and the external electronic device 102 may re - establish the GATT connection.

[0211] In operation 980, the electronic device 101 and the external electronic device 102 may perform the P2P service. For example, the electronic device 101 and the external electronic device 102 may perform the P2P service through a server and an application related to the P2P service.

[0212] Figure 10 It is a flowchart showing an example of an operation for identifying a communication range of a service target device of a P2P service in an electronic device according to an embodiment of the present disclosure.

[0213] Refer to Figure 10 , in operation 1010, the electronic device 101 may establish a GATT connection with the external electronic device 102 which is a service target device of the P2P service.

[0214] In operation 1020, the electronic device 101 and the external electronic device 102 may perform mutual authentication.

[0215] In operation 1021, when the authentication is completed, the electronic device 101 and the external electronic device 102 may exchange communication information.

[0216] In operation 1030, the electronic device 101 may request a ranging packet from the external electronic device 102.

[0217] In operation 1041, the electronic device 101 may start scanning for the ranging packet sent from the external electronic device 102. For example, the electronic device 101 may set the scanning period to 100% duty cycle.

[0218] In operation 1042, when the ranging packet request of the electronic device 101 is recognized, the external electronic device 102 may start ranging packet advertising. For example, the external electronic device 102 may be set to advertise at a power of - 45dBm every 20 milliseconds.

[0219] In operation 1050, the external electronic device 102 may send ranging packets. For example, 50 packets may be advertised.

[0220] In operation 1060, the electronic device 101 may measure the communication range with the external electronic device 102. For example, the electronic device 101 may scan the advertised packets, predict the distance of the external electronic device 102 based on the size or communication speed of the scanned packets, and determine whether the external electronic device 102 is within the communication range according to the predicted distance.

[0221] According to various embodiments of the present disclosure, the electronic device 101 may receive Bluetooth packets through a Bluetooth connection with the external electronic device 102, and may identify the communication range by measuring the received value of the packets. In addition, the electronic device 101 may receive data through Wi-Fi sensing or UWB connection with the external electronic device 102, and measure the communication range with the external electronic device 102 based on the received data.

[0222] In operation 1070, when the external electronic device 102 determines that the external electronic device 102 is within the communication range, the electronic device 101 may determine service handover and send service handover related information to the external electronic device 102.

[0223] In operation 1071, the electronic device 101 may send service handover related information to a server or application related to the P2P service to notify the service handover.

[0224] In operation 1072, the external electronic device 102 may send service handover related information to a server or application related to the P2P service to notify the service handover.

[0225] In operation 1080, the electronic device 101 and the external electronic device 102 may release the GATT connection. For example, in the case of performing a BLE pairing operation thereafter, the electronic device 101 and the external electronic device 102 may re-establish the GATT connection.

[0226] Figure 11 It is a flowchart showing an example of an operation for identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0227] Referring to Figure 11 , the electronic device 101 may identify a P2P service request for the external electronic device 102 from a user (e.g., Tom). For example, the P2P service may control the external electronic device 102 or a peripheral device of the external electronic device 102 (e.g., a vehicle) through the electronic device 101.

[0228] In operation 1110, when a P2P service request is recognized, the electronic device 101 may establish a GATT connection with the external electronic device 102.

[0229] In operation 1120, the electronic device 101 may measure the communication range with the external electronic device 102. For example, when it can be determined that the P2P service is for controlling a vehicle device or the external electronic device 102 or the electronic device 101 is inside a peripheral device (e.g., a vehicle) of the external electronic device 102, the above operation of measuring the communication range may be omitted.

[0230] In operation 1130, when it is determined that the external electronic device 102 is within the communication range (e.g., inside the second electronic device), the electronic device 101 may request the external electronic device 102 to activate the P2P service.

[0231] According to various embodiments of the present disclosure, the request to activate the P2P service may be included in a TDS packet based on the TDS protocol and sent to the external electronic device 102.

[0232] In operation 1140, the external electronic device 102 may identify whether the user is permitted to use the P2P service by recognizing the P2P service activation request. For example, the external electronic device 102 may display a screen on a display (e.g., Figure 1 the display device 160) that can respond to the permission or rejection of the P2P service.

[0233] According to various embodiments of the present disclosure, the external electronic device 102 may display information about the P2P service requested from the electronic device 101 (e.g., AAA vehicle control by the user of the electronic device 101) through the screen. For example, the user of the external electronic device 102 may select a button for responding to the permission or rejection of activating the P2P service.

[0234] In operation 1150, when a permission response is input through the screen, the external electronic device 102 may activate the P2P service.

[0235] In operation 1151, the external electronic device 102 may include information about whether the P2P service is activated in the TDS packet and send the information to the electronic device 101.

[0236] In operation 1160, when the information about whether the P2P service is activated indicates service permission, the electronic device 101 may activate the P2P service.

[0237] In operation 1170, the electronic device 101 may send service handover related information to the external electronic device 102. For example, the service handover related information may include the communication scheme for executing the P2P service or account information of the application.

[0238] In operation 1171, the electronic device 101 may send the recognized service handover related information to a server or application related to the P2P service to notify the service handover.

[0239] In operation 1172, the external electronic device 102 may send the service handover related information received from the electronic device 101 to a server or application related to the activated P2P service to notify the service handover.

[0240] According to various embodiments of the present disclosure, in the case where the P2P service is used in the external electronic device 102 (or a peripheral device of the external electronic device 102) to perform the music streaming service in the electronic device 101, the external electronic device 102 may access the server or application of the corresponding service through the account information of the service to perform the service of the electronic device 101 through the external electronic device 102.

[0241] In operation 1180, the electronic device 101 and the external electronic device 102 may release the GATT connection. For example, in the case of performing a BLE pairing operation thereafter, the electronic device 101 and the external electronic device 102 may re - establish the GATT connection.

[0242] In operation 1190, the electronic device 101 and the external electronic device 102 may perform the P2P service through the server or application of the activated P2P service. For example, the music streaming service in the electronic device 101 is handed over to the external electronic device 102, and the external electronic device 102 may control the music streaming service to be performed through the external electronic device 102 or a peripheral device (e.g., AAA car).

[0243] Figure 12 It is a diagram showing an example of a screen configuration for identifying whether a P2P service is permitted according to an embodiment of the present disclosure.

[0244] Referring to Figure 12 , when receiving a P2P service activation request from the electronic device 101, the external electronic device 102 may display a screen 1200 for asking the user's permission to activate the P2P service on a display (e.g., Figure 1 the display 160).

[0245] According to various embodiments of the present disclosure, the screen 1200 may include content notifying the user of the electronic device 101 (e.g., "Tom") of a request for a P2P service (e.g., AAA car control via Bluetooth communication) with a peripheral device of the external electronic device 102 (e.g., "AAA car"), a reject button 1201 for inputting a rejection response to the P2P service, or an allow button 1202 for inputting an approval response to the P2P service.

[0246] According to various embodiments of the present disclosure, when a user of the external electronic device 102 inputs the permission button 1202, the external electronic device 102 may activate the P2P service and notify the electronic device 101 whether the P2P service is activated. For example, when the electronic device 101 identifies whether the P2P service is activated, a service handover is performed to the AAA vehicle, and the electronic device 101 may perform the P2P service with the AAA vehicle.

[0247] Figure 13 is a flowchart showing an example of an operation for identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0248] According to various embodiments of the present disclosure, the electronic device 101 and the external electronic device 102 may include a short-range communication module (e.g., 210 or 210a). For example, the short-range communication module (e.g., 210 or 210a) may include a Wi-Fi Aware module (e.g., 211 or 211a) or a Wi-Fi Direct module (e.g., 212).

[0249] Refer to Figure 13 , in operation 1310, the electronic device 101 may establish a GATT connection with the external electronic device 102.

[0250] In operation 1320, the electronic device 101 may measure the communication range with the external electronic device 102. For example, when it can be determined whether the external electronic device 102 is connected to a vehicle device and the electronic device 101 is inside the vehicle device connected to the external electronic device 102, or when the P2P service is triggered by contact with the external electronic device 102, the operation of measuring the above communication range may be omitted.

[0251] In operation 1330, when it is determined that the external electronic device 102 is within the communication range (e.g., inside the vehicle device), the electronic device 101 may request the external electronic device 102 to activate the P2P service. For example, the P2P service activation request may be included in a TDS packet and sent to the external electronic device 102.

[0252] In operation 1340, the external electronic device 102 may identify whether the user is permitted to use the P2P service by recognizing the P2P service activation request. For example, the external electronic device 102 may display a screen capable of responding to the permission or rejection of the P2P service, and activate the P2P service when a permission response is input through the screen.

[0253] In operation 1351, when the information regarding whether the P2P service is activated indicates service permission, the external electronic device 102 may control the Wi-Fi sensing module 211a (or Wi-Fi Direct module 212) to open a communication session to activate the P2P service. For example, the short-range communication module 210a may request the Wi-Fi sensing module 211a to open a communication session or control the Wi-Fi Direct module 212 to initiate Wi-Fi Direct communication.

[0254] In operation 1352, the Wi-Fi sensing module 211a of the external electronic device 102 may perform control for subscribing to the corresponding service according to the communication session opening request.

[0255] According to various embodiments of the present disclosure, the short-range communication module 210a may send a communication session opening request to the Wi-Fi Direct module 212. The Wi-Fi Direct module 212 may search for devices that can be connected via Wi-Fi Direct by performing peer discovery and connection, and may be configured to connect to the searched devices.

[0256] In operation 1353, the Wi-Fi sensing module 211a (or Wi-Fi Direct module 212) of the external electronic device 102 may send connection information including information related to service subscription to the short-range communication module 210a. For example, a connection success notification may be sent.

[0257] In operation 1354, the external electronic device 102 may include information regarding whether the P2P service is activated in the TDS packet and send the information to the electronic device 101.

[0258] In operation 1361, when the information regarding whether the P2P service is activated indicates service permission, the electronic device 101 may control the Wi-Fi sensing module 211 (or Wi-Fi Direct module 212) to open a communication session to activate the P2P service. For example, the short-range communication module 210 may request the Wi-Fi sensing module 211 to open a communication session or control the Wi-Fi Direct module 212 to initiate Wi-Fi Direct communication.

[0259] In operation 1362, the Wi-Fi sensing module 211 of the electronic device 101 may perform control for publishing the corresponding service according to the communication session opening request. According to various embodiments of the present disclosure, the short-range communication module 210 may send a communication session opening request to the Wi-Fi Direct module 212. The Wi-Fi Direct module 212 may search for devices that can be connected via Wi-Fi Direct by performing peer discovery and connection, and may be configured to connect to the searched devices.

[0260] In operation 1363, the Wi-Fi sensing module 211 (or Wi-Fi Direct module 212) of the electronic device 101 may send connection information including information related to the publishing service to the short-range communication module 210a. For example, a connection success notification may be sent.

[0261] In operation 1364, the electronic device 101 may send service handover related information to the external electronic device 102.

[0262] In operation 1371, the electronic device 101 may send the identified service handover related information to the Wi-Fi sensing module 211 to request execution of the service handover. For example, the Wi-Fi sensing module 211 may send the service handover related information to a server or application related to the P2P service.

[0263] In operation 1372, the external electronic device 102 may send the identified service handover related information to the Wi-Fi sensing module 211a to request execution of the service handover. For example, the Wi-Fi sensing module 211a may send the service handover related information to a server or application related to the P2P service.

[0264] In operation 1380, the electronic device 101 and the external electronic device 102 may release the GATT connection. For example, in the case where a BLE pairing operation is performed thereafter, the electronic device 101 and the external electronic device 102 may re-establish the GATT connection.

[0265] In operation 1390, the Wi-Fi sensing module 211 of the electronic device 101 and the Wi-Fi sensing module 211a of the external electronic device 102 may perform a P2P service through an activated P2P service server or application.

[0266] Figure 14 It is a flowchart showing an example of an operation for identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0267] According to various embodiments of the present disclosure, the electronic device 101 and the external electronic device 102 may include a file transfer application 1401 or 1401a, which performs file transfer through a short-range communication module (e.g., 210 or 210a) or a click-to-share function (e.g., a synchronization function). The file transfer application 1401 or 1401a may be a gallery application for sharing files stored in a server or cloud with the electronic device 101 or the external electronic device 102.

[0268] According to various embodiments of the present disclosure, when a user of the electronic device 101 executes the file transfer application 1401 and selects at least one image to be sent to at least one external electronic device (e.g., 102), it can be recognized that a P2P service (e.g., at least one image transfer) is requested. For example, the electronic device 101 can recognize that the user selects at least one external electronic device to send at least one image and the selection of the at least one image.

[0269] According to various embodiments of the present disclosure, the subsequent operations 1410 to 1490 are described as operations of the electronic device 101 and the external electronic device 102, but the operations 1410 to 1490 can be respectively performed by using a plurality of external electronic devices (e.g., the external electronic device 102) on which the electronic device 101 intends to perform the P2P service.

[0270] Referring to Figure 14 , in operation 1410, the electronic device 101 can establish a GATT connection with the external electronic device 102 through the short-range communication module 210.

[0271] In operation 1420, the electronic device 101 can measure the communication range with the external electronic device 102 through the short-range communication module 210. For example, when it can be determined whether the electronic device 101 is located inside the external electronic device 102 which is a vehicle device, or when the P2P service is triggered by contact with the external electronic device 102, the operation of measuring the above communication range can be omitted.

[0272] In operation 1430, when it is determined that the external electronic device 102 is within the communication range (e.g., inside the second electronic device), the electronic device 101 can request the external electronic device 102 to activate the P2P service through the short-range communication module 210. For example, the P2P service activation request can be included in a TDS packet and sent to the external electronic device 102.

[0273] In operation 1441, the short-range communication module 210a of the external electronic device 102 can recognize whether the user is allowed to use the P2P service by recognizing the P2P service activation request. For example, each of a plurality of external electronic devices (e.g., 102) can display a screen capable of responding to the permission or rejection of the P2P service, and the P2P service is activated when a permission response is input through the screen.

[0274] At operation 1442, when the external electronic device 102 sends a P2P service activation request, the external electronic device 102 may send a click tracking command to the file transfer application 1401a to perform a click tracking function of identifying the file to be sent to the electronic device 101 in contact with the external electronic device 102. For example, the short - range communication module 210a may send a click tracking command to the file transfer application 1401a.

[0275] At operation 1443, the file transfer application 1401a of the external electronic device 102 may identify at least one image to be sent to the electronic device 101 according to the click tracking command.

[0276] At operation 1444, the file transfer application 1401a of the external electronic device 102 may notify the short - range communication module 210a that the click tracking has started.

[0277] At operation 1451, the electronic device 101 may send a click tracking command to the file transfer application 1401 according to the P2P service activation request to perform a click tracking function of identifying the file to be sent to the external electronic device 102 in contact with the electronic device 101. For example, the short - range communication module 210 may send a click tracking command to the file transfer application 1401.

[0278] At operation 1452, the file transfer application 1401 of the electronic device 101 may perform click tracking for identifying the file to be sent through the corresponding application according to the click tracking command.

[0279] At operation 1453, the file transfer application 1401 of the electronic device 101 may notify the short - range communication module 210 that the click tracking has started.

[0280] At operation 1461, the external electronic device 102 may include information about whether the P2P service is activated (e.g., a success notification of service activation) in the TDS packet and send the information to the electronic device 101.

[0281] At operation 1462, the electronic device 101 may send a confirmation message indicating that the P2P service activation result (e.g., service activation success) received from the external electronic device 102 is recognized.

[0282] At operation 1463, the electronic device 101 may identify service handover information for P2P service handover with at least one external electronic device (e.g., 102). For example, the service handover information may include information related to the communication scheme for performing the P2P service and communication configurations related to the communication scheme for each of the at least one external electronic device (e.g., 102).

[0283] According to various embodiments of the present disclosure, service handover related information may include information indicating that a P2P service is performed through Wi-Fi sensing in the external electronic device 102 and that a P2P service is performed through Wi-Fi Direct in another external electronic device.

[0284] In operation 1470, the electronic device 101 may send the identified service handover related information to the external electronic device 102. For example, the electronic device 101 may send the corresponding service handover related information to at least one external electronic device.

[0285] In operation 1471, the short-range communication module 210 of the electronic device 101 may notify the identified service handover related information to the file transfer application 1401.

[0286] In operation 1472, the short-range communication module 210a of the external electronic device 102 may notify the identified service handover related information to the file transfer application 1401a.

[0287] According to various embodiments of the present disclosure, the file transfer application 1401 or 1401a may perform a P2P service by using the communication scheme included in the service handover related information.

[0288] In operation 1480, the short-range communication module 210 of the electronic device 101 and the short-range communication module 210a of the external electronic device 102 may release the GATT connection. For example, in the case of performing a BLE pairing operation thereafter, the electronic device 101 and the external electronic device 102 may re-establish the GATT connection.

[0289] In operation 1490, the electronic device 101 and the external electronic device 102 may perform a P2P service through the file transfer application 1401 of the electronic device 101 and the file transfer application 1401a of the external electronic device 102.

[0290] According to various embodiments of the present disclosure, the electronic device 101 may perform service handover based on the communication scheme supported by at least one external electronic device (e.g., 102). For example, the electronic device 101 may perform a P2P service with the external electronic device 102 through Wi-Fi sensing and may perform a P2P service with another external electronic device through Wi-Fi Direct.

[0291] Figure 15 It is a flowchart showing an example of an operation of identifying whether a P2P service with a service target device is activated in an electronic device according to an embodiment of the present disclosure.

[0292] According to various embodiments of the present disclosure, the electronic device 101 and the external electronic device 102 may include a short-range communication module (e.g., 210 or 210a) or a file transfer application 1401 or 1401a.

[0293] Referring Figure 15 , in operation 1510, the file transfer application 1401 of the electronic device 101 may recognize a click tracking command. For example, when the electronic device 101 and the external electronic device 102 are in contact with each other, the file transfer application 1401 may determine that a click tracking operation has been triggered by a sensor of the electronic device 101.

[0294] In operation 1520, the file transfer application 1401a of the external electronic device 102 may recognize a click tracking command. For example, the file transfer application 1401a may determine that a click tracking operation has been triggered when the external electronic device 102 and an external electronic device (e.g., the electronic device 101) are in contact with each other.

[0295] In operation 1521, the file transfer application 1401a of the external electronic device 102 may notify the short-range communication module 210a of the external electronic device 102 of the occurrence of the click tracking event.

[0296] In operation 1522, the short-range communication module 210a of the external electronic device 102 may advertise a notification indicating the occurrence of the click tracking event to the electronic device 101. For example, the notification may be included in a TDS packet and may include a UUID or hash data.

[0297] In operation 1530, the short-range communication module 210 of the electronic device 101 may notify the file transfer application 1401 of the electronic device 101 of the occurrence of the click tracking event by recognizing the notification of the advertisement from the external electronic device 102. For example, the click tracking event may be a notification of a click tracking event detected by a sensor of the external electronic device 102.

[0298] In operation 1530a, the file transfer application 1401 of the electronic device 101 may stop click tracking by recognizing a valid click and the file to be sent to the external electronic device 102.

[0299] In operation 1531, the file transfer application 1401 of the electronic device 101 may send a result including information about the valid click recognized by the short-range communication module 210.

[0300] In operation 1532, the electronic device 101 may request a communication connection for service handover from the external electronic device 102 through the short-range communication module 210.

[0301] In operation 1540, the electronic device 101 may establish a GATT connection with the external electronic device 102 through the short - range communication module 210 for service handover.

[0302] In operation 1561, the electronic device 101 may notify the recognized service handover - related information to the file transfer application 1401.

[0303] In operation 1562, the external electronic device 102 may notify the recognized service handover - related information to the file transfer application 1401a.

[0304] In operation 1570, the electronic device 101 and the external electronic device 102 may release the GATT connection through the short - range communication module 210 or 210a. For example, in the case of performing a BLE pairing operation thereafter, the electronic device 101 and the external electronic device 102 may re - establish the GATT connection.

[0305] In operation 1580, the electronic device 101 and the external electronic device 102 may perform a P2P service through the file transfer application 1401 of the electronic device 101 and the file transfer application 1401a of the external electronic device 102.

[0306] Figure 16 It is a flowchart showing an example of operations for performing authentication in a P2P service between electronic devices according to an embodiment of the present disclosure.

[0307] According to various embodiments of the present disclosure, the manufacturer of the electronic device 101 or the external electronic device 102 may include a key memory 221 or 221a to sell the electronic device 101 or the external electronic device 102. For example, the key memory 221 or 221a may identify a certificate signing request (CSR) for a root authentication certificate and prove the certificate signature to authenticate the received key or certificate chain through the root authentication certificate.

[0308] Refer to Figure 16 , an electronic device (e.g., the electronic device 101 or the external electronic device 102) performing a P2P service may generate a key pair including a pair of a private key and a public key.

[0309] According to various embodiments of the present disclosure, in operation 1611, the security module 220 of the electronic device 101 may generate a key pair A including a pair of a private key A and a public key A. In operation 1612, the security module 220a of the external electronic device 102 may generate a key pair B including a pair of a private key B and a public key B.

[0310] In operation 1620, the electronic device 101 or the external electronic device 102 may request authentication from the other device. For example, an electronic device that publishes a P2P service may send an authentication request including a public key (e.g., public key A or public key B) to an electronic device that subscribes to the P2P service.

[0311] In operation 1630, the electronic device 101 may generate an authentication certificate chain by using the received public key B of the external electronic device 102.

[0312] In operation 1640, the external electronic device 102 may generate an authentication certificate chain by using the received public key A of the electronic device 101.

[0313] In operation 1650, the electronic device 101 and the external electronic device 102 may exchange the generated authentication certificate chains with each other.

[0314] In operation 1661, the electronic device 101 may verify the received authentication certificate chain by using the root authentication certificate stored in the key memory 221.

[0315] In operation 1662, the external electronic device 102 may verify the received authentication certificate chain by using the root authentication certificate stored in the key memory 221a.

[0316] According to various embodiments of the present disclosure, the electronic device 101 and the external electronic device 102 may complete the authentication of the other device based on the result of verifying the authentication certificate chain by the root authentication certificate of each device.

[0317] In operation 1671, the security module 220 of the electronic device 101 may generate a shared key according to the verification result of the authentication certificate chain.

[0318] In operation 1672, the security module 220a of the external electronic device 102 may generate a shared key according to the verification result of the authentication certificate chain.

[0319] The electronic device 101 or the external electronic device 102 according to various embodiments of the present disclosure may complete the authentication of the other device according to the verification of the authentication certificate chain, and may generate a shared key by using a private key (e.g., private key A or private key B) based on the key generation rule of elliptic curve Diffie-Hellman (ECDH). For example, the shared key may be used to decrypt the data of the external electronic device 102 by hashing with the SHA-256 algorithm.

[0320] According to various embodiments of the present disclosure, since an electronic device (e.g., electronic device 101 or external electronic device 102) performs authentication by using a public key and an authentication certificate chain of an external electronic device mutually authenticated by using a root authentication certificate, even if a MITM attacker steals the public key or the authentication certificate, decryption is impossible, and thus a man-in-the-middle attack can be effectively prevented.

[0321] Figure 17 is a flowchart illustrating an example of an operation of performing authentication for a P2P service between electronic devices according to an embodiment of the present disclosure.

[0322] According to various embodiments of the present disclosure, electronic device 101 or external electronic device 102 may include communication module 190 or 190a or security module 220 or 220a. Security module 220 or 220a may include key memory 221 or 221a, or be functionally connected to key memory 221 or 221a to verify a key or an authentication certificate chain received from the other device by using the authentication certificate stored in key memory 221 or 221a.

[0323] Refer to Figure 17 , at operation 1710, an electronic device (e.g., electronic device 101 or external electronic device 102) performing a P2P service may establish a GATT connection with each other.

[0324] At operation 1721, electronic device 101 may generate key pair A including a pair of private key A and public key A.

[0325] At operation 1723, external electronic device 102 may generate key pair B including a pair of private key B and public key B.

[0326] At operation 1731, electronic device 101 may send public key A to external electronic device 102 through the GATT connection for authentication of public key A.

[0327] At operation 1732, when external electronic device 102 receives public key A from electronic device 101, external electronic device 102 may request security module 220a of external electronic device 102 to prove public key A.

[0328] At operation 1733, security module 220a of external electronic device 102 may issue an authentication certificate chain of public key A and send the authentication certificate chain to communication module 190a.

[0329] At operation 1734, external electronic device 102 may send the authentication certificate chain of public key A to electronic device 101.

[0330] In operation 1741, the external electronic device 102 may send the public key B to the electronic device 101 via a GATT connection for authentication of the public key B.

[0331] In operation 1742, when the electronic device 101 receives the public key B from the external electronic device 102, the electronic device 101 may request the security module 220 of the external electronic device 102 to prove the public key B.

[0332] In operation 1743, the security module 220 of the electronic device 101 may issue an authentication certificate chain for the public key B and send the authentication certificate chain to the communication module 190.

[0333] In operation 1744, the electronic device 101 may send the authentication certificate chain for the public key B to the external electronic device 102.

[0334] In operation 1751, the external electronic device 102 may send a verification request for the authentication certificate chain of the public key B received from the electronic device 101 to the security module 220a.

[0335] According to various embodiments of the present disclosure, the security module 220a may verify the validity of the authentication certificate chain of the public key B by using the root authentication certificate stored in the key memory 221.

[0336] In operation 1772, when the authentication certificate chain of the public key B is verified as valid, the security module 220a of the external electronic device 102 may generate a shared key that can be used jointly with the electronic device 101.

[0337] In operation 1761, the electronic device 101 may request the security module 220 to verify the validity of the authentication certificate chain of the public key A received from the external electronic device 102.

[0338] According to various embodiments of the present disclosure, the security module 220 may verify the validity of the authentication certificate chain of the public key A by using the root authentication certificate stored in the key memory 221.

[0339] In operation 1771, when the authentication certificate chain of the public key A is verified as valid, the security module 220 of the electronic device 101 may generate a shared key that can be used jointly with the external electronic device 102.

[0340] According to various embodiments of the present disclosure, the order of operations 1731 to 1772 may be changed. For example, after the electronic device 101 sends the public key A to the external electronic device 102 through operation 1731, the external electronic device 102 may send the public key B to the electronic device 101 through operation 1741.

[0341] Figure 18 It is a flowchart showing an example of an operation for performing authentication of a P2P service between electronic devices according to an embodiment of the present disclosure.

[0342] Referring to Figure 18 , the electronic device 101 and the external electronic device 102 may establish a GATT connection and exchange authentication information through the GATT connection to perform authentication of the other device.

[0343] In operation 1840, the electronic device 101 and the external electronic device 102 may exchange additional information. For example, the additional information may include communication scheme information that the corresponding electronic device wishes to connect to the other device or configuration information related to a specific communication scheme.

[0344] In operation 1841, the electronic device 101 may send a random number A encrypted with a shared key to the external electronic device 102.

[0345] In operation 1842, the external electronic device 102 may send a random number B encrypted with the shared key to the electronic device 101.

[0346] According to various embodiments of the present disclosure, the random number A and the random number B are randomly generated by each electronic device and may be mapped and stored together with a timestamp.

[0347] In operation 1851, the electronic device 101 may store the received encrypted random number B by decrypting the random number B with the shared key.

[0348] In operation 1852, the external electronic device 102 may store the received encrypted random number A by decrypting the random number A with the shared key.

[0349] In operation 1860, the electronic device 101 and the second external electronic device 102 may release the GATT connection.

[0350] Figure 19 It is a flowchart showing an example of an operation for performing service handover by performing authentication of a P2P service between electronic devices according to an embodiment of the present disclosure.

[0351] Referring to Figure 19 , in operation 1912, the external electronic device 102 may configure a scan filter.

[0352] In operation 1913, the external electronic device 102 may perform a scan based on the configured scan filter.

[0353] In operation 1920, the electronic device 101 may identify that a P2P service is requested.

[0354] In operation 1931, the electronic device 101 may identify the stored random number B. For example, the random number B may be encrypted and received from an external electronic device 102, and may be decrypted and stored by using a shared key jointly generated with the external electronic device 102.

[0355] In operation 1932, the electronic device 101 may set advertisement data. For example, the electronic device 101 may set the advertisement data to include the TDS UUID and the hashed random number B.

[0356] In operation 1933, when the service handover of the P2P service is determined, the electronic device 101 may determine the start of the advertisement.

[0357] In operation 1941, the electronic device 101 may advertise the advertisement data including the TDS UUID and the hashed random number B.

[0358] In operation 1942, the external electronic device 102 may identify the stored random number A. For example, the external electronic device 102 may identify the timestamp of the random number B stored in the external electronic device 102, and may identify the random number A including the timestamp corresponding to the timestamp of the random number B.

[0359] In operation 1943, when the random number A is identified, the external electronic device 102 may request a communication connection from the electronic device 101.

[0360] In operation 1950, the electronic device 101 and the external electronic device 102 may establish a GATT connection. When Bluetooth pairing is performed through the GATT connection, the electronic device 101 and the external electronic device 102 may release the GATT connection. For example, when a BLE pairing operation is performed thereafter, the electronic device 101 and the external electronic device 102 may re - establish the GATT connection.

[0361] Figure 20 It is a diagram showing an example of a screen configuration for notifying a service handover of a P2P service between electronic devices according to an embodiment of the present disclosure.

[0362] Referring to Figure 20 , the electronic device 101 may notify the user of the service handover through a Bluetooth application related to the P2P service. For example, a service handover notification screen 2000 may be displayed according to the execution of the Bluetooth application.

[0363] According to various embodiments of the present disclosure, a service handover notification screen 2000 may display communication scheme information (e.g., "Bluetooth") according to a list 2010 of service handovers or electronic devices in which service handovers are performed. For example, the electronic device list 2010 may include devices (vehicle device (AAA Automobile) 2001 of the external electronic device 102) that can be connected to the external electronic device 102 through the corresponding communication scheme.

[0364] According to various embodiments of the present disclosure, when a user of the electronic device 101 selects the vehicle device 2001 of the external electronic device 102 from the electronic device list 2010, a service handover may be performed to the vehicle device 2001 of the external electronic device 102 to perform P2P communication between the electronic device 101 and the vehicle device 2001 of the external electronic device 102.

[0365] Figure 21 It is a flowchart showing an example of an operation of discovering a service handover device in P2P services between electronic devices according to an embodiment of the present disclosure.

[0366] Refer to Figure 21 In operation 2110, the electronic device 101 may recognize that a music sharing service for outputting the sound source of the electronic device 101 through at least one external electronic device (e.g., 102) has been requested.

[0367] In operation 2120, the electronic device 101 may discover the external electronic device 102. For example, the external electronic device 102 may determine the external electronic device 102 as the discovered device.

[0368] In operation 2121, the electronic device 101 may request a connection to the P2P service from the external electronic device 102.

[0369] In operation 2122, in response to the connection request, the electronic device 101 may establish a GATT connection with the external electronic device 102.

[0370] According to various embodiments of the present disclosure, the electronic device 101 may perform BLE pairing with the external electronic device 102 through the GATT connection, but the P2P service is for outputting the sound source of the electronic device 101 to the Bluetooth A2DP device of the external electronic device, and the pairing operation with the external electronic device 102 may be omitted.

[0371] In operation 2140, the electronic device 101 may authenticate the external electronic device 102.

[0372] In operation 2141, the external electronic device 102 may send information related to communication with the external electronic device 102 to the electronic device 101. For example, the information may include information related to a communication scheme or communication attributes that can be connected to the external electronic device 102.

[0373] According to various embodiments of the present disclosure, the electronic device 101 may identify whether the external electronic device 102 is within the communication range based on the exchanged information. However, the corresponding P2P service intends to output the sound source of the electronic device 101 from the device connected to the external electronic device 102 by performing service handover to the device connected to the external electronic device 102, and the operation of identifying the above communication range may be omitted.

[0374] In operation 2150, the electronic device 101 may discover an electronic device for service handover. For example, the electronic device 101 may determine a scheme for performing a communication connection with a device for performing a P2P service (e.g., the peripheral device 2101) and a device for performing a P2P2 service based on the communication-related information received from the external electronic device 102.

[0375] In operation 2151, the electronic device 101 may send information related to service handover to the external electronic device 102. For example, based on the communication information exchanged with the external electronic device 102, the information related to service handover may include electronic device information (e.g., the external electronic device 102 or the peripheral device 2101) for performing a music sharing service, a communication scheme, or information related to communication attributes.

[0376] In operation 2160, the external electronic device 102 may identify the information related to service handover sent from the electronic device 101.

[0377] In operation 2161, the external electronic device 102 may notify the peripheral device 2101 included in the information related to service handover of the application or service handover of the music sharing service.

[0378] According to various embodiments of the present disclosure, the electronic device 101 may identify the peripheral device 2101 (e.g., an A2DP device) of the external electronic device 102 based on the exchanged peripheral device information to perform a music sharing service and identify a communication scheme (e.g., Bluetooth) to perform the music sharing service with the peripheral device 2101.

[0379] In operation 2170, the electronic device 101 and the external electronic device 102 may perform a P2P service.

[0380] In operation 2171, the external electronic device 102 may perform a P2P service with the peripheral device 2101. For example, the electronic device 101 may send the sound source of the electronic device 101 to the peripheral device 2101 via a Bluetooth connection and may control the output of the sound source from the peripheral device 2101.

[0381] An electronic device according to various embodiments may be one of various types of electronic devices. The electronic device may include, for example, a portable communication device (e.g., a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance. According to an embodiment of the present disclosure, the electronic device is not limited to the electronic devices described above.

[0382] It should be understood that the various embodiments of the present disclosure and the terms used therein are not intended to limit the technical features described herein to specific embodiments, but include various changes, equivalent forms, or alternative forms corresponding to the respective embodiments. For the description of the drawings, similar reference numerals may be used to refer to similar or related elements. It will be understood that a singular form of a noun corresponding to a term may include one or more things, unless the relevant context clearly indicates otherwise. As used herein, each of the phrases such as "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" may include any one or all possible combinations of the items listed together in the corresponding one of the plurality of phrases. As used herein, terms such as "first" and "second" or "1st" and "2nd" may be used to simply distinguish a corresponding component from another component and do not limit the component in other respects (e.g., importance or order). It will be understood that if an element (e.g., a first element) is referred to as "coupled with", "coupled to", "connected with", or "connected to" another element (e.g., a second element) in the case where the term "operably" or "communicatively" is used or in the case where the term "operably" or "communicatively" is not used, it means that the one element may be directly (e.g., wired) connected to the other element, wirelessly connected to the other element, or connected to the other element via a third element.

[0383] As used herein, the term "module" may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with other terms (e.g., "logic", "logic block", "portion", or "circuit"). A module may be a single integrated component adapted to perform one or more functions or the smallest unit or portion of the single integrated component. For example, according to an embodiment, a module may be implemented in the form of an application specific integrated circuit (ASIC).

[0384] The various embodiments described herein may be implemented as software (e.g., a program #40) including one or more instructions readable by a machine (e.g., an electronic device #01) stored in a storage medium (e.g., an internal memory #36 or an external memory #38). For example, under the control of a processor, a processor (e.g., a processor #20) of the machine (e.g., an electronic device #01) may call at least one of the one or more instructions stored in the storage medium and run the at least one instruction with or without using one or more other components. This enables the machine to operate to perform at least one function according to the at least one instruction called. The one or more instructions may include code generated by a compiler or code that can be run by an interpreter. A machine-readable storage medium may be provided in the form of a non-transitory storage medium. Herein, the term "non-transitory storage medium" is a tangible device and does not include signals (e.g., electromagnetic waves), but the term does not distinguish between data being stored semi-permanently in the storage medium and data being stored temporarily in the storage medium. For example, a "non-transitory storage medium" may include a buffer that stores data temporarily.

[0385] According to an embodiment, a method according to various embodiments of the present disclosure may be included and provided in a computer program product. The computer program product may be traded between a seller and a purchaser as a product. The computer program product may be distributed in the form of a machine-readable storage medium (e.g., a compact disc read-only memory (CD-ROM)), or the computer program product may be distributed online (e.g., downloaded or uploaded) via an application store (e.g., Play Store TM ), or the computer program product may be directly distributed (e.g., downloaded or uploaded) between two user devices (e.g., smart phones). If it is distributed online, at least a portion of the computer program product (e.g., a downloadable application) may be generated temporarily, or at least a portion of the computer program product may be stored at least temporarily in a machine-readable storage medium (such as the memory of a manufacturer's server, an application store's server, or a forwarding server).

[0386] According to various embodiments, each of the above components (e.g., a module or a program) may include a single entity or multiple entities. According to various embodiments, one or more of the above components may be omitted, or one or more other components may be added. Optionally or additionally, multiple components (e.g., modules or programs) may be integrated into a single component. In this case, according to various embodiments, the integrated component may still perform the one or more functions of each of the multiple components in the same or similar manner as the corresponding one of the multiple components performed one or more functions before integration. According to various embodiments, the operations performed by a module, a program, or another component may be performed sequentially, in parallel, repeatedly, or in a heuristic manner, or one or more of the operations may be run in a different order or omitted, or one or more other operations may be added.

[0387] Although the present disclosure has been shown and described with reference to various embodiments of the present disclosure, those skilled in the art should understand that various forms and details of the present disclosure may be changed without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents.

Claims

1. An electronic device, comprising: a communication circuit; a security circuit; at least one processor operably connected to the communication circuit and the security circuit; and a memory operably connected to the at least one processor, wherein the memory stores instructions that, when executed by the at least one processor alone or in combination, cause the electronic device to: receive a public key from an external electronic device when a peer-to-peer (P2P) service is requested; send an authentication certificate chain generated based on the received public key to the external electronic device; verify the authentication certificate chain received from the external electronic device by using a root authentication certificate stored in the security circuit; generate a shared key based on verifying that the authentication certificate chain received from the external electronic device is valid; receive encrypted information about the external electronic device from the external electronic device; decrypt the encrypted information about the external electronic device by using the shared key; and perform a P2P service with the external electronic device through the communication circuit based on the decrypted information about the external electronic device.

2. The electronic device according to claim 1, wherein the instructions cause the electronic device to: receive the public key through the communication circuit, and receive the encrypted information about the external electronic device through a connection with a Generic Attribute Profile (GATT) of the external electronic device.

3. The electronic device according to claim 1, wherein the encrypted information about the external electronic device includes at least a part of the phone number of the external electronic device, and wherein the instructions cause the electronic device to: decrypt the phone number of the external electronic device with the shared key; and identify the validity of the external electronic device by comparing the decrypted value with the phone number of the external electronic device stored in the memory.

4. The electronic device according to claim 1, wherein the instructions cause the electronic device to generate the shared key according to the Elliptic Curve Diffie-Hellman (ECDH) rule with the same shared key as the external electronic device.

5. A method for performing a peer-to-peer (P2P) service in an electronic device, the method comprising: receiving a public key from an external electronic device when a P2P service is requested; sending an authentication certificate chain generated based on the received public key to the external electronic device; verifying the authentication certificate chain received from the external electronic device by using a root authentication certificate stored in the security circuit; generating a shared key based on verifying that the authentication certificate chain received from the external electronic device is valid; receiving encrypted information about the external electronic device from the external electronic device; decrypting the encrypted information about the external electronic device by using the shared key; and performing a P2P service with the external electronic device based on the decrypted information about the external electronic device.

6. The method according to claim 5, further comprising receiving the public key and receiving the encrypted information about the external electronic device through a connection with a Generic Attribute Profile (GATT) of the external electronic device.

Citation Information

Patent Citations

  • Uniform communication protocols for communication between controllers and accessories

    US20190260660A1