Wi-Fi point-to-point connection establishment method and device
By directly generating and transmitting confidential information in Wi-Fi P2P connection, avoiding signaling connections, the problem of prolonging Wi-Fi P2P connection establishment is solved and the user experience is improved.
Patent Information
- Application Number
- CN202310972702.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2025-02-14
AI Technical Summary
The delay in establishing an existing Wi-Fi P2P connection is long, which cannot meet the needs of users to quickly use Wi-Fi P2P connection to transmit service data, resulting in poor user experience.
By directly generating confidential information between the first electronic device and the second electronic device and passing it through broadcast messages without establishing a signaling connection, a Wi-Fi point-to-point connection is established.
The delay of signaling connection establishment and information interaction is reduced, thereby reducing the delay of Wi-Fi point-to-point connection establishment and improving user experience.
Smart Images

Figure CN119450644A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method and device for establishing a Wi-Fi point-to-point connection. Background Art
[0002] Wi-Fi Direct (wireless fidelity direct) is also called Wi-Fi P2P (wireless fidelityper-to-peer). Wi-Fi P2P can support two Wi-Fi devices to connect and communicate directly with each other without the intervention of a Wi-Fi hotspot. Wi-Fi P2P connection can support the interconnection between electronic devices and high-speed data transmission, and is widely used in distributed services (such as data sharing, multicasting), etc.
[0003] According to the current standard Wi-Fi DIRECT protocol, a Wi-Fi P2P connection is established. It takes a long time to establish a Wi-Fi P2P connection, which cannot meet the user's demand for quickly using the Wi-Fi P2P connection to transmit business data, resulting in a poor user experience. Summary of the invention
[0004] Embodiments of the present application provide a method and device for establishing a Wi-Fi point-to-point connection, so as to reduce the delay in establishing a Wi-Fi point-to-point connection.
[0005] In a first aspect, a method for establishing a Wi-Fi point-to-point connection is provided, which can be applied to the process of establishing a Wi-Fi point-to-point connection between a first electronic device and a second electronic device. On the first electronic device side, the method may include the following steps: determining to establish a Wi-Fi point-to-point connection with a second electronic device, generating confidential information based on a device master key and first information, and sending a first broadcast message; receiving second information of the second electronic device broadcast by the second electronic device; and establishing a Wi-Fi point-to-point connection with the second electronic device based on the confidential information and the second information of the first electronic device and the second information of the second electronic device. The confidential information is used to establish a Wi-Fi point-to-point connection, the first information includes time information and / or the number of connections to establish a Wi-Fi point-to-point connection between the first electronic device and the second electronic device, and the first broadcast message is used to notify the second electronic device to establish a Wi-Fi point-to-point connection with the first electronic device.
[0006] In the above implementation, since a signaling connection such as a Bluetooth connection is not established during the process of establishing a Wi-Fi connection between the first electronic device and the second electronic device, compared with an implementation based on the need to establish a signaling connection and transmit information for establishing a Wi-Fi point-to-point connection based on the signaling connection, the above implementation of the embodiment of the present application can reduce the delay in establishing a signaling connection and exchanging information based on the signaling connection, thereby reducing the delay in establishing a Wi-Fi point-to-point connection.
[0007] Optionally, a trust relationship exists between the first electronic device and the second electronic device.
[0008] In a possible implementation manner, the first broadcast message includes second information of the first electronic device.
[0009] Optionally, the second information of the first electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the first electronic device, device role information of the first electronic device, station (STA) channel information of the first electronic device, a list of channels supported by the first electronic device, dual-band dual-transmit capability information of the first electronic device, the address network segment of the first electronic device, the IP address of the first electronic device, the type of the first electronic device, and the power level of the first electronic device.
[0010] In a possible implementation, the receiving the second information broadcast by the second electronic device includes: receiving a second broadcast message, where the second broadcast message is sent by the second electronic device according to the first broadcast message, and the second broadcast message includes the second information of the second electronic device.
[0011] In the above implementation, the second information of the second electronic device can be sent to the first electronic device through a broadcast message without establishing a signaling connection and transmitting information through the signaling connection, thereby reducing the delay in establishing a Wi-Fi point-to-point connection.
[0012] Optionally, the second information of the second electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the second electronic device, device role information of the second electronic device, site STA channel information of the second electronic device, indication information of the channel selected by the second electronic device, dual-band dual-transmit capability information of the second electronic device, address segment of the second electronic device, IP address of the second electronic device, type of the second electronic device, and power level of the second electronic device.
[0013] In a possible implementation manner, the second broadcast message includes indication information, and the indication information indicates that the first electronic device is a group manager device.
[0014] In a possible implementation manner, after receiving the second broadcast message, the method further includes: sending a Wi-Fi point-to-point connection establishment request to the second electronic device.
[0015] In a possible implementation, the receiving the second information of the second electronic device includes: receiving a Wi-Fi point-to-point connection establishment request from the second electronic device, wherein the Wi-Fi point-to-point connection establishment request includes the second information of the second electronic device.
[0016] In the above implementation, when the second electronic device is the group manager, there is no need to send the second broadcast message. Instead, the second information of the second electronic device is sent to the first electronic device via a Wi-Fi point-to-point connection establishment request, so that a Wi-Fi point-to-point connection can be directly established with the first electronic device, thereby further reducing the delay in establishing the Wi-Fi point-to-point connection.
[0017] In a possible implementation, the sending of the first broadcast message includes: generating a first verification code according to the device master key and the number of connections; and sending the first broadcast message, wherein the first broadcast message includes the first verification code.
[0018] In the above implementation, the first electronic device generates a first verification code and sends it to the second electronic device through a first broadcast message so that the second electronic device can verify the verification code to improve security.
[0019] In a possible implementation manner, the confidential information includes a pre-shared key (PSK) and a service set identifier (SSID).
[0020] In a second aspect, a method for establishing a Wi-Fi point-to-point connection is provided, which can be applied to the process of establishing a Wi-Fi point-to-point connection between a first electronic device and a second electronic device. On the second electronic device side, the method may include the following steps: receiving a first broadcast message, the first broadcast message is used to notify the second electronic device to establish a Wi-Fi point-to-point connection with the first electronic device, and the first broadcast message includes the second information of the first electronic device; generating confidential information based on the device master key and the first information, the confidential information is used to establish a Wi-Fi point-to-point connection, the first information includes time information and / or the number of connections to establish a Wi-Fi point-to-point connection between the first electronic device and the second electronic device; establishing a Wi-Fi point-to-point connection with the first electronic device based on the confidential information and the second information of the second electronic device and the second information of the first electronic device.
[0021] In one possible implementation, the second information of the first electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the first electronic device, device role information of the first electronic device, site STA channel information of the first electronic device, a list of channels supported by the first electronic device, dual-band dual-transmission capability information of the first electronic device, the address network segment of the first electronic device, the IP address of the first electronic device, the type of the first electronic device, and the power level of the first electronic device.
[0022] In a possible implementation manner, after receiving the first broadcast message, the method further includes: sending a second broadcast message, wherein the second broadcast message includes second information of the second electronic device.
[0023] In one possible implementation, the second information of the second electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the second electronic device, device role information of the second electronic device, STA channel information of the second electronic device, indication information of the channel selected by the second electronic device, dual-band dual-transmission capability information of the second electronic device, address segment of the second electronic device, IP address of the second electronic device, type of the second electronic device, and power level of the second electronic device.
[0024] In a possible implementation manner, the second broadcast message includes indication information, and the indication information indicates that the first electronic device is a group manager device.
[0025] In a possible implementation manner, after sending the second broadcast message, the method further includes: receiving a Wi-Fi point-to-point connection establishment request sent by the first electronic device.
[0026] In a possible implementation, after generating confidential information according to the device master key and the first information, it also includes: establishing a Wi-Fi point-to-point connection request to the first electronic device, wherein the Wi-Fi point-to-point connection establishment request includes second information of the second electronic device.
[0027] In one possible implementation, the first broadcast message includes a first verification code generated by the first electronic device; before generating confidential information based on the device master key and the first information, it also includes: generating a second verification code based on the device master key and the number of connections; and verifying that the first electronic device is passed based on the first verification code and the second verification code.
[0028] In a possible implementation, the confidential information includes PSK and SSID.
[0029] According to a third aspect, a communication device is provided, comprising a unit or module for executing a method as described in any one of the first aspect, or a unit or module for executing a method as described in any one of the second aspect.
[0030] In a fourth aspect, a communication device is provided, comprising: one or more processors and one or more memories; wherein the one or more memories store one or more programs, and when the programs are executed by the one or more processors, the device executes a method as described in any one of the first aspect, or executes a method as described in any one of the second aspect.
[0031] In a fifth aspect, a readable storage medium is provided, comprising a computer program, which, when executed on a device, enables the device to execute a method as described in any one of the first aspect, or to execute a method as described in any one of the second aspect.
[0032] In a sixth aspect, a computer program product is provided, which, when executed on a device, enables the device to execute the method as described in any one of the first aspect, or to execute the method as described in any one of the second aspect.
[0033] In the seventh aspect, a chip system is provided, comprising: a processor; when the processor calls and runs a computer program from a memory, a device equipped with the chip system executes a method as described in any one of the first aspect, or executes a method as described in any one of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A network system architecture applicable to the embodiments of the present application;
[0035] Figure 2 A schematic diagram of a Wi-Fi P2P connection establishment process provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of a framework for implementing distributed services based on Wi-Fi P2P connection in an embodiment of the present application;
[0037] Figure 4 A schematic diagram of a process for implementing a distributed service based on a Wi-Fi P2P connection in an embodiment of the present application;
[0038] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0039] Figure 6 A schematic diagram of another Wi-Fi point-to-point connection establishment process provided in an embodiment of the present application;
[0040] Figure 7 A schematic user interface diagram of a user triggering a mobile phone to establish a Wi-Fi P2P connection with a large-screen device provided in an embodiment of the present application;
[0041] Figure 8 This is another schematic user interface diagram provided in an embodiment of the present application for a user to trigger a mobile phone to establish a Wi-Fi P2P connection with a large-screen device;
[0042] Fig. 9 A schematic diagram of a signaling interaction process for establishing a Wi-Fi point-to-point connection provided in an embodiment of the present application;
[0043] Fig.10 A schematic diagram of the structure of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0045] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0046] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0047] In some exemplary embodiments, reference Figure 1 , Figure 1 It is a schematic diagram of a communication system applicable to an embodiment of the present application.
[0048] like Figure 1 As shown, the communication system 10 may include various electronic devices, such as a mobile phone 11, a tablet computer 12, a large-screen device 13, etc. The embodiment of the present application does not specifically limit the type of electronic device (such as a mobile phone 11, a tablet computer 12 or a large-screen device 13). The communication system 10 may also include other devices, such as smart home devices and other Internet of Things (IOT) devices, etc. Figure 1 Not shown in FIG.
[0049] Exemplarily, the electronic device in the embodiments of the present application may be a mobile phone, a wearable device (such as a smart bracelet, a smart watch, a headset, etc.), a tablet computer, a handheld computer, a netbook, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a cellular phone, a personal digital assistant (PDA), an augmented reality (AR)\virtual reality (VR) device, etc., and may also be a television, a large screen, a speaker, a refrigerator, an air conditioner, a vehicle-mounted device (also referred to as a vehicle computer), a printer, a projector, etc. Exemplary embodiments of electronic devices include but are not limited to devices equipped with Or devices with other operating systems.
[0050] Each electronic device in the communication system 10 can form a near field communication network through a Wi-Fi point-to-point connection. A specific example of a Wi-Fi point-to-point connection may be an HML (Huawei Magneto Link) or AWDL (Apple Wireless Direct Link) connection. The embodiment of the present application does not limit the specific type of Wi-Fi point-to-point connection. Optionally, the operating frequency band of the Wi-Fi point-to-point connection may be a 2.4 GHz band or a 5 GHz band.
[0051] After multiple (two or more) electronic devices establish a Wi-Fi point-to-point connection, they become electronic devices in the soft bus network. Among them, the soft bus network can include homogeneous networks and heterogeneous networks. For example, electronic devices in a communication network communicate through Wi-Fi point-to-point connection, and the communication network is a homogeneous network. In the soft bus network, different electronic devices can perform their own services, or the services can be distributed on different electronic devices. For example, Figure 1 The various electronic devices shown constitute a soft bus network. The mobile phone 11 can synchronize the video it plays to the large-screen device 13 for playback in the form of screen projection via a Wi-Fi point-to-point connection; the mobile phone 11 can also transfer the photos stored on it to the tablet computer 12 via a Wi-Fi point-to-point connection to realize file sharing.
[0052] In some embodiments, a trust relationship can be established between different electronic devices in the soft bus network to implement distributed services. This trust relationship can be established in the discovery phase of the Wi-Fi point-to-point connection initialization process. Optionally, the trust relationship between electronic devices can be established based on a common account. For example, if the mobile phone 101 and the tablet computer 12 are logged in to the same account, the mobile phone 11 can be directly bound to the tablet computer 12 to establish a trust relationship, for example, directly clicking the binding button corresponding to the tablet computer 12 on the mobile phone 11 without waiting for the confirmation of the tablet computer 12. The trust relationship between electronic devices can also be established based on an associated account.
[0053] Multiple electronic devices with a trust relationship in a soft bus network can be called "super terminals". Figure 1 In the illustrated architecture, the mobile phone 11, tablet computer 12 and large-screen device 13 are all logged into the same account, thereby establishing a trust relationship, so the mobile phone 11, tablet computer 12 and large-screen device 13 form a "super terminal".
[0054] Figure 1 The electronic device in the illustrated architecture supports Wi-Fi point-to-point connection and the ability to implement distributed services based on Wi-Fi point-to-point connection. In the embodiments of the present application, "electronic device", "P2P device" and "terminal device" can be replaced with each other. In addition, "distributed service" and "P2P service" can also be replaced with each other.
[0055] refer to Figure 2 , Figure 2 The hardware structure diagram of an electronic device in the embodiment of the present application is exemplarily shown. The electronic device may be Figure 1 The mobile phone 11 or tablet computer 12 or large-screen device 13 in the illustrated architecture, or other electronic devices that can be used in the above architecture.
[0056] like Figure 2 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a wireless communication module 150, a sensor module 160, and the like.
[0057] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented by hardware, software, or a combination of software and hardware.
[0058] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. The controller may generate an operation control signal based on the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0059] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device.
[0060] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0061] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2 and the wireless communication module 150.
[0062] The wireless communication module 150 can provide wireless communication solutions including Wi-Fi (including Wi-Fi sensing and Wi-Fi AP), Bluetooth (BT), wireless data transmission modules (for example, 433MHz, 868MHz, 915MHz) applied to the electronic device 100. The wireless communication module 150 can be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via antenna 1 and / or antenna 2, filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through antenna 1 and / or antenna 2.
[0063] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0064] The internal memory 121 may be used to store one or more computer programs, which include instructions. The processor 110 may enable the electronic device 100 to perform the Wi-Fi point-to-point connection method provided in some embodiments of the present application, as well as various applications and data processing, etc. by running the above instructions stored in the internal memory 121. The internal memory 121 may include a code storage area and a data storage area. Among them, the code storage area may store an operating system. The data storage area may store data created during the use of the electronic device 100, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, a flash memory component, a universal flash storage (UFS), etc. In some embodiments, the processor 110 may enable the electronic device 100 to perform the Wi-Fi point-to-point connection establishment method provided in the embodiment of the present application, as well as other applications and data processing by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor 110.
[0065] refer to Figure 3 , Figure 3 The following is an exemplary diagram of a software system architecture on an electronic device in an embodiment of the present application. Figure 3 As shown in FIG. 1 , the system architecture mainly includes: hardware layer, hardware abstraction layer (HAL), application framework layer (Framework), and application layer from bottom to top. In addition, between the application layer and the application framework layer, there are also soft bus and Wi-Fi extension interface (Wi-Fi EXT). It can be understood that the soft bus and Wi-Fi EXT can also be regarded as components of the application framework layer.
[0066] Applications in the application layer (such as Figure 2 The "Huawei Share" application, "Screen Cast" application and "Multi-screen Collaboration" application in the Framework interface are some applications that users can directly access. They run on electronic devices and are windows for users to interact with electronic devices.
[0067] The soft bus includes a Wi-Fi function module that can provide services such as Wi-Fi device discovery, Wi-Fi connection, networking, as well as tasks and data buses.
[0068] Wi-Fi EXT provides Wi-Fi interface extension functions to enhance Wi-Fi interface functions so that the application layer can call Wi-Fi related services provided by the Framework.
[0069] Framework refers to some system capabilities running on the operating system of electronic devices. Taking the Android Open Source Project (AOSP) as an example, AOSP provides some related interfaces and services for operating Wi-Fi point-to-point. For example, Wi-Fi point-to-point related services may include Wi-Fi P2P Service. The interface type corresponding to Wi-Fi P2P Service is Wi-Fi P2P Manager type. The interface of Wi-Fi P2P Manager type includes: providing interfaces such as discovering devices (discoverPeers) and connecting (connect). These interfaces can be used by users to directly control Wi-Fi point-to-point.
[0070] HAL is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms.
[0071] The hardware layer can include a variety of communication interfaces, such as Figure 2 The hardware layer also includes the Bluetooth interface, universal serial bus (USB) interface, Ethernet (ETH) interface, modem, etc. shown in the figure. The hardware layer also includes middleware, which is responsible for the transfer of all messages between kernel state and user state during the operation of electronic equipment. One of the most widely used middleware is wpa_supplicant. wpa_supplicant is a daemon process that runs independently in the device and is used for message transfer. The hardware layer can also include Wi-Fi driver (Wi-FiDriver), Wi-Fi chip (Chipset), etc. (not shown in the figure). Among them, the Wi-Fi point-to-point connection protocol is generally implemented in the Wi-Fi chip. The Wi-Fi driver is responsible for connecting the Wi-Fi chip to the operating system of the terminal device.
[0072] The Framework layer in the terminal device interacts with the chip through the driver. For example, taking AOSP as an example, the Framework layer uses wpa_supplicant to interact with the driver and support encryption authentication. The application layer provides several interface functions that can be directly called by developers / businesses. After the call, the chip can be driven to perform corresponding Wi-Fi point-to-point related operations. The Framework layer itself is responsible for message forwarding and coordination between the upper-layer application and the lower-layer hardware (including wpa_supplicant, Wi-FiDriver, Chipset), connection management, etc. At present, users' Wi-Fi point-to-point operations are implemented by the application layer by calling the Wi-Fi point-to-point related interfaces and services in the Framework.
[0073] In some embodiments of the present application, a complete Wi-Fi point-to-point service includes three stages: device discovery, device connection, and service data transmission. After the Wi-Fi point-to-point connection is established, a group is formed (or it can also be called a Wi-Fi point-to-point group, such as a Wi-Fi P2P group). In the group, devices are divided into two roles: group manager and group client. In Wi-Fi P2P, the group manager is called GO (group owner), and the group client is called GC (group client). There is only one GO device in a Wi-Fi P2P group, and there can be one or more GC devices.
[0074] Taking Wi-Fi P2P as an example, in the Wi-Fi DIRECT protocol specification, establishing a Wi-Fi P2P connection requires a total of four steps, namely: Wi-Fi P2P device discovery (Device Discovery), group negotiation (Group Formation), Wi-Fi protected setup (Wi-Fi protected setup, WPS) process and associated connection.
[0075] Among them, Wi-Fi P2P device discovery includes two stages: scan and find. The Scan stage is to discover existing GO devices. The find stage is divided into the listen state and the search state. The Wi-Fi P2P device switches back and forth between the Search stage and the Listen stage. In the Search stage, the Wi-Fi P2P device sends a probe request frame (Probe Request). In the Listen stage, the Wi-Fi P2P device receives the probe request frames (Probe Request) from other devices and replies with the probe response frame (Probe Response). For the Search stage and the Listen stage, only when the Wi-Fi P2P devices are in different stages can they discover each other and proceed with the subsequent process. Therefore, the duration of these two stages is random to ensure that there will be windows in which the two stages are staggered.
[0076] Group negotiation is the next stage after Wi-Fi P2P device discovery. Since the two-end devices on a Wi-Fi P2P connection have the distinction between GO and GC roles, they need to negotiate their respective roles before connecting.
[0077] The WPS process is the next step after group negotiation, which is used to ensure the security and reliability of the established connection and avoid security vulnerabilities such as identity spoofing.
[0078] The final association involves a 4-step handshake, after which a trusted Wi-Fi P2P connection is established between the two devices.
[0079] During the Wi-Fi P2P connection establishment process, both devices switch between the Search phase and the Listen phase. Only when one device is in the Listen phase and the other device is in the Search phase at the same time can the device be discovered. However, this process may require both devices to switch between the Search phase and the Listen phase multiple times before the conditions for discovering the device are met, resulting in a long Wi-Fi P2P connection process and a poor user experience.
[0080] In order to speed up the process of establishing Wi-Fi P2P connections, other embodiments of the present application have modified and optimized the process of establishing standard Wi-Fi P2P connections. Use Bluetooth low energy (BLE) discovery instead of Wi-Fi P2P device discovery to speed up the discovery process. After BLE discovers the device, use the service to directly specify the GO / GC role to simplify the group negotiation process. By establishing a BLE / Bluetooth basic rate (BR) connection, security authentication and P2P group information exchange are performed based on the BLE / BR connection, and finally the GC device is directly connected to the P2P group on the specified channel to achieve Wi-Fi P2P connection.
[0081] See also Figure 4 and Figure 5 , Figure 4 A block diagram of a Wi-Fi P2P connection establishment process provided by an embodiment of the present application is exemplarily shown. Figure 5 An example is shown based on Figure 1 The signaling interaction diagram of the Wi-Fi P2P connection establishment process implemented by the system architecture shown below Figure 4 and Figure 5 , the Wi-Fi P2P connection establishment process provided in the embodiment of the present application is described.
[0082] like Figure 4 and Figure 5 As shown in FIG, the device authentication group network online process occurs in the device discovery phase. In this phase, device-level authentication and group-level authentication are implemented between the first electronic device and the second electronic device. In the device-level authentication process, the two devices implement device-level key negotiation; in the group-level authentication process, the two devices record the authentication results of the group. The signaling interaction process in this phase can be as follows: Figure 5 As shown, at 501 to 503, the soft bus in the first electronic device sends an authentication request to the communication interface, which includes the encrypted device master key (DEVMKey) of the first electronic device and the account information of the first electronic device. After receiving the authentication request, the communication interface of the second electronic device sends it to the soft bus of the second electronic device. At 504 to 506, the soft bus of the second electronic device sends the encrypted DEVMKey of the second electronic device to the first electronic device. At 507a to 508a, the first electronic device verifies whether the account information of the first electronic device and the second electronic device is the same. If so, the second electronic device is authenticated successfully, and the second electronic device is added to the group trust list to complete the device online; at 507b to 508b, the second electronic device verifies whether the account information of the first electronic device and the second electronic device is the same. If so, the first electronic device is authenticated successfully, and the first electronic device is added to the group trust list to complete the device online.
[0083] like Figure 4 and Figure 5 As shown in the figure, after completing device authentication and going online, the Wi-Fi P2P connection establishment phase begins. In this phase, a Bluetooth or other type of signaling connection is first established, and confidential information and second information used to establish a Wi-Fi P2P connection are transmitted between the two electronic devices through the signaling connection. Thereafter, the two devices establish a Wi-Fi P2P connection based on the confidential information and second information. Taking the signaling connection as a Bluetooth connection as an example, the signaling interaction process in this phase can be as follows: Figure 5 As shown, at 509 to 511, after the soft bus of the first electronic device receives the service request sent by the distributed service application, it triggers the middleware (such as WPA-supplicant) to generate confidential information such as a pre-shared key (PSK) and a service set identifier (SSID) according to a random number, and sends the confidential information to the soft bus; at 512 to 514, the soft bus of the first electronic device sends a broadcast message to notify the second electronic device to establish a signaling connection, and the second electronic device initiates a Bluetooth connection establishment process according to the notification. At 515, the first electronic device and the second electronic device negotiate a session key via a Bluetooth connection. The session key can be used to encrypt the transmitted information during the interaction process in the association connection phase; the first electronic device and the second electronic device can also send their respective P2P capabilities, connection status, supported channel lists, operating channel attributes, and other second information to the opposite device via the Bluetooth connection; at 516-517, the first electronic device sends confidential information (such as PSK, SSID, etc.) encrypted by DEVMKey to the second electronic device via the signaling connection; at 518, the second electronic device creates a GO and initiates a Wi-Fi P2P connection establishment process based on the confidential information.
[0084] like Figure 4 and Figure 5As shown, before establishing a Wi-Fi P2P connection, it is necessary to first establish a signaling connection such as BLE / BR. It takes a long time to establish a BLE / BR connection. For example, the typical time for establishing a BLE connection is 1-2 seconds, and the typical time for establishing a BR connection is 2-3 seconds. After the BLE / BR connection is established, confidential information and second information must be transmitted based on the BLE / BR connection, resulting in a long Wi-Fi P2P connection process. In addition, in the above process, the establishment of the Wi-Fi P2P connection is strongly dependent on the BLE / BR connection. This process is basically customized by the business and is not universal and scalable. Similarly, the establishment process of the HML connection and the AWDL connection also has the problem of long delays.
[0085] To this end, some other embodiments of the present application provide a method for establishing a Wi-Fi point-to-point connection and a device that can implement the method, so as to reduce the delay in establishing a Wi-Fi point-to-point connection. In the method for establishing a Wi-Fi point-to-point connection provided in the embodiment of the present application, after the device discovery process, when a Wi-Fi point-to-point connection needs to be established, each electronic device generates confidential information (such as PSD, SSID, etc.) for establishing a Wi-Fi point-to-point connection based on the device master key, without the need to establish a signaling connection such as BLE / BR and to transmit information through the signaling connection of BLE / BR, which can save the delay in establishing the BLE / BR signaling connection and the delay in information interaction through the BLE / BR signaling connection, thereby reducing the delay in establishing the Wi-Fi point-to-point connection.
[0086] Based on the above Figure 1 The network system architecture shown in Figure 6 The following is a logic block diagram of another Wi-Fi point-to-point connection process provided by an embodiment of the present application. Figure 6 The solution in the embodiment is introduced by taking the interaction between the first electronic device and the second electronic device as an example. For example, the first electronic device may be Figure 1 In the network system architecture shown, the mobile phone 11, the second electronic device can be Figure 1 The tablet computer 12 or large screen 13 in the network system architecture shown.
[0087] like Figure 6 As shown, the process may include the following steps 601 to 605:
[0088] Step 601: The first electronic device determines to establish a Wi-Fi point-to-point connection with the second electronic device.
[0089] In some cases, the first electronic device may automatically establish a Wi-Fi point-to-point connection with the second electronic device, or the first electronic device may be triggered by a distributed service to establish a Wi-Fi point-to-point connection with the second electronic device.
[0090] In other cases, the Wi-Fi point-to-point connection is established based on a user request, such as when a user performs a user operation on the first electronic device to trigger the establishment of a Wi-Fi point-to-point connection between the first electronic device and the second electronic device. Figure 1 The mobile phone 11 and the second electronic device are Figure 1 Taking the large-screen device 13 in the example, the user can trigger the establishment of a Wi-Fi P2P connection between the mobile phone 11 and the large-screen device 13 through the following two operation modes:
[0091] Method 1: Assume that the user needs to share files with a large-screen device using a mobile phone. Figure 7 As shown in a in FIG, the user opens the "File Management" application on the mobile phone, and the interface displayed is as follows Figure 7 As shown in b in FIG. 1 , the user selects the file to be shared (for example, file 1), clicks “Share”, and selects the sharing method. The interface displayed is as follows Figure 7 As shown in c in FIG. 1 , the user selects the sharing method of "Wi-Fi Direct Connection", and the mobile phone application will display the previously stored list of available devices to the user. The list of available devices includes the device identifiers of one or more devices. For example, the displayed list of available devices can be as follows: Figure 7 As shown in d in the figure. The user can select a device (such as a large-screen device) from the available device list as needed. For example, the user clicks the device identifier of the large-screen device in the device list to select the large-screen device.
[0092] Optional, such as Figure 7 As shown in d in the figure, the mobile phone can also display to the user whether each device in the available device list is a trusted device. If a device is an untrusted device, an icon indicating whether authentication is required can be displayed to the user. If the user is sure that authentication is required, the user can click "Authentication" and the mobile phone will automatically perform security authentication with the device. If the security authentication passes, the device is displayed as a trusted device. If the security authentication fails, the device is still displayed as an untrusted device.
[0093] Method 2: Assume that the user's purpose is only to connect the mobile phone and the large-screen device via Wi-Fi P2P to facilitate the quick transfer of files when there is data or file sharing later. Figure 8 Click "Settings" on the interface shown in a, and the interface displayed is as follows Figure 8 As shown in b in Figure 1, the user clicks the "WLAN Direct" menu to trigger the Wi-Fi P2P connection. After the user clicks "WLAN Direct", the interface displayed is as follows Figure 8As shown in c in FIG. 1 , the application on the mobile phone will display the previously stored list of available devices to the user. The list of available devices includes device identifiers of one or more devices. For example, the displayed list of available devices may be as follows: Figure 8 As shown in c in FIG. 1 , the user can select a device (eg, a large-screen device) from the available device list as needed. For example, the user clicks the device identifier of the large-screen device in the available device list to select the large-screen device.
[0094] Optional, such as Figure 8 As shown in c, the mobile phone can also display to the user whether each device in the available device list is a trusted device. If a device is an untrusted device, an icon indicating whether authentication is required can also be displayed to the user. If the user is sure that authentication is required, the user can click "Authentication" and the mobile phone will automatically perform security authentication with the device. If the security authentication passes, the device is displayed as a trusted device. If the security authentication fails, the device is still displayed as an untrusted device.
[0095] It should be understood that in the embodiment of the present application, in addition to the above two operation modes, the user can also trigger the mobile phone to establish a Wi-Fi P2P connection with other devices through other operation modes, and the embodiment of the present application is not limited here.
[0096] It should also be understood that in the embodiments of the present application, Figure 7 and Figure 8 The interface diagram shown is only exemplary and should not impose any restrictions on the interface displayed when a user triggers a mobile phone to establish a Wi-Fi P2P connection with another device in the embodiments of the present application. For example, in other embodiments of the present application, the icons on the interface displayed by the mobile phone may include: Figure 7 or Figure 8 More or fewer icons may be displayed on the interface, or some icons may be combined, or some icons may be split, or different icons may be displayed, etc. The present application embodiment is not limited here.
[0097] In some embodiments of the present application, a trust relationship exists between the first electronic device and the second electronic device to ensure the security of the Wi-Fi point-to-point connection, thereby ensuring the security of the distributed service. Optionally, the trust relationship between the first electronic device and the second electronic device can be established in the following manner:
[0098] Method 1: The first electronic device and the second electronic device log in using the same account, and a trust relationship is established between the first electronic device and the second electronic device.
[0099] Method 2: The first electronic device and the second electronic device establish a trust relationship after binding through a personal identification number (PIN) or scanning a code to bind. Figure 7 or Figure 8 In the example, if a device in the list of available devices is an untrusted device, an icon indicating whether authentication is required will be displayed to the user. If the user is sure that authentication is required, he or she can click "Authentication". The phone will pop up an interface for entering a PIN code, and perform security authentication with the peer device based on the PIN code entered by the user. For example, when a first electronic device is used to scan a graphic code provided by a second electronic device, a trust relationship is established between the first electronic device and the second electronic device.
[0100] Method 3: If the first electronic device and the second electronic device communicate multiple times, such as sending and receiving files multiple times, the first electronic device and the second electronic device may establish a trust relationship, and the trust relationship has a validity period. Once the validity period expires, the first electronic device and the second electronic device no longer trust each other.
[0101] Mode 4: The first electronic device and the second electronic device perform device authentication based on the device master key through device-to-device interaction, and a trust relationship can be established if the authentication is successful. Optionally, this process can occur in the device discovery phase.
[0102] After the first electronic device and the second electronic device establish a trust relationship, the first electronic device and the second electronic device may send heartbeat messages (a broadcast message) to each other at a set period to maintain the online status of the devices.
[0103] Step 602: The first electronic device generates confidential information according to the device master key and the first information.
[0104] The confidential information is used to establish a Wi-Fi point-to-point connection during the association phase. For specific implementation methods, please refer to step 606.
[0105] Optionally, the confidential information may include information such as a pre-shared key (PSK) and / or SSID. Since information such as PSK and SSID has a great impact on the security of Wi-Fi point-to-point connection, once leaked, it will cause security risks to Wi-Fi point-to-point connection, so this information is referred to as confidential information. Correspondingly, in the embodiment of the present application, other information used for Wi-Fi point-to-point connection is collectively referred to as second information. Exemplarily, the second information may include one or more of the following: Wi-Fi point-to-point connection status information of the electronic device, device role information of the electronic device, station (STA) channel information of the electronic device, a list of channels supported by the electronic device, dual-band dual-transmission capability information of the electronic device, address network segment of the electronic device, IP address of the electronic device, type of electronic device, power of the electronic device, etc. It can be understood that the above only exemplarily lists some second information, and the embodiment of the present application does not limit the type and quantity of the second information.
[0106] The device master key is a device-level key and is shared by the first electronic device and the second electronic device. That is, the device master key is stored in both the first electronic device and the second electronic device.
[0107] Optionally, the device master key used to generate confidential information is the device master key of the group manager device (GO device). Regardless of whether the first electronic device or the second electronic device is used as the GO device, the peer device stores the device master key of the GO device. The device master key described below in the embodiment of the present application refers to the device master key of the GO device.
[0108] Optionally, the first information used to generate confidential information may include time information and / or connection times.
[0109] In a possible implementation, the method for generating PSK may include: executing a first encryption algorithm according to the device master key and the first information to obtain a first string; intercepting the first string according to the length of the PSK to obtain a first random number, for example, intercepting from the first character of the first string, or intercepting from other positions of the first string; generating PSK according to the first random number. Exemplarily, taking the first encryption algorithm as a time-based one-time encryption algorithm (Time-Based One-Time Password Algorithm) as an example, the first random number may be generated based on the following formula, and then the PSK may be generated according to the first random number using a predetermined algorithm. The PSK may be a combination of letters and numbers, and the embodiment of the present application does not limit the algorithm.
[0110] In a possible implementation, the SSID generation method may include: executing a first encryption algorithm according to a device master key and first information to obtain a first string; intercepting the first string according to the length of the SSID to obtain a second random number, for example, intercepting from the first character of the first string, or intercepting from other positions of the first string; generating the SSID according to the second random number. Exemplarily, taking the first encryption algorithm as a time-based one-time encryption algorithm (Time-Based One-Time Password Algorithm) as an example, the second random number may be generated based on the following formula, and then the SSID may be generated using a predetermined algorithm based on the second random number. The SSID may be a combination of letters and numbers, and the present application embodiment does not limit the algorithm. The algorithm formula of the second random number is similar to the algorithm formula of the first random number.
[0111] Based on Figure 3 In the system architecture shown, in step 602, the soft bus of the first electronic device generates a first random number and a second random number according to the above method, and sends the first random number and the second random number to the middleware WPA-supplicant; WPA-supplicant generates a PSK according to the first random number and generates an SSID according to the second random number.
[0112] In an embodiment of the present application, when the GO / GC role is directly specified using the service after the device is discovered, the first electronic device can directly determine the GO device and use the device master key of the GO device stored on the first electronic device to generate confidential information. If the GO / GC role needs to be determined through negotiation, then the first electronic device cannot determine which device is the GO device at this time. The first electronic device can generate confidential information based on the device master key of the first electronic device and generate confidential information based on the device master key of the second electronic device. After the GO device is subsequently negotiated with the second electronic device, only the confidential information generated based on the device master key of the GO device is used to establish a Wi-Fi point-to-point connection.
[0113] Step 603: The first electronic device sends a first broadcast message, where the first broadcast message is used to notify the second electronic device to establish a Wi-Fi point-to-point connection with the first electronic device. Correspondingly, the second electronic device receives the first broadcast message.
[0114] The first electronic device may send second information that may be used for establishing a Wi-Fi point-to-point connection to the second electronic device through a first broadcast message.
[0115] In one possible implementation, the first broadcast message includes the Wi-Fi point-to-point connection status information of the first electronic device. Taking Wi-Fi P2P connection as an example, due to the limitation of the "Wi-Fi DIRECT" standard protocol, Wi-Fi P2P connection can only occur between a GO device and a GC device, and there is a limitation that one GO device can connect to a limited number of GC devices at most, and one GC device can only connect to one GO device. Therefore, before initiating the Wi-Fi P2P connection, the Wi-Fi P2P connection status of the first electronic device and the second electronic device will affect this Wi-Fi P2P connection. Optionally, the Wi-Fi point-to-point connection status information of the first electronic device may include one of the following: the first electronic device currently has no Wi-Fi point-to-point connection with any device, the first electronic device currently has a Wi-Fi point-to-point connection with other electronic devices and the role of the first electronic device is GO, and the first electronic device currently has a Wi-Fi point-to-point connection with other electronic devices and the role of the first electronic device is GC.
[0116] In another possible implementation manner, the first broadcast message includes device role information of the first electronic device. For example, the information may be device role indication information, which is used to indicate the device role of the first electronic device.
[0117] In another possible implementation, the first broadcast message includes a list of Wi-Fi point-to-point channels supported by the first electronic device, and the second electronic device can select a channel from the channel list based on a channel preference strategy, so that the first electronic device and the second electronic device establish a Wi-Fi point-to-point connection on the channel to ensure the performance and channel quality of the Wi-Fi point-to-point connection. The channel list may include a channel number. Optionally, the channel list may occupy 24 bits.
[0118] In another possible implementation, the first broadcast message includes the station (STA) channel indication information of the first electronic device, such as the channel number. The second electronic device can select the channel based on the STA channel of the first electronic device and the Wi-Fi point-to-point channel list to avoid frequent switching between the STA channel and the channel where the Wi-Fi point-to-point connection is located when the quality of the selected channel deteriorates. Since the Wi-Fi chip of the terminal device basically supports the coexistence of Wi-Fi stations and Wi-Fi P2P roles. Among them, the Wi-Fi station role can be understood as the terminal device establishing a Wi-Fi connection by connecting to a router (Wi-Fi hotspot / AP), and the Wi-Fi P2P role can be understood as the terminal device directly connecting to another device without a router. When the Wi-Fi station connection and Wi-Fi P2P connection of a terminal device are in the same frequency band but not the same channel, the same frequency and different channels will occur, thereby affecting the performance of the Wi-Fi station connection and Wi-Fi P2P. Therefore, the status of the Wi-Fi station of the terminal device will also affect the Wi-Fi P2P connection. The status of the Wi-Fi station can be reflected by the frequency of the AP to which the terminal device is connected.
[0119] In another possible implementation, the first broadcast message includes dual-band dual-transmission capability information of the first electronic device. According to the number of frequency bands and concurrency methods supported by the router, the dual-band dual-transmission capabilities that the electronic device can support may include the following types:
[0120] Single band single concurrent (SBSC): supports sending and receiving signals on only one frequency band;
[0121] Dual band single concurrent (DBSC): supports two frequency bands, but only supports single transmission. It does not support concurrent signal transmission on two frequency bands.
[0122] Dual band dual concurrent (DBDC): supports two frequency bands and supports sending signals on these two frequency bands concurrently;
[0123] Dual band adaptive concurrent (DBAC): Supports two frequency bands and supports adaptive switching between the two frequency bands. The Wi-Fi chip in electronic devices with this capability integrates two complete channels.
[0124] The Wi-Fi chips in electronic devices generally support two frequency bands, 2.4 GHz and 5 GHz. Correspondingly, the dual-band dual-transmit capability of electronic devices is either DBDC or DBAC.
[0125] The first electronic device sends the dual-band dual-transmission capability it supports to the second electronic device, so that the second electronic device can determine the dual-band working mode of the second electronic device according to the dual-band dual-transmission capability of the first electronic device. For example, if the first electronic device and the second electronic device both support DBDC, the second electronic device can work in a simultaneous dual-band (SDB) mode. SDB can also be called Dual-band concurrent (5GHz / 2.4GHz), which is a dual-band working mode. An electronic device working in this mode can simultaneously generate two independent wireless networks, corresponding to the 2.4GHz and 5GHz frequency bands, respectively. These two independent wireless networks can use different SSIDs or the same SSID. The two networks are independently operated and can perform data transmission concurrently. For another example, if the first electronic device and the second electronic device both support DBAC, the second electronic device can work in a synchronous dual-band (real simultaneous dual band, RSDB) mode, which involves switching between different channels. The efficiency of its switching directly affects the service performance.
[0126] In another possible implementation, the first broadcast message includes the address network segment of the first electronic device, the power level of the first electronic device, the type of the first electronic device, etc.
[0127] In another possible implementation manner, the first broadcast message includes the IP address of the first electronic device.
[0128] It can be understood that the first broadcast message may include one or more of the above information.
[0129] It is understandable that if part of the above information (such as the battery level of the device, the type of the device, etc.) has been exchanged in the device discovery phase, it may not be necessary to include it in the first broadcast message to save signaling overhead.
[0130] After receiving the first broadcast message, the second electronic device determines the group manager (GO). The second electronic device may determine the GO in one of the following ways:
[0131] Mode 1: The GO / GC role is pre-designated, for example, the second electronic device is pre-designated as a GO device.
[0132] Mode 2: The second electronic device determines the GO device according to the device role information sent by the first electronic device. For example, if the device role sent by the first electronic device indicates that the first electronic device is a GC device, the second electronic device determines itself as a GO device.
[0133] As mentioned above, the device role information of the first electronic device may be sent to the second electronic device during the device discovery process, and / or may be sent to the second electronic device via a first broadcast message.
[0134] Method 3: The second electronic device determines the GO device based on the power of the first electronic device and the second electronic device. For example, if the remaining power of the second electronic device is large, the second electronic device determines that the first electronic device is the GO device. This is because the GO device needs to assume the function of AP (access point) and group management tasks, which will generate certain power consumption, so more power is needed to ensure its operation.
[0135] As mentioned above, the power information of the first electronic device may be sent to the second electronic device during the device discovery process, and / or sent to the second electronic device via a first broadcast message.
[0136] Mode 4: The second electronic device determines the GO device according to the device types of the first electronic device and the second electronic device. For example, if the second electronic device determines that the first electronic device is a high resource consumption type electronic device according to the types of the first electronic device and the second electronic device, the second electronic device determines that the first electronic device is a GO device. For example, a large-screen device is a high resource consumption type device compared to a mobile phone.
[0137] Mode 5: The second electronic device determines the GO device according to the STA channels used by the first electronic device and the second electronic device. For example, if the second electronic device determines that the STA channel of the first electronic device is connected to a station according to the STA channels of the first electronic device and the second electronic device, the second electronic device determines that the first electronic device is a GO device.
[0138] Mode 6: The second electronic device determines the GO device according to the IP addresses of the first electronic device and the second electronic device. For example, if the IP address of the second electronic device is greater than the IP address of the first electronic device, the second electronic device is determined to be the GO device.
[0139] It is understood that the above are only exemplary methods for determining the GO role, and the application embodiment does not limit this. It is understood that the above methods can also be used in combination.
[0140] In an embodiment of the present application, the first electronic device may send the first broadcast message via BLE / BR broadcast, or send the first broadcast message via constrained application protocol (CoAP) broadcast, or send the first broadcast message via a local area network, or send the first broadcast message via near field communication, or notify through a simple single-point interaction, which is not limited by the embodiment of the present application.
[0141] The first broadcast message may include indication information for indicating the second electronic device, so that the second electronic device receives the first broadcast message and performs corresponding processing. Optionally, the indication information of the second electronic device may include information that can be used to identify the second electronic device, such as the device name and / or MAC address of the second electronic device.
[0142] Step 604: The second electronic device sends a second broadcast message based on the first broadcast message. This step is optional and is indicated by a dotted line in the figure.
[0143] The second electronic device may send second information that may be used for establishing a Wi-Fi point-to-point connection to the first electronic device through a second broadcast message.
[0144] In a possible implementation, the second broadcast message includes the Wi-Fi point-to-point connection status information of the second electronic device. The Wi-Fi point-to-point connection status information of the second electronic device may include one of the following: the second electronic device currently has no Wi-Fi point-to-point connection with any device, the second electronic device currently has a Wi-Fi point-to-point connection with other electronic devices and the role of the second electronic device is GO, and the second electronic device currently has a Wi-Fi point-to-point connection with other electronic devices and the role of the second electronic device is GC.
[0145] In another possible implementation manner, the second broadcast message includes device role information of the second electronic device. For example, the information may be device role indication information, which is used to indicate the device role of the second electronic device.
[0146] In another possible implementation manner, the second broadcast message includes STA (station) channel indication information of the second electronic device, such as the channel number.
[0147] In another possible implementation, the second broadcast message includes channel indication information, such as a channel number, and the channel is selected by the second electronic device from a list of channels supported by the received first electronic device based on a channel preference strategy.
[0148] In another possible implementation, the second broadcast message includes dual-band dual-transmission capability information of the second electronic device. For relevant content about the dual-band dual-transmission capability, refer to the above.
[0149] In another possible implementation, the second broadcast message includes the address network segment of the second electronic device, the power level of the second electronic device, the type of the second electronic device, etc.
[0150] In another possible implementation manner, the second broadcast message includes the IP address of the second electronic device.
[0151] It can be understood that the second broadcast message may include one or more of the above information.
[0152] It is understandable that if part of the above information (such as the battery level of the device, the type of the device, etc.) has been exchanged in the device discovery phase, it may not be necessary to include it in the second broadcast message to save signaling overhead.
[0153] In a possible implementation, if the second electronic device determines that it is a GC, the second electronic device notifies the first electronic device that it is a GO through a second broadcast message, for example, the second broadcast message includes indication information, and the indication information indicates that the first electronic device is a GO. Further, the second electronic device carries one or more of the above-mentioned second information in the second broadcast message and sends it to the first electronic device. If the second electronic device determines that it is a GO, the second electronic device may send the second broadcast message or may not send the second broadcast message. If the second electronic device does not send the second broadcast message, the above-mentioned second information of the second electronic device may be sent to the first electronic device in a subsequent step 606.
[0154] In an embodiment of the present application, the second electronic device may send the second broadcast message via BLE / BR broadcast, or send the first broadcast message via CoAP broadcast, or send the second broadcast message via a local area network, or send the second broadcast message via near field communication, or notify through a simple single-point interaction, which is not limited to the embodiments of the present application.
[0155] The second broadcast message may include indication information for indicating the first electronic device, so that the first electronic device receives the second broadcast message and performs corresponding processing. Optionally, the indication information of the first electronic device may include information such as the device name and / or MAC address of the first electronic device that can be used to identify the first electronic device.
[0156] Step 605: The second electronic device generates confidential information according to the device master key and the first information, and the confidential information is used in the Wi-Fi point-to-point connection establishment process.
[0157] The second electronic device generates confidential information in the same manner as the first electronic device.
[0158] Since the first electronic device and the second electronic device store each other's device master key, that is, the first electronic device and the second electronic device can both obtain the device master key of the GO device, the first electronic device and the second electronic device can generate confidential information based on the number of connections, which can ensure that the number of connections used by the first electronic device and the second electronic device to generate confidential information is the same, the number of connections for performing Wi-Fi point-to-point connections stored in the first electronic device and the second electronic device is the same, and the first electronic device and the second electronic device use the same algorithm to generate confidential information, so it can be ensured that the confidential information generated by the first electronic device and the second electronic device is the same, such as generating the same PSK and SSID.
[0159] Step 606: A Wi-Fi point-to-point connection is established between the first electronic device and the second electronic device.
[0160] In this step, the first electronic device and the second electronic device establish a Wi-Fi point-to-point connection based on confidential information (such as PSD and SSID) and second information of the first electronic device and second information of the second electronic device, respectively.
[0161] It can be understood that in step 606, the first electronic device and the second electronic device complete the process of establishing the Wi-Fi point-to-point connection by exchanging multiple messages.
[0162] In one possible way, the GO device first sends a Wi-Fi point-to-point connection establishment request to the other end, and then the Wi-Fi point-to-point connection establishment process can be completed through a four-way handshake process. An implementation method of the Wi-Fi point-to-point connection establishment process can refer to the Wi-Fi DIRECT protocol, which is not limited in the embodiments of the present application.
[0163] In another possible way, the second electronic device confirms itself as a GO device and directly establishes a Wi-Fi point-to-point connection with the first electronic device. Specifically, after receiving the first broadcast message, the second electronic device determines the Wi-Fi point-to-point connection mode according to the generated confidential information (such as PSK, SSID, etc.), the second information of the first electronic device, and the second information of the second electronic device. For example, it can determine which frequency the GO device is finally established on according to the Wi-Fi station channel of the first electronic device, the list of supported channels, whether broadband is supported, and other information, and create a Wi-Fi point-to-point group. The second electronic device sends a Wi-Fi point-to-point connection establishment request to the first electronic device, and the Wi-Fi point-to-point connection establishment request may include: the frequency of the Wi-Fi point-to-point group establishment, the GC device and the GO device role allocation, the SSID of the Wi-Fi point-to-point group, the MAC address or IP address of the first electronic device, and the port number, etc. The first electronic device creates a Wi-Fi point-to-point group according to the received Wi-Fi point-to-point connection establishment request. After a Wi-Fi point-to-point group is created on the first electronic device and the second electronic device, the application on the first electronic device establishes a transmission channel based on the Wi-Fi point-to-point connection with the application on the second electronic device, and the application on the first electronic device begins to transmit data to the application on the second electronic device based on the transmission channel of the Wi-Fi point-to-point connection.
[0164] It can be understood that in the embodiment of the present application, there is no restriction on the order of execution of step 604 and step 605. Step 604 can be executed before step 605, or after step 605, or at the same time as step 605. In other words, the second electronic device sends the second broadcast message before the second electronic device generates confidential information, or after the second electronic device generates confidential information, or at the same time as the second electronic device generates confidential information, and the embodiment of the present application does not limit it.
[0165] In a possible implementation, in the above Figure 6 In step 603 of the first broadcast message, the first verification code generated by the first electronic device is included in the first broadcast message; after receiving the first broadcast message, the second electronic device generates a second verification code, compares the first verification code with the second verification code, and if the first verification code is the same as the second verification code, the verification is successful, indicating that the first electronic device is a trusted device, and performs subsequent processing operations, such as replying to the second broadcast message, creating a GO, generating confidential information, etc.; if the verification fails, the second electronic device can automatically fall back to Figure 5In the process shown, for example, the second electronic device requests the first electronic device to establish a Bluetooth connection. After the Bluetooth connection between the first electronic device and the second electronic device is established, the second information is exchanged and the confidential information is transmitted through the Bluetooth connection.
[0166] Optionally, the method for the first electronic device to generate the first verification code is: executing a first encryption algorithm according to the device master key and the number of connections to obtain a first random number; intercepting the first random number according to a set length (for example, 4 bytes) to obtain a first verification code. The second electronic device generates a second verification code using the same method. Optionally, the first encryption algorithm is the same as the encryption algorithm for generating confidential information, thereby reducing the complexity of the solution.
[0167] Since the first electronic device and the second electronic device store the DEVMKey of the GO device, and only the first electronic device and the second electronic device know the current number of connections, it can be ensured that the verification codes calculated by both parties are the same under a trusted situation. If the verification codes calculated by both parties are different, it indicates that they are untrustworthy. Since the hash operation result is irreversible, it is impossible to obtain the calculation result before the hash operation, thereby preventing attacks and counterfeiting and improving security. In other cases, even if an untrusted electronic device can obtain the encrypted information, it cannot obtain the device master key DEVMKey, and it cannot infer the number of connections, and it cannot calculate a reliable verification code, so it can prevent attacks and counterfeiting. In another case, even if an untrusted electronic device can obtain the number of connections, it cannot obtain the DEVMKey, and it cannot calculate a reliable verification code, so it can prevent attacks and counterfeiting and improve security.
[0168] In some embodiments of the present application, in step 603, after the second electronic device receives the first broadcast message, it can determine whether the first electronic device is online. If the first electronic device is online, it can perform subsequent processing operations, such as comparing verification codes, etc.; if the first electronic device is not online, the request of the first electronic device to establish a Wi-Fi point-to-point connection can be rejected. In the device discovery phase, after the first electronic device and the second electronic device are authenticated, they can send heartbeat messages (a broadcast message) to each other according to a set period to keep the devices online. A device list for recording surrounding online devices can be saved in the electronic device. Once a heartbeat message sent by a device is not received within a set time length, it can be considered that the device is no longer online, thereby deleting the device from the device list. In this embodiment, after the second electronic device receives the first broadcast message, if the second electronic device determines that the first electronic device is not in the device list of surrounding online devices saved by the second electronic device, it can be considered that the first electronic device is not online, and then the Wi-Fi point-to-point connection request of the first electronic device can be rejected.
[0169] In some embodiments of the present application, device discovery may be performed first before step 601. In the device discovery phase, some second information for Wi-Fi point-to-point connection may be exchanged between devices for use in subsequent steps. For example, the second information may include device name, media access control (MAC) address, device account information, device Bluetooth and Wi-Fi switch status information, device power, device type, and other information.
[0170] The embodiments of the present application can utilize a variety of discovery means (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, USB discovery, near field communication (NFC), etc.) to perform device discovery, thereby improving versatility. Exemplarily, if a LAN discovery means is used for device discovery, the first electronic device and the second electronic device can exchange information through a router; if a broadcast discovery means is used for device discovery, the first electronic device and the second electronic device can exchange information through a broadcast method (for example: BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.). An example of a specific implementation method of the device discovery phase can be referenced. Fig. 9 The relevant steps in .
[0171] In the above implementation, since no signaling connection such as a Bluetooth connection is established in the process of establishing a Wi-Fi point-to-point connection between the first electronic device and the second electronic device, the Wi-Fi point-to-point channel is quickly negotiated based on BLE broadcast or other broadcast methods or simple single-point interactive notifications, and the existing trusted key (such as the device master key) is used to quickly calculate the PSK and other information required for the Wi-Fi point-to-point connection, thereby eliminating the overhead of transmitting the PSK through signaling channels such as Bluetooth. Therefore, compared with the implementation method based on the need to establish a signaling connection and transmit confidential information and second information used for establishing a Wi-Fi point-to-point connection based on the signaling connection, the above implementation method of the embodiment of the present application can reduce the delay in establishing a signaling connection and exchanging information based on the signaling connection, thereby reducing the delay in establishing a Wi-Fi point-to-point connection, and can realize distributed services to quickly establish Wi-Fi point-to-point through broadcasting.
[0172] The following will Figure 6 The implementation process of the process shown in the figure in a specific application scenario is used as an example to illustrate the embodiment of the present application. The application scenario is: based on Figure 1 In the architecture shown in FIG. 1 , a user operates on a mobile phone 11 (a first electronic device) to share files with a large-screen device 13 (a second electronic device). For the signaling interaction process between the mobile phone and the large-screen device, please refer to FIG. Fig. 9 .
[0173] like Fig. 9 As shown, the process may include the following steps:
[0174] Step 901: The soft bus of the mobile phone sends an authentication request to the communication interface of the electronic device, and the authentication request includes the DEVMKey and account information of the mobile phone. Furthermore, the authentication request may also include information such as the MAC address of the mobile phone.
[0175] In this step, illustratively, for electronic devices that support the HiChain protocol, their communication interface can be a HiChain interface. The HiChain mechanism is a protocol mechanism for OpenHarmony to achieve device interconnection security.
[0176] Step 902: The communication interface of the mobile phone sends the DEVMKey and other information of the mobile phone, and the information is received by the large-screen device.
[0177] Optionally, the DEVMKey and account information of the mobile phone are encrypted, and the key used is a key shared by the first electronic device and the second electronic device.
[0178] Optionally, the mobile phone may send a broadcast message, which includes the DEVMKey and account information of the mobile phone. Optionally, the broadcast message may be a low-power Bluetooth broadcast message.
[0179] Step 903: The communication interface of the large-screen device sends the DEVMKey and other information of the mobile phone to the soft bus of the large-screen device through an authentication request.
[0180] Step 904: The soft bus of the large-screen device sends the DEVMKey and account information of the large-screen device to the communication interface. Furthermore, the information may also include the MAC address of the large-screen device and other information.
[0181] Step 905: The communication module of the large-screen device sends the DEVMKey and other information of the large-screen device, and the information is received by the mobile phone.
[0182] Optionally, the DEVMKey and account information of the large-screen device are encrypted, and the key used is a key shared by the first electronic device and the second electronic device.
[0183] Optionally, the large-screen device may send a broadcast message, which includes information such as the DEVMKey of the large-screen device. Optionally, the broadcast message may be a low-power Bluetooth broadcast message.
[0184] Step 906: The communication interface of the mobile phone sends the DEVMKey and other information of the large-screen device to the soft bus of the mobile phone.
[0185] Steps 907a and 907b: The soft bus of the mobile phone authenticates the large-screen device, adds the large-screen device to the list of trusted devices, and saves the DEVMKey and other information of the large-screen device after successful authentication; the soft bus of the large-screen device authenticates the mobile phone, and after successful authentication, adds the mobile phone to the list of optional devices, and saves the DEVMKey and other information of the mobile phone.
[0186] Optionally, if the account information of the large-screen device is equal to the account information of the mobile phone, the mobile phone successfully authenticates the large-screen device; if the account information of the mobile phone is equal to the account information of the large-screen device, the large-screen device successfully authenticates the mobile phone.
[0187] Steps 908a and 908b: The mobile phone and the large-screen device are online respectively.
[0188] At this point, device authentication is completed in the device discovery process. Furthermore, mobile phones and large-screen devices also obtain information such as the MAC address of the peer device.
[0189] Step 909: In response to the user operation of requesting to share files with the large screen, the application on the mobile phone sends a service request to the soft bus of the mobile phone, and the soft bus triggers the middleware according to the service request. The user interface related to the operation of requesting to share files with the large screen device can be referred to Figure 7 .
[0190] Step 910: The middleware in the mobile phone generates confidential information based on the DEVMKey of the first electronic device and the first information, such as PSK and SSID. The specific generation method is referred to in the above embodiment.
[0191] Step 911: the middleware in the mobile phone requests the soft bus to be transmitted across devices.
[0192] Step 912: The soft bus in the mobile phone sends a first broadcast message, and the first broadcast message is received by the large-screen device.
[0193] Optionally, the first broadcast message includes the MAC address of the large-screen device. The first broadcast message is used to trigger the large-screen device to generate confidential information and establish a Wi-Fi point-to-point connection.
[0194] Optionally, the first broadcast message includes second information of the mobile phone.
[0195] Optionally, the first broadcast message may also include a first verification code generated by the mobile phone.
[0196] The specific implementation of this step can refer to the above embodiment.
[0197] Step 913: The soft bus in the large-screen device notifies the middleware in the large-screen device to generate confidential information, such as PSK and SSID. The specific generation method is described in the above embodiment.
[0198] Optionally, if the first broadcast message includes a first verification code, the large-screen device also generates a second verification code and compares whether the first verification code and the second verification code are the same. If the first verification code and the second verification code are the same, the verification is successful, and then the confidential information is generated. The specific implementation method refers to the above embodiment.
[0199] Step 914: The middleware on the large-screen device generates confidential information, such as PSK and SSID, based on the DEVMKey of the GO device and the first information. The confidential information generated by the large-screen device is the same as the confidential information generated by the mobile phone.
[0200] Step 915: The large-screen device sends a Wi-Fi point-to-point connection establishment request to the mobile phone.
[0201] Optionally, the Wi-Fi point-to-point connection establishment request includes second information of the large-screen device.
[0202] Optionally, the large-screen device can send a Wi-Fi point-to-point connection establishment request through a broadcast method such as BLE broadcast, BR broadcast, or Wi-Fi broadcast.
[0203] Step 916: Establish a Wi-Fi point-to-point connection between the mobile phone and the large-screen device.
[0204] In the above process, in a possible implementation of steps 915 to 916, after the large-screen device receives the first broadcast message, it determines the Wi-Fi point-to-point connection mode based on the generated confidential information (such as PSK, SSID, etc.), the second information of the mobile phone, and the second information of the device. For example, it can determine which frequency the GO device is finally established on based on the mobile phone's Wi-Fi station channel, the supported channel list, whether broadband is supported, and other information, and create a Wi-Fi point-to-point group. The large-screen device sends a Wi-Fi point-to-point connection establishment request to the mobile phone, and the Wi-Fi point-to-point connection establishment request may include: the frequency of the Wi-Fi point-to-point group establishment, the role allocation of the GC device and the GO device, the SSID of the Wi-Fi point-to-point group, the MAC address or IP address of the mobile phone, and the port number, etc. The mobile phone creates a Wi-Fi point-to-point group based on the received Wi-Fi point-to-point connection establishment request. After creating a Wi-Fi point-to-point group on the mobile phone and the large-screen device, the application on the mobile phone and the application on the large-screen device establish a transmission channel based on the Wi-Fi point-to-point connection. The application on the mobile phone starts sharing files with the application on the large-screen device based on the transmission channel of the Wi-Fi point-to-point connection.
[0205] It is understandable that in order to implement the functions in the above embodiments, the communication device includes hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0206] Fig.10 The following is a schematic diagram of the structure of possible communication devices provided in the embodiments of the present application. These communication devices can be used to implement the functions of the terminal device or network device in the above method embodiments, and thus can also achieve the beneficial effects of the above method embodiments. In the embodiments of the present application, the communication device can be as follows: Figure 1 The mobile phone 11, tablet computer 12, one of the large-screen devices 13, or other electronic devices shown may also be a module (such as a chip) applied to the above electronic devices.
[0207] like Fig.10 As shown, the communication device 1000 includes a processing unit 1010 and a transceiver unit 1020. The communication device 1000 is used to implement the above Figure 6 or Fig. 9 The functions of the electronic device in the method embodiment shown in FIG.
[0208] When the communication device 1000 is used to implement Figure 6 When the function of the first electronic device in the method embodiment shown is: the processing unit 1010 determines to establish a Wi-Fi point-to-point connection with the second electronic device, generates confidential information based on the device master key and the first information, and sends a first broadcast message through the transceiver unit 1020; wherein the confidential information is used to establish a Wi-Fi point-to-point connection, the first information includes time information and / or the number of connections to establish a Wi-Fi point-to-point connection between the first electronic device and the second electronic device, and the first broadcast message is used to notify the second electronic device to establish a Wi-Fi point-to-point connection with the first electronic device. The transceiver unit 1020 receives the second information of the second electronic device, and the second information is used to establish a Wi-Fi point-to-point connection. The processing unit 1010 establishes a Wi-Fi point-to-point connection with the second electronic device based on the confidential information and the second information of the first electronic device and the second information of the second electronic device.
[0209] When the communication device 1000 is used to implement Figure 6When the function of the second electronic device in the method embodiment shown is: the transceiver unit 1020 receives a first broadcast message, where the first broadcast message is used to notify the second electronic device to establish a Wi-Fi point-to-point connection with the first electronic device, and the first broadcast message includes second information of the first electronic device, and the second information is used to establish the Wi-Fi point-to-point connection; the processing unit 1010 generates confidential information according to the device master key and the first information, where the confidential information is used to establish the Wi-Fi point-to-point connection, and the first information includes time information and / or the number of connections to establish the Wi-Fi point-to-point connection between the first electronic device and the second electronic device; the processing unit 1010 establishes a Wi-Fi point-to-point connection with the first electronic device according to the confidential information, the second information of the second electronic device, and the second information of the first electronic device.
[0210] For a more detailed description of the processing unit 1010 and the transceiver unit 1020, please refer to Figure 6 or Fig. 9 The relevant description in the method embodiment shown is directly obtained and will not be repeated here.
[0211] The method steps in the embodiments of the present application can be implemented in hardware or in software instructions that can be executed by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory, flash memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, register, hard disk, mobile hard disk, CD-ROM or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. The storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a network device or a terminal. The processor and the storage medium can also be present in a network device or a terminal as discrete components.
[0212] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc; it may also be a semiconductor medium, for example, a solid-state hard disk. The computer-readable storage medium may be a volatile or nonvolatile storage medium, or may include both volatile and nonvolatile types of storage media.
[0213] In the various embodiments of the present application, unless otherwise specified or provided in a logical conflict, the terms and / or descriptions between the different embodiments are consistent and may be referenced to each other, and the technical features in the different embodiments may be combined to form new embodiments according to their inherent logical relationships.
[0214] In the present application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In the text description of the present application, the character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula of the present application, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "Including at least one of A, B and C" can mean: including A; including B; including C; including A and B; including A and C; including B and C; including A, B and C.
[0215] It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.
Claims
1. A method for establishing a Wi-Fi point-to-point connection, characterized in that: Applied to a first electronic device, the method includes: Determine to establish a Wi-Fi point-to-point connection with a second electronic device; Generate confidential information according to the device master key and the first information, and send a first broadcast message; wherein the confidential information is used to establish a Wi-Fi point-to-point connection, the first information includes time information and / or the number of connections to establish a Wi-Fi point-to-point connection between the first electronic device and the second electronic device, and the first broadcast message is used to notify the second electronic device to establish a Wi-Fi point-to-point connection with the first electronic device; receiving second information of the second electronic device broadcasted by the second electronic device; A Wi-Fi point-to-point connection is established with the second electronic device according to the confidential information and the second information of the first electronic device and the second information of the second electronic device.
2. The method according to claim 1, characterized in that The first broadcast message includes second information of the first electronic device.
3. The method according to claim 2, characterized in that The second information of the first electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the first electronic device, device role information of the first electronic device, site STA channel information of the first electronic device, a list of channels supported by the first electronic device, dual-band dual-transmit capability information of the first electronic device, an address segment of the first electronic device, an IP address of the first electronic device, a type of the first electronic device, and a power level of the first electronic device.
4. The method according to any one of claims 1 to 3, characterized in that: The second information of the second electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the second electronic device, device role information of the second electronic device, site STA channel information of the second electronic device, indication information of the channel selected by the second electronic device, dual-band dual-transmission capability information of the second electronic device, address segment of the second electronic device, IP address of the second electronic device, type of the second electronic device, and power level of the second electronic device.
5. The method according to any one of claims 1 to 4, characterized in that: The receiving the second information of the second electronic device broadcasted by the second electronic device includes: A second broadcast message sent by the second electronic device is received, where the second broadcast message includes indication information, and the indication information indicates that the first electronic device is a group manager device.
6. The method according to claim 5, characterized in that After receiving the second broadcast message, the method further includes: A Wi-Fi point-to-point connection establishment request is sent to the second electronic device.
7. The method according to any one of claims 1 to 6, characterized in that: The receiving the second information of the second electronic device broadcasted by the second electronic device includes: A Wi-Fi point-to-point connection establishment request is received from the second electronic device, where the Wi-Fi point-to-point connection establishment request includes second information of the second electronic device.
8. The method according to any one of claims 1 to 8, characterized in that The sending of the first broadcast message comprises: Generate a first verification code according to the device master key and the number of connections; A first broadcast message is sent, where the first broadcast message includes the first verification code.
9. The method according to any one of claims 1 to 8, characterized in that The confidential information includes a pre-shared key PSK and a service set identifier SSID.
10. A method for establishing a Wi-Fi point-to-point connection, characterized in that: Applied to a second electronic device, the method includes: receiving a first broadcast message, where the first broadcast message is used to notify a second electronic device to establish a Wi-Fi point-to-point connection with the first electronic device, and the first broadcast message includes second information of the first electronic device; generating confidential information according to the device master key and the first information, where the confidential information is used to establish a Wi-Fi point-to-point connection, where the first information includes time information and / or a number of connections to establish a Wi-Fi point-to-point connection between the first electronic device and the second electronic device; A Wi-Fi point-to-point connection is established with the first electronic device according to the confidential information, the second information of the second electronic device, and the second information of the first electronic device.
11. The method according to claim 10, characterized in that The second information of the first electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the first electronic device, device role information of the first electronic device, site STA channel information of the first electronic device, a list of channels supported by the first electronic device, dual-band dual-transmit capability information of the first electronic device, an address segment of the first electronic device, an IP address of the first electronic device, a type of the first electronic device, and a power level of the first electronic device.
12. The method according to any one of claims 10 to 11, characterized in that: After receiving the first broadcast message, the method further includes: The second information of the second electronic device is broadcasted.
13. The method according to any one of claims 10 to 12, characterized in that: The second information of the second electronic device includes one or more of the following: Wi-Fi point-to-point connection status information of the second electronic device, device role information of the second electronic device, site STA channel information of the second electronic device, indication information of the channel selected by the second electronic device, dual-band dual-transmission capability information of the second electronic device, address segment of the second electronic device, IP address of the second electronic device, type of the second electronic device, and power level of the second electronic device.
14. The method according to any one of claims 12 to 13, characterized in that: The broadcasting the second information of the second electronic device includes: A second broadcast message is sent, where the second broadcast message includes indication information, and the indication information indicates that the first electronic device is a group manager device.
15. The method according to claim 14, characterized in that After sending the second broadcast message, the method further includes: Receive a Wi-Fi point-to-point connection establishment request sent by the first electronic device.
16. The method according to any one of claims 10 to 11, characterized in that: After generating confidential information according to the device master key and the first information, the method further includes: A Wi-Fi point-to-point connection establishment request is sent to the first electronic device, where the Wi-Fi point-to-point connection establishment request includes second information of the second electronic device.
17. The method according to any one of claims 10 to 16, characterized in that: The first broadcast message includes a first verification code generated by the first electronic device; Before generating confidential information according to the device master key and the first information, the method further includes: Generate a second verification code according to the device master key and the number of connections; The first electronic device is authenticated according to the first authentication code and the second authentication code.
18. The method according to any one of claims 10 to 17, characterized in that: The confidential information includes a pre-shared key PSK and a service set identifier SSID.
19. A communication device, characterized in that: The method comprises a unit or a module for executing the method according to any one of claims 1 to 9, or comprises a unit or a module for executing the method according to any one of claims 10 to 18.
20. A communication device, characterized in that: include: One or more processors and one or more memories; wherein the one or more memories store one or more programs, and when the programs are executed by the one or more processors, the device executes the method as described in any one of claims 1-9, or executes the method as described in any one of claims 10-18.
21. A readable storage medium, characterized in that: The method comprises a computer program, which, when executed on a device, causes the device to execute the method according to any one of claims 1 to 9, or to execute the method according to any one of claims 10 to 18.
22. A computer program product, characterized in that When the method is executed on a device, the device is caused to execute the method according to any one of claims 1 to 9, or execute the method according to any one of claims 10 to 18.
23. A chip system, characterized in that: include: processor; When the processor calls and runs the computer program from the memory, the device equipped with the chip system executes the method as described in any one of claims 1 to 9, or executes the method as described in any one of claims 10 to 18.
Citation Information
Cited By
WI-FI peer-to-peer connection establishment method and apparatus
EP4694359A1
Communication method and electronic device
WO2026113457A1