WO2022228207A1 - Method for establishing wi-fi p2p connection, and electronic device - Google Patents

Method for establishing wi-fi p2p connection, and electronic device Download PDF

Info

Publication number
WO2022228207A1
WO2022228207A1 PCT/CN2022/087673 CN2022087673W WO2022228207A1 WO 2022228207 A1 WO2022228207 A1 WO 2022228207A1 CN 2022087673 W CN2022087673 W CN 2022087673W WO 2022228207 A1 WO2022228207 A1 WO 2022228207A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
connection
information
establish
connection information
Prior art date
Application number
PCT/CN2022/087673
Other languages
French (fr)
Chinese (zh)
Inventor
董继阳
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022228207A1 publication Critical patent/WO2022228207A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1042Peer-to-peer [P2P] networks using topology management mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • H04W4/08User group management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • H04W76/16Involving different core network technologies, e.g. a packet-switched [PS] bearer in combination with a circuit-switched [CS] bearer

Definitions

  • the present application relates to the field of communications, and more specifically, to a method and electronic device for establishing a Wi-Fi P2P connection.
  • Wi-Fi direct connection wireless fidelity peer-to-peer, Wi-Fi P2P
  • Wi-Fi P2P wireless fidelity technology
  • Wi-Fi DIRECT An important technology under the "Wi-Fi DIRECT" standard protocol launched by the alliance, Wi-Fi P2P can support two Wi-Fi devices to directly connect and communicate with each other's devices without the intervention of Wi-Fi hotspots .
  • a complete Wi-Fi P2P service includes three stages: Wi-Fi P2P device discovery, Wi-Fi P2P device connection, and Wi-Fi P2P device service data transmission.
  • a P2P group (or also called a Wi-Fi P2P group) is formed after the Wi-Fi P2P device connection is established.
  • the Wi-Fi P2P device connection is established according to the standard Wi-Fi DIRECT protocol.
  • the Wi-Fi P2P device connection takes a long time, which cannot meet the requirements of users to quickly use the Wi-Fi P2P link to transmit business data, and the user experience is poor.
  • the present application provides a method and an electronic device for establishing a Wi-Fi P2P connection.
  • the information required for the Wi-Fi P2P connection is exchanged in advance before the electronic device actually initiates the Wi-Fi P2P connection, so that the user can use the electronic device to use the electronic device.
  • the device actually initiates a Wi-Fi P2P connection most of the information has been exchanged, which further shortens the time-consuming of the Wi-Fi P2P connection and improves the user experience.
  • a method for discovering and connecting an electronic device comprising: a first electronic device acquiring first connection information of a second electronic device, the first connection information is used to establish a Wi-Fi P2P connection, the first The operation is used to instruct to establish a Wi-Fi P2P connection with the second electronic device and the first electronic device receives the first operation; the first electronic device responds to the first operation and establishes Wi-Fi P2P with the second electronic device according to the first connection information connect.
  • the second electronic device is Wi-Fi P2P connected
  • the first connection information required for the connection is exchanged in advance before the first electronic device and the second electronic device establish a Wi-Fi P2P connection, so that when the user uses the electronic device to actually initiate a Wi-Fi P2P connection, most of the information has been After the interaction is completed, it is only necessary to send some simple signaling to complete the Wi-Fi P2P connection, thereby further shortening the time-consuming of the Wi-Fi P2P connection and improving the user experience.
  • the first connection information includes: inherent information used by the second electronic device to establish a Wi-Fi P2P connection and/or available information used by the second electronic device to establish a Wi-Fi P2P connection change information.
  • the inherent information used by the second electronic device to establish a Wi-Fi P2P connection includes: a list of channels supported by the second electronic device, and the SSID of the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group. , PWD of the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group, whether the second electronic device supports Wi-Fi P2P connection, whether the second electronic device supports broadband, and the device information of the second electronic device at least one of.
  • variable information used by the second electronic device to establish a Wi-Fi P2P connection includes: a Wi-Fi P2P connection status of the second electronic device and/or a frequency of a Wi-Fi hotspot to which the second electronic device is connected.
  • the method further includes: establishing a first connection between the first electronic device and the second electronic device; and acquiring the first electronic device in the Wi-Fi P2P connection of the second electronic device by the first electronic device
  • the connection information includes: the first electronic device receives the first connection information sent by the second electronic device through the first connection.
  • the first connection includes: any one of a Bluetooth connection, a Wi-Fi connection, an NFC connection, a Zigbee connection, a USB connection, and the like.
  • various discovery methods such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.
  • BLE discovery BLE discovery
  • LAN discovery Wi-Fi P2P discovery
  • Wi-Fi P2P discovery broadcast discovery
  • it supports the use of different types of connection methods or broadcast methods to exchange information, which improves the efficiency of information exchange, and improves the versatility and scalability.
  • acquiring the first connection information of the second electronic device by the first electronic device includes: the first electronic device receives the first connection sent by the second electronic device through the first broadcast message information.
  • the first broadcast packet may include a packet broadcast through BLE, BR, Wi-Fi, or the like.
  • variable information used by the second electronic device to establish a Wi-Fi P2P connection and the inherent information used by the second electronic device to establish a Wi-Fi P2P connection can be respectively sent to the first electronic device by using different signaling, The same signaling can also be used to send to the first electronic device.
  • the timing at which the second electronic device sends the variable information used by the second electronic device to establish the Wi-Fi P2P connection may be periodically sent, or may be sent at the second electronic device It can be sent when the device and the first electronic device actually establish a Wi-Fi P2P connection, and can be sent before the second electronic device and the first electronic device actually establish a Wi-Fi P2P connection, or, when the second electronic device is used to establish Wi-Fi -After the variable information of the Fi P2P connection is changed, it is sent after a period of time, or, it is sent immediately after the variable information used by the second electronic device to establish the Wi-Fi P2P connection changes.
  • the timing at which the second electronic device sends the variable information used by the second electronic device to establish a Wi-Fi P2P connection to the first electronic device may be sent to the first electronic device It can be performed before the inherent information for establishing a Wi-Fi P2P connection, or after sending the inherent information for establishing a Wi-Fi P2P connection, or it can be performed at the same time as sending the inherent information for establishing a Wi-Fi P2P connection. .
  • the method further includes: the first electronic device sends second connection information of the first electronic device to the second electronic device; the second connection information is used to establish a Wi-Fi P2P connection,
  • the second connection information includes: inherent information used by the first electronic device to establish a Wi-Fi P2P connection and/or variable information used by the first electronic device to establish a Wi-Fi P2P connection.
  • the information required for the first electronic device to perform a Wi-Fi P2P connection is sent to the second electronic device in advance before the electronic device, thereby realizing that the information required for the Wi-Fi P2P connection is actually initiated by the electronic device
  • the Wi-Fi P2P connection is exchanged in advance, thereby shortening the time-consuming of the Wi-Fi P2P connection and improving the user experience.
  • sending the second connection information of the first electronic device by the first electronic device to the second electronic device includes: the first electronic device sends the second electronic device to the second electronic device through the first broadcast message Send the second connection information of the first electronic device.
  • the first broadcast packet may include a packet broadcast through BLE, BR, Wi-Fi, or the like.
  • sending the second connection information of the first electronic device by the first electronic device to the second electronic device includes: the first electronic device sends the first electronic device to the second electronic device through the first connection Second connection information of an electronic device.
  • variable information used by the first electronic device to establish a Wi-Fi P2P connection and the inherent information used by the first electronic device to establish a Wi-Fi P2P connection can be respectively sent to the second electronic device by using different signaling, The same signaling can also be used to send to the second electronic device.
  • the timing at which the first electronic device sends the variable information used by the first electronic device to establish the Wi-Fi P2P connection to the second electronic device may be sent periodically, or, It can be sent during the process of establishing a Wi-Fi P2P connection between the first electronic device and the second electronic device, or, after the variable information used by the first electronic device to establish a Wi-Fi P2P connection changes, after a period of time Send, or send immediately after the variable information used by the first electronic device to establish the Wi-Fi P2P connection changes.
  • the timing of the variable information in the Wi-Fi P2P connection sent by the first electronic device to the second electronic device may be when the first electronic device sends the first electronic device to the second electronic device for establishing Wi-Fi It can be performed before the inherent information of the P2P connection, or after the first electronic device sends the inherent information of the first electronic device to establish the Wi-Fi P2P connection to the second electronic device, or it can also be performed with the first electronic device to the second electronic device.
  • the two electronic devices transmit the inherent information in the Wi-Fi P2P connection of the first electronic device simultaneously.
  • the inherent information used by the first electronic device to establish a Wi-Fi P2P connection includes: a list of channels supported by the first electronic device, and the SSID of the Wi-Fi P2P group when the first electronic device creates a Wi-Fi P2P group. , PWD of the Wi-Fi P2P group when the first electronic device creates a Wi-Fi P2P group, whether the first electronic device supports Wi-Fi P2P connection, whether the first electronic device supports broadband, and the device information of the second electronic device at least one of.
  • variable information used by the first electronic device to establish a Wi-Fi P2P connection includes: a Wi-Fi P2P connection status of the first electronic device and/or a frequency of a Wi-Fi hotspot to which the first electronic device is connected.
  • the method further includes: a first The electronic device and the second electronic device perform security authentication through the first connection; after the security authentication is passed, the first electronic device adds the second electronic device to the trusted list device.
  • the first electronic device and the second electronic device perform device security authentication through the first connection, so that the first electronic device and the second electronic device can mutually determine trusted devices.
  • the sender can first use the encrypted password The key encrypts the information and sends it. After the receiver receives the information, it decrypts it through the decryption key, which can ensure the security of information transmission.
  • the first electronic device before the first electronic device sends the inherent information for establishing a Wi-Fi P2P connection to the second electronic device, if the first electronic device has not determined that the second electronic device is available If the first electronic device is used for Wi-Fi P2P connection, the first electronic device can send part of the information in the inherent information used by the first electronic device for the Wi-Fi P2P connection to the second electronic device. For example, the device information of the first electronic device may be sent to the second electronic device.
  • the first electronic device For other information in the inherent information in the Wi-Fi P2P connection used by the first electronic device (for example: the list of channels supported by the first electronic device, the SSID of the P2P group when the first electronic device creates a P2P group, the first electronic device When creating a P2P group, the PWD of the P2P group, whether the first electronic device itself supports Wi-Fi P2P connection, whether the first electronic device supports broadband, etc.) will not be sent to the second electronic device. After the first electronic device determines that the second electronic device is a trusted device, other information in the inherent information in the Wi-Fi P2P connection of the first electronic device is sent to the second electronic device.
  • the user can also independently select which or which of the inherent information in the Wi-Fi P2P connection of the first electronic device is to be used in the settings. sent to the second electronic device.
  • the first electronic device has determined that the second electronic device is a trusted device, all information in the inherent information in the Wi-Fi P2P connection of the first electronic device may be sent to the second electronic device.
  • the second electronic device if it has not been determined that the first electronic device is a trusted device, a similar method can be used to share or send the difference in the Wi-Fi P2P connection of the second electronic device for the trusted device and the untrusted device, respectively. inherent information.
  • the first electronic device before the first electronic device sends the variable information for establishing a Wi-Fi P2P connection to the second electronic device, if the first electronic device has not determined that the second electronic device is If the device is a trusted device, the first electronic device can send part of the information in the variable information used by the first electronic device for the Wi-Fi P2P connection to the second electronic device. Other information in the variable information used by the first electronic device for the Wi-Fi P2P connection will not be sent to the second electronic device. After the first electronic device determines that the second electronic device is a trusted device, other information in the variable information in the Wi-Fi P2P connection of the first electronic device is sent to the second electronic device.
  • the user can also independently select which or which of the variable information in the Wi-Fi P2P connection of the first electronic device to be connected in the settings.
  • the information is sent to the second electronic device.
  • the first electronic device If the first electronic device has determined that the second electronic device is a trusted device, it can send all the information in the variable information in the Wi-Fi P2P connection of the first electronic device to the second electronic device.
  • the second electronic device if it has not been determined that the first electronic device is a trusted device, a similar method can be used to share or send the difference in the Wi-Fi P2P connection of the second electronic device for the trusted device and the untrusted device, respectively. variable information.
  • the method further includes: after the first electronic device receives the first operation, the first electronic device acquires third connection information of the second electronic device, where the third connection information includes: In addition to the first connection information, information used by the second electronic device to establish a Wi-Fi P2P connection.
  • the third connection information includes inherent information used by the second electronic device to establish a Wi-Fi P2P connection.
  • the third connection information includes variable information used by the second electronic device to establish a Wi-Fi P2P connection .
  • the third connection information includes: the second electronic device is used to establish a Wi-Fi P2P connection.
  • the inherent information information other than this part of the information.
  • the third connection information includes: the second electronic device is used to establish a Wi-Fi P2P connection In the variable information of , the information other than this part of the information.
  • the first electronic device establishes a Wi-Fi P2P connection with the second electronic device according to the first connection information in response to the first operation, including: the first electronic device according to the first electronic device The inherent information used by the device to establish a Wi-Fi P2P connection, the inherent information used by the first electronic device to establish a Wi-Fi P2P connection, the first connection information and the third connection information, determine the frequency of Wi-Fi P2P group establishment, GC device and GO device role assignment, the SSID and PWD of the Wi-Fi P2P group, the first electronic device sends a second broadcast message to the second electronic device, and establishes the Wi-Fi P2P group with the second electronic device,
  • the second broadcast message includes: the MAC address, IP address and port number of the first electronic device, the frequency of the Wi-Fi P2P group establishment, the role assignment of the GC device and the GO device, the SSID and PWD.
  • the first electronic device and the second electronic device exchange information required for Wi-Fi P2P connection in advance, so that when Wi-Fi P2P connection is actually initiated, Wi-Fi P2P Some or all of the information necessary for the connection has been exchanged.
  • Wi-Fi P2P connection it is only necessary to send some simple signaling (such as broadcast messages, Bluetooth messages, etc.) to complete the Wi-Fi P2P connection. , thereby further shortening the time spent on Wi-Fi P2P connection and improving user experience.
  • it can be used in different product platforms to meet the needs of different upper-layer applications.
  • the second broadcast packet may include a packet broadcast through BLE, BR, Wi-Fi, or the like.
  • the first electronic device if in the Wi-Fi P2P group, the first electronic device is a GO device and the second electronic device is a GC device, the first electronic device establishes the Wi-Fi P2P group, the second electronic device joins the Wi-Fi P2P group according to the Wi-Fi P2P group information (the frequency of the Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group). Wi-Fi P2P groups.
  • the second electronic device if in the Wi-Fi P2P group, the second electronic device is a GO device and the first electronic device is a GC device, the second electronic device establishes the Wi-Fi P2P group, the first electronic device joins the Wi-Fi P2P group according to the Wi-Fi P2P group information (the frequency of the Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group). Wi-Fi P2P groups.
  • the method further includes: the first electronic device sends service data to the second electronic device through the Wi-Fi P2P connection.
  • a method for establishing a communication connection comprising: before the first electronic device receives a first operation of a user, the first electronic device obtains fourth connection information of the second electronic device, and the fourth connection information uses
  • the first operation is used to instruct the establishment of the communication connection with the second electronic device, and the fourth connection information requires information including: working frequency information and/or communication channel information of the second electronic device; An operation; in response to the first operation, the first electronic device establishes the communication connection with the second electronic device according to the fourth connection information.
  • the two-end devices before the two-end devices actually establish a wireless communication connection, the two-end devices exchange information (including the operating frequency information and/or communication channel information of the devices, etc.) necessary for establishing the communication connection in advance, so that the When the two-end device actually initiates the communication connection, most of the information has been exchanged, and the communication connection only needs to be sent by the two-end device to send some simple signaling, thereby further shortening the time for establishing the communication connection and improving the user experience.
  • information including the operating frequency information and/or communication channel information of the devices, etc.
  • the first electronic device may be a terminal device
  • the second electronic device may be an AP device or a soft AP device.
  • the second electronic device may be a router or another terminal device.
  • the communication connection includes: a Wi-Fi connection.
  • the necessary information for the second electronic device to establish the communication connection further includes: at least one of the SSID, PWD, MAC address, IP address and port number of the second electronic device for establishing the communication connection .
  • the method further includes: acquiring, by the first electronic device, fourth connection information of the second electronic device, including: the first electronic device receiving the fourth connection information through the first connection.
  • the first connection includes: a Bluetooth connection, an NFC connection, a Zigbee connection, a USB connection, and the like.
  • a variety of discovery methods such as BLE discovery, LAN discovery, broadcast discovery, etc.
  • the information exchange is carried out in the connection mode or the broadcast mode, which improves the efficiency of necessary information exchange, and improves the versatility and scalability.
  • acquiring the fourth connection information of the second electronic device by the first electronic device includes: the first electronic device receives the fourth connection information through a third broadcast message.
  • the third broadcast message includes: a message broadcast through BLE, BR, Wi-Fi, and the like.
  • the method further includes: the first electronic device sends fifth connection information to the second electronic device, where the fifth connection information includes working frequency information and/or communication channel of the first electronic device information.
  • the fifth connection information may be sent through the first connection and/or a broadcast message.
  • the fifth connection information further includes: or at least one of the SSID, PWD, MAC address, IP address, and port number of the first electronic device for establishing the communication connection.
  • an electronic device comprising: a unit for performing the steps in the above first aspect or any possible implementation manner of the first aspect, or for performing the above second aspect Or a unit of each step in any possible implementation manner of any aspect of the second aspect.
  • an electronic device in a fourth aspect, includes at least one processor and a memory, and the at least one processor is configured to execute: the method in the first aspect or any possible implementation manner of the first aspect, or , a method in a possible implementation manner of the above second aspect or any one of the second aspects.
  • an electronic device in a fifth aspect, includes at least one processor and an interface circuit, and the at least one processor is configured to execute: the method in the above first aspect or any possible implementation manner of the first aspect, Or, the above second aspect or the method in any possible implementation manner of the second aspect.
  • a communication apparatus in a sixth aspect, includes any electronic device provided in the third aspect, the fourth aspect, or the fifth aspect.
  • a computer program product comprising a computer program, when executed by a processor, the computer program is used to perform the method in any one of the first aspect or the second aspect, or, for carrying out the method in any possible implementation of the first aspect or any of the second aspects.
  • a computer-readable storage medium is provided, and a computer program is stored in the computer-readable storage medium, and when the computer program is executed, is used to execute any one of the first aspect or the second aspect.
  • a method alternatively, a method for performing any possible implementation of any of the first aspect or the second aspect.
  • a chip in a ninth aspect, includes: a processor for calling and running a computer program from a memory, so that a communication device installed with the chip executes any one of the first aspect or the second aspect.
  • a method alternatively, a method for performing any possible implementation of any of the first aspect or the second aspect.
  • the method for establishing a Wi-Fi P2P connection provided by this application, when performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery , can support a variety of discovery methods, and support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability, and can be used as a platform-level capability for various applications.
  • various discovery methods such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.
  • the information required for the Wi-Fi P2P connection will be exchanged in stages, and the inherent information in the information required by the Wi-Fi P2P connection (for example: the list of channels supported by the device, P2P group SSID, PWD, whether Support broadband (such as whether to support 160MHz), device information, etc., are exchanged in advance before the Wi-Fi P2P service is initiated.
  • Change the variable information in the information required for Wi-Fi P2P connection (for example: Wi-Fi P2P connection status of the device, role, frequency of the AP connected to the device, etc.) Exchange in advance before initiating, or exchange in the process of actually initiating Wi-Fi P2P connection.
  • Wi-Fi P2P connection when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged.
  • Wi-Fi P2P connection when the Wi-Fi P2P connection is actually initiated, only some simple signaling (such as broadcast message, Bluetooth message, etc.) to complete the Wi-Fi P2P connection, thereby further shortening the time spent in the Wi-Fi P2P connection and improving the user experience.
  • it can be used in different product platforms to meet the needs of different upper-layer applications.
  • FIG. 1 is an architectural diagram of an example of a Wi-Fi P2P service system on an electronic device provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a formal structure of an example of Wi-Fi P2P device connection and networking provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an example of an application scenario applicable to the embodiment of the present application provided by the embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an example of a method for establishing a Wi-Fi P2P connection provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of another example of a method for establishing a Wi-Fi P2P connection provided by an embodiment of the present application.
  • FIG. 6 is a schematic user interface diagram of an example of a user triggering a smartphone to establish a Wi-Fi P2P connection with a large-screen device according to an embodiment of the present application.
  • FIG. 7 is a schematic user interface diagram of another example of a user triggering a smart phone to establish a Wi-Fi P2P connection with a large-screen device according to an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of an example of establishing a first connection between a smartphone and a large-screen device according to an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of another example of establishing a first connection between a smartphone and a large-screen device according to an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of an example of the structure of an electronic device provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • plural means two or more.
  • various aspects or features of the present application may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques.
  • article of manufacture encompasses a computer program accessible from any computer readable device, carrier or medium.
  • computer readable media may include, but are not limited to: magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs) etc.), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), card, stick or key drives, etc.).
  • various storage media described herein can represent one or more devices and/or other machine-readable media for storing information.
  • the term "machine-readable medium” may include, but is not limited to, wireless channels and various other media capable of storing, containing, and/or carrying instructions and/or data.
  • GSM Global System of Mobile communication
  • CDMA Code Division Multiple Access
  • CDMA Wideband Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • GSM Global System of Mobile communication
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • GPRS General Packet Radio Service
  • LTE Long Term Evolution
  • FDD Frequency Division Duplex
  • TDD Time Division Duplex
  • UMTS Universal Mobile Telecommunication System
  • WiMAX Worldwide Interoperability for Microwave Access
  • 5G 5th Generation
  • 5G 5th Generation
  • New Radio New Radio
  • various aspects or features of the present application may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques.
  • article of manufacture encompasses a computer program accessible from any computer readable device, carrier or medium.
  • computer readable media may include, but are not limited to: magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs) etc.), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), card, stick or key drives, etc.).
  • various storage media described herein can represent one or more devices and/or other machine-readable media for storing information.
  • the term "machine-readable medium” may include, but is not limited to, wireless channels and various other media capable of storing, containing, and/or carrying instructions and/or data.
  • Wi-Fi P2P technology is an important technology under the "Wi-Fi DIRECT" standard protocol launched by the Wi-Fi Alliance. Wi-Fi P2P can support two Wi-Fi devices without the intervention of Wi-Fi hotspots. Connect and communicate directly with the counterpart device.
  • the system architecture mainly includes: Wi-Fi chip (Chipset), Wi-Fi Driver (Wi-Fi Driver), middleware, application framework layer (FRAMEWORK), and upper application (application, APP).
  • Wi-Fi driver is responsible for connecting the Wi-Fi chip with the operating system of the terminal device
  • the middleware is used for the transfer of all messages between the kernel state and the user state during the operation of the terminal device.
  • wpa_supplicant is an open source project, which was later modified by Google and introduced into the Android platform. It is a daemon process that runs independently in the device and is used for message transfer.
  • Wi-Fi P2P related services can include Wi-Fi P2P Service, the interface type corresponding to Wi-Fi P2P Service is Wi-Fi P2P management (Manager) type, and the interface of Wi-Fi P2P Manager type includes: discoverPeers), connect (connect) and other interfaces, these interfaces can be directly controlled by the user to Wi-Fi P2P.
  • Wi-Fi P2P Service the interface type corresponding to Wi-Fi P2P Service
  • the interface type corresponding to Wi-Fi P2P Service is Wi-Fi P2P management (Manager) type
  • the interface of Wi-Fi P2P Manager type includes: discoverPeers), connect (connect) and other interfaces, these interfaces can be directly controlled by the user to Wi-Fi P2P.
  • Upper-layer applications are applications that users who use the FRAMEWORK interface can directly contact. They run on the terminal device and are the windows for the user to interact with the terminal device.
  • the Wi-Fi P2P connection protocol is generally implemented in the Wi-Fi chip, and the FRAMEWORK layer in the terminal device interacts with the chip through the driver.
  • the FRAMEWORK layer is used to interact with the driver and support encryption authentication through wpa_supplicant.
  • the application layer provides several interface functions that can be directly called by developers/businesses. After calling, the chip can execute the corresponding Wi-Fi function through the driver.
  • -Fi P2P related operations the FRAMEWORK layer itself is responsible for the message transfer and coordination, connection management, etc. between the upper-layer application and the lower-layer hardware (including wpa_supplicant, Wi-Fi Driver, Chipset).
  • the user's operation of Wi-Fi P2P is realized by the application layer by calling the Wi-Fi P2P related interfaces and services in FRAMEWORK.
  • a complete Wi-Fi P2P service includes three stages: Wi-Fi P2P device discovery, Wi-Fi P2P device connection, and Wi-Fi P2P device service data transmission.
  • a P2P group (or also called a Wi-Fi P2P group) is formed after the Wi-Fi P2P device connection is established.
  • the device has two roles: P2P group manager (group owner, GO) and P2P group client (group client, GC).
  • P2P group manager group owner, GO
  • P2P group client group client, GC
  • GO devices can only be connected to GC, and cannot establish connections with other GO devices
  • Wi-Fi P2P connections In addition to the limitations of the Wi-Fi DIRECT protocol itself, different chip manufacturers and different operating systems (such as Android, Windows, etc.) also have some other limitations on Wi-Fi P2P connections.
  • chip platforms such as HiSilicon do not support the same Multiple P2P roles on the device. Not supporting multiple P2P roles on the same device can be understood as: the same device cannot act as GO and GC at the same time; or, during the period when one device acts as a GO, the device cannot act as a GO in another P2P group; or , while a device is serving as a GC, the device cannot serve as a GC in another P2P group.
  • AOSP does not support the coexistence of multiple P2P roles on the same device. Therefore, as shown in Figure 2, the current form of Wi-Fi P2P device connection and networking is limited to a star network centered on GO devices.
  • Wi-Fi P2P device discovery Device Discovery
  • group negotiation Group Formation
  • Wi-Fi protection Setup Wi-Fi protected setup, WPS
  • Wi-Fi P2P device discovery is a key capability in Wi-Fi DIRECT, including two stages: scan and find.
  • the Scan phase is to discover existing GO devices.
  • the find phase is divided into a listening phase (listen State) and a search phase (search State).
  • P2P devices will switch back and forth between the Search phase and the Listen phase.
  • the P2P device will send a probe request frame (Probe Request)
  • the P2P device will receive the probe request frame (Probe Request) from other devices and reply with a probe reply frame (Probe Response).
  • the protocol stipulates that the duration of these two phases is random, to ensure that there can be a window where the two phases are wrong, that is, there is no temporal overlap between the two phases, and there needs to be a time interval between the two phases.
  • Group negotiation is the next stage after Wi-Fi P2P devices are discovered. Due to the protocol, on a Wi-Fi P2P connection, two-end devices have GO and GC roles, so they need to negotiate their roles before connecting.
  • 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 loopholes such as identity spoofing.
  • the final association connection involves a 4-step handshake, after which a trusted Wi-Fi P2P connection is established between the two devices.
  • Wi-Fi P2P device connection To establish a Wi-Fi P2P device connection according to the standard Wi-Fi DIRECT protocol, you only need to trigger Wi-Fi P2P discovery at both ends, and then wait for the discovery result. When the desired device is scanned, initiate a connection and wait for the connection result. . However, using this technology will cause the Wi-Fi P2P device connection process to take a long time. As described above, the two-end device needs to have a wrong window between the Search stage and the Listen stage (that is, the device at one end is in the Search stage, and the device at the other end needs to In the Listen stage. Or the device at one end is in the Listen stage, and the device at the other end needs to be in the Search stage). For either end device, it will switch back and forth between the Search stage and the Listen stage.
  • the other end of the device cannot be guaranteed to be in the Listen stage, and when one end of the device is in the Search stage and the other end of the device is not in the Listen stage, device discovery cannot be performed.
  • the two-end device can perform device discovery, and if the other end device is still in the Listen stage, the two-end device cannot perform device discovery . In other words, during this process, both devices switch between the Search stage and the Listen stage.
  • the standard Wi-Fi P2P connection establishment process has been modified and optimized in the related art.
  • BLE bluetooth low energy
  • BLE/Bluetooth basic rate (BR) connection By establishing a BLE/Bluetooth basic rate (BR) connection, performing security authentication and exchanging P2P group information based on the BLE/BR connection, the GC device is finally directly connected to the P2P group on the designated channel to realize Wi- Fi P2P connection.
  • BR Bluetooth basic rate
  • this application provides a method for establishing a Wi-Fi P2P connection.
  • various discovery methods such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast Discovery, etc.
  • it can support multiple discovery methods, and at the same time support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability.
  • the information required for the Wi-Fi P2P connection is exchanged in stages, and the inherent information in the information required for the Wi-Fi P2P connection (for example, the list of channels supported by the device, the service set identifier of the P2P group) is exchanged.
  • Wi-Fi P2P connection status of the device, role, frequency of the AP (ie Wi-Fi hotspot) connected to the device, etc.) after the variable information changes , to synchronize between devices, so that when the user uses the device to actually initiate a Wi-Fi P2P connection, most of the information has been exchanged, and only some simple signaling (such as broadcast messages, Bluetooth messages, etc.) needs to be sent.
  • Send signaling to complete the Wi-Fi P2P connection, thereby further shortening the time-consuming of the Wi-Fi P2P connection and improving the user experience.
  • the method provided in this application is mainly aimed at the Wi-Fi P2P connection and networking scenarios in the Wi-Fi DIRECT standard protocol, and can be applied to the Android operation of the Wi-Fi P2P technology using the Wi-Fi DIRECT standard protocol. It can also be applied to devices using IOS operating system and Hongmeng operating system, etc.
  • the embodiments of the present application are not limited herein.
  • FIG. 3 is a schematic diagram of a communication system applicable to an embodiment of the present application.
  • the system includes: a first electronic device 110 and a second electronic device 120 .
  • the first electronic device 110 is a smartphone used by a user in the family as an example
  • the second electronic device 120 is a large-screen device (such as a smart TV, a smart screen, etc.) in the family as an example .
  • a user uses a smartphone and wants to share files with a large-screen device using a Wi-Fi P2P link.
  • the first electronic device or the second electronic device may include: a smart phone, a smart TV, a large-screen device, a tablet computer, a netbook, a PDA, a computer handheld communication device, a handheld computing device, and a smart bracelet , smart at hand, wearable device, user equipment, access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device .
  • the terminal device may also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a wireless communication Functional handheld devices, computing devices or other processing devices connected to wireless modems, in-vehicle devices, terminal devices in 5G networks or terminal devices in the future evolved public land mobile network (PLMN), etc., This embodiment of the present application does not limit this.
  • SIP Session Initiation Protocol
  • WLL Wireless Local Loop
  • PDA Personal Digital Assistant
  • FIG. 4 is a schematic flowchart of an example of a Wi-Fi P2P connection method 200 provided by the present application in the scenario shown in FIG. 3 .
  • the method 200 includes: S205 to S250.
  • the communication module in the smart phone and the communication module in the large-screen device establish a first connection.
  • the communication module in the smartphone and the communication module in the large-screen device may establish a first connection through interactive broadcast messages, for example, the first connection may be a BLE connection, a universal serial bus (USB), BR connection, near field communication (near field communication, NFC) connection, Zigbee connection, Wi-Fi connection or socket connection based on LAN, etc.
  • the first connection may be a BLE connection, a universal serial bus (USB), BR connection, near field communication (near field communication, NFC) connection, Zigbee connection, Wi-Fi connection or socket connection based on LAN, etc.
  • a Wi-Fi connection may be understood as a communication connection established between a smartphone and a large-screen device through an access point device.
  • the information transmission between the smartphone and the large-screen device needs to be relayed through an access point device (such as a router device), and the smartphone and the large-screen device cannot communicate directly.
  • the communication module in the smart phone sends inherent information in the information required for the Wi-Fi P2P connection of the smart phone to the communication module of the large-screen device through the first connection or broadcasting.
  • the communication module in the smartphone can send the inherent information in the information required by the Wi-Fi P2P connection of the smartphone to the large-screen device through the first connection. communication module.
  • the inherent information in the Wi-Fi P2P connection can be understood as: when a smartphone establishes a Wi-Fi P2P connection with other devices, within a period of time information that remains unchanged.
  • the list of channels supported by a smartphone refers to the list of channels supported by a smartphone on the 5GHz frequency band, which is an inherent property of a smartphone.
  • SSID and PWD refer to the network ID and key used by the smartphone when creating a P2P group. These two items are randomly generated when the smartphone is powered on, and remain unchanged for a certain period of time (ie, the life cycle). After the cycle, it will be randomly generated again to ensure the security of the Wi-Fi P2P connection.
  • the inherent information in the Wi-Fi P2P connection of the smartphone includes: a list of channels supported by the smartphone (for example, to support 36 channels) , corresponding to 5180MHz), the SSID of the P2P group when the smartphone creates a P2P group, the PWD of the P2P group when the smartphone creates a P2P group, whether the smartphone itself supports Wi-Fi P2P connection, whether the smartphone supports broadband (for example, whether Support 160MHz, if it is supported, it can be represented by true, if it is not supported, it can be represented by false), device information of smart phones, etc.
  • the device information of the smart phone includes: the device name of the smart phone, account information of the smart phone, the status of the Bluetooth of the smart phone, the Wi-Fi switch, the power level of the smart phone, and the like.
  • the communication module in the smartphone can also broadcast (for example, BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.)
  • the communication module transmits information inherent in the Wi-Fi P2P connection of the smartphone.
  • the communication module in the smartphone can also send the Wi-Fi P2P connection of the smartphone to the communication module of the large-screen device through broadcasting and the first connection. inherent information in .
  • the communication module of the large-screen device After the communication module of the large-screen device receives the inherent information in the information required by the Wi-Fi P2P connection of the smartphone through the first connection and/or broadcasting, it can store the information required by the Wi-Fi P2P connection of the smartphone. inherent information.
  • the communication module in the large-screen device transmits the inherent information in the information required by the Wi-Fi P2P connection of the large-screen device (that is, the inherent information used by the large-screen device to establish a Wi-Fi P2P connection) through the first connection or broadcasting. ) to the communication module in the smartphone.
  • the communication module in the large-screen device can send inherent information in the information required by the Wi-Fi P2P connection of the large-screen device to the smartphone through the first connection. in the communication module.
  • the inherent information in the Wi-Fi P2P connection of the large-screen device includes: a list of channels supported by the large-screen device, the SSID of the P2P group when the large-screen device creates a P2P group, and the large-screen device creates a P2P group PWD of the P2P group, whether the large-screen device itself supports Wi-Fi P2P connection, whether the large-screen device supports broadband, and device information of the large-screen device, etc.
  • the device information of the large-screen device may include: the device name of the large-screen device, account information of the large-screen device, the Bluetooth of the large-screen device, the status of the Wi-Fi switch, the power level of the large-screen device, and the like.
  • the communication module in the large-screen device can also send the Wi-Fi data of the large-screen device to the communication module of the smartphone by broadcasting (for example, BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.). Inherent information in Fi P2P connections.
  • broadcasting for example, BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.
  • the communication module in the large-screen device can also send the Wi- Information inherent in Fi P2P connections.
  • the communication module of the smartphone After the communication module of the smartphone receives the inherent information in the information required for the Wi-Fi P2P connection of the large-screen device through the first connection and/or broadcasting, it can store the information required for the Wi-Fi P2P connection of the large-screen device inherent information in .
  • the above-mentioned S210 and S215 are the process of exchanging inherent information in the Wi-Fi P2P connection between the large-screen device and the smartphone.
  • the flow includes S220 to S245.
  • the driver and chip module of the smartphone sends a message to the FRAMEWORK module of the smartphone when the Wi-Fi P2P connection status of the smartphone changes, and/or the frequency of the AP (ie Wi-Fi hotspot) connected to the smartphone changes.
  • the message includes: at least one of the Wi-Fi P2P connection status of the smartphone and the frequency of the AP connected to the smartphone.
  • the Wi-Fi P2P connection status of the smartphone includes: the smartphone does not currently have a Wi-Fi P2P connection with any device; the smartphone currently has a Wi-Fi P2P connection with other devices , and the role of the smartphone is GO; there is currently a Wi-Fi P2P connection between the smartphone and other devices, and the role of the smartphone is either GC.
  • the FRAMEWORK module of the smartphone sends a message to the communication module of the smartphone, where the message includes at least one of the Wi-Fi P2P connection status of the smartphone and the frequency of the AP connected to the smartphone.
  • the communication module of the smart phone sends a message to the communication module of the large-screen device.
  • the message includes: variable information in the Wi-Fi P2P connection of the smartphone (ie, variable information used by the smartphone to establish the Wi-Fi P2P connection).
  • variable information in the Wi-Fi P2P connection of the smartphone includes at least one of the Wi-Fi P2P connection status of the smartphone and the frequency of the AP to which the smartphone is connected.
  • Wi-Fi STATION Wi-Fi station
  • Wi-Fi P2P Wi-Fi P2P roles.
  • the role of Wi-Fi STATION can be understood as the terminal device establishes a Wi-Fi connection by connecting to the router (Wi-Fi hotspot/AP)
  • the role of Wi-Fi P2P can be understood as the terminal device does not pass through the router and directly communicates with other device to connect to Wi-Fi.
  • the Wi-Fi STATION status of the terminal device will also affect the Wi-Fi P2P connection, and the Wi-Fi STATION status can be reflected by the frequency of the AP connected to the terminal device. Therefore, in this embodiment of the present application, after the frequency of the AP connected to the smartphone or the large-screen device changes, the smartphone or the large-screen device can synchronize the frequency of the connected AP to the devices in the trusted device list.
  • Wi-Fi P2P connection can only occur between GO devices and GC devices, and there is a GO device connected to a limited number of GC devices at most, and a GC device only.
  • the smartphone and the large-screen device will synchronously notify all members in the trusted device list of the Wi-Fi P2P status of the smartphone and the large-screen device. equipment.
  • the Wi-Fi P2P connection status of the device includes: the device does not currently have a Wi-Fi P2P connection with any device; the device currently has a Wi-Fi P2P connection with other devices, and the role of the device is GO; There is currently a Wi-Fi P2P connection between the device and other devices, and the role of the device is GC.
  • variable information in the Wi-Fi P2P connection of the smartphone may also be included in the process of the smartphone in the Wi-Fi P2P connection, and others may change at any time, and will affect the Wi-Fi P2P
  • the connection information is not limited in this embodiment of the present application.
  • the message may be sent in the form of broadcasting (for example: BLE broadcasting, BR broadcasting, Wi-Fi broadcasting, etc.), or may also be sent through the first connection, or, through broadcasting and the first connection Both ways to send.
  • broadcasting for example: BLE broadcasting, BR broadcasting, Wi-Fi broadcasting, etc.
  • the communication module of the large-screen device After receiving the variable information in the Wi-Fi P2P connection of the smartphone through the first connection and/or broadcasting, the communication module of the large-screen device can store the variable information in the Wi-Fi P2P connection of the smartphone.
  • the timing for the communication module of the smart phone to send the variable information in the Wi-Fi P2P connection of the smart phone to the communication module of the large-screen device may be periodically sent, or may be sent on the smart phone. It is sent during the actual Wi-Fi P2P connection with the large-screen device, or, after the variable information in the Wi-Fi P2P connection of the smartphone, after a period of time, or you can also set some sending rules :
  • the Wi-Fi P2P connection status of the smartphone changes, immediately send the changed Wi-Fi P2P connection status of the smartphone to the communication module of the large-screen device, and when sending the Wi-Fi P2P connection status of the smartphone , if the frequency of the AP connected to the smartphone also changes, the changed frequency of the AP connected to the smartphone will be sent to the large-screen device. That is to say, if only the frequency of the AP connected to the smartphone changes, it will not individually trigger the sending of the changed frequency of the AP connected to the smartphone to the communication module of the large-screen device.
  • the smartphone Wi-Fi P2P connection If the status has also changed, the changed smartphone Wi-Fi P2P connection status will be sent to the large-screen device. That is to say, if only the Wi-Fi P2P connection status of the smartphone changes, it will not be individually triggered to send the changed Wi-Fi P2P connection status of the smartphone to the communication module of the large-screen device.
  • any of the variable information in the Wi-Fi P2P connection of the smartphone changes, the smartphone will immediately send the changed information in the Wi-Fi P2P connection to the communication module of the large-screen device. That is, any one of the variable information in the Wi-Fi P2P connection of the smartphone can be sent independently without being affected by other information.
  • S230 can be executed before S210, can also be executed after S210, or can also be executed simultaneously with S210.
  • the smartphone sends the variable information in the Wi-Fi P2P connection of the smartphone to the large-screen device before the smartphone sends the inherent information in the Wi-Fi P2P connection of the smartphone to the large-screen device, and also It can be performed after the smartphone sends the inherent information in the Wi-Fi P2P connection of the smartphone to the large-screen device, or it can be performed simultaneously with the smartphone sending the inherent information in the Wi-Fi P2P connection of the smartphone to the large-screen device.
  • the embodiments of the present application are not limited.
  • the FRAMEWORK module of the large-screen device Send a message, the message includes at least one of the Wi-Fi P2P connection status of the large-screen device and the frequency of the AP to which the large-screen device is connected.
  • the Wi-Fi P2P connection status of the large-screen device includes: the large-screen device currently does not have a Wi-Fi P2P connection with any device; the large-screen device currently has a Wi-Fi P2P connection with other devices. Fi P2P connection, and the role of the large-screen device is GO; there is currently a Wi-Fi P2P connection between the large-screen device and other devices, and the role of the large-screen device is any one of GC.
  • the FRAMEWORK module of the large-screen device sends a message to the communication module of the large-screen device, the message including: at least one of the Wi-Fi P2P connection status of the large-screen device and the frequency of the AP connected to the large-screen device.
  • the communication module of the large-screen device sends a message to the communication module of the smartphone device.
  • the message includes: variable information in the Wi-Fi P2P connection of the large-screen device (that is, variable information used by the large-screen device to establish a Wi-Fi P2P connection).
  • variable information in the Wi-Fi P2P connection of the large-screen device includes: at least one of the Wi-Fi P2P connection status and the frequency of the AP to which the large-screen device is connected.
  • variable information in the Wi-Fi P2P connection of the large-screen device may also be included in the process of the large-screen device being connected to Wi-Fi P2P, and others may change at any time, and will affect the Wi-Fi P2P connection.
  • Information about the Fi P2P connection is not limited in this embodiment of the present application.
  • the message may be sent in the form of broadcasting (for example: BLE broadcasting, BR broadcasting, Wi-Fi broadcasting, etc.), or may also be sent through the first connection, or, through broadcasting and the first connection Both ways to send.
  • broadcasting for example: BLE broadcasting, BR broadcasting, Wi-Fi broadcasting, etc.
  • S245 can be executed before S215, can also be executed after S215, or can also be executed simultaneously with S215.
  • the large-screen device sends the variable information in the Wi-Fi P2P connection of the large-screen device to the smartphone before the large-screen device sends the inherent information in the Wi-Fi P2P connection of the large-screen device to the smartphone.
  • it can also be performed after the large-screen device sends the inherent information in the Wi-Fi P2P connection of the large-screen device to the smartphone, or it can also be performed with the large-screen device to the smartphone.
  • the inherent information is carried out at the same time.
  • the embodiments of the present application are not limited.
  • the timing for the communication module of the large-screen device to send the variable information in the Wi-Fi P2P connection of the large-screen device to the communication module of the smartphone may be periodically sent, or it may also be Set some sending rules.
  • the rules are similar to those in S230, and are not repeated here for the sake of introduction.
  • the above-mentioned S220 to S245 are the processes of exchanging (or also called synchronizing) the variable information in the Wi-Fi P2P connection between the large-screen device and the smartphone.
  • the communication module of the smartphone and the communication module of the large-screen device establish a Wi-Fi P2P connection according to the variable information and fixed information in the exchanged Wi-Fi P2P connection.
  • the smartphone can simply send some simple signaling (such as broadcast messages, Bluetooth messages, etc.) to the large-screen device to complete Wi-Fi Fi P2P connection.
  • some simple signaling such as broadcast messages, Bluetooth messages, etc.
  • S230 can be executed before S250, or can also be executed concurrently with S250.
  • the smartphone sends variable information in the smartphone's Wi-Fi P2P connection to the large-screen device, either before the smartphone and the large-screen device establish a Wi-Fi P2P connection, or before the smartphone and the large-screen device establish a Wi-Fi P2P connection.
  • the device is in the process of establishing a Wi-Fi P2P connection.
  • the embodiments of the present application are not limited.
  • S245 can be executed before S250, or can also be executed concurrently with S250.
  • the large-screen device sends variable information in the Wi-Fi P2P connection of the large-screen device to the smartphone, either before the large-screen device and the smartphone establish a Wi-Fi P2P connection, or before the large-screen device and the smartphone establish a Wi-Fi P2P connection.
  • the smartphone is in the process of establishing a Wi-Fi P2P connection.
  • the embodiments of the present application are not limited.
  • the information required for the Wi-Fi P2P connection is exchanged in stages, and the information required for the Wi-Fi P2P connection is exchanged in stages.
  • the inherent information in the information is exchanged in advance before the Wi-Fi P2P service is initiated.
  • the variable information in the information required by the Wi-Fi P2P connection is changed, it is exchanged in advance before the Wi-Fi P2P service is initiated, or it is exchanged during the actual initiation of the Wi-Fi P2P connection. Therefore, when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged.
  • the Wi-Fi P2P connection is actually initiated, only some simple signaling needs to be sent. Wi-Fi P2P connection, thereby further shortening the time spent in Wi-Fi P2P connection and improving user experience.
  • the method further includes: a smartphone and a large
  • the screen device establishes a first connection by scanning and performs inter-device security authentication based on the first connection, that is, the steps described in S204, S206 to S208 described below.
  • both the smart phone and the large-screen device are connected to the routing hotspot at home, and the driver and chip module of the smart phone and the large-screen device automatically start background scanning to discover the device.
  • both the smartphone and the large-screen device can use one or more methods of BLE scanning, classic Bluetooth scanning, wireless local area networks (WLAN) scanning, or Wi-Fi P2P scanning to discover devices. to discover the device.
  • the classic Bluetooth includes at least one of two types of Bluetooth: BR and Bluetooth enhanced data rate (EDR).
  • S205 can be executed.
  • the communication module in the smartphone and the communication module in the large-screen device negotiate a key based on the first connection to obtain an encryption key and a decryption key, thereby completing the device security authentication based on the first connection.
  • the smart phone can add the large-screen device to the trusted device list, and the large-screen device can also add the smart phone to the trusted device list.
  • the communication module in the smart phone stores the encryption key and the decryption key.
  • the communication module in the large-screen device stores the encryption key and the decryption key.
  • S210 to S250 may be performed.
  • the specific steps corresponding to S210 to S250 reference may be made to the description of the corresponding steps above, which is not repeated here for brevity.
  • S210 may be directly executed without executing S206 to S208.
  • the smartphone will not add the large-screen device to the list of trusted devices, and the large-screen device will not add the smartphone to the list of trusted devices, that is, the smartphone and the large-screen device communicate with each other. Not a trusted device.
  • the smart phone and the large-screen device log into the same account, or the smart phone and the large-screen device have been verified as trusted devices before, or the smart phone After binding with the large-screen device in various ways (for example, through QR code scanning, etc.), it can be confirmed that the smartphone and the large-screen device are mutually trusted devices.
  • the smart phone can add the large-screen device to the trusted device list, and the large-screen device can also add the smart phone to the trusted device list.
  • various discovery methods can be used for device discovery, which can support various discovery methods, and at the same time It supports the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability. It can be used as a platform-level capability for various applications, and can be used in different product platforms to meet the needs of different upper-layer applications. .
  • the smart phone and the large-screen device perform device security authentication through the first connection, so that the smart phone and the large-screen device can mutually determine trusted devices. After the trusted devices are determined, Wi-Fi The exchange of inherent information and variable information in the Fi P2P connection ensures the security of information exchange and avoids the risk of information leakage.
  • the sender can first use the encryption key to encrypt the information. After encryption, it is sent, and after the receiver receives the information, it is decrypted by the decryption key, which can ensure the security of information transmission.
  • the smart phone in the process of exchanging inherent information in the Wi-Fi P2P connection between the smartphone and the large-screen device described in S210 and S215. If the smart phone has not determined that the large-screen device is a trusted device, the smart phone can send part of the inherent information of the Wi-Fi P2P connection of the smart phone to the large-screen device. For example, the device information of a smartphone can be sent to a large-screen device.
  • the smartphone For other information inherent in the Wi-Fi P2P connection of the smartphone (for example: the list of channels supported by the smartphone, the SSID of the P2P group when the smartphone creates a P2P group, the PWD of the P2P group when the smartphone creates the P2P group , whether the smartphone itself supports Wi-Fi P2P connection, whether the smartphone supports broadband, etc.) will not be sent to large-screen devices.
  • the smartphone determines that the large-screen device is a trusted device, other information in the inherent information in the Wi-Fi P2P connection of the smartphone is sent to the large-screen device.
  • the smartphone can also independently choose which or which information among the inherent information in the Wi-Fi P2P connection of the smartphone is sent to the large-screen device in the settings.
  • a similar method can be used to share or send different inherent information in the Wi-Fi P2P connection of the large-screen device for trusted devices and untrusted devices.
  • the smartphone has determined that the large-screen device is a trusted device, all inherent information in the Wi-Fi P2P connection of the smartphone can be sent to the large-screen device.
  • the user can also independently choose which or which of the inherent information in the Wi-Fi P2P connection of the smartphone to send to the large-screen device in the settings.
  • the inherent information in the Wi-Fi P2P connection of the large-screen device can be sent to the smartphone in a similar manner.
  • the smart phone in the process of exchanging variable information in the Wi-Fi P2P connection between the smart phone and the large-screen device described in S230 and S245. If the smart phone has not determined that the large-screen device is a trusted device, the smart phone can send part of the variable information of the Wi-Fi P2P connection of the smart phone to the large-screen device. For smartphone Wi-Fi P2P connection other information in variable information is not sent to large screen device. After the smartphone determines that the large-screen device is a trusted device, other information in the variable information in the Wi-Fi P2P connection of the smartphone is sent to the large-screen device.
  • the smartphone can also independently choose which or which of the variable information in the Wi-Fi P2P connection of the smartphone to send to the large-screen device in the settings.
  • variable information in the Wi-Fi P2P connection of the smartphone can be sent to the large-screen device.
  • the user can also independently choose which or which of the variable information in the Wi-Fi P2P connection of the smartphone to send to the large-screen device in the settings.
  • variable information in the Wi-Fi P2P connection of the large-screen device can be sent to the smartphone in a similar manner.
  • the smartphone and the large-screen device establish Wi-Fi according to the variable information and fixed information in the exchanged Wi-Fi P2P connection.
  • the specific process of the P2P connection may include: S2511 to S2525.
  • the communication module of the smart phone sends the information of the available device list to the application in the smart phone.
  • the application in the smartphone may be a file sharing application.
  • the list of available devices may include trusted devices (the steps described in S206 to S208 have been performed), and may further include untrusted devices. Untrusted devices refer to: although the smartphone is connected to a certain device The first connection has been established, but the device security authentication based on the first connection has not been performed, that is, the steps described in S206 to S208 have not been performed. Large screen devices are included in the list of available devices.
  • the communication module of the large-screen device may also send the information of the available device list to the large-screen device.
  • the application in the large-screen device may be a file sharing application.
  • the list of available devices includes smartphones.
  • the user triggers the smartphone to establish a Wi-Fi P2P connection with the large-screen device.
  • the user can trigger the smartphone to establish a Wi-Fi P2P connection with the large-screen device through the following two operation modes:
  • the first operation mode Suppose the user needs to use the smartphone to share files with the large-screen device, as shown in a in Figure 6, the user opens the "File Management" application on the smartphone, and the displayed interface is as shown in Figure 6 As shown in b, the user selects a file to be shared (for example, file 1), clicks "Share", and selects a sharing method.
  • the displayed interface is as shown in c in Figure 6.
  • the user selects the sharing method of "Wi-Fi Direct", and the application on the smartphone will display the previously stored list of available devices to the user.
  • the list of available devices contains the device IDs of one or more devices.
  • the displayed list of available devices may be as shown in d in FIG. 6 .
  • the user may select a device (for example, a large-screen device) on the available device list as required. For example, when the user clicks the device ID of the large-screen device in the device list, the selection of the large-screen device is realized.
  • the smartphone may also display to the user whether each device in the displayed list of available devices is a trusted device. If a certain device is an untrusted device, an icon indicating whether authentication is required can also be displayed to the user. If the user determines that authentication is required, he can click "Authenticate", and the smartphone will automatically perform security authentication with the device (ie, execute S206 to S208). , if the security authentication is passed, the device is displayed as a trusted device. If the security authentication fails, the device is still displayed as an untrusted device.
  • the second mode of operation Assume that the user's purpose is only to connect the smartphone and the large-screen device Wi-Fi P2P, so as to facilitate the quick file transfer when there is data or file sharing in the future.
  • the displayed interface is as shown in c in Figure 7, and the application on the smartphone will display the previously stored list of available devices to the user.
  • the list of available devices contains the device IDs of one or more devices.
  • the displayed list of available devices may be as shown in c in FIG.
  • the user may select a device (for example, a large-screen device) on the available device list as required. For example, the user clicks the device ID of the large-screen device in the list of available devices, so as to realize the selection of the large-screen device.
  • a device for example, a large-screen device
  • the smartphone can also display to the user whether each device in the displayed list of available devices is a trusted device, and if a certain device is an untrusted device, it can also show the user to the user. Displays an icon indicating whether authentication is required. If the user determines that authentication is required, he or she can click "Authenticate", and the smartphone will automatically perform security authentication with the device. If the security authentication is passed, the device will be displayed as a trusted device. If the security authentication fails, the device is still displayed as an untrusted device.
  • the user can also trigger the smartphone to establish a Wi-Fi P2P connection with other devices through other operation modes, which is not limited in the embodiment of the present application.
  • the interface diagrams shown in FIG. 6 and FIG. 7 are only exemplary, and should not be displayed in the process of the user triggering the smartphone to establish a Wi-Fi P2P connection with other devices in the embodiment of the present application.
  • the interface imposes any restrictions.
  • the icons on the interface displayed by the smartphone may include more or less icons than those displayed on the interface shown in FIG. 6 or FIG. 7 , or combine certain icons, or split certain icons. some icons, or different icons, etc.
  • the embodiments of the present application are not limited herein.
  • S230 can be executed before S2512, can also be executed after S2512, or can also be executed simultaneously with S2512.
  • the smartphone and the large-screen device exchange variable information in the Wi-Fi P2P connection, either before the smartphone actually establishes a Wi-Fi P2P connection with the large-screen device, or, before the smartphone actually establishes a Wi-Fi P2P connection with the large-screen device.
  • the large-screen device exchanges during the process of establishing a Wi-Fi P2P connection.
  • the embodiments of the present application are not limited.
  • S245 may be executed before S2512, may also be executed after S2512, or may also be executed simultaneously with S2512, which is not limited in this embodiment of the present application.
  • the application on the smartphone calls the Wi-Fi P2P connection interface, and sends a Wi-Fi P2P connection request to the communication module in the smartphone, and the Wi-Fi P2P
  • the connection request includes the identification of the large screen device of the mobile phone.
  • the following will describe the specific process of establishing a Wi-Fi P2P connection between the smartphone and the large-screen device after the smartphone and the large-screen device obtain the information required to establish the Wi-Fi P2P connection, and the process includes S2514 to S2524.
  • the communication module in the smartphone determines the Wi-Fi P2P connection mode according to the inherent information and variable information in the Wi-Fi P2P connection of the large-screen device previously stored.
  • Wi-Fi P2P Wi-Fi P2P
  • the inherent information and variable information in the connection have been exchanged with the large-screen device, and the smartphone uses the inherent information and variable information in the Wi-Fi P2P connection between itself and the large-screen device.
  • a smartphone determines the GO and GC roles according to the device type and device status (battery power, etc.) of itself and the large-screen device, Wi-Fi P2P connection status, etc.
  • a smartphone is a GO device
  • a large-screen device is a GC device.
  • the smartphone determines which frequency the GO device is ultimately built on according to the Wi-Fi STATION channel of the large-screen device, the list of supported 5G channels, whether it supports broadband, etc., and determines the SSID and PWD of the Wi-Fi P2P group. That is, the connection method of Wi-Fi P2P is determined.
  • the communication module in the smart phone sends a Wi-Fi P2P group establishment request to the communication module of the large-screen device by means of broadcasting or the first connection.
  • the Wi-Fi P2P group establishment request includes: the frequency of Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group, the MAC address or IP address of the smartphone, and port number, etc.
  • the communication module in the smartphone can send a Wi-Fi P2P group establishment request to the communication module of the large-screen device through BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.
  • the communication module of the large-screen device after receiving the Wi-Fi P2P group establishment request, sends the Wi-Fi P2P group establishment request to the driver and chip module of the large-screen device.
  • the driver and chip module of the large-screen device establish a Wi-Fi P2P group according to the Wi-Fi P2P group establishment request.
  • the driver and chip module of the large-screen device sends a notification message that the Wi-Fi P2P group is successfully established to the communication module of the large-screen device.
  • the communication module of the large-screen device sends a notification message of the successful establishment of the Wi-Fi P2P group to the communication module in the smartphone by broadcasting or the first connection, and the notification message includes: the frequency of the establishment of the Wi-Fi P2P group , GC device and GO device role assignment, SSID and PWD of Wi-Fi P2P group, MAC address, or IP address and port number of large screen device.
  • the communication module in the smartphone sends a notification message that the Wi-Fi P2P group is successfully established to the driver and chip of the smartphone.
  • the notification message includes: the frequency of Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group, the MAC address, or IP address and port number of the large-screen device.
  • the driver and chip module of the smartphone join the Wi-Fi P2P group according to the notification message of the successful establishment of the Wi-Fi P2P group.
  • the driver and chip module of the smart phone notifies the communication module in the smart phone of the successful joining of the Wi-Fi P2P group.
  • the communication module in the smart phone after receiving the message, sends a message of successfully joining the Wi-Fi P2P group to the application on the smart phone.
  • the application on the smart phone after the application on the smart phone receives the message of successfully joining the Wi-Fi P2P group, it establishes a transmission channel based on the Wi-Fi P2P connection with the application on the large-screen device (for example, a file sharing application).
  • the application on the smartphone starts file sharing to the application on the large-screen device based on the transmission channel of the Wi-Fi P2P connection.
  • the method for establishing a Wi-Fi P2P connection provided by this application, when performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery , can support a variety of discovery methods, and support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability, and can be used as a platform-level capability for various applications.
  • various discovery methods such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.
  • the information required for the Wi-Fi P2P connection will be exchanged in stages, and the inherent information in the information required by the Wi-Fi P2P connection (for example: the list of channels supported by the device, P2P group SSID, PWD, whether Support broadband (such as whether to support 160MHz), device information, etc., are exchanged in advance before the Wi-Fi P2P service is initiated.
  • variable information in the information required for Wi-Fi P2P connection for example: Wi-Fi P2P connection status of the device, role, frequency of the AP (ie Wi-Fi hotspot) connected to the device, etc.
  • the variable information changes exchange in advance before the Wi-Fi P2P service is initiated, or exchange in the process of actually initiating the Wi-Fi P2P connection. Therefore, when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged.
  • Wi-Fi P2P connection When the Wi-Fi P2P connection is actually initiated, only some simple signaling (such as broadcast message, Bluetooth message, etc.) to complete the Wi-Fi P2P connection, thereby further shortening the time spent in the Wi-Fi P2P connection and improving the user experience. Moreover, it can be used in different product platforms to meet the needs of different upper-layer applications.
  • S205 may include:
  • the communication module in the smartphone sends a first broadcast message, which may be a BLE broadcast message, a BR broadcast message, or a Wi-Fi broadcast message.
  • the first broadcast message carries: the device identifier (deviceId) of the smart phone, the device type, the connection address, the version number, and the like.
  • the connection address may include: the MAC address of the smart phone, the IP address of the smart phone, the port number, and the like.
  • the communication module of the large-screen device replies with a second broadcast message, where the second broadcast message may be a BLE broadcast message, a BR broadcast message, or a Wi-Fi broadcast message, and the like.
  • the second broadcast message includes: a device identifier (deviceId) of the large-screen device, a device type, a connection address, a version number, and the like.
  • the connection address may include: the MAC address of the large-screen device, the IP address and port number of the large-screen device, and the like.
  • the communication module in the smartphone after receiving the second broadcast message, the communication module in the smartphone establishes a first connection with the large-screen device according to the connection address included in the second broadcast message. For example, if it is based on a MAC address, the first connection established is a BLE connection or a BR connection; if it is based on a MAC address, an IP address and a port number, the first connection established is a socket connection based on a local area network.
  • S206 can be executed.
  • S205 may include:
  • the communication module in the smartphone sends a first broadcast message, which may be a BLE broadcast message, a BR broadcast message, or a Wi-Fi broadcast message.
  • the first broadcast message carries: the device identifier (deviceId) of the smart phone, the device type, the connection address, the version number, and the like.
  • the connection address may include: the MAC address of the smart phone, the IP address of the smart phone, the port number, and the like.
  • the communication module of the large-screen device receives the first broadcast message.
  • the communication module of the large-screen device establishes a first connection with the smartphone according to the connection address included in the first broadcast message. For example, if it is based on the MAC address of the smartphone, the first connection established is a BLE connection or a BR connection; if it is based on the IP address and port number of the smartphone, the first connection established is a local area network-based socket connection.
  • the method for establishing a Wi-Fi P2P connection provided by this application, when performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery , can support a variety of discovery methods, and support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability, and can be used as a platform-level capability for various applications.
  • various discovery methods such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.
  • the information required for the Wi-Fi P2P connection will be exchanged in stages, and the inherent information in the information required by the Wi-Fi P2P connection (for example: the list of channels supported by the device, P2P group SSID, PWD, whether Support broadband (such as whether to support 160MHz), device information, etc. to exchange in advance before the Wi-Fi P2P service is initiated, and the variable information in the information required for Wi-Fi P2P connection (for example: device Wi-Fi P2P connection Status, role, frequency of the AP (ie Wi-Fi hotspot) connected to the device, etc.) After the variable information changes, it is exchanged in advance before the Wi-Fi P2P service is initiated, or the Wi-Fi P2P connection process is actually initiated.
  • the variable information required for Wi-Fi P2P connection for example: the list of channels supported by the device, P2P group SSID, PWD, whether Support broadband (such as whether to support 160MHz), device information, etc.
  • Wi-Fi P2P connection when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged.
  • a Wi-Fi P2P connection When a Wi-Fi P2P connection is actually initiated, it only needs to send some simple signaling (such as broadcast messages, Bluetooth messages, etc.) to complete the Wi-Fi P2P connection, thereby further shortening the time used for the Wi-Fi P2P connection.
  • Some simple signaling such as broadcast messages, Bluetooth messages, etc.
  • the first electronic device is a terminal device
  • the second electronic device is an access point device (access point, AP).
  • the second electronic device may be a router.
  • Wi-Fi connection inherent information that is, information that remains unchanged for a period of time during a Wi-Fi connection.
  • the router supports the frequency hopping function the working frequency or channel of the router may change at any time.
  • the router can change the working frequency of the changed working frequency. , channel and other information (for example, through Bluetooth packets, Wi-Fi packets, etc.) to the terminal device, or the terminal device can also actively request the router for information such as the frequency and channel of the router's operation.
  • channel and other information for example, through Bluetooth packets, Wi-Fi packets, etc.
  • the terminal device After the terminal device obtains the variable information of the Wi-Fi connection such as the frequency and channel of the router's operation (that is, during the Wi-Fi connection process, it may change at any time, and the information that will affect the Wi-Fi connection), the user actually triggers the terminal
  • the device establishes a Wi-Fi connection with the router, since the terminal device has previously acquired the inherent information (including the router's SSID and PWD, etc.) and variable information (including the router's working frequency, channel, etc.) , so that when the user uses the terminal device to initiate a Wi-Fi connection, most of the information has been exchanged.
  • the first terminal device directly scans the operating frequency and channel of the router, and only the terminal device needs to send some simple signaling. (For example, sending signaling through broadcast messages, Bluetooth messages, etc.) can complete the Wi-Fi connection, thereby further shortening the time-consuming of the Wi-Fi connection and improving the user experience.
  • the first electronic device is a terminal device
  • the second electronic device is a soft AP (soft AP).
  • a soft AP can be understood as a terminal device connected to a wired network or a wireless network, and the terminal device is used as a Wi-Fi hotspot to provide a Wi-Fi network for other terminal devices.
  • soft APs may include smart phones, tablet computers, netbooks, PDAs, computer handheld communication devices, etc. used by the user.
  • the first electronic device is the first terminal device used by the user
  • the second electronic device is the second terminal device used by the user.
  • the first terminal device and the second terminal device may exchange their respective Wi-Fi connection-specific information such as SSID and PWD during Wi-Fi connection (that is, information that remains unchanged for a period of time during Wi-Fi connection).
  • the first terminal device and the second terminal device can exchange Wi-Fi connection variable information such as their respective working frequencies and channels through broadcast messages (eg, Bluetooth messages, etc.) (in the Wi-Fi connection process, may change at any time and affect Wi-Fi connection information).
  • the first terminal device When the user actually triggers the first terminal device to establish a Wi-Fi connection with the second terminal device, because the first terminal device has previously acquired the inherent information (including the SSID of the second terminal device) for establishing a Wi-Fi connection with the second terminal device and PWD, etc.) and variable information (including the working frequency, channel, etc. of the second terminal device), so that when the user uses the first terminal device to actually initiate a Wi-Fi connection, most of the information has been exchanged, and the first terminal device The device only needs to send some simple signaling (such as broadcast packets, Bluetooth packets) to complete the Wi-Fi connection, thereby further shortening the time-consuming of the Wi-Fi connection and improving the user experience.
  • some simple signaling such as broadcast packets, Bluetooth packets
  • the smartphone and the large-screen device may establish a Wi-Fi connection using the above two methods.
  • the first electronic device and the second electronic device may further establish a communication connection in other manners, for example, the communication connection may be a Bluetooth connection or the like.
  • the communication connection may be a Bluetooth connection or the like.
  • the first electronic device and the second electronic device can exchange the inherent information and available information in the Wi-Fi connection through the communication connection. Changing information can increase the rate of information exchange and further shorten the time-consuming of Wi-Fi connections.
  • the first electronic device and the second electronic device may also exchange inherent information and variable information in the Wi-Fi connection through broadcast messages (eg, Bluetooth messages, Wi-Fi messages, etc.).
  • broadcast messages eg, Bluetooth messages, Wi-Fi messages, etc.
  • the embodiments of the present application are not limited herein.
  • the two-terminal device before the two-terminal device actually establishes a wireless communication connection provided by the present application, the two-terminal device exchanges information necessary for establishing the communication connection in advance, so that when the two-terminal device actually initiates the communication connection, most of the information has been exchanged.
  • the method of completing the communication connection only requires the two-end devices to send some simple signaling, which is not only applicable to the scenarios including establishing Wi-Fi connection and Wi-Fi P2P connection, but also applicable to establishing other communication connections ( For example, in a scenario of Bluetooth and Zigbee, this embodiment of the present application does not limit it.
  • the electronic device (including the above-mentioned first electronic device and the second electronic device) can be divided into functional modules.
  • each function can be divided into various function modules, or two or more functions can be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that, the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • the electronic device provided by the embodiment of the present application is used to execute the above method.
  • the embodiment provides any method for establishing a Wi-Fi P2P connection, so the same effect as the above implementation method can be achieved.
  • the electronic device may include a processing module, a memory module and a communication module.
  • the processing module may be used to control and manage the actions of the electronic device. For example, it may be used to support the electronic device to perform the steps performed by the processing unit.
  • the memory module can be used to support the storage of program codes and data, etc.
  • the communication module can be used to support the communication between the electronic device and other devices.
  • the processing module may be a processor or a controller. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure.
  • the processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and the like.
  • the storage module may be a memory.
  • the communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
  • FIG. 10 shows a schematic diagram of the hardware structure of an example of the electronic device 300 provided in the present application.
  • the electronic device 300 may be a smartphone or a large-screen device in the foregoing method embodiments.
  • the electronic device 300 may include a processor 310 , an external memory interface 320 , an internal memory 321 , a universal serial bus (USB) interface 330 , a charge management module 340 , a power management module 341 , and a battery 342 , Antenna 1, Antenna 2, wireless communication module 350, etc.
  • USB universal serial bus
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 300 .
  • the electronic device 300 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • Processor 310 may include one or more processing units.
  • the processor 310 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video Codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc.
  • application processor application processor
  • AP application processor
  • modem processor graphics processor
  • image signal processor image signal processor
  • ISP image signal processor
  • controller a video Codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • NPU neural-network processing unit
  • different processing units may be independent components, or may be integrated in one or more processors.
  • electronic device 300 may also include one or more processors 310 .
  • the controller can generate an operation control signal according to the instruction operation code and
  • processor 310 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM card interface, and/or USB interface, etc.
  • the USB interface 330 is an interface that conforms to the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 330 can be used to connect a charger to charge the electronic device 300, and can also be used to transmit data between the electronic device 300 and peripheral devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 500 .
  • the electronic device 300 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the wireless communication function of the electronic device 300 may be implemented by the antenna 1, the antenna 2, the wireless communication module 350, and the like.
  • the wireless communication module 350 can provide Wi-Fi (including Wi-Fi perception and Wi-Fi AP), Bluetooth (bluetooth, BT), mobile network, and wireless data transmission modules (for example, 433MHz, 868MHz) applied on the electronic device 300 , 515MHz) and other wireless communication solutions.
  • the wireless communication module 350 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 350 receives the electromagnetic wave via the antenna 1 or the antenna 2 (or, the antenna 1 and the antenna 2 ), filters and frequency modulates the electromagnetic wave signal, and sends the processed signal to the processor 310 .
  • the wireless communication module 350 can also receive the signal to be sent from the processor 310, perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1 or the antenna 2.
  • the external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 300.
  • the external memory card communicates with the processor 310 through the external memory interface 320 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 321 may be used to store one or more computer programs including instructions.
  • the processor 310 may execute the above-mentioned instructions stored in the internal memory 321, thereby enabling the electronic device 300 to execute the Wi-Fi direct connection data transmission method, various applications and data processing provided in some embodiments of the present application.
  • the internal memory 321 may include a code storage area and a data storage area. Among them, the code storage area can store the operating system.
  • the data storage area may store data and the like created during the use of the electronic device 300 .
  • the internal memory 321 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage components, flash memory components, universal flash storage (UFS), and the like.
  • the processor 310 may execute the instructions stored in the internal memory 321 and/or the instructions stored in the memory provided in the processor 310 to cause the electronic device 300 to execute any of the functions provided in the embodiments of the present application.
  • the electronic device 300 includes, but is not limited to, smart TVs, large-screen devices, mobile phones, tablet computers, notebooks, large-screen TVs, smart home items, PDAs, POS, in-vehicle computers, and the like.
  • smart TVs large-screen devices
  • mobile phones tablet computers
  • notebooks large-screen TVs
  • smart home items PDAs
  • POS in-vehicle computers
  • the embodiments of the present application are not limited herein.
  • each unit in the above apparatus can be realized in the form of software calling through the processing element; also can all be realized in the form of hardware; some units can also be realized in the form of software calling through the processing element, and some units can be realized in the form of hardware.
  • each unit can be a separately established processing element, or can be integrated in a certain chip of the device to be implemented, and can also be stored in the memory in the form of a program, which can be called by a certain processing element of the device and execute the unit's processing. Function.
  • the processing element may also be called a processor, which may be an integrated circuit with signal processing capability.
  • each step of the above method or each of the above units may be implemented by an integrated logic circuit of hardware in the processor element or implemented in the form of software being invoked by the processing element.
  • a unit in any of the above apparatuses may be one or more integrated circuits configured to implement the above methods, eg, one or more application specific integrated circuits (ASICs), or, one or more A plurality of digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • FPGAs field programmable gate arrays
  • the processing element can be a general-purpose processor, such as a central processing unit (central processing unit, CPU) or other processors that can invoke programs.
  • CPU central processing unit
  • these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • An embodiment of the present application further provides a system for establishing a Wi-Fi P2P connection, the system comprising: the first electronic device (such as a smartphone) and a second electronic device (such as a large-screen device) provided in the above method embodiments ).
  • Embodiments of the present application further provide a computer-readable storage medium for storing computer program codes, where the computer program includes instructions for executing any of the methods for establishing a Wi-Fi P2P connection provided by the above embodiments of the present application.
  • the readable medium may be a read-only memory (read-only memory, ROM) or a random access memory (random access memory, RAM), which is not limited in this embodiment of the present application.
  • the present application also provides a computer program product, the computer program product includes instructions, when the instructions are executed, to cause the first electronic device and the second electronic device to perform corresponding operations corresponding to the above methods.
  • An embodiment of the present application further provides a chip located in a communication device, the chip includes: a processing unit and a communication unit, the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface, a pin or a circuit, etc.
  • the processing unit can execute computer instructions, so that the communication device executes any of the methods for establishing a Wi-Fi P2P connection provided by the above embodiments of the present application.
  • the computer instructions are stored in a storage unit.
  • the storage unit is a storage unit in the chip, such as a register, a cache, etc.
  • the storage unit can also be a storage unit in the terminal located outside the chip, such as ROM or other storage units that can store static information and instructions. Types of static storage devices, random RAM, etc.
  • the processor mentioned in any one of the above may be a CPU, a microprocessor, an ASIC, or one or more integrated circuits for controlling the program execution of the above-mentioned transmission method of feedback information.
  • the processing unit and the storage unit can be decoupled, respectively disposed on different physical devices, and connected in a wired or wireless manner to implement the respective functions of the processing unit and the storage unit, so as to support the system chip to implement the above embodiments various functions in .
  • the processing unit and the memory may also be coupled on the same device.
  • the communication device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the above-provided method. The beneficial effects in the corresponding method will not be repeated here.
  • the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be ROM, programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM) , EEPROM) or flash memory.
  • Volatile memory can be RAM, which acts as an external cache.
  • RAM random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate Synchronous dynamic random access memory double data rate SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • synchronous link dynamic random access memory direct memory bus random access memory Access memory
  • direct rambus RAM direct rambus RAM
  • the methods in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software When implemented in 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.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer program or instructions may be stored in or transmitted over a computer-readable storage medium.
  • the computer-readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server that integrates one or more available media.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a readable storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned readable storage medium includes: U disk, removable hard disk, ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided in the present application are a method for establishing a Wi-Fi P2P connection, and an electronic device. The method comprises: before receiving a first operation of a user, a first electronic device acquiring connection information for a second electronic device to establish a Wi-Fi P2P connection, and the first electronic device receiving the first operation; and in response to the first operation, the first electronic device establishing the Wi-Fi P2P connection with the second electronic device according to the connection information for the second electronic device to establish the Wi-Fi P2P connection. By means of the method provided in the present application, information required for a Wi-Fi P2P connection is exchanged ahead of an electronic device truly initiating the Wi-Fi P2P connection, such that when a user truly initiates the Wi-Fi P2P connection by using the electronic device, most of the information has already been exchanged, thereby shortening the time consumed for a Wi-Fi P2P connection, and improving the user experience.

Description

建立Wi-Fi P2P连接的方法和电子设备Method and electronic device for establishing Wi-Fi P2P connection
本申请要求于2021年4月28日提交国家知识产权局、申请号为202110469588.5、申请名称为“建立Wi-Fi P2P连接的方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110469588.5 and the application title "Method and Electronic Device for Establishing a Wi-Fi P2P Connection" filed with the State Intellectual Property Office on April 28, 2021, the entire contents of which are by reference Incorporated in this application.
技术领域technical field
本申请涉及通信领域,更为具体的,涉及一种建立Wi-Fi P2P连接的方法和电子设备。The present application relates to the field of communications, and more specifically, to a method and electronic device for establishing a Wi-Fi P2P connection.
背景技术Background technique
Wi-Fi直连(wireless fidelity peer-to-peer,Wi-Fi P2P)技术是无线保真技术(wireless-fidelity,
Figure PCTCN2022087673-appb-000001
)联盟推出的“Wi-Fi DIRECT”标准协议下的一项重要技术,Wi-Fi P2P可以支持两个Wi-Fi设备在没有Wi-Fi热点介入的情况下,直接与对方设备进行连接和通信。
Wi-Fi direct connection (wireless fidelity peer-to-peer, Wi-Fi P2P) technology is wireless fidelity technology (wireless-fidelity,
Figure PCTCN2022087673-appb-000001
) An important technology under the "Wi-Fi DIRECT" standard protocol launched by the alliance, Wi-Fi P2P can support two Wi-Fi devices to directly connect and communicate with each other's devices without the intervention of Wi-Fi hotspots .
一个完整的Wi-Fi P2P业务包括:Wi-Fi P2P设备发现、Wi-Fi P2P设备连接、Wi-Fi P2P设备业务数据传输这三个阶段。在Wi-Fi P2P设备连接建立后形成一个P2P群组(或者也可以称为Wi-Fi P2P群组)。A complete Wi-Fi P2P service includes three stages: Wi-Fi P2P device discovery, Wi-Fi P2P device connection, and Wi-Fi P2P device service data transmission. A P2P group (or also called a Wi-Fi P2P group) is formed after the Wi-Fi P2P device connection is established.
按照标准的Wi-Fi DIRECT协议建立Wi-Fi P2P设备连接,Wi-Fi P2P设备连接需要的时间较长,不能满足用户快速利用Wi-Fi P2P链路传输业务数据的要求,用户体验差。The Wi-Fi P2P device connection is established according to the standard Wi-Fi DIRECT protocol. The Wi-Fi P2P device connection takes a long time, which cannot meet the requirements of users to quickly use the Wi-Fi P2P link to transmit business data, and the user experience is poor.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种建立Wi-Fi P2P连接的方法和电子设备,将进行Wi-Fi P2P连接需要的信息在电子设备真正发起Wi-Fi P2P连接之前提前进行交换,从而使得在用户利用该电子设备真正发起Wi-Fi P2P连接时,大部分的信息已经交互完成,从而进一步缩短Wi-Fi P2P连接的耗时,提高用户体验。The present application provides a method and an electronic device for establishing a Wi-Fi P2P connection. The information required for the Wi-Fi P2P connection is exchanged in advance before the electronic device actually initiates the Wi-Fi P2P connection, so that the user can use the electronic device to use the electronic device. When the device actually initiates a Wi-Fi P2P connection, most of the information has been exchanged, which further shortens the time-consuming of the Wi-Fi P2P connection and improves the user experience.
第一方面,提供了一种发现和连接电子设备的方法,该方法包括:第一电子设备获取第二电子设备的第一连接信息,第一连接信息用于建立Wi-Fi P2P连接,第一操作用于指示与第二电子设备建立Wi-Fi P2P连接第一电子设备接收第一操作;第一电子设备响应于第一操作,根据第一连接信息,与第二电子设备建立Wi-Fi P2P连接。In a first aspect, a method for discovering and connecting an electronic device is provided, the method comprising: a first electronic device acquiring first connection information of a second electronic device, the first connection information is used to establish a Wi-Fi P2P connection, the first The operation is used to instruct to establish a Wi-Fi P2P connection with the second electronic device and the first electronic device receives the first operation; the first electronic device responds to the first operation and establishes Wi-Fi P2P with the second electronic device according to the first connection information connect.
第一方面提供的建立Wi-Fi P2P连接的方法,在用户触发第一电子和和第二电子设备之间进行Wi-Fi P2P连接的第一操作之前,将第二电子设备进行Wi-Fi P2P连接需要的第一连接信息在第一电子设备和第二电子设备建立Wi-Fi P2P连接之前提前进行交换,从而使得在用户利用该电子设备真正发起Wi-Fi P2P连接时,大部分的信息已经交互完成,仅仅需要发送一些简单的信令即可完成Wi-Fi P2P连接,从而进一步缩短Wi-Fi P2P连接的耗时,提高用户体验。In the method for establishing a Wi-Fi P2P connection provided by the first aspect, before the user triggers the first operation of performing the Wi-Fi P2P connection between the first electronic device and the second electronic device, the second electronic device is Wi-Fi P2P connected The first connection information required for the connection is exchanged in advance before the first electronic device and the second electronic device establish a Wi-Fi P2P connection, so that when the user uses the electronic device to actually initiate a Wi-Fi P2P connection, most of the information has been After the interaction is completed, it is only necessary to send some simple signaling to complete the Wi-Fi P2P connection, thereby further shortening the time-consuming of the Wi-Fi P2P connection and improving the user experience.
在第一方面一种可能的实现方式中,第一连接信息包括:第二电子设备用于建立Wi-Fi P2P连接的固有信息和/或第二电子设备用于建立Wi-Fi P2P连接的可变信息。In a possible implementation manner of the first aspect, the first connection information includes: inherent information used by the second electronic device to establish a Wi-Fi P2P connection and/or available information used by the second electronic device to establish a Wi-Fi P2P connection change information.
示例性的,第二电子设备用于建立Wi-Fi P2P连接的固有信息包括:第二电子设备支持的信道列表、第二电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的SSID、第二电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的PWD、第二电子设备是否支持Wi-Fi P2P连接、第二电子设备是否支持宽频、第二电子设备的设备信息中的至少一种。Exemplarily, the inherent information used by the second electronic device to establish a Wi-Fi P2P connection includes: a list of channels supported by the second electronic device, and the SSID of the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group. , PWD of the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group, whether the second electronic device supports Wi-Fi P2P connection, whether the second electronic device supports broadband, and the device information of the second electronic device at least one of.
示例性的,第二电子设备用于建立Wi-Fi P2P连接的可变信息包括:第二电子设备的Wi-Fi P2P连接状态和/或第二电子设备连接的Wi-Fi热点的频率。Exemplarily, the variable information used by the second electronic device to establish a Wi-Fi P2P connection includes: a Wi-Fi P2P connection status of the second electronic device and/or a frequency of a Wi-Fi hotspot to which the second electronic device is connected.
在第一方面一种可能的实现方式中,该方法还包括:第一电子设备和第二电子设备建立第一连接;第一电子设备获取第二电子设备的Wi-Fi P2P连接中的第一连接信息,包括:第一电子设备通过第一连接,接收第二电子设备发送的第一连接信息。In a possible implementation manner of the first aspect, the method further includes: establishing a first connection between the first electronic device and the second electronic device; and acquiring the first electronic device in the Wi-Fi P2P connection of the second electronic device by the first electronic device The connection information includes: the first electronic device receives the first connection information sent by the second electronic device through the first connection.
示例性的,第一连接包括:蓝牙连接、Wi-Fi连接、NFC连接、Zigbee连接、USB连接等中的任意一种。在该实现方式中,在进行Wi-Fi P2P设备发现时,可以利用多种发现手段(例如BLE发现、局域网发现、Wi-Fi P2P发现、广播发现等)进行设备发现,可以支持多种发现手段,同时支持使用不同的类型的连接方式或者广播方式进行信息的交互,提高了信息交换的效率,并且提高了通用性和可扩展性。Exemplarily, the first connection includes: any one of a Bluetooth connection, a Wi-Fi connection, an NFC connection, a Zigbee connection, a USB connection, and the like. In this implementation, when Wi-Fi P2P device discovery is performed, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery, and various discovery methods can be supported At the same time, it supports the use of different types of connection methods or broadcast methods to exchange information, which improves the efficiency of information exchange, and improves the versatility and scalability.
在第一方面一种可能的实现方式中,第一电子设备获取第二电子设备的第一连接信息,包括:第一电子设备通过第一广播报文,接收第二电子设备发送的第一连接信息。示例性的,第一广播报文可以包括通过BLE、BR、Wi-Fi等广播的报文。In a possible implementation manner of the first aspect, acquiring the first connection information of the second electronic device by the first electronic device includes: the first electronic device receives the first connection sent by the second electronic device through the first broadcast message information. Exemplarily, the first broadcast packet may include a packet broadcast through BLE, BR, Wi-Fi, or the like.
示例性的,第二电子设备用于建立Wi-Fi P2P连接的可变信息和第二电子设备用于建立Wi-Fi P2P连接的固有信息可以分别利用不同的信令发送给第一电子设备,也可以利用同一个信令发送给第一电子设备。Exemplarily, the variable information used by the second electronic device to establish a Wi-Fi P2P connection and the inherent information used by the second electronic device to establish a Wi-Fi P2P connection can be respectively sent to the first electronic device by using different signaling, The same signaling can also be used to send to the first electronic device.
在第一方面一种可能的实现方式中,第二电子设备发送第二电子设备用于建立Wi-Fi P2P连接的可变信息的时机,可以是周期性的发送,或者,可以在第二电子设备和第一电子设备真正建立Wi-Fi P2P连接的过程中发送,可以在第二电子设备和第一电子设备真正建立Wi-Fi P2P连接之前发送,或者,在第二电子设备用于建立Wi-Fi P2P连接的可变信息变化后,间隔一段时间后发送,或者,在第二电子设备用于建立Wi-Fi P2P连接的可变信息变化后立即进行发送。In a possible implementation manner of the first aspect, the timing at which the second electronic device sends the variable information used by the second electronic device to establish the Wi-Fi P2P connection may be periodically sent, or may be sent at the second electronic device It can be sent when the device and the first electronic device actually establish a Wi-Fi P2P connection, and can be sent before the second electronic device and the first electronic device actually establish a Wi-Fi P2P connection, or, when the second electronic device is used to establish Wi-Fi -After the variable information of the Fi P2P connection is changed, it is sent after a period of time, or, it is sent immediately after the variable information used by the second electronic device to establish the Wi-Fi P2P connection changes.
在第一方面一种可能的实现方式中,第二电子设备向第一电子设备发送第二电子设备用于建立Wi-Fi P2P连接的可变信息的时机,可以在向第一电子设备发送用于建立Wi-Fi P2P连接的固有信息之前进行,也可以在发送用于建立Wi-Fi P2P连接的固有信息之后进行,或者,也可以和发送用于建立Wi-Fi P2P连接的固有信息同时进行。In a possible implementation manner of the first aspect, the timing at which the second electronic device sends the variable information used by the second electronic device to establish a Wi-Fi P2P connection to the first electronic device may be sent to the first electronic device It can be performed before the inherent information for establishing a Wi-Fi P2P connection, or after sending the inherent information for establishing a Wi-Fi P2P connection, or it can be performed at the same time as sending the inherent information for establishing a Wi-Fi P2P connection. .
在第一方面一种可能的实现方式中,该方法还包括:第一电子设备向第二电子设备发送第一电子设备的第二连接信息;该二连接信息用于建立Wi-Fi P2P连接,第二连接信息包括:第一电子设备用于建立Wi-Fi P2P连接的固有信息和/或第一电子设备用于建立Wi-Fi P2P连接的可变信息。在该实现方式中,将第一电子设备进行Wi-Fi P2P连接需要的信息在电子设备之前提前发送给第二电子设备,从而实现了将进行Wi-Fi P2P连接需要的信息在电子设备真正发起Wi-Fi P2P连接之前提前进行交换,从而缩短Wi-Fi P2P连接的耗时,提高用户体验。In a possible implementation manner of the first aspect, the method further includes: the first electronic device sends second connection information of the first electronic device to the second electronic device; the second connection information is used to establish a Wi-Fi P2P connection, The second connection information includes: inherent information used by the first electronic device to establish a Wi-Fi P2P connection and/or variable information used by the first electronic device to establish a Wi-Fi P2P connection. In this implementation, the information required for the first electronic device to perform a Wi-Fi P2P connection is sent to the second electronic device in advance before the electronic device, thereby realizing that the information required for the Wi-Fi P2P connection is actually initiated by the electronic device The Wi-Fi P2P connection is exchanged in advance, thereby shortening the time-consuming of the Wi-Fi P2P connection and improving the user experience.
在第一方面一种可能的实现方式中,第一电子设备向第二电子设备发送第一电子设备的第二连接信息,包括:第一电子设备通过第一广播报文,向第二电子设备发送第一电子设备的第二连接信息。示例性的,第一广播报文可以包括通过BLE、BR、Wi-Fi等广播的报文。In a possible implementation manner of the first aspect, sending the second connection information of the first electronic device by the first electronic device to the second electronic device includes: the first electronic device sends the second electronic device to the second electronic device through the first broadcast message Send the second connection information of the first electronic device. Exemplarily, the first broadcast packet may include a packet broadcast through BLE, BR, Wi-Fi, or the like.
在第一方面一种可能的实现方式中,第一电子设备向第二电子设备发送第一电子设备的第二连接信息,包括:第一电子设备通过第一连接,向第二电子设备发送第一电子设备的第二连接信息。In a possible implementation manner of the first aspect, sending the second connection information of the first electronic device by the first electronic device to the second electronic device includes: the first electronic device sends the first electronic device to the second electronic device through the first connection Second connection information of an electronic device.
示例性的,第一电子设备用于建立Wi-Fi P2P连接的可变信息和第一电子设备用于建立Wi-Fi P2P连接的固有信息可以分别利用不同的信令发送给第二电子设备,也可以利用同一个信令发送给第二电子设备。Exemplarily, the variable information used by the first electronic device to establish a Wi-Fi P2P connection and the inherent information used by the first electronic device to establish a Wi-Fi P2P connection can be respectively sent to the second electronic device by using different signaling, The same signaling can also be used to send to the second electronic device.
在第一方面一种可能的实现方式中,第一电子设备向第二电子设备发送第一电子设备用于建立Wi-Fi P2P连接的可变信息的时机,可以是周期性的发送,或者,可以在第一电子设备和第二电子设备之间建立Wi-Fi P2P连接的过程中发送,或者,在第一电子设备用于建立Wi-Fi P2P连接的可变信息变化后,间隔一段时间后发送,或者,在第一电子设备用于建立Wi-Fi P2P连接的可变信息变化后立即进行发送。In a possible implementation manner of the first aspect, the timing at which the first electronic device sends the variable information used by the first electronic device to establish the Wi-Fi P2P connection to the second electronic device may be sent periodically, or, It can be sent during the process of establishing a Wi-Fi P2P connection between the first electronic device and the second electronic device, or, after the variable information used by the first electronic device to establish a Wi-Fi P2P connection changes, after a period of time Send, or send immediately after the variable information used by the first electronic device to establish the Wi-Fi P2P connection changes.
示例性的,第一电子设备向第二电子设备发送的Wi-Fi P2P连接中的可变信息的时机,可以在第一电子设备向第二电子设备发送第一电子设备用于建立Wi-Fi P2P连接的固有信息之前进行,也可以在第一电子设备向第二电子设备发送第一电子设备用于建立Wi-Fi P2P连接的固有信息之后进行,或者,也可以和第一电子设备向第二电子设备发送第一电子设备Wi-Fi P2P连接中的固有信息同时进行。Exemplarily, the timing of the variable information in the Wi-Fi P2P connection sent by the first electronic device to the second electronic device may be when the first electronic device sends the first electronic device to the second electronic device for establishing Wi-Fi It can be performed before the inherent information of the P2P connection, or after the first electronic device sends the inherent information of the first electronic device to establish the Wi-Fi P2P connection to the second electronic device, or it can also be performed with the first electronic device to the second electronic device. The two electronic devices transmit the inherent information in the Wi-Fi P2P connection of the first electronic device simultaneously.
示例性的,第一电子设备用于建立Wi-Fi P2P连接的固有信息包括:第一电子设备支持的信道列表、第一电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的SSID、第一电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的PWD、第一电子设备是否支持Wi-Fi P2P连接、第一电子设备是否支持宽频、第二电子设备的设备信息中的至少一种。Exemplarily, the inherent information used by the first electronic device to establish a Wi-Fi P2P connection includes: a list of channels supported by the first electronic device, and the SSID of the Wi-Fi P2P group when the first electronic device creates a Wi-Fi P2P group. , PWD of the Wi-Fi P2P group when the first electronic device creates a Wi-Fi P2P group, whether the first electronic device supports Wi-Fi P2P connection, whether the first electronic device supports broadband, and the device information of the second electronic device at least one of.
示例性的,第一电子设备用于建立Wi-Fi P2P连接的可变信息包括:第一电子设备的Wi-Fi P2P连接状态和/或第一电子设备连接的Wi-Fi热点的频率。Exemplarily, the variable information used by the first electronic device to establish a Wi-Fi P2P connection includes: a Wi-Fi P2P connection status of the first electronic device and/or a frequency of a Wi-Fi hotspot to which the first electronic device is connected.
在第一方面一种可能的实现方式中,在第一电子设备和第二电子设备建立第一连接后,第一电子设备通过第一连接接收第一连接信息之前,该方法还包括:第一电子设备和第二电子设备通过第一连接进行安全认证;在该安全认证通过后,第一电子设备将第二电子设备加入到可信列表设备中。在该实现方式中,第一电子设备和第二电子设备通过第一连接进行设备的安全认证,可以实现第一电子设备和第二电子设备之间相互进行可信设备的确定,在确定可信设备之后,进行Wi-Fi P2P连接中的固有信息和可变信息的交换,保证了信息交换的安全性,避免了信息泄漏的风险。In a possible implementation manner of the first aspect, after the first electronic device and the second electronic device establish the first connection, and before the first electronic device receives the first connection information through the first connection, the method further includes: a first The electronic device and the second electronic device perform security authentication through the first connection; after the security authentication is passed, the first electronic device adds the second electronic device to the trusted list device. In this implementation manner, the first electronic device and the second electronic device perform device security authentication through the first connection, so that the first electronic device and the second electronic device can mutually determine trusted devices. After the device, the inherent information and variable information in the Wi-Fi P2P connection are exchanged, which ensures the security of information exchange and avoids the risk of information leakage.
在第一方面一种可能的实现方式中,第一电子设备如果通过第一连接接收第二电子设备发送的Wi-Fi P2P连接中的固有信息和可变信息,则发送方可以先利用加密密钥将信息进行加密后发送,接收方接收到信息后,通过解密密钥解密,这样可以保证信息传输的安全性。In a possible implementation manner of the first aspect, if the first electronic device receives the inherent information and variable information in the Wi-Fi P2P connection sent by the second electronic device through the first connection, the sender can first use the encrypted password The key encrypts the information and sends it. After the receiver receives the information, it decrypts it through the decryption key, which can ensure the security of information transmission.
在第一方面一种可能的实现方式中,在第一电子设备向第二电子设备发送用于建立Wi-Fi P2P连接的固有信息之前,如果第一电子设备还没有确定第二电子设备为可 信设备,则第一电子设备可以将第一电子设备用于Wi-Fi P2P连接的固有信息中的部分信息发送给第二电子设备。例如,可以将第一电子设备的设备信息发送给第二电子设备。对于第一电子设备用于Wi-Fi P2P连接中固有信息中的其他信息(例如:第一电子设备支持的信道列表、第一电子设备创建P2P群组时P2P群组的SSID、第一电子设备创建P2P群组时P2P群组的PWD、第一电子设备自身是否支持Wi-Fi P2P连接、第一电子设备是否支持宽频等)并不会发送给第二电子设备。在第一电子设备确定第二电子设备为可信设备之后,才将第一电子设备Wi-Fi P2P连接中的固有信息中的其他信息发送给第二电子设备。In a possible implementation manner of the first aspect, before the first electronic device sends the inherent information for establishing a Wi-Fi P2P connection to the second electronic device, if the first electronic device has not determined that the second electronic device is available If the first electronic device is used for Wi-Fi P2P connection, the first electronic device can send part of the information in the inherent information used by the first electronic device for the Wi-Fi P2P connection to the second electronic device. For example, the device information of the first electronic device may be sent to the second electronic device. For other information in the inherent information in the Wi-Fi P2P connection used by the first electronic device (for example: the list of channels supported by the first electronic device, the SSID of the P2P group when the first electronic device creates a P2P group, the first electronic device When creating a P2P group, the PWD of the P2P group, whether the first electronic device itself supports Wi-Fi P2P connection, whether the first electronic device supports broadband, etc.) will not be sent to the second electronic device. After the first electronic device determines that the second electronic device is a trusted device, other information in the inherent information in the Wi-Fi P2P connection of the first electronic device is sent to the second electronic device.
示例性的,如果第一电子设备还没有确定第二电子设备为可信设备,则用户还可以在设置中自主选择将第一电子设备Wi-Fi P2P连接中的固有信息中的哪些或者哪个信息发送给第二电子设备。Exemplarily, if the first electronic device has not yet determined that the second electronic device is a trusted device, the user can also independently select which or which of the inherent information in the Wi-Fi P2P connection of the first electronic device is to be used in the settings. sent to the second electronic device.
示例性的,如果第一电子设备已经确定第二电子设备为可信设备,则可以将第一电子设备Wi-Fi P2P连接中的固有信息中的全部信息发送给第二电子设备。Exemplarily, if the first electronic device has determined that the second electronic device is a trusted device, all information in the inherent information in the Wi-Fi P2P connection of the first electronic device may be sent to the second electronic device.
对于第二电子设备而言,如果还没有确定第一电子设备为可信设备,可以利用类似的方式针对可信设备和不可信设备分别分享或者发送第二电子设备Wi-Fi P2P连接中的不同的固有信息。For the second electronic device, if it has not been determined that the first electronic device is a trusted device, a similar method can be used to share or send the difference in the Wi-Fi P2P connection of the second electronic device for the trusted device and the untrusted device, respectively. inherent information.
在第一方面一种可能的实现方式中,在第一电子设备向第二电子设备发送用于建立Wi-Fi P2P连接的可变信息之前,如果第一电子设备还没有确定第二电子设备为可信设备,则第一电子设备可以将第一电子设备用于Wi-Fi P2P连接的可变信息中的部分信息发送给第二电子设备。对于第一电子设备用于Wi-Fi P2P连接中可变信息中的其他信息并不会发送给第二电子设备。在第一电子设备确定第二电子设备为可信设备之后,才将第一电子设备Wi-Fi P2P连接中的可变信息中的其他信息发送给第二电子设备。In a possible implementation manner of the first aspect, before the first electronic device sends the variable information for establishing a Wi-Fi P2P connection to the second electronic device, if the first electronic device has not determined that the second electronic device is If the device is a trusted device, the first electronic device can send part of the information in the variable information used by the first electronic device for the Wi-Fi P2P connection to the second electronic device. Other information in the variable information used by the first electronic device for the Wi-Fi P2P connection will not be sent to the second electronic device. After the first electronic device determines that the second electronic device is a trusted device, other information in the variable information in the Wi-Fi P2P connection of the first electronic device is sent to the second electronic device.
示例性的,如果第一电子设备还没有确定第二电子设备为可信设备,则用户还可以在设置中自主选择将第一电子设备Wi-Fi P2P连接中的可变信息中的哪些或者哪个信息发送给第二电子设备。Exemplarily, if the first electronic device has not yet determined that the second electronic device is a trusted device, the user can also independently select which or which of the variable information in the Wi-Fi P2P connection of the first electronic device to be connected in the settings. The information is sent to the second electronic device.
如果第一电子设备已经确定第二电子设备为可信设备,则可以将第一电子设备Wi-Fi P2P连接中的可变信息中的全部信息发送给第二电子设备。If the first electronic device has determined that the second electronic device is a trusted device, it can send all the information in the variable information in the Wi-Fi P2P connection of the first electronic device to the second electronic device.
对于第二电子设备而言,如果还没有确定第一电子设备为可信设备,可以利用类似的方式针对可信设备和不可信设备分别分享或者发送第二电子设备Wi-Fi P2P连接中的不同的可变信息。For the second electronic device, if it has not been determined that the first electronic device is a trusted device, a similar method can be used to share or send the difference in the Wi-Fi P2P connection of the second electronic device for the trusted device and the untrusted device, respectively. variable information.
在第一方面一种可能的实现方式中,该方法还包括:在第一电子设备接收第一操作后,第一电子设备获取第二电子设备的第三连接信息,第三连接信息包括:除第一连接信息之外、第二电子设备用于建立Wi-Fi P2P连接的信息。In a possible implementation manner of the first aspect, the method further includes: after the first electronic device receives the first operation, the first electronic device acquires third connection information of the second electronic device, where the third connection information includes: In addition to the first connection information, information used by the second electronic device to establish a Wi-Fi P2P connection.
示例性的,如果第一连接信息不包括第二电子设备用于建立Wi-Fi P2P连接的固有信息,则第三连接信息包括第二电子设备用于建立Wi-Fi P2P连接的固有信息。Exemplarily, if the first connection information does not include inherent information used by the second electronic device to establish a Wi-Fi P2P connection, the third connection information includes inherent information used by the second electronic device to establish a Wi-Fi P2P connection.
示例性的,如果第一连接信息不包括第二电子设备用于建立Wi-Fi P2P连接的可变信息,则第三连接信息包括第二电子设备用于建立Wi-Fi P2P连接的可变信息。Exemplarily, if the first connection information does not include variable information used by the second electronic device to establish a Wi-Fi P2P connection, the third connection information includes variable information used by the second electronic device to establish a Wi-Fi P2P connection .
示例性的,如果第一连接信息包括第二电子设备用于建立Wi-Fi P2P连接的固有 信息中的部分信息,则第三连接信息包括:第二电子设备用于建立Wi-Fi P2P连接的固有信息中,除过该部分信息之外的信息。Exemplarily, if the first connection information includes part of the inherent information used by the second electronic device to establish a Wi-Fi P2P connection, the third connection information includes: the second electronic device is used to establish a Wi-Fi P2P connection. Among the inherent information, information other than this part of the information.
示例性的,如果第一连接信息包括第二电子设备用于建立Wi-Fi P2P连接的可变信息中的部分信息,则第三连接信息包括:第二电子设备用于建立Wi-Fi P2P连接的可变信息中,除过该部分信息之外的信息。Exemplarily, if the first connection information includes part of the variable information used by the second electronic device to establish a Wi-Fi P2P connection, the third connection information includes: the second electronic device is used to establish a Wi-Fi P2P connection In the variable information of , the information other than this part of the information.
在第一方面一种可能的实现方式中,第一电子设备响应于第一操作,根据第一连接信息,与第二电子设备建立Wi-Fi P2P连接,包括:第一电子设备根据第一电子设备用于建立Wi-Fi P2P连接的固有信息、第一电子设备用于建立Wi-Fi P2P连接的固有信息、第一连接信息和第三连接信息,确定Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、该Wi-Fi P2P群组的SSID和PWD,第一电子设备向第二电子设备发送第二广播报文,与第二电子设备建立该Wi-Fi P2P群组,第二广播报文包括:第一电子设备的MAC地址、IP地址以及端口号、该Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、该Wi-Fi P2P群组的SSID和PWD。在该实现方式中,第一电子设备和第二电子设备在发现设备后,将进行Wi-Fi P2P连接需要的信息提前进行交换,从而使得在真正发起Wi-Fi P2P连接时,Wi-Fi P2P连接所必须的部分信息或者全部信息已经交互完成,在真正发起Wi-Fi P2P连接时,仅仅需要发送一些简单的信令(例如广播报文、蓝牙报文等)即可完成Wi-Fi P2P连接,从而进一步缩短Wi-Fi P2P连接所用的时间,提高用户体验。并且,可以使用在不同的产品平台,满足不同上层应用的需求。In a possible implementation manner of the first aspect, the first electronic device establishes a Wi-Fi P2P connection with the second electronic device according to the first connection information in response to the first operation, including: the first electronic device according to the first electronic device The inherent information used by the device to establish a Wi-Fi P2P connection, the inherent information used by the first electronic device to establish a Wi-Fi P2P connection, the first connection information and the third connection information, determine the frequency of Wi-Fi P2P group establishment, GC device and GO device role assignment, the SSID and PWD of the Wi-Fi P2P group, the first electronic device sends a second broadcast message to the second electronic device, and establishes the Wi-Fi P2P group with the second electronic device, The second broadcast message includes: the MAC address, IP address and port number of the first electronic device, the frequency of the Wi-Fi P2P group establishment, the role assignment of the GC device and the GO device, the SSID and PWD. In this implementation manner, after discovering the devices, the first electronic device and the second electronic device exchange information required for Wi-Fi P2P connection in advance, so that when Wi-Fi P2P connection is actually initiated, Wi-Fi P2P Some or all of the information necessary for the connection has been exchanged. When a Wi-Fi P2P connection is actually initiated, it is only necessary to send some simple signaling (such as broadcast messages, Bluetooth messages, etc.) to complete the Wi-Fi P2P connection. , thereby further shortening the time spent on Wi-Fi P2P connection and improving user experience. Moreover, it can be used in different product platforms to meet the needs of different upper-layer applications.
示例性的,第二广播报文可以包括通过BLE、BR、Wi-Fi等广播的报文。Exemplarily, the second broadcast packet may include a packet broadcast through BLE, BR, Wi-Fi, or the like.
在第一方面一种可能的实现方式中,如果在该Wi-Fi P2P群组中,第一电子设备为GO设备,第二电子设备为GC设备,则由第一电子设备建立该Wi-Fi P2P群组,第二电子设备根据Wi-Fi P2P群组信息(该Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、该Wi-Fi P2P群组的SSID和PWD)加入该Wi-Fi P2P群组。In a possible implementation manner of the first aspect, if in the Wi-Fi P2P group, the first electronic device is a GO device and the second electronic device is a GC device, the first electronic device establishes the Wi-Fi P2P group, the second electronic device joins the Wi-Fi P2P group according to the Wi-Fi P2P group information (the frequency of the Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group). Wi-Fi P2P groups.
在第一方面一种可能的实现方式中,如果在该Wi-Fi P2P群组中,第二电子设备为GO设备,第一电子设备为GC设备,则由第二电子设备建立该Wi-Fi P2P群组,第一电子设备根据Wi-Fi P2P群组信息(该Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、该Wi-Fi P2P群组的SSID和PWD)加入该Wi-Fi P2P群组。In a possible implementation manner of the first aspect, if in the Wi-Fi P2P group, the second electronic device is a GO device and the first electronic device is a GC device, the second electronic device establishes the Wi-Fi P2P group, the first electronic device joins the Wi-Fi P2P group according to the Wi-Fi P2P group information (the frequency of the Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group). Wi-Fi P2P groups.
在第一方面一种可能的实现方式中,该方法还包括:第一电子设备通过该Wi-Fi P2P连接,向第二电子设备发送业务的数据。In a possible implementation manner of the first aspect, the method further includes: the first electronic device sends service data to the second electronic device through the Wi-Fi P2P connection.
第二方面,提供一种建立通信连接的方法,该方法包括:在第一电子设备接收用户的第一操作之前,第一电子设备获取第二电子设备的第四连接信息,第四连接信息用于建立通信连接,第一操作用于指示与第二电子设备建立该通信连接,第四连接信息要信息包括:第二电子设备的工作频率信息和/或通信信道信息;第一电子设备接收第一操作;第一电子设备响应于第一操作,根据第四连接信息,与第二电子设备建立该通信连接。In a second aspect, there is provided a method for establishing a communication connection, the method comprising: before the first electronic device receives a first operation of a user, the first electronic device obtains fourth connection information of the second electronic device, and the fourth connection information uses For establishing a communication connection, the first operation is used to instruct the establishment of the communication connection with the second electronic device, and the fourth connection information requires information including: working frequency information and/or communication channel information of the second electronic device; An operation; in response to the first operation, the first electronic device establishes the communication connection with the second electronic device according to the fourth connection information.
第二方面提供的方法,在双端设备真正建立无线通信连接之前,双端设备提前交换建立该通信连接所必须的信息(包括设备的工作频率信息和/或通信信道信息等),从而使得在双端设备真正发起通信连接时,大部分的信息已经交互完成,仅仅需要双 端设备发送一些简单的信令即可完成通信连,从而进一步缩短建立通信连接所用的时间,提高用户体验。In the method provided by the second aspect, before the two-end devices actually establish a wireless communication connection, the two-end devices exchange information (including the operating frequency information and/or communication channel information of the devices, etc.) necessary for establishing the communication connection in advance, so that the When the two-end device actually initiates the communication connection, most of the information has been exchanged, and the communication connection only needs to be sent by the two-end device to send some simple signaling, thereby further shortening the time for establishing the communication connection and improving the user experience.
示例性的,第一电子设备可以为终端设备,第二电子设备可以为AP设备或者软AP设备。例如,第二电子设备可以为路由器或者另一个终端设备。Exemplarily, the first electronic device may be a terminal device, and the second electronic device may be an AP device or a soft AP device. For example, the second electronic device may be a router or another terminal device.
示例性的,该通信连接包括:Wi-Fi连接。Exemplarily, the communication connection includes: a Wi-Fi connection.
示例性的,第二电子设备建立该通信连接中的必要信息还包括:第二电子设备建立该通信连接的SSID、PWD、第二电子设备的MAC地址、IP地址以及端口号中的至少一种。Exemplarily, the necessary information for the second electronic device to establish the communication connection further includes: at least one of the SSID, PWD, MAC address, IP address and port number of the second electronic device for establishing the communication connection .
在第二方面一种可能的实现方式中,该方法还包括:第一电子设备获取第二电子设备的第四连接信息,包括:第一电子设备通过第一连接,接收第四连接信息。示例性的,第一连接包括:蓝牙连接、NFC连接、Zigbee连接、USB连接等。在该实现方式中,在进行双端设备发现时,可以利用多种发现手段(例如BLE发现、局域网发现、广播发现等)进行设备发现,可以支持多种发现手段,同时支持使用不同的类型的连接方式或者广播方式进行信息的交互,提高了必要信息交换的效率,并且提高了通用性和可扩展性。In a possible implementation manner of the second aspect, the method further includes: acquiring, by the first electronic device, fourth connection information of the second electronic device, including: the first electronic device receiving the fourth connection information through the first connection. Exemplarily, the first connection includes: a Bluetooth connection, an NFC connection, a Zigbee connection, a USB connection, and the like. In this implementation, when performing dual-terminal device discovery, a variety of discovery methods (such as BLE discovery, LAN discovery, broadcast discovery, etc.) can be used for device discovery, and a variety of discovery methods can be supported. The information exchange is carried out in the connection mode or the broadcast mode, which improves the efficiency of necessary information exchange, and improves the versatility and scalability.
在第二方面一种可能的实现方式中,第一电子设备获取第二电子设备的第四连接信息,包括:第一电子设备通过第三广播报文,接收第四连接信息。In a possible implementation manner of the second aspect, acquiring the fourth connection information of the second electronic device by the first electronic device includes: the first electronic device receives the fourth connection information through a third broadcast message.
示例性的,第三广播报文包括:通过BLE、BR、Wi-Fi等广播的报文。Exemplarily, the third broadcast message includes: a message broadcast through BLE, BR, Wi-Fi, and the like.
在第二方面一种可能的实现方式中,该方法还包括:第一电子设备向第二电子设备发送第五连接信息,第五连接信息包括第一电子设备的工作频率信息和/或通信信道信息。In a possible implementation manner of the second aspect, the method further includes: the first electronic device sends fifth connection information to the second electronic device, where the fifth connection information includes working frequency information and/or communication channel of the first electronic device information.
示例性的,第五连接信息可以通过第一连接和/或广播报文发送。Exemplarily, the fifth connection information may be sent through the first connection and/or a broadcast message.
示例性的,第五连接信息还包括:或者第一电子设备建立该通信连接的SSID、PWD、第一电子设备的MAC地址、IP地址以及端口号中的至少一种。Exemplarily, the fifth connection information further includes: or at least one of the SSID, PWD, MAC address, IP address, and port number of the first electronic device for establishing the communication connection.
第三方面,提供了一种电子设备,该电子设备包括:用于执行以上第一方面或者第一方面的任意一方面可能的实现方式中的各个步骤的单元,或者用于执行以上第二方面或者第二方面的任意一方面可能的实现方式中的各个步骤的单元。In a third aspect, an electronic device is provided, the electronic device comprising: a unit for performing the steps in the above first aspect or any possible implementation manner of the first aspect, or for performing the above second aspect Or a unit of each step in any possible implementation manner of any aspect of the second aspect.
第四方面,提供了一种电子设备,该电子设备包括至少一个处理器和存储器,至少一个处理器用于执行:以上第一方面或者第一方面的任意一方面可能的实现方式中的方法,或者,以上第二方面或者第二方面的任意一方面可能的实现方式中的方法。In a fourth aspect, an electronic device is provided, the electronic device includes at least one processor and a memory, and the at least one processor is configured to execute: the method in the first aspect or any possible implementation manner of the first aspect, or , a method in a possible implementation manner of the above second aspect or any one of the second aspects.
第五方面,提供了一种电子设备,该电子设备包括至少一个处理器和接口电路,至少一个处理器用于执行:以上第一方面或者第一方面的任意一方面可能的实现方式中的方法,或者,以上第二方面或者第二方面的任意一方面可能的实现方式中的方法。In a fifth aspect, an electronic device is provided, the electronic device includes at least one processor and an interface circuit, and the at least one processor is configured to execute: the method in the above first aspect or any possible implementation manner of the first aspect, Or, the above second aspect or the method in any possible implementation manner of the second aspect.
第六方面,提供了一种通信装置,该通信装置包括上述第三方面、第四方面或者第五方面提供的任一种电子设备。In a sixth aspect, a communication apparatus is provided, and the communication apparatus includes any electronic device provided in the third aspect, the fourth aspect, or the fifth aspect.
第七方面,提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序在被处理器执行时,用于执行第一方面或者第二方面中任意一方面中的方法,或者,用于执行第一方面或者第二方面中任意一方面中的任意可能的实现方式中的方法。In a seventh aspect, a computer program product is provided, the computer program product comprising a computer program, when executed by a processor, the computer program is used to perform the method in any one of the first aspect or the second aspect, or, for carrying out the method in any possible implementation of the first aspect or any of the second aspects.
第八方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序被执行时,用于执行第一方面或者第二方面中任意一方面中的方法,或者,用于执行第一方面或者第二方面中任意一方面中的任意可能的实现方式中的方法。In an eighth aspect, a computer-readable storage medium is provided, and a computer program is stored in the computer-readable storage medium, and when the computer program is executed, is used to execute any one of the first aspect or the second aspect. A method, alternatively, a method for performing any possible implementation of any of the first aspect or the second aspect.
第九方面,提供了一种芯片,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的通信设备执行第一方面或者第二方面中任意一方面中的方法,或者,用于执行第一方面或者第二方面中任意一方面中的任意可能的实现方式中的方法。In a ninth aspect, a chip is provided, the chip includes: a processor for calling and running a computer program from a memory, so that a communication device installed with the chip executes any one of the first aspect or the second aspect. A method, alternatively, a method for performing any possible implementation of any of the first aspect or the second aspect.
本申请提供的建立Wi-Fi P2P连接的方法,在进行Wi-Fi P2P设备发现时,可以利用多种发现手段(例如BLE发现、局域网发现、Wi-Fi P2P发现、广播发现等)进行设备发现,可以支持多种发现手段,同时支持使用不同的类型的连接方式或者广播方式进行信息的交互,提高了通用性和可扩展性,可以作为平台级的能力提供各个应用使用。在发现设备后,将进行Wi-Fi P2P连接需要的信息分阶段进行交换,将Wi-Fi P2P连接需要的信息中的固有信息(例如:设备支持的信道列表、P2P群组SSID、PWD、是否支持宽频(例如是否支持160MHz)、设备信息等)等在Wi-Fi P2P业务发起前提前进行交换。将Wi-Fi P2P连接需要的信息中的可变信息(例如:设备Wi-Fi P2P的连接状态、角色、设备连接的AP的频率等)在可变信息发生变化后,在Wi-Fi P2P业务发起前提前进行交换,或者,在真正发起Wi-Fi P2P连接过程进行交换。从而使得在真正发起Wi-Fi P2P连接时,Wi-Fi P2P连接所必须的部分信息或者全部信息已经交互完成,在真正发起Wi-Fi P2P连接时,仅仅需要发送一些简单的信令(例如广播报文、蓝牙报文等)即可完成Wi-Fi P2P连接,从而进一步缩短Wi-Fi P2P连接所用的时间,提高用户体验。并且,可以使用在不同的产品平台,满足不同上层应用的需求。The method for establishing a Wi-Fi P2P connection provided by this application, when performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery , can support a variety of discovery methods, and support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability, and can be used as a platform-level capability for various applications. After the device is discovered, the information required for the Wi-Fi P2P connection will be exchanged in stages, and the inherent information in the information required by the Wi-Fi P2P connection (for example: the list of channels supported by the device, P2P group SSID, PWD, whether Support broadband (such as whether to support 160MHz), device information, etc., are exchanged in advance before the Wi-Fi P2P service is initiated. Change the variable information in the information required for Wi-Fi P2P connection (for example: Wi-Fi P2P connection status of the device, role, frequency of the AP connected to the device, etc.) Exchange in advance before initiating, or exchange in the process of actually initiating Wi-Fi P2P connection. Therefore, when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged. When the Wi-Fi P2P connection is actually initiated, only some simple signaling (such as broadcast message, Bluetooth message, etc.) to complete the Wi-Fi P2P connection, thereby further shortening the time spent in the Wi-Fi P2P connection and improving the user experience. Moreover, it can be used in different product platforms to meet the needs of different upper-layer applications.
附图说明Description of drawings
图1是本申请实施例提供的一例电子设备上的Wi-Fi P2P业务系统架构图。FIG. 1 is an architectural diagram of an example of a Wi-Fi P2P service system on an electronic device provided by an embodiment of the present application.
图2是本申请实施例提供的一例Wi-Fi P2P设备连接与组网的形式结构的示意图。FIG. 2 is a schematic diagram of a formal structure of an example of Wi-Fi P2P device connection and networking provided by an embodiment of the present application.
图3是本申请实施例提供的一例适用于本申请实施例的应用场景的示意图。FIG. 3 is a schematic diagram of an example of an application scenario applicable to the embodiment of the present application provided by the embodiment of the present application.
图4是本申请实施例提供的一例建立Wi-Fi P2P连接的方法的示意性流程图。FIG. 4 is a schematic flowchart of an example of a method for establishing a Wi-Fi P2P connection provided by an embodiment of the present application.
图5是本申请实施例提供的另一例建立Wi-Fi P2P连接的方法的示意性流程图。FIG. 5 is a schematic flowchart of another example of a method for establishing a Wi-Fi P2P connection provided by an embodiment of the present application.
图6是本申请实施例提供的一例用户触发智能手机与大屏设备建立Wi-Fi P2P连接的示意性用户界面图。FIG. 6 is a schematic user interface diagram of an example of a user triggering a smartphone to establish a Wi-Fi P2P connection with a large-screen device according to an embodiment of the present application.
图7是本申请实施例提供的另一例用户触发智能手机与大屏设备建立Wi-Fi P2P连接的示意性用户界面图。FIG. 7 is a schematic user interface diagram of another example of a user triggering a smart phone to establish a Wi-Fi P2P connection with a large-screen device according to an embodiment of the present application.
图8是本申请实施例提供的一例智能手机与大屏设备建立第一连接的示意性流程图。FIG. 8 is a schematic flowchart of an example of establishing a first connection between a smartphone and a large-screen device according to an embodiment of the present application.
图9是本申请实施例提供的另一例智能手机与大屏设备建立第一连接的示意性流程图。FIG. 9 is a schematic flowchart of another example of establishing a first connection between a smartphone and a large-screen device according to an embodiment of the present application.
图10是本申请实施例提供的一例电子设备结构的示意性框图。FIG. 10 is a schematic block diagram of an example of the structure of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in the present application will be described below with reference to the accompanying drawings.
在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。In the description of the embodiments of the present application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this document is only an association that describes an associated object Relation, it means that there can be three kinds of relations, for example, A and/or B can mean that A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
另外,本申请的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本申请中使用的术语“制品”涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读介质可以包括,但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatile disc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。另外,本文描述的各种存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读介质。术语“机器可读介质”可包括但不限于,无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。Additionally, various aspects or features of the present application may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used in this application encompasses a computer program accessible from any computer readable device, carrier or medium. For example, computer readable media may include, but are not limited to: magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs) etc.), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), card, stick or key drives, etc.). Additionally, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and/or carrying instructions and/or data.
本申请实施例的技术方案可以应用于各种通信系统,例如:全球移动通讯(Global System of Mobile communication,GSM)系统、码分多址(Code Division Multiple Access,CDMA)系统、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)系统、通用分组无线业务(General Packet Radio Service,GPRS)、长期演进(Long Term Evolution,LTE)系统、LTE频分双工(Frequency Division Duplex,FDD)系统、LTE时分双工(Time Division Duplex,TDD)、通用移动通信系统(Universal Mobile Telecommunication System,UMTS)、全球互联微波接入(Worldwide Interoperability for Microwave Access,WiMAX)通信系统、第五代(5th Generation,5G)系统或新无线(New Radio,NR)等。The technical solutions of the embodiments of the present application can be applied to various communication systems, for example: a Global System of Mobile communication (GSM) system, a Code Division Multiple Access (CDMA) system, a wideband Code Division Multiple Access (CDMA) system (Wideband Code Division Multiple Access, WCDMA) system, General Packet Radio Service (General Packet Radio Service, GPRS), Long Term Evolution (Long Term Evolution, LTE) system, LTE Frequency Division Duplex (Frequency Division Duplex, FDD) system, LTE Time Division Duplex (TDD), Universal Mobile Telecommunication System (UMTS), Worldwide Interoperability for Microwave Access (WiMAX) communication system, 5th Generation (5G) System or New Radio (New Radio, NR), etc.
另外,本申请的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本申请中使用的术语“制品”涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读介质可以包括,但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatile disc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。另外,本文描述的各种存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读介质。术语“机器可读介质”可包括但不限于,无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。Additionally, various aspects or features of the present application may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used in this application encompasses a computer program accessible from any computer readable device, carrier or medium. For example, computer readable media may include, but are not limited to: magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs) etc.), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), card, stick or key drives, etc.). Additionally, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and/or carrying instructions and/or data.
Wi-Fi P2P技术是Wi-Fi联盟推出的“Wi-Fi DIRECT”标准协议下的一项重要技术, Wi-Fi P2P可以支持两个Wi-Fi设备在没有Wi-Fi热点介入的情况下,直接与对方设备进行连接和通信。Wi-Fi P2P technology is an important technology under the "Wi-Fi DIRECT" standard protocol launched by the Wi-Fi Alliance. Wi-Fi P2P can support two Wi-Fi devices without the intervention of Wi-Fi hotspots. Connect and communicate directly with the counterpart device.
图1所示的一例适用于本申请的方案的电子设备上的Wi-Fi P2P业务系统架构图,如图1所示的,该系统架构主要包括:Wi-Fi芯片(Chipset)、Wi-Fi驱动(Wi-Fi Driver)、中间件、应用程序框架层(FRAMEWORK)、以及上层应用(application,APP)。其中,Wi-Fi驱动负责将Wi-Fi芯片与终端设备的操作系统对接起来,而中间件用于终端设备运行中所有消息在内核态与用户态之间的中转,目前应用最为广泛的中间件之一是wpa_supplicant。wpa_supplicant是一个开源项目,后来被谷歌(Google)修改后引入了安卓(Android)平台,是一个独立运行在设备内的守护进程,用于消息的中转。An example of a Wi-Fi P2P service system architecture diagram on an electronic device applicable to the solution of the present application is shown in FIG. 1. As shown in FIG. 1, the system architecture mainly includes: Wi-Fi chip (Chipset), Wi-Fi Driver (Wi-Fi Driver), middleware, application framework layer (FRAMEWORK), and upper application (application, APP). Among them, the Wi-Fi driver is responsible for connecting the Wi-Fi chip with the operating system of the terminal device, and the middleware is used for the transfer of all messages between the kernel state and the user state during the operation of the terminal device. Currently, the most widely used middleware One is wpa_supplicant. wpa_supplicant is an open source project, which was later modified by Google and introduced into the Android platform. It is a daemon process that runs independently in the device and is used for message transfer.
FRAMEWORK是运行在终端设备操作系统之上的一些系统能力,以安卓开放源代码项目(android open source project,AOSP)为例,AOSP提供了一些用于操作Wi-Fi P2P的相关接口和服务,例如Wi-Fi P2P相关的服务可以包括Wi-Fi P2P Service,Wi-Fi P2P Service对应的接口类型为Wi-Fi P2P管理(Manager)类型,Wi-Fi P2P Manager类型的接口包括:提供诸如发现设备(discoverPeers)、连接(connect)等接口,这些接口可以由用户直接对Wi-Fi P2P进行控制。FRAMEWORK is some system capabilities running on the terminal device operating system. Taking the Android open source project (AOSP) as an example, AOSP provides some related interfaces and services for operating Wi-Fi P2P, such as Wi-Fi P2P related services can include Wi-Fi P2P Service, the interface type corresponding to Wi-Fi P2P Service is Wi-Fi P2P management (Manager) type, and the interface of Wi-Fi P2P Manager type includes: discoverPeers), connect (connect) and other interfaces, these interfaces can be directly controlled by the user to Wi-Fi P2P.
上层应用是使用FRAMEWORK接口的一些用户可直接接触的应用,它们运行在终端设备上,是用户与终端设备交互的窗口。Upper-layer applications are applications that users who use the FRAMEWORK interface can directly contact. They run on the terminal device and are the windows for the user to interact with the terminal device.
Wi-Fi P2P的连接协议一般在Wi-Fi芯片内实现,终端设备内的FRAMEWORK层通过驱动与芯片进行交互。例如,以AOSP为例,FRAMEWORK层通过wpa_supplicant用来与驱动交互以及支持加密认证,通过应用层提供了若干可供开发者/业务直接调用的接口函数,调用后可以通过驱动使芯片执行对应的Wi-Fi P2P相关操作,FRAMEWORK层自身负责上层应用与下层硬件(包括wpa_supplicant、Wi-Fi Driver、Chipset)的消息中转和协调、连接管理等内容。目前,用户对于Wi-Fi P2P的操作都是应用层通过调用FRAMEWORK中的Wi-Fi P2P相关接口和服务来实现的。The Wi-Fi P2P connection protocol is generally implemented in the Wi-Fi chip, and the FRAMEWORK layer in the terminal device interacts with the chip through the driver. For example, taking AOSP as an example, the FRAMEWORK layer is used to interact with the driver and support encryption authentication through wpa_supplicant. The application layer provides several interface functions that can be directly called by developers/businesses. After calling, the chip can execute the corresponding Wi-Fi function through the driver. -Fi P2P related operations, the FRAMEWORK layer itself is responsible for the message transfer and coordination, connection management, etc. between the upper-layer application and the lower-layer hardware (including wpa_supplicant, Wi-Fi Driver, Chipset). At present, the user's operation of Wi-Fi P2P is realized by the application layer by calling the Wi-Fi P2P related interfaces and services in FRAMEWORK.
一个完整的Wi-Fi P2P业务包括:Wi-Fi P2P设备发现、Wi-Fi P2P设备连接、Wi-Fi P2P设备业务数据传输这三个阶段。在Wi-Fi P2P设备连接建立后形成一个P2P群组(或者也可以称为Wi-Fi P2P群组)。在P2P群组内,设备存在P2P群组管理者(group owner,GO)和P2P群组客户端(group client,GC)两种角色的区分,同时协议规范里对Wi-Fi P2P连接的方式进行了说明和限制,主要存在以下三点:A complete Wi-Fi P2P service includes three stages: Wi-Fi P2P device discovery, Wi-Fi P2P device connection, and Wi-Fi P2P device service data transmission. A P2P group (or also called a Wi-Fi P2P group) is formed after the Wi-Fi P2P device connection is established. In a P2P group, the device has two roles: P2P group manager (group owner, GO) and P2P group client (group client, GC). In order to explain and limit, there are mainly the following three points:
(1)GO设备仅能与GC相连接,无法与其他GO设备建立连接;(1) GO devices can only be connected to GC, and cannot establish connections with other GO devices;
(2)GC设备仅能与GO设备相连接,无法与其他GO设备或GC设备建立连接;(2) GC devices can only be connected with GO devices, and cannot establish connections with other GO devices or GC devices;
(3)GO设备连接GC设备的数量存在上限;(3) There is an upper limit on the number of GO devices connected to GC devices;
除了Wi-Fi DIRECT协议本身的限制之外,不同芯片厂商、不同操作系统(例如Android、windows等)还存在一些其他对Wi-Fi P2P连接的限制,例如:海思等芯片平台不支持同一个设备上的多种P2P角色。不支持同一个设备上的多种P2P角色可以理解为:同一个设备不能同时作为GO和GC;或者,在一个设备作为GO的期间内,该设备不能作为另外一个P2P群组内的GO;或者,在一个设备作为GC的期间内,该设备不能作为另外一个P2P群组内的GC。并且,AOSP也不支持同一个设备多种P2P角色共存。因此,如图2所示的,当前Wi-Fi P2P设备连接与组网的形式局限于以 GO设备为中心的星型网络。In addition to the limitations of the Wi-Fi DIRECT protocol itself, different chip manufacturers and different operating systems (such as Android, Windows, etc.) also have some other limitations on Wi-Fi P2P connections. For example, chip platforms such as HiSilicon do not support the same Multiple P2P roles on the device. Not supporting multiple P2P roles on the same device can be understood as: the same device cannot act as GO and GC at the same time; or, during the period when one device acts as a GO, the device cannot act as a GO in another P2P group; or , while a device is serving as a GC, the device cannot serve as a GC in another P2P group. Moreover, AOSP does not support the coexistence of multiple P2P roles on the same device. Therefore, as shown in Figure 2, the current form of Wi-Fi P2P device connection and networking is limited to a star network centered on GO devices.
在标准的Wi-Fi DIRECT协议规范里,建立Wi-Fi P2P设备连接一共需要4个步骤,分别是:Wi-Fi P2P设备发现(Device Discovery)、群组协商(Group Formation)、Wi-Fi保护设置(Wi-Fi protected setup,WPS)流程、以及关联连接。In the standard Wi-Fi DIRECT protocol specification, a total of 4 steps are required to establish a Wi-Fi P2P device connection, namely: Wi-Fi P2P device discovery (Device Discovery), group negotiation (Group Formation), Wi-Fi protection Setup (Wi-Fi protected setup, WPS) process, and associated connections.
其中,Wi-Fi P2P设备发现是Wi-Fi DIRECT里的一项关键能力,包含扫描(scan)和发现(find)两个阶段。Scan阶段是为了发现已有的GO设备,find阶段又分为侦听阶段(listen State)和搜索阶段(search State),P2P设备将在Search阶段和Listen阶段之间来回切换。在Search阶段中,P2P设备将发送探测请求帧(Probe Request),而Listen阶段中,该P2P设备将接收其他设备的探测请求帧(Probe Request)并回复探测回复帧(Probe Response)。对于Search阶段和Listen阶段而言,只有P2P设备双方处于不同的阶段,才有可能互相发现并进行后续的流程。因此协议规定这两个阶段的持续时间是随机的,保证能够出现两个阶段相错的窗口,即这两个阶段之间是没有时间上的重叠的,两个阶段之间需要存在时间间隔。Among them, Wi-Fi P2P device discovery is a key capability in Wi-Fi DIRECT, including two stages: scan and find. The Scan phase is to discover existing GO devices. The find phase is divided into a listening phase (listen State) and a search phase (search State). P2P devices will switch back and forth between the Search phase and the Listen phase. In the Search phase, the P2P device will send a probe request frame (Probe Request), and in the Listen phase, the P2P device will receive the probe request frame (Probe Request) from other devices and reply with a probe reply frame (Probe Response). For the Search stage and the Listen stage, only if the P2P devices are in different stages, it is possible to discover each other and carry out the subsequent process. Therefore, the protocol stipulates that the duration of these two phases is random, to ensure that there can be a window where the two phases are wrong, that is, there is no temporal overlap between the two phases, and there needs to be a time interval between the two phases.
群组协商是Wi-Fi P2P设备发现后的下一阶段,由于协议规定,在一条Wi-Fi P2P连接上,双端设备有GO和GC角色的区分,因此在连接之前需要协商各自的角色。Group negotiation is the next stage after Wi-Fi P2P devices are discovered. Due to the protocol, on a Wi-Fi P2P connection, two-end devices have GO and GC roles, so they need to negotiate their roles before connecting.
WPS流程是群组协商后的下一个步骤,用于保证建立的连接的安全性与可靠性,避免身份仿冒等安全漏洞。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 loopholes such as identity spoofing.
最后的关联连接涉及到了4步握手,完成后就会在两台设备间建立起一条可信的Wi-Fi P2P连接。The final association connection involves a 4-step handshake, after which a trusted Wi-Fi P2P connection is established between the two devices.
按照标准的Wi-Fi DIRECT协议建立Wi-Fi P2P设备连接,只需要在双端触发Wi-Fi P2P发现,然后等待发现结果,当扫描到期望的设备时,发起连接,然后等待连接结果即可。但是使用该技术会导致Wi-Fi P2P设备连接的过程耗时较长,如上文描述,需要双端设备出现Search阶段和Listen阶段相错的窗口(即一端设备处于Search阶段内,另一端设备需要处于Listen阶段内。或者一端设备处于Listen阶段内,另一端设备需要处于Search阶段内)。对于任何一端设备而言,其将在Search阶段和Listen阶段之间来回切换。当一端设备处于Search阶段时,并不能保证另一端设备处于Listen阶段,而当一端设备处于Search阶段内,而另一端设备并不处于Listen阶段内时,便不能进行设备发现,在这种情况下,当一端设备从Search阶段切换至Listen阶段后,如果另一端设备也切换至Search阶段,则双端设备可以进行设备发现,如果另一端设备还处于Listen阶段内,则双端设备不能进行设备发现。换句话说,在这个过程中,双端设备均在Search阶段和Listen阶段之间切换,只有一端设备处于Listen阶段内,而另一端设备同时处于Search阶段内才可以发现设备,但是这个过程可能需要双端设备均进行多次的Search阶段和Listen阶段之间切换,才可能满足发现设备的条件:即需要一端设备处于Search阶段内,另一端设备同时处于Listen阶段内,或者,一端设备处于Listen阶段内,另一端设备同时处于Search阶段内。而满足发现设备条件的这个过程耗时比较长,典型值在1~3s不等。而连接时间也较长,典型值在2~3s,综合来看,一个完整的Wi-Fi P2P连接流程共需耗时3~6s,用户体验较差。To establish a Wi-Fi P2P device connection according to the standard Wi-Fi DIRECT protocol, you only need to trigger Wi-Fi P2P discovery at both ends, and then wait for the discovery result. When the desired device is scanned, initiate a connection and wait for the connection result. . However, using this technology will cause the Wi-Fi P2P device connection process to take a long time. As described above, the two-end device needs to have a wrong window between the Search stage and the Listen stage (that is, the device at one end is in the Search stage, and the device at the other end needs to In the Listen stage. Or the device at one end is in the Listen stage, and the device at the other end needs to be in the Search stage). For either end device, it will switch back and forth between the Search stage and the Listen stage. When one end of the device is in the Search stage, the other end of the device cannot be guaranteed to be in the Listen stage, and when one end of the device is in the Search stage and the other end of the device is not in the Listen stage, device discovery cannot be performed. In this case , when one end device switches from the Search stage to the Listen stage, if the other end device also switches to the Search stage, the two-end device can perform device discovery, and if the other end device is still in the Listen stage, the two-end device cannot perform device discovery . In other words, during this process, both devices switch between the Search stage and the Listen stage. Only one end of the device is in the Listen stage, and the other end of the device is in the Search stage at the same time to discover the device, but this process may require Both devices at both ends switch between the Search phase and the Listen phase multiple times to meet the conditions for device discovery: that is, the device at one end needs to be in the Search phase and the device at the other end is in the Listen phase at the same time, or the device at one end is in the Listen phase. The device at the other end is in the Search phase at the same time. The process of meeting the conditions for discovering devices takes a long time, and the typical value ranges from 1 to 3 seconds. The connection time is also long, with a typical value of 2 to 3 seconds. In general, a complete Wi-Fi P2P connection process takes 3 to 6 seconds, and the user experience is poor.
为了加速Wi-Fi P2P连接的建立过程,相关技术中对标准的Wi-Fi P2P连接的建立流程进行了改造和优化。使用低功耗蓝牙(bluetooth low energy,BLE)发现代替Wi-Fi  P2P设备发现来加速发现过程。BLE发现设备后使用业务直接指定GO/GC角色,来简化群组协商过程。通过建立BLE/蓝牙基础速率(basic rate,BR)连接,基于BLE/BR连接进行安全认证及P2P群组信息的交换,最终使GC设备直接在指定信道接入到P2P群组中,实现Wi-Fi P2P连接。利用该技术可以加速Wi-Fi P2P连接的建立流程,但是强依赖于BLE/BR连接,该过程基本由业务定制,不具备通用性和可扩展性。In order to speed up the establishment process of the Wi-Fi P2P connection, the standard Wi-Fi P2P connection establishment process has been modified and optimized in the related art. Use bluetooth low energy (BLE) discovery instead of Wi-Fi P2P device discovery to speed up the discovery process. After BLE discovers the device, it uses the service to directly specify the GO/GC role to simplify the group negotiation process. By establishing a BLE/Bluetooth basic rate (BR) connection, performing security authentication and exchanging P2P group information based on the BLE/BR connection, the GC device is finally directly connected to the P2P group on the designated channel to realize Wi- Fi P2P connection. Using this technology can accelerate the process of establishing a Wi-Fi P2P connection, but it is strongly dependent on BLE/BR connection. This process is basically customized by the business and does not have universality and scalability.
有鉴于此,本申请提供了一种建立Wi-Fi P2P连接的方法,在进行Wi-Fi P2P设备发现时,可以利用多种发现手段(例如BLE发现、局域网发现、Wi-Fi P2P发现、广播发现等)进行设备发现,可以支持多种发现手段,同时支持使用不同的类型的连接方式或者广播方式进行信息的交互,提高了通用性和可扩展性。并且,将进行Wi-Fi P2P连接需要的信息分阶段进行交换,将Wi-Fi P2P连接需要的信息中的固有信息(例如:设备支持的信道列表、P2P群组的服务集标识(service set identifier,SSID)、密码(password,PWD)、是否支持宽频(例如是否支持160MHz)、设备信息等)在Wi-Fi P2P业务发起前提前进行交换。将Wi-Fi P2P连接需要的信息中的可变信息(例如:设备Wi-Fi P2P的连接状态、角色、设备连接的AP(即Wi-Fi热点)的频率等)在可变信息发生变化后,进行设备之间的同步,从而使得在用户利用该设备真正发起Wi-Fi P2P连接时,大部分的信息已经交互完成,仅仅需要发送一些简单的信令(例如广播报文、蓝牙报文等发送信令)即可完成Wi-Fi P2P连接,从而进一步缩短Wi-Fi P2P连接的耗时,提高用户体验。In view of this, this application provides a method for establishing a Wi-Fi P2P connection. When performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast Discovery, etc.) for device discovery, it can support multiple discovery methods, and at the same time support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability. In addition, the information required for the Wi-Fi P2P connection is exchanged in stages, and the inherent information in the information required for the Wi-Fi P2P connection (for example, the list of channels supported by the device, the service set identifier of the P2P group) is exchanged. , SSID), password (password, PWD), whether to support broadband (for example, whether to support 160MHz), device information, etc.) are exchanged in advance before the Wi-Fi P2P service is initiated. Change the variable information in the information required for Wi-Fi P2P connection (for example: Wi-Fi P2P connection status of the device, role, frequency of the AP (ie Wi-Fi hotspot) connected to the device, etc.) after the variable information changes , to synchronize between devices, so that when the user uses the device to actually initiate a Wi-Fi P2P connection, most of the information has been exchanged, and only some simple signaling (such as broadcast messages, Bluetooth messages, etc.) needs to be sent. Send signaling) to complete the Wi-Fi P2P connection, thereby further shortening the time-consuming of the Wi-Fi P2P connection and improving the user experience.
下面结合具体的例子来说明本申请提供的建立Wi-Fi P2P连接的方法。The following describes the method for establishing a Wi-Fi P2P connection provided by the present application with reference to specific examples.
应理解,本申请提供的方法主要是针对Wi-Fi DIRECT标准协议中的Wi-Fi P2P连接和组网的场景中,可以适用于使用Wi-Fi DIRECT标准协议的Wi-Fi P2P技术的Android操作系统和WINDOWS操作系统的设备中,还可以适用于使用IOS操作系统和鸿蒙操作系统的设备中等。本申请实施例在此不作限制。It should be understood that the method provided in this application is mainly aimed at the Wi-Fi P2P connection and networking scenarios in the Wi-Fi DIRECT standard protocol, and can be applied to the Android operation of the Wi-Fi P2P technology using the Wi-Fi DIRECT standard protocol. It can also be applied to devices using IOS operating system and Hongmeng operating system, etc. The embodiments of the present application are not limited herein.
图3所示的一例适用于本申请实施例的通信系统的示意图。如图3所示的,该系统包括:第一电子设备110、第二电子设备120。在图3所示的例子中,第一电子设备110以家庭中的用户使用的智能手机为例、第二电子设备120为家庭中的大屏设备(例如为智能电视、智慧屏等)为例。用户使用智能手机,想要利用Wi-Fi P2P链路向大屏设备分享文件。An example shown in FIG. 3 is a schematic diagram of a communication system applicable to an embodiment of the present application. As shown in FIG. 3 , the system includes: a first electronic device 110 and a second electronic device 120 . In the example shown in FIG. 3 , the first electronic device 110 is a smartphone used by a user in the family as an example, and the second electronic device 120 is a large-screen device (such as a smart TV, a smart screen, etc.) in the family as an example . A user uses a smartphone and wants to share files with a large-screen device using a Wi-Fi P2P link.
应该理解,图3中所示的例子不应该对本申请实施例中的电子设备产生任何的限制。It should be understood that the example shown in FIG. 3 should not impose any limitation on the electronic device in the embodiments of the present application.
在本申请实施例中,第一电子设备或第二电子设备可以包括:智能手机、智能电视、大屏设备、平板电脑、上网本、PDA、电脑手持式通信设备、手持式计算设备、智能手环、智能手边、可穿戴设备、用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。终端设备还可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字处理(Personal Digital Assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、,5G网络中的终端设备或者未来演进的公用陆地移动通信网络(public land mobile network,PLMN)中的终端设 备等,本申请实施例对此并不限定。In this embodiment of the present application, the first electronic device or the second electronic device may include: a smart phone, a smart TV, a large-screen device, a tablet computer, a netbook, a PDA, a computer handheld communication device, a handheld computing device, and a smart bracelet , smart at hand, wearable device, user equipment, access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device . The terminal device may also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a wireless communication Functional handheld devices, computing devices or other processing devices connected to wireless modems, in-vehicle devices, terminal devices in 5G networks or terminal devices in the future evolved public land mobile network (PLMN), etc., This embodiment of the present application does not limit this.
图4所示的为在图3所示的场景中,本申请提供的一例Wi-Fi P2P连接的方法200的示意性流程图。该方法200包括:S205至S250。FIG. 4 is a schematic flowchart of an example of a Wi-Fi P2P connection method 200 provided by the present application in the scenario shown in FIG. 3 . The method 200 includes: S205 to S250.
S205,智能手机中的通信模块和大屏设备中的通信模块建立第一连接。S205, the communication module in the smart phone and the communication module in the large-screen device establish a first connection.
在S205中,智能手机中的通信模块和大屏设备中的通信模块可以通过交互广播消息建立第一连接,例如,第一连接可以为BLE连接、通用串行总线(universal serial bus,USB)、BR连接、近场通信(near field communication,NFC)连接、紫峰(Zigbee)连接、Wi-Fi连接或者基于局域网的socket连接等。本申请实施例在此不作限制。In S205, the communication module in the smartphone and the communication module in the large-screen device may establish a first connection through interactive broadcast messages, for example, the first connection may be a BLE connection, a universal serial bus (USB), BR connection, near field communication (near field communication, NFC) connection, Zigbee connection, Wi-Fi connection or socket connection based on LAN, etc. The embodiments of the present application are not limited herein.
在本申请实施例中,Wi-Fi连接可以理解为智能手机中和大屏设备通过接入点设备建立的通信连接。智能手机中和大屏设备之间信息传输需要通过接入点设备(例如路由器设备)进行中转,智能手机中和大屏设备之间不能直接进行通信。In this embodiment of the present application, a Wi-Fi connection may be understood as a communication connection established between a smartphone and a large-screen device through an access point device. The information transmission between the smartphone and the large-screen device needs to be relayed through an access point device (such as a router device), and the smartphone and the large-screen device cannot communicate directly.
S210,智能手机中的通信模块通过第一连接或者广播方式,将智能手机的Wi-Fi P2P连接需要的信息中的固有信息发送给大屏设备的通信模块。S210, the communication module in the smart phone sends inherent information in the information required for the Wi-Fi P2P connection of the smart phone to the communication module of the large-screen device through the first connection or broadcasting.
可选的,作为一种可能的实现方式,在S210中,智能手机中的通信模块可以通过第一连接,将智能手机的Wi-Fi P2P连接需要的信息中的固有信息发送给大屏设备的通信模块。Optionally, as a possible implementation manner, in S210, the communication module in the smartphone can send the inherent information in the information required by the Wi-Fi P2P connection of the smartphone to the large-screen device through the first connection. communication module.
在本申请实施例中,Wi-Fi P2P连接中的固有信息(即用于建立Wi-Fi P2P连接的固有信息)可以理解为:智能手机与其他设备建立Wi-Fi P2P连接时,在一段时间内保持不变的信息。例如,智能手机支持的信道列表是指智能手机在5GHz频段上支持的信道列表,这属于智能手机的固有属性。SSID和PWD是指智能手机在创建P2P群组时所使用的网络ID和密钥,这两项在智能手机开机时随机生成,并且在一定时间内(即生命周期)保持不变,超过该生命周期后会重新随机生成,从而保证Wi-Fi P2P连接的安全性。In the embodiment of the present application, the inherent information in the Wi-Fi P2P connection (that is, the inherent information for establishing a Wi-Fi P2P connection) can be understood as: when a smartphone establishes a Wi-Fi P2P connection with other devices, within a period of time information that remains unchanged. For example, the list of channels supported by a smartphone refers to the list of channels supported by a smartphone on the 5GHz frequency band, which is an inherent property of a smartphone. SSID and PWD refer to the network ID and key used by the smartphone when creating a P2P group. These two items are randomly generated when the smartphone is powered on, and remain unchanged for a certain period of time (ie, the life cycle). After the cycle, it will be randomly generated again to ensure the security of the Wi-Fi P2P connection.
在本申请实施例中,该智能手机的Wi-Fi P2P连接中的固有信息(即智能手机用于建立Wi-Fi P2P连接的固有信息)包括:智能手机支持的信道列表(例如为支持36信道,对应5180MHz)、智能手机创建P2P群组时P2P群组的SSID、智能手机创建P2P群组时P2P群组的PWD、智能手机自身是否支持Wi-Fi P2P连接、智能手机是否支持宽频(例如是否支持160MHz,如果支持可以用true表示,如果不支持可以用false表示)、智能手机的设备信息等。In this embodiment of the present application, the inherent information in the Wi-Fi P2P connection of the smartphone (that is, the inherent information used by the smartphone to establish a Wi-Fi P2P connection) includes: a list of channels supported by the smartphone (for example, to support 36 channels) , corresponding to 5180MHz), the SSID of the P2P group when the smartphone creates a P2P group, the PWD of the P2P group when the smartphone creates a P2P group, whether the smartphone itself supports Wi-Fi P2P connection, whether the smartphone supports broadband (for example, whether Support 160MHz, if it is supported, it can be represented by true, if it is not supported, it can be represented by false), device information of smart phones, etc.
可选的,在本申请实施例中,智能手机的设备信息包括:智能手机的设备名称、智能手机的账号信息、智能手机的蓝牙、Wi-Fi开关的状态、智能手机的电量等。Optionally, in this embodiment of the present application, the device information of the smart phone includes: the device name of the smart phone, account information of the smart phone, the status of the Bluetooth of the smart phone, the Wi-Fi switch, the power level of the smart phone, and the like.
可选的,作为另一种可能的实现方式,在S210中,智能手机中的通信模块也可以通过广播的方式(例如:BLE广播、BR广播、Wi-Fi广播等),向大屏设备的通信模块发送智能手机的Wi-Fi P2P连接中的固有信息。Optionally, as another possible implementation manner, in S210, the communication module in the smartphone can also broadcast (for example, BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.) The communication module transmits information inherent in the Wi-Fi P2P connection of the smartphone.
或者,作为又一种可能的实现方式,在S210中,智能手机中的通信模块也可以通过广播和第一连接这两种方式,向大屏设备的通信模块发送智能手机的Wi-Fi P2P连接中的固有信息。Or, as another possible implementation manner, in S210, the communication module in the smartphone can also send the Wi-Fi P2P connection of the smartphone to the communication module of the large-screen device through broadcasting and the first connection. inherent information in .
大屏设备的通信模块通过第一连接和/或广播的方式接收到智能手机的Wi-Fi P2P连接需要的信息中的固有信息后,可以存储该智能手机的Wi-Fi P2P连接需要的信息 中的固有信息。After the communication module of the large-screen device receives the inherent information in the information required by the Wi-Fi P2P connection of the smartphone through the first connection and/or broadcasting, it can store the information required by the Wi-Fi P2P connection of the smartphone. inherent information.
S215,大屏设备中的通信模块通过第一连接或者广播方式,将大屏设备的Wi-Fi P2P连接需要的信息中的固有信息(即大屏设备用于建立Wi-Fi P2P连接的固有信息)发送给智能手机中的通信模块。S215, the communication module in the large-screen device transmits the inherent information in the information required by the Wi-Fi P2P connection of the large-screen device (that is, the inherent information used by the large-screen device to establish a Wi-Fi P2P connection) through the first connection or broadcasting. ) to the communication module in the smartphone.
可选的,在S215中,作为一种可能的实现方式,大屏设备中的通信模块可以通过第一连接,将大屏设备的Wi-Fi P2P连接需要的信息中的固有信息发送给智能手机中的通信模块。在本申请实施例中,大屏设备的Wi-Fi P2P连接中的固有信息包括:大屏设备支持的信道列表、大屏设备创建P2P群组时P2P群组的SSID、大屏设备创建P2P群组时P2P群组的PWD、大屏设备自身是否支持Wi-Fi P2P连接、大屏设备是否支持宽频、大屏设备的设备信息等。Optionally, in S215, as a possible implementation manner, the communication module in the large-screen device can send inherent information in the information required by the Wi-Fi P2P connection of the large-screen device to the smartphone through the first connection. in the communication module. In the embodiment of this application, the inherent information in the Wi-Fi P2P connection of the large-screen device includes: a list of channels supported by the large-screen device, the SSID of the P2P group when the large-screen device creates a P2P group, and the large-screen device creates a P2P group PWD of the P2P group, whether the large-screen device itself supports Wi-Fi P2P connection, whether the large-screen device supports broadband, and device information of the large-screen device, etc.
大屏设备的设备信息可以包括:大屏设备的设备名称、大屏设备的账号信息、大屏设备的蓝牙、Wi-Fi开关的状态、大屏设备的电量等。The device information of the large-screen device may include: the device name of the large-screen device, account information of the large-screen device, the Bluetooth of the large-screen device, the status of the Wi-Fi switch, the power level of the large-screen device, and the like.
可选的,在S215中,大屏设备中的通信模块也可以通过广播的方式(例如:BLE广播、BR广播、Wi-Fi广播等),向智能手机的通信模块发送大屏设备的Wi-Fi P2P连接中的固有信息。Optionally, in S215, the communication module in the large-screen device can also send the Wi-Fi data of the large-screen device to the communication module of the smartphone by broadcasting (for example, BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.). Inherent information in Fi P2P connections.
或者,在S215中,作为另一种可能的实现方式,大屏设备中的通信模块也可以通过广播的方式和第一连接这两种方式,向智能手机的通信模块发送大屏设备的Wi-Fi P2P连接中的固有信息。Or, in S215, as another possible implementation manner, the communication module in the large-screen device can also send the Wi- Information inherent in Fi P2P connections.
智能手机的通信模块通过第一连接和/或广播的方式接收到大屏设备的Wi-Fi P2P连接需要的信息中的固有信息后,可以存储该大屏设备的Wi-Fi P2P连接需要的信息中的固有信息。After the communication module of the smartphone receives the inherent information in the information required for the Wi-Fi P2P connection of the large-screen device through the first connection and/or broadcasting, it can store the information required for the Wi-Fi P2P connection of the large-screen device inherent information in .
上述的S210和S215,即为大屏设备和智能手机交换Wi-Fi P2P连接中的固有信息的过程。The above-mentioned S210 and S215 are the process of exchanging inherent information in the Wi-Fi P2P connection between the large-screen device and the smartphone.
下面,将具体说明大屏设备和智能手机交换(或者也可以称为同步)Wi-Fi P2P连接中的可变信息(即用于建立Wi-Fi P2P连接的可变信息)的具体流程,该流程包括S220至S245。Below, the specific process of exchanging (or also referred to as synchronizing) the variable information in the Wi-Fi P2P connection (that is, the variable information used to establish the Wi-Fi P2P connection) between the large-screen device and the smartphone will be described in detail. The flow includes S220 to S245.
S220,智能手机的驱动和芯片模块在智能手机的Wi-Fi P2P连接状态发生变化,和/或智能手机连接的AP(即Wi-Fi热点)的频率变化时,向智能手机的FRAMEWORK模块发送消息,该消息包括:智能手机的Wi-Fi P2P连接状态和智能手机连接的AP的频率中的至少一个。在本申请实施例中,智能手机的Wi-Fi P2P连接状态包括:智能手机当前没有与任何设备之间存在Wi-Fi P2P连接的状态;智能手机当前与其他设备之间存在Wi-Fi P2P连接,且智能手机的角色为GO;智能手机当前与其他设备之间存在Wi-Fi P2P连接,且智能手机的角色为GC中的任意一种。S220, the driver and chip module of the smartphone sends a message to the FRAMEWORK module of the smartphone when the Wi-Fi P2P connection status of the smartphone changes, and/or the frequency of the AP (ie Wi-Fi hotspot) connected to the smartphone changes. , the message includes: at least one of the Wi-Fi P2P connection status of the smartphone and the frequency of the AP connected to the smartphone. In the embodiment of the present application, the Wi-Fi P2P connection status of the smartphone includes: the smartphone does not currently have a Wi-Fi P2P connection with any device; the smartphone currently has a Wi-Fi P2P connection with other devices , and the role of the smartphone is GO; there is currently a Wi-Fi P2P connection between the smartphone and other devices, and the role of the smartphone is either GC.
S225,智能手机的FRAMEWORK模块向智能手机的通信模块发送消息,该消息包括:智能手机的Wi-Fi P2P连接状态和智能手机连接的AP的频率中的至少一个。S225, the FRAMEWORK module of the smartphone sends a message to the communication module of the smartphone, where the message includes at least one of the Wi-Fi P2P connection status of the smartphone and the frequency of the AP connected to the smartphone.
S230,智能手机的通信模块向大屏设备的通信模块发送消息。该消息包括:智能手机的Wi-Fi P2P连接中的可变信息(即智能手机用于建立Wi-Fi P2P连接的可变信息)。S230, the communication module of the smart phone sends a message to the communication module of the large-screen device. The message includes: variable information in the Wi-Fi P2P connection of the smartphone (ie, variable information used by the smartphone to establish the Wi-Fi P2P connection).
例如:智能手机的Wi-Fi P2P连接中的可变信息包括:智能手机的Wi-Fi P2P连接状态和智能手机连接的AP的频率中的至少一个。For example, the variable information in the Wi-Fi P2P connection of the smartphone includes at least one of the Wi-Fi P2P connection status of the smartphone and the frequency of the AP to which the smartphone is connected.
具体的,由于终端设备(例如智能手机或者大屏设备)的Wi-Fi芯片基本上均支持Wi-Fi站点(Wi-Fi STATION)和Wi-Fi P2P角色同时存在。其中,Wi-Fi STATION角色可以理解为该终端设备通过连接路由器(Wi-Fi热点/AP)的方式建立Wi-Fi连接,Wi-Fi P2P角色可以理解为该终端设备不通过路由器,直接与另外的设备进行Wi-Fi连接。当一个终端设备的Wi-Fi STATION连接和Wi-Fi P2P连接处于同一频段但是非同一信道的时候,会出现同频异信道的情况,从而影响Wi-Fi STATION连接和Wi-Fi P2P的性能。因此,终端设备的Wi-Fi STATION的状态也会对Wi-Fi P2P连接有影响,Wi-Fi STATION的状态可以利用终端设备连接的AP的频率体现。因此,在本申请实施例中,在智能手机或者大屏设备连接的AP的频率发生变化后,智能手机或者大屏设备可以将连接的AP的频率同步到可信设备列表内的设备中。Specifically, since the Wi-Fi chips of terminal devices (such as smart phones or large-screen devices) basically support the simultaneous existence of Wi-Fi stations (Wi-Fi STATION) and Wi-Fi P2P roles. Among them, the role of Wi-Fi STATION can be understood as the terminal device establishes a Wi-Fi connection by connecting to the router (Wi-Fi hotspot/AP), and the role of Wi-Fi P2P can be understood as the terminal device does not pass through the router and directly communicates with other device to connect to Wi-Fi. When the Wi-Fi STATION connection of a terminal device and the Wi-Fi P2P connection are in the same frequency band but not the same channel, the same frequency and different channels will occur, thus affecting the performance of the Wi-Fi STATION connection and Wi-Fi P2P. Therefore, the Wi-Fi STATION status of the terminal device will also affect the Wi-Fi P2P connection, and the Wi-Fi STATION status can be reflected by the frequency of the AP connected to the terminal device. Therefore, in this embodiment of the present application, after the frequency of the AP connected to the smartphone or the large-screen device changes, the smartphone or the large-screen device can synchronize the frequency of the connected AP to the devices in the trusted device list.
此外,受到“Wi-Fi DIRECT”标准协议的限制,Wi-Fi P2P连接仅能发生在GO设备与GC设备之间,并且存在1个GO设备至多连接有限数量的GC设备、1个GC设备只能连接1个GO设备的限制,因此在发起Wi-Fi P2P连接之前,双端设备(大屏设备和智能手机)的Wi-Fi P2P连接状态也会影响本次Wi-Fi P2P连接。因此,在本申请实施例中,在智能手机或者大屏设备Wi-Fi P2P连接状态发生变化时,智能手机和大屏设备将自身的Wi-Fi P2P状态同步通知到可信设备列表内的所有设备。In addition, due to the limitation of the "Wi-Fi DIRECT" standard protocol, Wi-Fi P2P connection can only occur between GO devices and GC devices, and there is a GO device connected to a limited number of GC devices at most, and a GC device only The limitation of being able to connect 1 GO device, so before initiating a Wi-Fi P2P connection, the Wi-Fi P2P connection status of the dual-end devices (large-screen devices and smartphones) will also affect this Wi-Fi P2P connection. Therefore, in this embodiment of the present application, when the Wi-Fi P2P connection status of the smartphone or the large-screen device changes, the smartphone and the large-screen device will synchronously notify all members in the trusted device list of the Wi-Fi P2P status of the smartphone and the large-screen device. equipment.
其中,设备的Wi-Fi P2P连接状态包括:设备当前没有与任何设备之间存在Wi-Fi P2P连接的状态;设备当前与其他设备之间存在Wi-Fi P2P连接,且设备的角色为GO;设备当前与其他设备之间存在Wi-Fi P2P连接,且设备的角色为GC。Among them, the Wi-Fi P2P connection status of the device includes: the device does not currently have a Wi-Fi P2P connection with any device; the device currently has a Wi-Fi P2P connection with other devices, and the role of the device is GO; There is currently a Wi-Fi P2P connection between the device and other devices, and the role of the device is GC.
应理解,在本申请实施例中,智能手机的Wi-Fi P2P连接中的可变信息还可以包括在智能手机在Wi-Fi P2P连接中过程,其它可能随时变化,并且会影响Wi-Fi P2P连接的信息,本申请实施例在此不作限制。It should be understood that, in this embodiment of the present application, the variable information in the Wi-Fi P2P connection of the smartphone may also be included in the process of the smartphone in the Wi-Fi P2P connection, and others may change at any time, and will affect the Wi-Fi P2P The connection information is not limited in this embodiment of the present application.
可选的,在S230中,该消息可以通过广播的形式(例如:BLE广播、BR广播、Wi-Fi广播等)发送,或者,也可以通过第一连接发送,或者,通过广播和第一连接这两种方式发送。Optionally, in S230, the message may be sent in the form of broadcasting (for example: BLE broadcasting, BR broadcasting, Wi-Fi broadcasting, etc.), or may also be sent through the first connection, or, through broadcasting and the first connection Both ways to send.
大屏设备的通信模块通过第一连接和/或广播的方式接收到智能手机的Wi-Fi P2P连接中的可变信息后,可以存储该智能手机的Wi-Fi P2P连接中的可变信息。After receiving the variable information in the Wi-Fi P2P connection of the smartphone through the first connection and/or broadcasting, the communication module of the large-screen device can store the variable information in the Wi-Fi P2P connection of the smartphone.
应理解,在S230中,对于智能手机的通信模块向大屏设备的通信模块发送智能手机的Wi-Fi P2P连接中的可变信息的时机,可以是周期性的发送,或者,可以在智能手机和大屏设备之间真正发起Wi-Fi P2P连接的过程中发送,或者,在智能手机的Wi-Fi P2P连接中的可变信息后,间隔一段时间后发送,或者,还可以设置一些发送规则:It should be understood that, in S230, the timing for the communication module of the smart phone to send the variable information in the Wi-Fi P2P connection of the smart phone to the communication module of the large-screen device may be periodically sent, or may be sent on the smart phone. It is sent during the actual Wi-Fi P2P connection with the large-screen device, or, after the variable information in the Wi-Fi P2P connection of the smartphone, after a period of time, or you can also set some sending rules :
例如,在智能手机的Wi-Fi P2P连接状态发生变化后,立即向大屏设备的通信模块发送变化后的智能手机的Wi-Fi P2P连接状态,在发送智能手机的Wi-Fi P2P连接状态时,如果智能手机连接的AP的频率也发生了变化,则一并将变化后的智能手机连接的AP的频率发送给大屏设备。也就是说,如果仅仅是智能手机连接的AP的频率发生了变化,将不会单独触发向大屏设备的通信模块发送变化后的智能手机连接的AP的频率。For example, after the Wi-Fi P2P connection status of the smartphone changes, immediately send the changed Wi-Fi P2P connection status of the smartphone to the communication module of the large-screen device, and when sending the Wi-Fi P2P connection status of the smartphone , if the frequency of the AP connected to the smartphone also changes, the changed frequency of the AP connected to the smartphone will be sent to the large-screen device. That is to say, if only the frequency of the AP connected to the smartphone changes, it will not individually trigger the sending of the changed frequency of the AP connected to the smartphone to the communication module of the large-screen device.
又例如:在智能手机连接的AP的频率变化后,立即向大屏设备的通信模块发送变化后的连接的AP的频率,在发送智连接的AP的频率时,如果智能手机Wi-Fi P2P 连接状态也发生了变化,则一并将变化后的智能手机Wi-Fi P2P连接状态发送给大屏设备。也就是说,如果仅仅是智能手机Wi-Fi P2P连接状态发生了变化,将不会单独触发向大屏设备的通信模块发送变化后的智能手机Wi-Fi P2P连接状态。Another example: after the frequency of the AP connected to the smartphone changes, immediately send the changed frequency of the connected AP to the communication module of the large-screen device. When sending the frequency of the AP connected to the smartphone, if the smartphone Wi-Fi P2P connection If the status has also changed, the changed smartphone Wi-Fi P2P connection status will be sent to the large-screen device. That is to say, if only the Wi-Fi P2P connection status of the smartphone changes, it will not be individually triggered to send the changed Wi-Fi P2P connection status of the smartphone to the communication module of the large-screen device.
再例如:如果智能手机的Wi-Fi P2P连接中的可变信息中的任意一个发生变化,智能收手机都会立即大屏设备的通信模块发送变化后的Wi-Fi P2P连接中的可变信息。即智能手机的Wi-Fi P2P连接中的可变信息中的任意一个都是可以独立发送的,不受其他信息的影响。Another example: if any of the variable information in the Wi-Fi P2P connection of the smartphone changes, the smartphone will immediately send the changed information in the Wi-Fi P2P connection to the communication module of the large-screen device. That is, any one of the variable information in the Wi-Fi P2P connection of the smartphone can be sent independently without being affected by other information.
应理解,在本申请实施例中,对于S230和S210执行过程的先后顺序不作限制。S230可以在S210之前执行,也可以在S210之后执行,或者,还可以和S210同时执行。换句话说,智能手机向大屏设备发送智能手机的Wi-Fi P2P连接中的可变信息,可以在智能手机向大屏设备发送智能手机的Wi-Fi P2P连接中的固有信息之前进行,也可以在智能手机向大屏设备发送智能手机的Wi-Fi P2P连接中的固有信息之后进行,或者,也可以和智能手机向大屏设备发送智能手机的Wi-Fi P2P连接中的固有信息同时进行。本申请实施例不作限制。It should be understood that, in this embodiment of the present application, there is no limitation on the sequence of executing the processes of S230 and S210. S230 can be executed before S210, can also be executed after S210, or can also be executed simultaneously with S210. In other words, the smartphone sends the variable information in the Wi-Fi P2P connection of the smartphone to the large-screen device before the smartphone sends the inherent information in the Wi-Fi P2P connection of the smartphone to the large-screen device, and also It can be performed after the smartphone sends the inherent information in the Wi-Fi P2P connection of the smartphone to the large-screen device, or it can be performed simultaneously with the smartphone sending the inherent information in the Wi-Fi P2P connection of the smartphone to the large-screen device. . The embodiments of the present application are not limited.
S235,大屏设备的驱动和芯片模块在大屏设备的Wi-Fi P2P连接状态发生变化,或者大屏设备连接的AP(即Wi-Fi热点)的频率变化时,向大屏设备的FRAMEWORK模块发送消息,该消息包括:大屏设备的Wi-Fi P2P连接状态,大屏设备连接的AP的频率中的至少一个。在本申请实施例中,大屏设备的Wi-Fi P2P连接状态包括:大屏设备当前没有与任何设备之间存在Wi-Fi P2P连接的状态;大屏设备当前与其他设备之间存在Wi-Fi P2P连接,且大屏设备的角色为GO;大屏设备当前与其他设备之间存在Wi-Fi P2P连接,且大屏设备的角色为GC中的任意一种。S235, when the driver and chip module of the large-screen device change the Wi-Fi P2P connection status of the large-screen device, or the frequency of the AP (ie Wi-Fi hotspot) connected to the large-screen device changes, the FRAMEWORK module of the large-screen device Send a message, the message includes at least one of the Wi-Fi P2P connection status of the large-screen device and the frequency of the AP to which the large-screen device is connected. In this embodiment of the present application, the Wi-Fi P2P connection status of the large-screen device includes: the large-screen device currently does not have a Wi-Fi P2P connection with any device; the large-screen device currently has a Wi-Fi P2P connection with other devices. Fi P2P connection, and the role of the large-screen device is GO; there is currently a Wi-Fi P2P connection between the large-screen device and other devices, and the role of the large-screen device is any one of GC.
S240,大屏设备的FRAMEWORK模块向大屏设备的通信模块发送消息,该消息包括:大屏设备的Wi-Fi P2P连接状态和大屏设备连接的AP的频率中的至少一个。S240, the FRAMEWORK module of the large-screen device sends a message to the communication module of the large-screen device, the message including: at least one of the Wi-Fi P2P connection status of the large-screen device and the frequency of the AP connected to the large-screen device.
S245,大屏设备的通信模块向智能手机备的通信模块发送消息。该消息包括:大屏设备的Wi-Fi P2P连接中的可变信息(即大屏设备用于建立Wi-Fi P2P连接的可变信息)。S245, the communication module of the large-screen device sends a message to the communication module of the smartphone device. The message includes: variable information in the Wi-Fi P2P connection of the large-screen device (that is, variable information used by the large-screen device to establish a Wi-Fi P2P connection).
例如,大屏设备的Wi-Fi P2P连接中的可变信息包括:Wi-Fi P2P连接状态和大屏设备连接的AP的频率中的至少一个。For example, the variable information in the Wi-Fi P2P connection of the large-screen device includes: at least one of the Wi-Fi P2P connection status and the frequency of the AP to which the large-screen device is connected.
应理解,在本申请实施例中,大屏设备的Wi-Fi P2P连接中的可变信息还可以包括在大屏设备在Wi-Fi P2P连接中过程,其它可能随时变化,并且会影响Wi-Fi P2P连接的信息,本申请实施例在此不作限制。It should be understood that, in this embodiment of the present application, the variable information in the Wi-Fi P2P connection of the large-screen device may also be included in the process of the large-screen device being connected to Wi-Fi P2P, and others may change at any time, and will affect the Wi-Fi P2P connection. Information about the Fi P2P connection is not limited in this embodiment of the present application.
可选的,在S245中,该消息可以通过广播的形式(例如:BLE广播、BR广播、Wi-Fi广播等)发送,或者,也可以通过第一连接发送,或者,通过广播和第一连接这两种方式发送。Optionally, in S245, the message may be sent in the form of broadcasting (for example: BLE broadcasting, BR broadcasting, Wi-Fi broadcasting, etc.), or may also be sent through the first connection, or, through broadcasting and the first connection Both ways to send.
应理解,在本申请实施例中,对于S245和S215执行过程的先后顺序不作限制。S245可以在S215之前执行,也可以在S215之后执行,或者,还可以和S215同时执行。换句话说,大屏设备向智能手机发送大屏设备的Wi-Fi P2P连接中的可变信息,可以在大屏设备向智能手机发送大屏设备的Wi-Fi P2P连接中的固有信息之前进行,也可以在大屏设备向智能手机发送大屏设备的Wi-Fi P2P连接中的固有信息之后进行, 或者,也可以和大屏设备向智能手机发送大屏设备的Wi-Fi P2P连接中的固有信息同时进行。本申请实施例不作限制。It should be understood that, in this embodiment of the present application, there is no limitation on the sequence of executing the processes of S245 and S215. S245 can be executed before S215, can also be executed after S215, or can also be executed simultaneously with S215. In other words, the large-screen device sends the variable information in the Wi-Fi P2P connection of the large-screen device to the smartphone before the large-screen device sends the inherent information in the Wi-Fi P2P connection of the large-screen device to the smartphone. , it can also be performed after the large-screen device sends the inherent information in the Wi-Fi P2P connection of the large-screen device to the smartphone, or it can also be performed with the large-screen device to the smartphone. The inherent information is carried out at the same time. The embodiments of the present application are not limited.
可选的,在S245中,对于大屏设备的通信模块向智能手机的通信模块发送大屏设备的Wi-Fi P2P连接中的可变信息的时机,可以是周期性的发送,或者,还可以设置一些发送规则。其规则和S230中的类似,为了简介,这里不再赘述。Optionally, in S245, the timing for the communication module of the large-screen device to send the variable information in the Wi-Fi P2P connection of the large-screen device to the communication module of the smartphone may be periodically sent, or it may also be Set some sending rules. The rules are similar to those in S230, and are not repeated here for the sake of introduction.
上述的S220至S245,即为大屏设备和智能手机交换(或者也可以称为同步)Wi-Fi P2P连接中的可变信息的过程。The above-mentioned S220 to S245 are the processes of exchanging (or also called synchronizing) the variable information in the Wi-Fi P2P connection between the large-screen device and the smartphone.
S250,智能手机的通信模块和大屏设备的通信模块根据交换的Wi-Fi P2P连接中的可变信息和固定信息,建立Wi-Fi P2P连接。S250, the communication module of the smartphone and the communication module of the large-screen device establish a Wi-Fi P2P connection according to the variable information and fixed information in the exchanged Wi-Fi P2P connection.
例如,在智能手机和大屏设备真正发起Wi-Fi P2P连接时,智能手机可以只需要向大屏设备发发送一些简单的信令(例如广播报文、蓝牙报文等)即可完成Wi-Fi P2P连接。For example, when a smartphone and a large-screen device actually initiate a Wi-Fi P2P connection, the smartphone can simply send some simple signaling (such as broadcast messages, Bluetooth messages, etc.) to the large-screen device to complete Wi-Fi Fi P2P connection.
还应理解,在本申请实施例中,对于S230和S250执行过程的先后顺序不作限制。S230可以在S250之前执行,或者,还可以和S250同时执行。换句话说,智能手机向大屏设备发送智能手机的Wi-Fi P2P连接中的可变信息,可以在智能手机和大屏设备建立Wi-Fi P2P连接之前进行,也可以在智能手机和大屏设备建立Wi-Fi P2P连接的过程中进行。本申请实施例不作限制。It should also be understood that, in this embodiment of the present application, there is no limitation on the sequence of executing the processes of S230 and S250. S230 can be executed before S250, or can also be executed concurrently with S250. In other words, the smartphone sends variable information in the smartphone's Wi-Fi P2P connection to the large-screen device, either before the smartphone and the large-screen device establish a Wi-Fi P2P connection, or before the smartphone and the large-screen device establish a Wi-Fi P2P connection. The device is in the process of establishing a Wi-Fi P2P connection. The embodiments of the present application are not limited.
类似的,在本申请实施例中,对于S245和S250执行过程的先后顺序不作限制。S245可以在S250之前执行,或者,还可以和S250同时执行。换句话说,大屏设备向智能手机发送大屏设备的Wi-Fi P2P连接中的可变信息,可以在大屏设备和智能手机建立Wi-Fi P2P连接之前进行,也可以在大屏设备和智能手机建立Wi-Fi P2P连接的过程中进行。本申请实施例不作限制。Similarly, in this embodiment of the present application, there is no limitation on the sequence of execution of S245 and S250. S245 can be executed before S250, or can also be executed concurrently with S250. In other words, the large-screen device sends variable information in the Wi-Fi P2P connection of the large-screen device to the smartphone, either before the large-screen device and the smartphone establish a Wi-Fi P2P connection, or before the large-screen device and the smartphone establish a Wi-Fi P2P connection. The smartphone is in the process of establishing a Wi-Fi P2P connection. The embodiments of the present application are not limited.
本申请提供的建立Wi-Fi P2P连接的方法,在进行Wi-Fi P2P设备发现并建立第一连接后,将进行Wi-Fi P2P连接需要的信息分阶段进行交换,将Wi-Fi P2P连接需要的信息中的固有信息在Wi-Fi P2P业务发起前提前进行交换。将Wi-Fi P2P连接需要的信息中的可变信息在可变信息发生变化后,在Wi-Fi P2P业务发起前提前进行交换,或者,在真正发起Wi-Fi P2P连接过程进行交换。从而使得在真正发起Wi-Fi P2P连接时,Wi-Fi P2P连接所必须的部分信息或者全部信息已经交互完成,在真正发起Wi-Fi P2P连接时,仅仅需要发送一些简单的信令即可完成Wi-Fi P2P连接,从而进一步缩短Wi-Fi P2P连接所用的时间,提高用户体验。In the method for establishing a Wi-Fi P2P connection provided in this application, after the Wi-Fi P2P device is discovered and the first connection is established, the information required for the Wi-Fi P2P connection is exchanged in stages, and the information required for the Wi-Fi P2P connection is exchanged in stages. The inherent information in the information is exchanged in advance before the Wi-Fi P2P service is initiated. After the variable information in the information required by the Wi-Fi P2P connection is changed, it is exchanged in advance before the Wi-Fi P2P service is initiated, or it is exchanged during the actual initiation of the Wi-Fi P2P connection. Therefore, when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged. When the Wi-Fi P2P connection is actually initiated, only some simple signaling needs to be sent. Wi-Fi P2P connection, thereby further shortening the time spent in Wi-Fi P2P connection and improving user experience.
可选的,在本申请实施例中,作为另一种可能的实现方式,如图5所示的,在图4所示步骤的基础上,在S210之前,该方法还包括:智能手机和大屏设备通过扫描建立第一连接以及基于第一连接进行设备间安全认证的过程,即下文描述的S204、S206至S208描述的步骤。Optionally, in this embodiment of the present application, as another possible implementation manner, as shown in FIG. 5 , on the basis of the steps shown in FIG. 4 , before S210 , the method further includes: a smartphone and a large The screen device establishes a first connection by scanning and performs inter-device security authentication based on the first connection, that is, the steps described in S204, S206 to S208 described below.
S204,智能手机和大屏设备均连接到家里的路由热点,智能手机和大屏设备的驱动和芯片模块自动开启后台扫描来发现设备。本申请实施例中,智能手机和大屏设备均可以利用BLE扫描、经典蓝牙扫描、无线局域网(wireless local area networks,WLAN)扫描或者Wi-Fi P2P扫描中的一种或者多种发现设备的方式来发现设备。其中,经典蓝牙包括:BR和蓝牙增强速率(bluetooth enhanced data rate,EDR)两种类型的蓝牙 中的至少一种。S204, both the smart phone and the large-screen device are connected to the routing hotspot at home, and the driver and chip module of the smart phone and the large-screen device automatically start background scanning to discover the device. In this embodiment of the present application, both the smartphone and the large-screen device can use one or more methods of BLE scanning, classic Bluetooth scanning, wireless local area networks (WLAN) scanning, or Wi-Fi P2P scanning to discover devices. to discover the device. The classic Bluetooth includes at least one of two types of Bluetooth: BR and Bluetooth enhanced data rate (EDR).
应理解,在本申请实施例中,智能手机和大屏设备在进行后台扫描时,进行的是周期性的后台扫描。It should be understood that, in the embodiments of the present application, when the smartphone and the large-screen device perform background scanning, periodic background scanning is performed.
在S204之后,便可以执行S205。After S204, S205 can be executed.
在S205之后,可以执行S206至S208。After S205, S206 to S208 may be performed.
S206,智能手机中的通信模块和大屏设备中的通信模块基于第一连接进行密钥的协商,得到加密密钥和解密密钥,从而完成基于第一连接的设备安全认证。S206, the communication module in the smartphone and the communication module in the large-screen device negotiate a key based on the first connection to obtain an encryption key and a decryption key, thereby completing the device security authentication based on the first connection.
在S206之后,智能手机便可以将大屏设备添加到可信设备列表内,大屏设备也可以将智能手机添加到可信设备列表内。After S206, the smart phone can add the large-screen device to the trusted device list, and the large-screen device can also add the smart phone to the trusted device list.
S207,智能手机中的通信模块存储该加密密钥和解密密钥。S207, the communication module in the smart phone stores the encryption key and the decryption key.
S208,大屏设备中的通信模块存储该加密密钥和解密密钥。S208, the communication module in the large-screen device stores the encryption key and the decryption key.
在S208之后,便可以执行S210至S250。S210至S250对应的具体步骤的描述可以参考上述对应步骤的描述,为了简洁,这里不再赘述。After S208, S210 to S250 may be performed. For the description of the specific steps corresponding to S210 to S250, reference may be made to the description of the corresponding steps above, which is not repeated here for brevity.
应该理解,在本申请实施例中,如果智能手机和大屏设备之前已经经过验证互为可信设备,则在S205之后,也可以不用执行S206至S208,直接执行S210。It should be understood that, in this embodiment of the present application, if the smartphone and the large-screen device have been verified as mutually trusted devices before, after S205, S210 may be directly executed without executing S206 to S208.
可选的,作为另一种可能的实现方式,即使智能手机和大屏设备之间没有经过验证互为可信设备,在S205之后,也可以不用执行S206至S208,直接执行S210。在这种情况下,智能手机便不会将大屏设备添加到可信设备列表内,大屏设备也不会将智能手机添加到可信设备列表内,即智能手机和大屏设备之间互相不为可信设备。Optionally, as another possible implementation manner, even if the smartphone and the large-screen device are not verified as mutually trusted devices, after S205, S210 may be directly executed without executing S206 to S208. In this case, the smartphone will not add the large-screen device to the list of trusted devices, and the large-screen device will not add the smartphone to the list of trusted devices, that is, the smartphone and the large-screen device communicate with each other. Not a trusted device.
可选的,在本申请实施例中,例如,智能手机和大屏设备登录的是同一个账号,或者,智能手机和大屏设备之间之前已经通过验证互为可信设备,或者,智能手机和大屏设备之间通过各种方式(例如通过二维码扫描等)进行绑定后,可以确认智能手机和大屏设备互为可信设备。智能手机便可以将大屏设备添加到可信设备列表内,大屏设备也可以将智能手机添加到可信设备列表内。Optionally, in this embodiment of the present application, for example, the smart phone and the large-screen device log into the same account, or the smart phone and the large-screen device have been verified as trusted devices before, or the smart phone After binding with the large-screen device in various ways (for example, through QR code scanning, etc.), it can be confirmed that the smartphone and the large-screen device are mutually trusted devices. The smart phone can add the large-screen device to the trusted device list, and the large-screen device can also add the smart phone to the trusted device list.
在S204中,在进行Wi-Fi P2P设备发现时,可以利用多种发现手段(例如BLE发现、局域网发现、Wi-Fi P2P发现、广播发现等)进行设备发现,可以支持多种发现手段,同时支持使用不同的类型的连接方式或者广播方式进行信息的交互,提高了通用性和可扩展性,可以作为平台级的能力提供各个应用使用,可以使用在不同的产品平台,满足不同上层应用的需求。In S204, when performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery, which can support various discovery methods, and at the same time It supports the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability. It can be used as a platform-level capability for various applications, and can be used in different product platforms to meet the needs of different upper-layer applications. .
在S206至S208中,智能手机和大屏设备通过第一连接进行设备的安全认证,可以实现智能手机和大屏设备之间相互进行可信设备的确定,在确定可信设备之后,进行Wi-Fi P2P连接中的固有信息和可变信息的交换,保证了信息交换的安全性,避免了信息泄漏的风险。In S206 to S208, the smart phone and the large-screen device perform device security authentication through the first connection, so that the smart phone and the large-screen device can mutually determine trusted devices. After the trusted devices are determined, Wi-Fi The exchange of inherent information and variable information in the Fi P2P connection ensures the security of information exchange and avoids the risk of information leakage.
可选的,在S210至S245中,智能手机和大屏设备之间如果通过第一连接交换Wi-Fi P2P连接中的固有信息和可变信息,则发送方可以先利用加密密钥将信息进行加密后发送,接收方接收到信息后,通过解密密钥解密,这样可以保证信息传输的安全性。Optionally, in S210 to S245, if the smart phone and the large-screen device exchange the inherent information and variable information in the Wi-Fi P2P connection through the first connection, the sender can first use the encryption key to encrypt the information. After encryption, it is sent, and after the receiver receives the information, it is decrypted by the decryption key, which can ensure the security of information transmission.
可选的,作为一种可能的实现方式,在S210和S215描述的智能手机和大屏设备之间交换Wi-Fi P2P连接中的固有信息过程中。如果智能手机还没有确定大屏设备为 可信设备,则智能手机可以将智能手机Wi-Fi P2P连接的固有信息中的部分信息发送给大屏设备。例如,可以将智能手机的设备信息发送给大屏设备。对于智能手机Wi-Fi P2P连接中固有信息中的其他信息(例如:智能手机支持的信道列表、智能手机创建P2P群组时P2P群组的SSID、智能手机创建P2P群组时P2P群组的PWD、智能手机自身是否支持Wi-Fi P2P连接、智能手机是否支持宽频等)并不会发送给大屏设备。在智能手机确定大屏设备为可信设备之后,才将智能手机Wi-Fi P2P连接中的固有信息中的其他信息发送给大屏设备。Optionally, as a possible implementation manner, in the process of exchanging inherent information in the Wi-Fi P2P connection between the smartphone and the large-screen device described in S210 and S215. If the smart phone has not determined that the large-screen device is a trusted device, the smart phone can send part of the inherent information of the Wi-Fi P2P connection of the smart phone to the large-screen device. For example, the device information of a smartphone can be sent to a large-screen device. For other information inherent in the Wi-Fi P2P connection of the smartphone (for example: the list of channels supported by the smartphone, the SSID of the P2P group when the smartphone creates a P2P group, the PWD of the P2P group when the smartphone creates the P2P group , whether the smartphone itself supports Wi-Fi P2P connection, whether the smartphone supports broadband, etc.) will not be sent to large-screen devices. After the smartphone determines that the large-screen device is a trusted device, other information in the inherent information in the Wi-Fi P2P connection of the smartphone is sent to the large-screen device.
或者,如果智能手机还没有确定大屏设备为可信设备,则用户还可以在设置中自主选择将智能手机Wi-Fi P2P连接中的固有信息中的哪些或者哪个信息发送给大屏设备。Or, if the smartphone has not yet determined that the large-screen device is a trusted device, the user can also independently choose which or which information among the inherent information in the Wi-Fi P2P connection of the smartphone is sent to the large-screen device in the settings.
对于大屏设备而言,如果还没有确定智能手机为可信设备,可以利用类似的方式针对可信设备和不可信设备分别分享或者发送大屏设备Wi-Fi P2P连接中的不同的固有信息。For large-screen devices, if the smartphone has not been determined as a trusted device, a similar method can be used to share or send different inherent information in the Wi-Fi P2P connection of the large-screen device for trusted devices and untrusted devices.
如果智能手机已经确定大屏设备为可信设备,则可以将智能手机Wi-Fi P2P连接中的全部固有信息均发送给大屏设备。或者,用户也可以在设置中自主选择将智能手机Wi-Fi P2P连接中的固有信息中的哪些或者哪个信息发送给大屏设备。If the smartphone has determined that the large-screen device is a trusted device, all inherent information in the Wi-Fi P2P connection of the smartphone can be sent to the large-screen device. Alternatively, the user can also independently choose which or which of the inherent information in the Wi-Fi P2P connection of the smartphone to send to the large-screen device in the settings.
对于大屏设备而言,如果已经确定智能手机为可信设备,可以利用类似的方式向智能手机发送大屏设备Wi-Fi P2P连接中的固有信息。For large-screen devices, if it has been determined that the smartphone is a trusted device, the inherent information in the Wi-Fi P2P connection of the large-screen device can be sent to the smartphone in a similar manner.
可选的,作为一种可能的实现方式,在S230和S245描述的智能手机和大屏设备之间交换Wi-Fi P2P连接中的可变信息过程中。如果智能手机还没有确定大屏设备为可信设备,则智能手机可以将智能手机Wi-Fi P2P连接的可变信息中的部分信息可以发送给大屏设备。对于智能手机Wi-Fi P2P连接中可变信息中的其他信息并不会发送给大屏设备。在智能手机确定大屏设备为可信设备之后,才将智能手机Wi-Fi P2P连接中的可变信息中的其他信息发送给大屏设备。Optionally, as a possible implementation manner, in the process of exchanging variable information in the Wi-Fi P2P connection between the smart phone and the large-screen device described in S230 and S245. If the smart phone has not determined that the large-screen device is a trusted device, the smart phone can send part of the variable information of the Wi-Fi P2P connection of the smart phone to the large-screen device. For smartphone Wi-Fi P2P connection other information in variable information is not sent to large screen device. After the smartphone determines that the large-screen device is a trusted device, other information in the variable information in the Wi-Fi P2P connection of the smartphone is sent to the large-screen device.
或者,如果智能手机还没有确定大屏设备为可信设备,则用户还可以在设置中自主选择将智能手机Wi-Fi P2P连接中的可变信息中的哪些或者哪个信息发送给大屏设备。Or, if the smartphone has not yet determined that the large-screen device is a trusted device, the user can also independently choose which or which of the variable information in the Wi-Fi P2P connection of the smartphone to send to the large-screen device in the settings.
对于大屏设备而言,如果还没有确定智能手机为可信设备,可以利用类似的方式针对可信设备和不可信设备分别分享或者发送大屏设备Wi-Fi P2P连接中的不同的可变信息。For large-screen devices, if the smartphone has not been determined as a trusted device, similar methods can be used to share or send different variable information in the Wi-Fi P2P connection of the large-screen device for trusted devices and untrusted devices. .
如果智能手机已经确定大屏设备为可信设备,则可以将智能手机Wi-Fi P2P连接中的全部可变信息均发送给大屏设备。或者,用户也可以在设置中自主选择将智能手机Wi-Fi P2P连接中的可变信息中的哪些或者哪个信息发送给大屏设备。If the smartphone has determined that the large-screen device is a trusted device, all variable information in the Wi-Fi P2P connection of the smartphone can be sent to the large-screen device. Alternatively, the user can also independently choose which or which of the variable information in the Wi-Fi P2P connection of the smartphone to send to the large-screen device in the settings.
对于大屏设备而言,如果已经确定智能手机为可信设备,可以利用类似的方式向智能手机发送大屏设备Wi-Fi P2P连接中的可变信息。For large-screen devices, if it has been determined that the smartphone is a trusted device, the variable information in the Wi-Fi P2P connection of the large-screen device can be sent to the smartphone in a similar manner.
可选的,作为一种可能的实现方式,如图5所示的,在S250中:智能手机和大屏设备根据交换的Wi-Fi P2P连接中的可变信息和固定信息,建立Wi-Fi P2P连接的具体过程可以包括:S2511至S2525。Optionally, as a possible implementation manner, as shown in FIG. 5 , in S250: the smartphone and the large-screen device establish Wi-Fi according to the variable information and fixed information in the exchanged Wi-Fi P2P connection. The specific process of the P2P connection may include: S2511 to S2525.
S2511,智能手机的通信模块将可用设备列表的信息发送给智能手机中的应用。例 如,智能手机中应用可以是文件分享应用。在本申请实施例中,可用设备列表可以包括可信设备(已经执行了S206至S208描述的步骤),进一步的,还可以包括不可信设备,不可信设备是指:虽然智能手机与某个设备已经建立了第一连接,但是还没有进行基于第一连接的设备安全认证,即没有执行S206至S208描述的步骤。可用设备列表中包括大屏设备。S2511, the communication module of the smart phone sends the information of the available device list to the application in the smart phone. For example, the application in the smartphone may be a file sharing application. In this embodiment of the present application, the list of available devices may include trusted devices (the steps described in S206 to S208 have been performed), and may further include untrusted devices. Untrusted devices refer to: although the smartphone is connected to a certain device The first connection has been established, but the device security authentication based on the first connection has not been performed, that is, the steps described in S206 to S208 have not been performed. Large screen devices are included in the list of available devices.
可选的,在本申请实施例中,在大屏设备发现了智能手机,并且与智能手机建立第一连接后,大屏设备的通信模块也可以将可用设备列表的信息发送给大屏设备中的应用。例如,大屏设备中应用可以是文件分享应用。可用设备列表中包括智能手机。Optionally, in this embodiment of the present application, after the large-screen device discovers the smart phone and establishes the first connection with the smart phone, the communication module of the large-screen device may also send the information of the available device list to the large-screen device. Applications. For example, the application in the large-screen device may be a file sharing application. The list of available devices includes smartphones.
S2512,用户触发智能手机与大屏设备建立Wi-Fi P2P连接。在本申请实施例中,用户可以通过如下两种操作方式触发智能手机与大屏设备建立Wi-Fi P2P连接:S2512, the user triggers the smartphone to establish a Wi-Fi P2P connection with the large-screen device. In the embodiment of the present application, the user can trigger the smartphone to establish a Wi-Fi P2P connection with the large-screen device through the following two operation modes:
第一种操作方式:假设用户需要利用智能手机向大屏设备分享文件,如图6中的a所示的,用户在智能手机上打开文“文件管理”应用,显示的界面如图6中的b所示的,用户选择需要分享的文件(例如为文件1),点击“分享”,选择分享方式。显示的界面如图6中的c所示的,用户选择“Wi-Fi直连”的分享方式,智能手机上应用会将之前存储的可用设备列表显示给用户。该可用设备列表中包含有一个或多个设备的设备标识。例如,显示的可用设备列表可以如图6中的d所示的。用户可以根据需要在该可用设备列表上选择一个设备(例如为大屏设备)。例如:用户在设备列表中点击大屏设备的设备标识,便实现了选择大屏设备。The first operation mode: Suppose the user needs to use the smartphone to share files with the large-screen device, as shown in a in Figure 6, the user opens the "File Management" application on the smartphone, and the displayed interface is as shown in Figure 6 As shown in b, the user selects a file to be shared (for example, file 1), clicks "Share", and selects a sharing method. The displayed interface is as shown in c in Figure 6. The user selects the sharing method of "Wi-Fi Direct", and the application on the smartphone will display the previously stored list of available devices to the user. The list of available devices contains the device IDs of one or more devices. For example, the displayed list of available devices may be as shown in d in FIG. 6 . The user may select a device (for example, a large-screen device) on the available device list as required. For example, when the user clicks the device ID of the large-screen device in the device list, the selection of the large-screen device is realized.
可选的,如图6中的d所示的,智能手机还可以将显示的可用设备列表中每一个设备是否为可信设备显示给用户。如果某一个设备为不可信设备,还可以向用户显示是否需要认证的图标,如果用户确定需要认证,则可以点击“认证”,智能手机便自动和该设备进行安全认证(即执行S206至S208),如果安全认证通过,则显示该设备为可信设备。如果安全认证不通过,则仍然显示该设备为不可信设备。Optionally, as shown in d in FIG. 6 , the smartphone may also display to the user whether each device in the displayed list of available devices is a trusted device. If a certain device is an untrusted device, an icon indicating whether authentication is required can also be displayed to the user. If the user determines that authentication is required, he can click "Authenticate", and the smartphone will automatically perform security authentication with the device (ie, execute S206 to S208). , if the security authentication is passed, the device is displayed as a trusted device. If the security authentication fails, the device is still displayed as an untrusted device.
第二种操作方式:假设用户的目的仅仅是为了将智能手机和大屏设备Wi-Fi P2P连接,以方便后续有数据或者文件分享时快捷的进行文件传输。用户在智能手机上显示的如图7中的a所示的界面上点击“设置”,显示的界面如图7中的b所示的,用户单击“WLAN直连”菜单,便可以触发Wi-Fi P2P连接。用户点击“WLAN直连”后,显示的界面如图7中的c所示的,智能手机上的应用会将之前存储的可用设备列表显示给用户。该可用设备列表中包含有一个或多个设备的设备标识。例如,显示的可用设备列表可以如图7中的c所示的。用户可以根据需要在该可用设备列表上选择一个设备(例如为大屏设备)。例如:用户在可用设备列表中点击大屏设备的设备标识,便实现了选择大屏设备。The second mode of operation: Assume that the user's purpose is only to connect the smartphone and the large-screen device Wi-Fi P2P, so as to facilitate the quick file transfer when there is data or file sharing in the future. The user clicks "Settings" on the interface shown in a in Figure 7 displayed on the smartphone, and the displayed interface is shown in b in Figure 7. The user clicks the "WLAN Direct" menu to trigger Wi-Fi. -Fi P2P connection. After the user clicks "WLAN Direct", the displayed interface is as shown in c in Figure 7, and the application on the smartphone will display the previously stored list of available devices to the user. The list of available devices contains the device IDs of one or more devices. For example, the displayed list of available devices may be as shown in c in FIG. 7 . The user may select a device (for example, a large-screen device) on the available device list as required. For example, the user clicks the device ID of the large-screen device in the list of available devices, so as to realize the selection of the large-screen device.
可选的,如图7中的c所示的,智能手机还可以将显示的可用设备列表中每一个设备是否为可信设备显示给用户,如果某一个设备为不可信设备,还可以向用户显示是否需要认证的图标,如果用户确定需要认证,则可以点击“认证”,智能手机便自动和该设备进行安全认证,如果安全认证通过,则显示该设备为可信设备。如果安全认证不通过,则仍然显示该设备为不可信设备。Optionally, as shown in c in FIG. 7 , the smartphone can also display to the user whether each device in the displayed list of available devices is a trusted device, and if a certain device is an untrusted device, it can also show the user to the user. Displays an icon indicating whether authentication is required. If the user determines that authentication is required, he or she can click "Authenticate", and the smartphone will automatically perform security authentication with the device. If the security authentication is passed, the device will be displayed as a trusted device. If the security authentication fails, the device is still displayed as an untrusted device.
应理解,在本申请实施例中,除了上述的两种操作方式之外,用户还可以通过其他操作方式触发智能手机与其他设备建立Wi-Fi P2P连接,本申请实施例在此不作限 制。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 smartphone to establish a Wi-Fi P2P connection with other devices through other operation modes, which is not limited in the embodiment of the present application.
还应理解,在本申请实施例中,图6和图7所示的界面图仅仅是示例性的,不应该对本申请实施例中用户触发智能手机与其他设备建立Wi-Fi P2P连接过程显示的界面产生任何限制。例如,在本申请另一些实施例中,智能手机显示的界面上的图标可以包括比图6或者图7所示界面上显示的更多或更少图标,或者组合某些图标,或者拆分某些图标,或者不同的图标等。本申请实施例在此不作限制。It should also be understood that, in the embodiment of the present application, the interface diagrams shown in FIG. 6 and FIG. 7 are only exemplary, and should not be displayed in the process of the user triggering the smartphone to establish a Wi-Fi P2P connection with other devices in the embodiment of the present application. The interface imposes any restrictions. For example, in other embodiments of the present application, the icons on the interface displayed by the smartphone may include more or less icons than those displayed on the interface shown in FIG. 6 or FIG. 7 , or combine certain icons, or split certain icons. some icons, or different icons, etc. The embodiments of the present application are not limited herein.
还应理解,在本申请实施例中,对于S230和S2512执行过程的先后顺序不作限制。S230可以在S2512之前执行,也可以在S2512之后执行,或者,还可以和S2512同时执行。换句话说,智能手机和大屏设备交换Wi-Fi P2P连接中的可变信息,可以在智能手机真正和大屏设备建立Wi-Fi P2P连接之前进行交换,或者,也可以在智能手机真正和大屏设备建立Wi-Fi P2P连接的过程中进行交换。本申请实施例不作限制。It should also be understood that, in this embodiment of the present application, there is no limitation on the sequence of executing the processes of S230 and S2512. S230 can be executed before S2512, can also be executed after S2512, or can also be executed simultaneously with S2512. In other words, the smartphone and the large-screen device exchange variable information in the Wi-Fi P2P connection, either before the smartphone actually establishes a Wi-Fi P2P connection with the large-screen device, or, before the smartphone actually establishes a Wi-Fi P2P connection with the large-screen device. The large-screen device exchanges during the process of establishing a Wi-Fi P2P connection. The embodiments of the present application are not limited.
类似的,对于S245和S2512执行过程的先后顺序不作限制。S245可以在S2512之前执行,也可以在S2512之后执行,或者,还可以和S2512同时执行,本申请实施例不作限制。Similarly, there is no limitation on the sequence of execution of S245 and S2512. S245 may be executed before S2512, may also be executed after S2512, or may also be executed simultaneously with S2512, which is not limited in this embodiment of the present application.
S2513,用户在可用设备列表中点击大屏设备的设备标识后,智能手机上的应用调用Wi-Fi P2P连接接口,向智能手机中的通信模块发送Wi-Fi P2P连接请求,该Wi-Fi P2P连接请求包括手机大屏设备的标识。S2513, after the user clicks the device identification of the large-screen device in the available device list, the application on the smartphone calls the Wi-Fi P2P connection interface, and sends a Wi-Fi P2P connection request to the communication module in the smartphone, and the Wi-Fi P2P The connection request includes the identification of the large screen device of the mobile phone.
下面将描述智能手机和大屏设备获取了建立Wi-Fi P2P连接所需要的信息后,智能手机和大屏设备之间建立Wi-Fi P2P连接的具体流程,该流程包括S2514至S2524。The following will describe the specific process of establishing a Wi-Fi P2P connection between the smartphone and the large-screen device after the smartphone and the large-screen device obtain the information required to establish the Wi-Fi P2P connection, and the process includes S2514 to S2524.
S2514,智能手机中的通信模块接收到该Wi-Fi P2P连接请求后,根据之前存储的大屏设备的Wi-Fi P2P连接中的固有信息和可变信息,确定Wi-Fi P2P连接方式。S2514, after receiving the Wi-Fi P2P connection request, the communication module in the smartphone determines the Wi-Fi P2P connection mode according to the inherent information and variable information in the Wi-Fi P2P connection of the large-screen device previously stored.
具体的,在S2514中,当用户利用智能手机真正需要发起到大屏设备的Wi-Fi P2P连接时,由于此时智能手机建立Wi-Fi P2P连接所需的绝大部分信息(Wi-Fi P2P连接中的固有信息和可变信息)已经和大屏设备交换完成,智能手机根据自身与大屏设备的Wi-Fi P2P连接中的固有信息和可变信息。例如:智能手机根据自身与大屏设备的设备类型和设备状态(电池电量等)、Wi-Fi P2P连接状态等来确定GO以及GC角色。例如:智能手机为GO设备,大屏设备为GC设备。智能手机根据大屏设备的Wi-Fi STATION信道、支持的5G信道列表、是否支持宽频等信息确定GO设备最终建立在哪个频率上,以及确定Wi-Fi P2P群组的SSID和PWD等。即确定了Wi-Fi P2P的连接方式。Specifically, in S2514, when the user really needs to initiate a Wi-Fi P2P connection to a large-screen device using a smartphone, most of the information required for the smartphone to establish a Wi-Fi P2P connection (Wi-Fi P2P The inherent information and variable information in the connection) have been exchanged with the large-screen device, and the smartphone uses the inherent information and variable information in the Wi-Fi P2P connection between itself and the large-screen device. For example, a smartphone determines the GO and GC roles according to the device type and device status (battery power, etc.) of itself and the large-screen device, Wi-Fi P2P connection status, etc. For example: a smartphone is a GO device, and a large-screen device is a GC device. The smartphone determines which frequency the GO device is ultimately built on according to the Wi-Fi STATION channel of the large-screen device, the list of supported 5G channels, whether it supports broadband, etc., and determines the SSID and PWD of the Wi-Fi P2P group. That is, the connection method of Wi-Fi P2P is determined.
S2515,智能手机中的通信模块通过广播或者第一连接的方式向大屏设备的通信模块发送Wi-Fi P2P群组建立请求。该Wi-Fi P2P群组建立请求包括:Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、Wi-Fi P2P群组的SSID和PWD、智能手机的MAC地址、或者IP地址以及端口号等。S2515, the communication module in the smart phone sends a Wi-Fi P2P group establishment request to the communication module of the large-screen device by means of broadcasting or the first connection. The Wi-Fi P2P group establishment request includes: the frequency of Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group, the MAC address or IP address of the smartphone, and port number, etc.
例如,在S2515中,智能手机中的通信模块可以通过BLE广播、BR广播、Wi-Fi广播等向大屏设备的通信模块发送Wi-Fi P2P群组建立请求。For example, in S2515, the communication module in the smartphone can send a Wi-Fi P2P group establishment request to the communication module of the large-screen device through BLE broadcast, BR broadcast, Wi-Fi broadcast, etc.
S2516,大屏设备的通信模块接收到该Wi-Fi P2P群组建立请求后,向大屏设备的驱动和芯片模块发送该Wi-Fi P2P群组建立请求。S2516, after receiving the Wi-Fi P2P group establishment request, the communication module of the large-screen device sends the Wi-Fi P2P group establishment request to the driver and chip module of the large-screen device.
S2517,大屏设备的驱动和芯片模块根据Wi-Fi P2P群组建立请求,建立Wi-Fi P2P 群组。S2517, the driver and chip module of the large-screen device establish a Wi-Fi P2P group according to the Wi-Fi P2P group establishment request.
S2518,大屏设备的驱动和芯片模块向大屏设备的通信模块发送Wi-Fi P2P群组建立成功的通知消息。S2518, the driver and chip module of the large-screen device sends a notification message that the Wi-Fi P2P group is successfully established to the communication module of the large-screen device.
S2519,大屏设备的通信模块通过广播或者第一连接的方式向智能手机中的通信模块发送Wi-Fi P2P群组建立成功的通知消息,该通知消息包括:Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、Wi-Fi P2P群组的SSID和PWD、大屏设备的MAC地址、或者IP地址以及端口号等。S2519, the communication module of the large-screen device sends a notification message of the successful establishment of the Wi-Fi P2P group to the communication module in the smartphone by broadcasting or the first connection, and the notification message includes: the frequency of the establishment of the Wi-Fi P2P group , GC device and GO device role assignment, SSID and PWD of Wi-Fi P2P group, MAC address, or IP address and port number of large screen device.
S2520,智能手机中的通信模块向智能手机的驱动和芯片发送Wi-Fi P2P群组建立成功的通知消息。该通知消息包括:Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、Wi-Fi P2P群组的SSID和PWD、大屏设备的MAC地址、或者IP地址以及端口号等。S2520, the communication module in the smartphone sends a notification message that the Wi-Fi P2P group is successfully established to the driver and chip of the smartphone. The notification message includes: the frequency of Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the SSID and PWD of the Wi-Fi P2P group, the MAC address, or IP address and port number of the large-screen device.
S2521,智能手机的驱动和芯片模块根据Wi-Fi P2P群组建立成功的通知消息,加入Wi-Fi P2P群组。S2521, the driver and chip module of the smartphone join the Wi-Fi P2P group according to the notification message of the successful establishment of the Wi-Fi P2P group.
S2522,智能手机的驱动和芯片模块向智能手机中的通信模块通知加入Wi-Fi P2P群组成功的消息。S2522, the driver and chip module of the smart phone notifies the communication module in the smart phone of the successful joining of the Wi-Fi P2P group.
S2523,智能手机中的通信模块接收到该消息后,向智能手机上的应用发送加入Wi-Fi P2P群组成功的消息。S2523, after receiving the message, the communication module in the smart phone sends a message of successfully joining the Wi-Fi P2P group to the application on the smart phone.
S2524,智能手机上的应用接收到加入Wi-Fi P2P群组成功的消息后,与大屏设备上的应用(例如为文件分享应用)建立基于Wi-Fi P2P连接的传输通道。S2524, after the application on the smart phone receives the message of successfully joining the Wi-Fi P2P group, it establishes a transmission channel based on the Wi-Fi P2P connection with the application on the large-screen device (for example, a file sharing application).
在S2524之后,智能手机和大屏设备之间便建立了Wi-Fi P2P连接。After S2524, a Wi-Fi P2P connection is established between the smartphone and the large-screen device.
S2525,智能手机上的应用基于Wi-Fi P2P连接的传输通道,向大屏设备上的应用开始文件分享。S2525, the application on the smartphone starts file sharing to the application on the large-screen device based on the transmission channel of the Wi-Fi P2P connection.
本申请提供的建立Wi-Fi P2P连接的方法,在进行Wi-Fi P2P设备发现时,可以利用多种发现手段(例如BLE发现、局域网发现、Wi-Fi P2P发现、广播发现等)进行设备发现,可以支持多种发现手段,同时支持使用不同的类型的连接方式或者广播方式进行信息的交互,提高了通用性和可扩展性,可以作为平台级的能力提供各个应用使用。在发现设备后,将进行Wi-Fi P2P连接需要的信息分阶段进行交换,将Wi-Fi P2P连接需要的信息中的固有信息(例如:设备支持的信道列表、P2P群组SSID、PWD、是否支持宽频(例如是否支持160MHz)、设备信息等)等在Wi-Fi P2P业务发起前提前进行交换。将Wi-Fi P2P连接需要的信息中的可变信息(例如:设备Wi-Fi P2P的连接状态、角色、设备连接的AP(即Wi-Fi热点)的频率等)在可变信息发生变化后,在Wi-Fi P2P业务发起前提前进行交换,或者,在真正发起Wi-Fi P2P连接过程进行交换。从而使得在真正发起Wi-Fi P2P连接时,Wi-Fi P2P连接所必须的部分信息或者全部信息已经交互完成,在真正发起Wi-Fi P2P连接时,仅仅需要发送一些简单的信令(例如广播报文、蓝牙报文等)即可完成Wi-Fi P2P连接,从而进一步缩短Wi-Fi P2P连接所用的时间,提高用户体验。并且,可以使用在不同的产品平台,满足不同上层应用的需求。The method for establishing a Wi-Fi P2P connection provided by this application, when performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery , can support a variety of discovery methods, and support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability, and can be used as a platform-level capability for various applications. After the device is discovered, the information required for the Wi-Fi P2P connection will be exchanged in stages, and the inherent information in the information required by the Wi-Fi P2P connection (for example: the list of channels supported by the device, P2P group SSID, PWD, whether Support broadband (such as whether to support 160MHz), device information, etc., are exchanged in advance before the Wi-Fi P2P service is initiated. Change the variable information in the information required for Wi-Fi P2P connection (for example: Wi-Fi P2P connection status of the device, role, frequency of the AP (ie Wi-Fi hotspot) connected to the device, etc.) after the variable information changes , exchange in advance before the Wi-Fi P2P service is initiated, or exchange in the process of actually initiating the Wi-Fi P2P connection. Therefore, when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged. When the Wi-Fi P2P connection is actually initiated, only some simple signaling (such as broadcast message, Bluetooth message, etc.) to complete the Wi-Fi P2P connection, thereby further shortening the time spent in the Wi-Fi P2P connection and improving the user experience. Moreover, it can be used in different product platforms to meet the needs of different upper-layer applications.
可选的,在本申请实施例中,在S204之后,对于S205:智能手机中的通信模块和大屏设备中的通信模块通过交互广播消息建立第一连接而言,可以有两种不同的实 现方式:Optionally, in this embodiment of the present application, after S204, for S205: the communication module in the smartphone and the communication module in the large-screen device establish the first connection through interactive broadcast messages, there may be two different implementations. Way:
第一种实现方式:例如如图8所示的:S205可以包括:The first implementation manner: For example, as shown in Figure 8: S205 may include:
S2051a中,智能手机驱动和芯片模块开启后台扫描来发现设备后,智能手机中的通信模块发送第一广播消息,第一广播消息可以为BLE广播消息、BR广播消息或者Wi-Fi广播消息等。第一广播消息内携带:智能手机的设备标识(deviceId)、设备类型、连接地址、版本号等。例如,该连接地址可以包括:智能手机的MAC地址、智能手机的IP地址以及端口号等。In S2051a, after the smartphone driver and the chip module enable background scanning to discover devices, the communication module in the smartphone sends a first broadcast message, which may be a BLE broadcast message, a BR broadcast message, or a Wi-Fi broadcast message. The first broadcast message carries: the device identifier (deviceId) of the smart phone, the device type, the connection address, the version number, and the like. For example, the connection address may include: the MAC address of the smart phone, the IP address of the smart phone, the port number, and the like.
S2052a,大屏设备的驱动和芯片模块开启后台扫描来发现设备后,大屏设备的通信模块接收到第一广播消息后。S2052a, after the driver and the chip module of the large-screen device enable background scanning to discover the device, and after the communication module of the large-screen device receives the first broadcast message.
S2053a,大屏设备的通信模块回复第二广播消息,第二广播消息可以为:BLE广播消息、BR广播消息或者Wi-Fi广播消息等。第二广播消息包括:大屏设备的设备标识(deviceId)、设备类型、连接地址、版本号等。例如,该连接地址可以包括:大屏设备的MAC地址、大屏设备的IP地址以及端口号等。S2053a, the communication module of the large-screen device replies with a second broadcast message, where the second broadcast message may be a BLE broadcast message, a BR broadcast message, or a Wi-Fi broadcast message, and the like. The second broadcast message includes: a device identifier (deviceId) of the large-screen device, a device type, a connection address, a version number, and the like. For example, the connection address may include: the MAC address of the large-screen device, the IP address and port number of the large-screen device, and the like.
S2054a,智能手机中的通信模块接收到第二广播消息后,根据第二广播消息包括的连接地址,与大屏设备建立第一连接。例如,如果是基于MAC地址,则建立的第一连接为BLE连接或者BR连接,如果是基于MAC地址IP地址以及端口号,则建立的第一连接为基于局域网的socket连接。S2054a, after receiving the second broadcast message, the communication module in the smartphone establishes a first connection with the large-screen device according to the connection address included in the second broadcast message. For example, if it is based on a MAC address, the first connection established is a BLE connection or a BR connection; if it is based on a MAC address, an IP address and a port number, the first connection established is a socket connection based on a local area network.
在S2054a之后,便可以执行S206。After S2054a, S206 can be executed.
第二种实现方式:例如如图9所示的:S205可以包括:The second implementation manner: For example, as shown in Figure 9: S205 may include:
S2051b中,智能手机驱动和芯片模块开启后台扫描来发现设备后,智能手机中的通信模块发送第一广播消息,第一广播消息可以为BLE广播消息、BR广播消息或者Wi-Fi广播消息等。第一广播消息内携带:智能手机的设备标识(deviceId)、设备类型、连接地址、版本号等。例如,该连接地址可以包括:智能手机的MAC地址、智能手机的IP地址以及端口号等。In S2051b, after the smartphone driver and the chip module enable background scanning to discover devices, the communication module in the smartphone sends a first broadcast message, which may be a BLE broadcast message, a BR broadcast message, or a Wi-Fi broadcast message. The first broadcast message carries: the device identifier (deviceId) of the smart phone, the device type, the connection address, the version number, and the like. For example, the connection address may include: the MAC address of the smart phone, the IP address of the smart phone, the port number, and the like.
S2052b,大屏设备的驱动和芯片模块开启后台扫描来发现设备后,大屏设备的通信模块接收到第一广播消息。S2052b, after the driver and the chip module of the large-screen device enable background scanning to discover the device, the communication module of the large-screen device receives the first broadcast message.
S2053b,大屏设备的通信模块根据第一广播消息包括的连接地址,与智能手机建立第一连接。例如,如果是基于智能手机的MAC地址,则建立的第一连接为BLE连接或者BR连接,如果是基于智能手机的IP地址以及端口号,则建立的第一连接为基于局域网的socket连接。S2053b, the communication module of the large-screen device establishes a first connection with the smartphone according to the connection address included in the first broadcast message. For example, if it is based on the MAC address of the smartphone, the first connection established is a BLE connection or a BR connection; if it is based on the IP address and port number of the smartphone, the first connection established is a local area network-based socket connection.
在S2053b之后,便可以执行S206。After S2053b, S206 can be executed.
本申请提供的建立Wi-Fi P2P连接的方法,在进行Wi-Fi P2P设备发现时,可以利用多种发现手段(例如BLE发现、局域网发现、Wi-Fi P2P发现、广播发现等)进行设备发现,可以支持多种发现手段,同时支持使用不同的类型的连接方式或者广播方式进行信息的交互,提高了通用性和可扩展性,可以作为平台级的能力提供各个应用使用。在发现设备后,将进行Wi-Fi P2P连接需要的信息分阶段进行交换,将Wi-Fi P2P连接需要的信息中的固有信息(例如:设备支持的信道列表、P2P群组SSID、PWD、是否支持宽频(例如是否支持160MHz)、设备信息等)等在Wi-Fi P2P业务发起前提前进行交换,将Wi-Fi P2P连接需要的信息中的可变信息(例如:设备Wi-Fi P2P的连 接状态、角色、设备连接的AP(即Wi-Fi热点)的频率等)在可变信息发生变化后,在Wi-Fi P2P业务发起前提前进行交换,或者,在真正发起Wi-Fi P2P连接过程进行交换。从而使得在真正发起Wi-Fi P2P连接时,Wi-Fi P2P连接所必须的部分信息或者全部信息已经交互完成。在真正发起Wi-Fi P2P连接时,仅仅需要发送一些简单的信令(例如广播报文、蓝牙报文等)即可完成Wi-Fi P2P连接,从而进一步缩短Wi-Fi P2P连接所用的时间,提高用户体验。并且,可以使用在不同的产品平台,满足不同上层应用的需求。The method for establishing a Wi-Fi P2P connection provided by this application, when performing Wi-Fi P2P device discovery, various discovery methods (such as BLE discovery, LAN discovery, Wi-Fi P2P discovery, broadcast discovery, etc.) can be used for device discovery , can support a variety of discovery methods, and support the use of different types of connection methods or broadcast methods for information interaction, which improves the versatility and scalability, and can be used as a platform-level capability for various applications. After the device is discovered, the information required for the Wi-Fi P2P connection will be exchanged in stages, and the inherent information in the information required by the Wi-Fi P2P connection (for example: the list of channels supported by the device, P2P group SSID, PWD, whether Support broadband (such as whether to support 160MHz), device information, etc. to exchange in advance before the Wi-Fi P2P service is initiated, and the variable information in the information required for Wi-Fi P2P connection (for example: device Wi-Fi P2P connection Status, role, frequency of the AP (ie Wi-Fi hotspot) connected to the device, etc.) After the variable information changes, it is exchanged in advance before the Wi-Fi P2P service is initiated, or the Wi-Fi P2P connection process is actually initiated. exchange. Therefore, when the Wi-Fi P2P connection is actually initiated, some or all of the information necessary for the Wi-Fi P2P connection has been exchanged. When a Wi-Fi P2P connection is actually initiated, it only needs to send some simple signaling (such as broadcast messages, Bluetooth messages, etc.) to complete the Wi-Fi P2P connection, thereby further shortening the time used for the Wi-Fi P2P connection. Improve user experience. Moreover, it can be used in different product platforms to meet the needs of different upper-layer applications.
应理解,上文以建立Wi-Fi P2P连接为例说明本申请提供的方法。在本申请另一些可能的实现方式中,例如,在第一电子设备和第二电子设备建立Wi-Fi连接场景中,也可以利用本申请提供的构思,下文将具体进行说明。It should be understood that the method provided in the present application is described above by taking establishing a Wi-Fi P2P connection as an example. In some other possible implementation manners of the present application, for example, in the scenario of establishing a Wi-Fi connection between the first electronic device and the second electronic device, the concepts provided by the present application can also be used, which will be described in detail below.
在本申请实施例中,作为一种可能的实现方式,假设第一电子设备为终端设备,第二电子设备为接入点设备(access point,AP),例如,第二电子设备可以为路由器。在这种情况下,在用户触发终端设备和路由器建立Wi-Fi连接之前,由于路由器已经存在,在建立Wi-Fi连接之前,终端设备可以通过后台组网发现,获取到路由器的SSID以及PWD等Wi-Fi连接固有信息(即在Wi-Fi连接中过程,在一段时间内保持不变的信息)。除此之外,由于路由器支持跳频功能,因此,路由器工作的频率或者信道等也可能随时发生变化,因此,在路由器工作的频率或者信道等发生变化后,路由器可以将变化后的工作的频率、信道等信息发送(例如通过蓝牙报文、Wi-Fi报文等)给终端设备,或者,终端设备也可以主动向路由器请求路由器工作的频率、信道等信息。在终端设备获取到路由器工作的频率、信道等Wi-Fi连接可变信息(即在Wi-Fi连接中过程,可能随时变化,并且会影响Wi-Fi连接的信息)后,在用户真正触发终端设备和路由器建立Wi-Fi连接时,由于终端设备之前已经获取了和路由器建立Wi-Fi连接的固有信息(包括路由器的SSID以及PWD等)以及可变信息(包括路由器工作的频率、信道等),从而使得在用户利用终端设备真正发起Wi-Fi连接时,大部分的信息已经交互完成,第一终端设备直接在路由器的工作频率以及信道进行扫描,并且仅仅需要终端设备发送一些简单的信令(例如通过广播报文、蓝牙报文等发送信令)即可完成Wi-Fi连接,从而进一步缩短Wi-Fi连接的耗时,提高用户体验。In the embodiment of the present application, as a possible implementation manner, it is assumed that the first electronic device is a terminal device, and the second electronic device is an access point device (access point, AP). For example, the second electronic device may be a router. In this case, before the user triggers the terminal device to establish a Wi-Fi connection with the router, since the router already exists, before the Wi-Fi connection is established, the terminal device can be discovered through the background networking and obtain the SSID and PWD of the router, etc. Wi-Fi connection inherent information (that is, information that remains unchanged for a period of time during a Wi-Fi connection). In addition, since the router supports the frequency hopping function, the working frequency or channel of the router may change at any time. Therefore, after the working frequency or channel of the router changes, the router can change the working frequency of the changed working frequency. , channel and other information (for example, through Bluetooth packets, Wi-Fi packets, etc.) to the terminal device, or the terminal device can also actively request the router for information such as the frequency and channel of the router's operation. After the terminal device obtains the variable information of the Wi-Fi connection such as the frequency and channel of the router's operation (that is, during the Wi-Fi connection process, it may change at any time, and the information that will affect the Wi-Fi connection), the user actually triggers the terminal When the device establishes a Wi-Fi connection with the router, since the terminal device has previously acquired the inherent information (including the router's SSID and PWD, etc.) and variable information (including the router's working frequency, channel, etc.) , so that when the user uses the terminal device to initiate a Wi-Fi connection, most of the information has been exchanged. The first terminal device directly scans the operating frequency and channel of the router, and only the terminal device needs to send some simple signaling. (For example, sending signaling through broadcast messages, Bluetooth messages, etc.) can complete the Wi-Fi connection, thereby further shortening the time-consuming of the Wi-Fi connection and improving the user experience.
在本申请实施例中,作为另一种可能的实现方式,假设第一电子设备为终端设备,第二电子设备为软AP(soft AP)。软AP可以理解为一个连接有线网络或者无线网络的终端设备,将这个终端设备作为Wi-Fi热点为其他终端设备提供Wi-Fi网络。例如,软AP可以包括用户使用的智能手机、平板电脑、上网本、PDA、电脑手持式通信设备等。在这种情况下,假设第一电子设备为用户使用的第一终端设备,第二电子为用户使用的第二终端设备。在用户触发第一终端设备和第二终端设备建立Wi-Fi连接之前,第一终端设备和第二终端设备可以通过各种广播报文(例如蓝牙报文、Wi-Fi报文等)交换各自进行Wi-Fi连接时的SSID以及PWD等Wi-Fi连接固有信息(即在Wi-Fi连接中过程,在一段时间内保持不变的信息)。除此之外,第一终端设备和第二终端设备可以通过广播报文(例如;蓝牙报文等)交换各自的工作的频率、信道等Wi-Fi连接可变信息(在Wi-Fi连接中过程,可能随时变化,并且会影响Wi-Fi连接的信息)。在用户真正触发第一终端设备和第二终端设备建立Wi-Fi连接时,由于第 一终端设备之前已经获取了和第二终端设备建立Wi-Fi连接的固有信息(包括第二终端设备的SSID以及PWD等)以及可变信息(包括第二终端设备工作的频率、信道等),从而使得在用户利用第一终端设备真正发起Wi-Fi连接时,大部分的信息已经交互完成,第一终端设备仅仅需要发送一些简单的信令(例如广播报文、蓝牙报文)即可完成Wi-Fi连接,从而进一步缩短Wi-Fi连接的耗时,提高用户体验。In this embodiment of the present application, as another possible implementation manner, it is assumed that the first electronic device is a terminal device, and the second electronic device is a soft AP (soft AP). A soft AP can be understood as a terminal device connected to a wired network or a wireless network, and the terminal device is used as a Wi-Fi hotspot to provide a Wi-Fi network for other terminal devices. For example, soft APs may include smart phones, tablet computers, netbooks, PDAs, computer handheld communication devices, etc. used by the user. In this case, it is assumed that the first electronic device is the first terminal device used by the user, and the second electronic device is the second terminal device used by the user. Before the user triggers the first terminal device and the second terminal device to establish a Wi-Fi connection, the first terminal device and the second terminal device may exchange their respective Wi-Fi connection-specific information such as SSID and PWD during Wi-Fi connection (that is, information that remains unchanged for a period of time during Wi-Fi connection). In addition, the first terminal device and the second terminal device can exchange Wi-Fi connection variable information such as their respective working frequencies and channels through broadcast messages (eg, Bluetooth messages, etc.) (in the Wi-Fi connection process, may change at any time and affect Wi-Fi connection information). When the user actually triggers the first terminal device to establish a Wi-Fi connection with the second terminal device, because the first terminal device has previously acquired the inherent information (including the SSID of the second terminal device) for establishing a Wi-Fi connection with the second terminal device and PWD, etc.) and variable information (including the working frequency, channel, etc. of the second terminal device), so that when the user uses the first terminal device to actually initiate a Wi-Fi connection, most of the information has been exchanged, and the first terminal device The device only needs to send some simple signaling (such as broadcast packets, Bluetooth packets) to complete the Wi-Fi connection, thereby further shortening the time-consuming of the Wi-Fi connection and improving the user experience.
例如,在上述的方法200的S205中,在智能手机和大屏设备之间的第一连接为Wi-Fi连接时,智能手机和大屏设备可以利用上述的两种方式建立Wi-Fi连接。For example, in S205 of the above-mentioned method 200, when the first connection between the smartphone and the large-screen device is a Wi-Fi connection, the smartphone and the large-screen device may establish a Wi-Fi connection using the above two methods.
可选的,在第一电子设备和第二电子设备建立Wi-Fi连接之前,第一电子设备和第二电子设备可以还建立其他方式的通信连接,例如,该通信连接可以是蓝牙连接等。在建立通信连接之后,用户真正触发第一电子设备和第二电子设备建立Wi-Fi连接之前,第一电子设备和第二电子设备可以通过该通信连接交换Wi-Fi连接中的固有信息和可变信息,可以提高信息交换的速率,进一步的缩短Wi-Fi连接的耗时。Optionally, before the first electronic device and the second electronic device establish a Wi-Fi connection, the first electronic device and the second electronic device may further establish a communication connection in other manners, for example, the communication connection may be a Bluetooth connection or the like. After the communication connection is established, before the user actually triggers the first electronic device and the second electronic device to establish a Wi-Fi connection, the first electronic device and the second electronic device can exchange the inherent information and available information in the Wi-Fi connection through the communication connection. Changing information can increase the rate of information exchange and further shorten the time-consuming of Wi-Fi connections.
可选的,第一电子设备和第二电子设备还可以通过广播报文(例如;蓝牙报文、Wi-Fi报文等)交换Wi-Fi连接中的固有信息和可变信息。本申请实施例在此不作限制。Optionally, the first electronic device and the second electronic device may also exchange inherent information and variable information in the Wi-Fi connection through broadcast messages (eg, Bluetooth messages, Wi-Fi messages, etc.). The embodiments of the present application are not limited herein.
应理解,本申请提供的在双端设备真正建立无线通信连接之前,双端设备提前交换建立该通信连接所必须的信息,从而使得在双端设备真正发起通信连接时,大部分的信息已经交互完成,仅仅需要双端设备发送一些简单的信令即可完成通信连接的方法,不仅可以适用于包括建立Wi-Fi连接、Wi-Fi P2P连接的场景中,还可以适用于建立其他通信连接(例如蓝牙、紫蜂(Zigbee))的场景中,本申请实施例在此不作限制。It should be understood that before the two-terminal device actually establishes a wireless communication connection provided by the present application, the two-terminal device exchanges information necessary for establishing the communication connection in advance, so that when the two-terminal device actually initiates the communication connection, most of the information has been exchanged. Complete, the method of completing the communication connection only requires the two-end devices to send some simple signaling, which is not only applicable to the scenarios including establishing Wi-Fi connection and Wi-Fi P2P connection, but also applicable to establishing other communication connections ( For example, in a scenario of Bluetooth and Zigbee, this embodiment of the present application does not limit it.
应理解,上述只是为了帮助本领域技术人员更好地理解本申请实施例,而非要限制本申请实施例的范围。本领域技术人员根据所给出的上述示例,显然可以进行各种等价的修改或变化,例如,上述方法200中某些步骤可以不必须的,或者可以新加入某些步骤等。或者上述任意两种或者任意多种实施例的组合。这样的修改、变化或者组合后的方案也落入本申请实施例的范围内。It should be understood that the above is only to help those skilled in the art to better understand the embodiments of the present application, but is not intended to limit the scope of the embodiments of the present application. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples. For example, some steps in the above method 200 may be unnecessary, or some new steps may be added. Or a combination of any two or any of the above embodiments. Such modifications, changes or combined solutions also fall within the scope of the embodiments of the present application.
还应理解,本申请实施例中的方式、情况、类别以及实施例的划分仅是为了描述的方便,不应构成特别的限定,各种方式、类别、情况以及实施例中的特征在不矛盾的情况下可以相结合。It should also be understood that the manners, situations, categories, and divisions of the embodiments in the embodiments of the present application are only for the convenience of description, and should not constitute a special limitation, and the various manners, categories, situations, and features in the embodiments are not contradictory. can be combined.
还应理解,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that the various numbers and 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 numbers of the above processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
还应理解,上文对本申请实施例的描述着重于强调各个实施例之间的不同之处,未提到的相同或相似之处可以互相参考,为了简洁,这里不再赘述。It should also be understood that the above description of the embodiments of the present application focuses on emphasizing the differences between the various embodiments, and the unmentioned same or similar points can be referred to each other, and are not repeated here for brevity.
上述结合图1-图9描述了本申请实施例提供的建立Wi-Fi P2P连接的方法的实施例,下面描述本申请实施例提供的电子设备。The foregoing describes the embodiments of the method for establishing a Wi-Fi P2P connection provided by the embodiments of the present application with reference to FIG. 1 to FIG. 9 , and the electronic devices provided by the embodiments of the present application are described below.
本实施例可以根据上述方法,对电子设备(包括上述的第一电子设备、第二电子设备、)进行功能模块的划分。例如,可以对应各个功能,划分为各个功能模块,也 可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment, according to the above method, the electronic device (including the above-mentioned first electronic device and the second electronic device) can be divided into functional modules. For example, each function can be divided into various function modules, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that, the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
需要说明的是,上述方法实施例涉及的各步骤的相关内容,均可以援引到对应功能模块的功能描述,此处不再赘述。It should be noted that, the relevant content of each step involved in the above method embodiments can be cited in the functional description of the corresponding functional module, and details are not repeated here.
本申请实施例提供的电子设备,用于执行上述方法实施例提供任一种建立Wi-Fi P2P连接的方法,因此可以达到与上述实现方法相同的效果。在采用集成的单元的情况下,电子设备可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对电子设备的动作进行控制管理。例如,可以用于支持电子设备执行处理单元执行的步骤。存储模块可以用于支持存储程序代码和数据等。通信模块,可以用于支持电子设备与其他设备的通信。The electronic device provided by the embodiment of the present application is used to execute the above method. The embodiment provides any method for establishing a Wi-Fi P2P connection, so the same effect as the above implementation method can be achieved. Where an integrated unit is employed, the electronic device may include a processing module, a memory module and a communication module. The processing module may be used to control and manage the actions of the electronic device. For example, it may be used to support the electronic device to perform the steps performed by the processing unit. The memory module can be used to support the storage of program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.
其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。The processing module may be a processor or a controller. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and the like. The storage module may be a memory. The communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
示例性地,图10示出了本申请提供的一例电子设备300的硬件结构示意图。该电子设备300可以为上述的方法实施例中的智能手机或者大屏设备。如图10所示,电子设备300可包括处理器310,外部存储器接口320,内部存储器321,通用串行总线(universal serial bus,USB)接口330,充电管理模块340,电源管理模块341,电池342,天线1,天线2,无线通信模块350等。Exemplarily, FIG. 10 shows a schematic diagram of the hardware structure of an example of the electronic device 300 provided in the present application. The electronic device 300 may be a smartphone or a large-screen device in the foregoing method embodiments. As shown in FIG. 10 , the electronic device 300 may include a processor 310 , an external memory interface 320 , an internal memory 321 , a universal serial bus (USB) interface 330 , a charge management module 340 , a power management module 341 , and a battery 342 , Antenna 1, Antenna 2, wireless communication module 350, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备300的具体限定。在本申请另一些实施例中,电子设备300可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 300 . In other embodiments of the present application, the electronic device 300 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器310可以包括一个或多个处理单元。例如:处理器310可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的部件,也可以集成在一个或多个处理器中。在一些实施例中,电子设备300也可以包括一个或多个处理器310。其中,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。 Processor 310 may include one or more processing units. For example, the processor 310 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video Codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent components, or may be integrated in one or more processors. In some embodiments, electronic device 300 may also include one or more processors 310 . The controller can generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions.
在一些实施例中,处理器310可以包括一个或多个接口。接口可以包括集成电路间(inter-integrated circuit,I2C)接口,集成电路间音频(integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,SIM卡接口,和/或USB接口等。其中,USB接口330是符合USB标准规范的接口,具体 可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口330可以用于连接充电器为电子设备300充电,也可以用于电子设备300与外围设备之间传输数据。In some embodiments, processor 310 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM card interface, and/or USB interface, etc. Among them, the USB interface 330 is an interface that conforms to the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 330 can be used to connect a charger to charge the electronic device 300, and can also be used to transmit data between the electronic device 300 and peripheral devices.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备500的结构限定。在本申请另一些实施例中,电子设备300也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 500 . In other embodiments of the present application, the electronic device 300 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
电子设备300的无线通信功能可以通过天线1,天线2以及无线通信模块350等实现。The wireless communication function of the electronic device 300 may be implemented by the antenna 1, the antenna 2, the wireless communication module 350, and the like.
无线通信模块350可以提供应用在电子设备300上的包括Wi-Fi(包括Wi-Fi感知和Wi-Fi AP),蓝牙(bluetooth,BT),移动网络,无线数传模块(例如,433MHz,868MHz,515MHz)等无线通信的解决方案。无线通信模块350可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块350经由天线1或者天线2(或者,天线1和天线2)接收电磁波,将电磁波信号滤波以及调频处理,将处理后的信号发送到处理器310。无线通信模块350还可以从处理器310接收待发送的信号,对其进行调频,放大,经天线1或者天线2转为电磁波辐射出去。The wireless communication module 350 can provide Wi-Fi (including Wi-Fi perception and Wi-Fi AP), Bluetooth (bluetooth, BT), mobile network, and wireless data transmission modules (for example, 433MHz, 868MHz) applied on the electronic device 300 , 515MHz) and other wireless communication solutions. The wireless communication module 350 may be one or more devices integrating at least one communication processing module. The wireless communication module 350 receives the electromagnetic wave via the antenna 1 or the antenna 2 (or, the antenna 1 and the antenna 2 ), filters and frequency modulates the electromagnetic wave signal, and sends the processed signal to the processor 310 . The wireless communication module 350 can also receive the signal to be sent from the processor 310, perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1 or the antenna 2.
外部存储器接口320可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备300的存储能力。外部存储卡通过外部存储器接口320与处理器310通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 300. The external memory card communicates with the processor 310 through the external memory interface 320 to realize the data storage function. For example to save files like music, video etc in external memory card.
内部存储器321可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器310可以通过运行存储在内部存储器321的上述指令,从而使得电子设备300执行本申请一些实施例中所提供的Wi-Fi直连下数据传输的方法,以及各种应用以及数据处理等。内部存储器321可以包括代码存储区和数据存储区。其中,代码存储区可存储操作系统。数据存储区可存储电子设备300使用过程中所创建的数据等。此外,内部存储器321可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储部件,闪存部件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器310可以通过运行存储在内部存储器321的指令,和/或存储在设置于处理器310中的存储器的指令,来使得电子设备300执行本申请实施例中所提供任一种的Wi-Fi直连下数据传输的方法,以及其他应用及数据处理。 Internal memory 321 may be used to store one or more computer programs including instructions. The processor 310 may execute the above-mentioned instructions stored in the internal memory 321, thereby enabling the electronic device 300 to execute the Wi-Fi direct connection data transmission method, various applications and data processing provided in some embodiments of the present application. The internal memory 321 may include a code storage area and a data storage area. Among them, the code storage area can store the operating system. The data storage area may store data and the like created during the use of the electronic device 300 . In addition, the internal memory 321 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage components, flash memory components, universal flash storage (UFS), and the like. In some embodiments, the processor 310 may execute the instructions stored in the internal memory 321 and/or the instructions stored in the memory provided in the processor 310 to cause the electronic device 300 to execute any of the functions provided in the embodiments of the present application. A method for data transmission under Wi-Fi direct connection, as well as other applications and data processing.
电子设备300包括但不限于智能电视、大屏设备、手机、平板电脑、笔记本、大屏电视、智能家居单品、PDA、POS、车载电脑等。本申请实施例在此不作限制。The electronic device 300 includes, but is not limited to, smart TVs, large-screen devices, mobile phones, tablet computers, notebooks, large-screen TVs, smart home items, PDAs, POS, in-vehicle computers, and the like. The embodiments of the present application are not limited herein.
应理解,电子设备300执行上述相应步骤的具体过程请参照前文中结合图4、图5和图7和图9所示的各个实施例中描述的智能手机或者大屏设备执行步骤的相关描述,为了简洁,这里不加赘述。It should be understood that, for the specific process of the electronic device 300 performing the above-mentioned corresponding steps, please refer to the relevant description of the steps performed by the smart phone or the large-screen device described above in conjunction with the respective embodiments shown in FIGS. 4 , 5 , 7 and 9 , For the sake of brevity, they are not repeated here.
还应理解,以上装置中单元的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且装置中的单元可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分单元以软件通过处理元件调用的形式实现,部分单元以硬件的形式实现。例如,各个单元可以为单独设立的处理元件,也可以集成在装置的某一个芯片中实现,此外,也可以以程序的形式存储于存储器中,由装置的某一个处理元件调用并执行该单元的功能。这里该处理元件又可以称为处理器,可以是一种具有信号处理能力的集成电路。在实现过程中,上述方法的各步骤或以上各个单元可以通过处理器元件中的硬件的集成逻 辑电路实现或者以软件通过处理元件调用的形式实现。在一个例子中,以上任一装置中的单元可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个专用集成电路(application specific integrated circuit,ASIC),或,一个或多个数字信号处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(field programmable gate array,FPGA),或这些集成电路形式中至少两种的组合。再如,当装置中的单元可以通过处理元件调度程序的形式实现时,该处理元件可以是通用处理器,例如中央处理器(central processing unit,CPU)或其它可以调用程序的处理器。再如,这些单元可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。It should also be understood that the division of units in the above apparatus is only a division of logical functions, and may be fully or partially integrated into a physical entity in actual implementation, or may be physically separated. And all the units in the device can be realized in the form of software calling through the processing element; also can all be realized in the form of hardware; some units can also be realized in the form of software calling through the processing element, and some units can be realized in the form of hardware. For example, each unit can be a separately established processing element, or can be integrated in a certain chip of the device to be implemented, and can also be stored in the memory in the form of a program, which can be called by a certain processing element of the device and execute the unit's processing. Function. Here, the processing element may also be called a processor, which may be an integrated circuit with signal processing capability. In the implementation process, each step of the above method or each of the above units may be implemented by an integrated logic circuit of hardware in the processor element or implemented in the form of software being invoked by the processing element. In one example, a unit in any of the above apparatuses may be one or more integrated circuits configured to implement the above methods, eg, one or more application specific integrated circuits (ASICs), or, one or more A plurality of digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms. For another example, when a unit in the apparatus can be implemented in the form of a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (central processing unit, CPU) or other processors that can invoke programs. For another example, these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).
本申请实施例还提供了一种建立Wi-Fi P2P连接的系统,该系统包括:上述方法实施例中提供的第一电子设备(例如为智能手机)和第二电子设备(例如为大屏设备)。An embodiment of the present application further provides a system for establishing a Wi-Fi P2P connection, the system comprising: the first electronic device (such as a smartphone) and a second electronic device (such as a large-screen device) provided in the above method embodiments ).
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序代码,该计算机程序包括用于执行上述本申请实施例提供的任意一种建立Wi-Fi P2P连接的方法的指令。该可读介质可以是只读存储器(read-only memory,ROM)或随机存取存储器(random access memory,RAM),本申请实施例对此不做限制。Embodiments of the present application further provide a computer-readable storage medium for storing computer program codes, where the computer program includes instructions for executing any of the methods for establishing a Wi-Fi P2P connection provided by the above embodiments of the present application. The readable medium may be a read-only memory (read-only memory, ROM) or a random access memory (random access memory, RAM), which is not limited in this embodiment of the present application.
本申请还提供了一种计算机程序产品,该计算机程序产品包括指令,当该指令被执行时,以使得第一电子设备、第二电子设备执行对应于上述方法中的对应的操作。The present application also provides a computer program product, the computer program product includes instructions, when the instructions are executed, to cause the first electronic device and the second electronic device to perform corresponding operations corresponding to the above methods.
本申请实施例还提供了一种位于通信装置中的芯片,该芯片包括:处理单元和通信单元,该处理单元,例如可以是处理器,该通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行计算机指令,以使所述通信装置执行上述本申请实施例提供的任一种建立Wi-Fi P2P连接的方法。An embodiment of the present application further provides a chip located in a communication device, the chip includes: a processing unit and a communication unit, the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface, a pin or a circuit, etc. The processing unit can execute computer instructions, so that the communication device executes any of the methods for establishing a Wi-Fi P2P connection provided by the above embodiments of the present application.
可选地,该计算机指令被存储在存储单元中。Optionally, the computer instructions are stored in a storage unit.
可选地,该存储单元为该芯片内的存储单元,如寄存器、缓存等,该存储单元还可以是该终端内的位于该芯片外部的存储单元,如ROM或可存储静态信息和指令的其他类型的静态存储设备,随机RAM等。其中,上述任一处提到的处理器,可以是一个CPU,微处理器,ASIC,或一个或多个用于控制上述的反馈信息的传输方法的程序执行的集成电路。该处理单元和该存储单元可以解耦,分别设置在不同的物理设备上,通过有线或者无线的方式连接来实现该处理单元和该存储单元的各自的功能,以支持该系统芯片实现上述实施例中的各种功能。或者,该处理单元和该存储器也可以耦合在同一个设备上。Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc., and the storage unit can also be a storage unit in the terminal located outside the chip, such as ROM or other storage units that can store static information and instructions. Types of static storage devices, random RAM, etc. Wherein, the processor mentioned in any one of the above may be a CPU, a microprocessor, an ASIC, or one or more integrated circuits for controlling the program execution of the above-mentioned transmission method of feedback information. The processing unit and the storage unit can be decoupled, respectively disposed on different physical devices, and connected in a wired or wireless manner to implement the respective functions of the processing unit and the storage unit, so as to support the system chip to implement the above embodiments various functions in . Alternatively, the processing unit and the memory may also be coupled on the same device.
其中,本实施例提供的通信装置、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the communication device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the above-provided method. The beneficial effects in the corresponding method will not be repeated here.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是ROM、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是RAM,其用作外部高速缓存。RAM有多种不同的类型,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态 随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。It can be understood that the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Wherein, the non-volatile memory may be ROM, programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM) , EEPROM) or flash memory. Volatile memory can be RAM, which acts as an external cache. There are many different types of RAM such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate Synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory Access memory (direct rambus RAM, DR RAM).
在本申请中可能出现的对各种消息/信息/设备/网元/系统/装置/动作/操作/流程/概念等各类客体进行了赋名,可以理解的是,这些具体的名称并不构成对相关客体的限定,所赋名称可随着场景,语境或者使用习惯等因素而变更,对本申请中技术术语的技术含义的理解,应主要从其在技术方案中所体现/执行的功能和技术效果来确定。Various messages/information/equipment/network element/system/device/action/operation/process/concept that may appear in this application are given names. It can be understood that these specific names do not Constitutes a limitation on related objects, and the assigned names can be changed according to factors such as the scene, context or usage habits. The understanding of the technical meaning of the technical terms in this application should mainly be based on the functions embodied/executed in the technical solution. and technical effects.
在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。In the various embodiments of the present application, if there is no special description or logical conflict, the terms and/or descriptions between different embodiments are consistent and can be referred to each other, and the technical features in different embodiments are based on their inherent Logical relationships can be combined to form new embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
本申请的实施例中的方法可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序或指令。在计算机上加载和执行所述计算机程序或指令时,全部或部分地执行本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机程序或指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是集成一个或多个可用介质的服务器等数据存储设备。The methods in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in 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 instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are executed in whole or in part. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer program or instructions may be stored in or transmitted over a computer-readable storage medium. The computer-readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server that integrates one or more available media.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或 者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个可读存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的可读存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a readable storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned readable storage medium includes: U disk, removable hard disk, ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (28)

  1. 一种建立无线保真直连Wi-Fi P2P连接的方法,其特征在于,所述方法包括:A method for establishing a wireless fidelity direct Wi-Fi P2P connection, characterized in that the method comprises:
    在第一电子设备接收用户的第一操作之前,所述第一电子设备获取第二电子设备的第一连接信息,所述第一连接信息用于建立Wi-Fi P2P连接,所述第一操作用于指示与所述第二电子设备建立Wi-Fi P2P连接;Before the first electronic device receives the user's first operation, the first electronic device obtains first connection information of the second electronic device, where the first connection information is used to establish a Wi-Fi P2P connection, and the first operation for instructing to establish a Wi-Fi P2P connection with the second electronic device;
    所述第一电子设备接收所述第一操作;the first electronic device receives the first operation;
    所述第一电子设备响应于所述第一操作,根据所述第一连接信息,与所述第二电子设备建立Wi-Fi P2P连接。The first electronic device establishes a Wi-Fi P2P connection with the second electronic device according to the first connection information in response to the first operation.
  2. 根据权利要求1所述的方法,其特征在于,所述第一连接信息包括:所述第二电子设备用于建立Wi-Fi P2P连接的固有信息和/或所述第二电子设备用于建立Wi-Fi P2P连接的可变信息;The method according to claim 1, wherein the first connection information comprises: inherent information used by the second electronic device to establish a Wi-Fi P2P connection and/or used by the second electronic device to establish a Wi-Fi P2P connection Variable information for Wi-Fi P2P connections;
    其中,所述第二电子设备用于建立Wi-Fi P2P连接的固有信息包括:Wherein, the inherent information used by the second electronic device to establish a Wi-Fi P2P connection includes:
    所述第二电子设备支持的信道列表、所述第二电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的SSID、所述第二电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的PWD、所述第二电子设备是否支持Wi-Fi P2P连接、所述第二电子设备是否支持宽频、所述第二电子设备的设备信息中的至少一种;The list of channels supported by the second electronic device, the SSID of the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group, and the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group at least one of the PWD of the Fi P2P group, whether the second electronic device supports Wi-Fi P2P connection, whether the second electronic device supports broadband, and device information of the second electronic device;
    所述第二电子设备用于建立Wi-Fi P2P连接的可变信息包括:The variable information used by the second electronic device to establish a Wi-Fi P2P connection includes:
    所述第二电子设备的Wi-Fi P2P连接状态和/或所述第二电子设备连接的Wi-Fi热点的频率。The Wi-Fi P2P connection status of the second electronic device and/or the frequency of the Wi-Fi hotspot to which the second electronic device is connected.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:
    所述第一电子设备和所述第二电子设备建立第一连接,所述第一连接包括Wi-Fi或蓝牙连接;establishing a first connection between the first electronic device and the second electronic device, and the first connection includes a Wi-Fi or Bluetooth connection;
    所述第一电子设备获取第二电子设备的第一连接信息,包括:The first electronic device obtains the first connection information of the second electronic device, including:
    所述第一电子设备通过所述第一连接,接收所述第二电子设备发送的所述第一连接信息。The first electronic device receives the first connection information sent by the second electronic device through the first connection.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述第一电子设备获取第二电子设备的第一连接信息,包括:The method according to any one of claims 1 to 3, wherein the obtaining, by the first electronic device, the first connection information of the second electronic device comprises:
    所述第一电子设备通过第一广播报文,接收所述第二电子设备发送的所述第一连接信息。The first electronic device receives the first connection information sent by the second electronic device through a first broadcast message.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    所述第一电子设备向所述第二电子设备发送所述第一电子设备的第二连接信息,所述二连接信息用于建立Wi-Fi P2P连接,所述第二连接信息包括:所述第一电子设备用于建立Wi-Fi P2P连接的固有信息和/或所述第一电子设备用于建立Wi-Fi P2P连接的可变信息。The first electronic device sends second connection information of the first electronic device to the second electronic device, where the second connection information is used to establish a Wi-Fi P2P connection, and the second connection information includes: the Intrinsic information used by the first electronic device to establish a Wi-Fi P2P connection and/or variable information used by the first electronic device to establish a Wi-Fi P2P connection.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 5, wherein the method further comprises:
    在所述第一电子设备接收所述第一操作后,所述第一电子设备获取所述第二电子设备的第三连接信息,所述第三连接信息包括:除所述第一连接信息之外、所述第二电子设备用于建立Wi-Fi P2P连接的信息。After the first electronic device receives the first operation, the first electronic device acquires third connection information of the second electronic device, where the third connection information includes: in addition to the first connection information In addition, the information used by the second electronic device to establish a Wi-Fi P2P connection.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述第一电子设备响 应于所述第一操作,根据所述第一连接信息,与所述第二电子设备建立Wi-Fi P2P连接,包括:The method according to any one of claims 1 to 6, wherein, in response to the first operation, the first electronic device establishes a Wi-Fi connection with the second electronic device according to the first connection information -Fi P2P connection including:
    所述第一电子设备根据所述第一连接信息,或者根据所述第一连接信息和所述第三连接信息,确定Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、所述Wi-Fi P2P群组的SSID和PWD;The first electronic device determines, according to the first connection information, or according to the first connection information and the third connection information, the frequency of Wi-Fi P2P group establishment, the role assignment of the GC device and the GO device, the The SSID and PWD of the Wi-Fi P2P group;
    所述第一电子设备向所述第二电子设备发送第二广播报文,所述第二广播报文用于使得所述第二电子设备加入所述Wi-Fi P2P群组,所述第二广播报文包括:所述第一电子设备的MAC地址、IP地址以及端口号、所述Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、所述Wi-Fi P2P群组的SSID和PWD。The first electronic device sends a second broadcast message to the second electronic device, where the second broadcast message is used to make the second electronic device join the Wi-Fi P2P group, and the second The broadcast message includes: the MAC address, IP address and port number of the first electronic device, the frequency of establishing the Wi-Fi P2P group, the role assignment of the GC device and the GO device, the SSID and PWD.
  8. 根据权利要求3所述的方法,在所述第一电子设备和所述第二电子设备建立第一连接之后,所述第一电子设备通过所述第一连接接收所述第一连接信息之前,所述方法还包括:The method according to claim 3, after the first electronic device and the second electronic device establish a first connection, and before the first electronic device receives the first connection information through the first connection, The method also includes:
    所述第一电子和所述第二电子设备基于所述第一连接,进行安全认证;The first electronic device and the second electronic device perform security authentication based on the first connection;
    在所述安全认证通过后,所述第一电子设备确定所述第二电子设备为可信设备。After the security authentication is passed, the first electronic device determines that the second electronic device is a trusted device.
  9. 一种建立通信连接方法,其特征在于,所述方法包括:A method for establishing a communication connection, characterized in that the method comprises:
    在第一电子设备接收用户的第一操作之前,所述第一电子设备获取第二电子设备的第四连接信息,所述第四连接信息用于建立通信连接,所述第一操作用于指示与所述第二电子设备建立所述通信连接,所述第四连接信息要信息包括:所述第二电子设备的工作频率信息和/或通信信道信息;Before the first electronic device receives the user's first operation, the first electronic device acquires fourth connection information of the second electronic device, where the fourth connection information is used to establish a communication connection, and the first operation is used to indicate establishing the communication connection with the second electronic device, and the required information in the fourth connection information includes: operating frequency information and/or communication channel information of the second electronic device;
    所述第一电子设备接收所述第一操作;the first electronic device receives the first operation;
    所述第一电子设备响应于所述第一操作,根据所述第四连接信息,与所述第二电子设备建立所述通信连接。The first electronic device establishes the communication connection with the second electronic device according to the fourth connection information in response to the first operation.
  10. 根据权利要求9所述方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    所述第一电子设备和所述第二电子设备建立第一连接;establishing a first connection between the first electronic device and the second electronic device;
    所述第一电子设备获取第二电子设备的第四连接信息,包括:The first electronic device obtains the fourth connection information of the second electronic device, including:
    所述第一电子设备通过所述第一连接,接收所述第四连接信息。The first electronic device receives the fourth connection information through the first connection.
  11. 根据权利要求9或10所述的方法,其特征在于,所述第一电子设备获取第二电子设备的第四连接信息,包括:The method according to claim 9 or 10, wherein the obtaining, by the first electronic device, the fourth connection information of the second electronic device comprises:
    所述第一电子设备通过第三广播报文,接收所述第四连接信息。The first electronic device receives the fourth connection information through a third broadcast message.
  12. 根据权利要求9至11中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 9 to 11, wherein the method further comprises:
    所述第一电子设备向所述第二电子设备发送第五连接信息,所述第五连接信息包括所述第一电子设备的工作频率信息和/或通信信道信息。The first electronic device sends fifth connection information to the second electronic device, where the fifth connection information includes operating frequency information and/or communication channel information of the first electronic device.
  13. 根据权利要求10所述的方法,其特征在于,The method of claim 10, wherein:
    所述通信连接为Wi-Fi连接,所述第一连接为蓝牙连接。The communication connection is a Wi-Fi connection, and the first connection is a Bluetooth connection.
  14. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, characterized in that the electronic device comprises:
    处理器;存储器;以及计算机程序,所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述电子设备执行以下步骤:a processor; a memory; and a computer program, the computer program being stored on the memory, which, when executed by the processor, causes the electronic device to perform the following steps:
    在所述电子设备接收用户的第一操作之前,所述电子设备获取第二电子设备的第一连接信息,所述第一连接信息用于建立Wi-Fi P2P连接,所述第一操作用于指示与 所述第二电子设备建立Wi-Fi P2P连接;Before the electronic device receives the user's first operation, the electronic device acquires first connection information of the second electronic device, where the first connection information is used to establish a Wi-Fi P2P connection, and the first operation is used for Instruct to establish a Wi-Fi P2P connection with the second electronic device;
    所述电子设备接收所述第一操作;the electronic device receives the first operation;
    所述电子设备响应于所述第一操作,根据所述第一连接信息,与所述第二电子设备建立Wi-Fi P2P连接。In response to the first operation, the electronic device establishes a Wi-Fi P2P connection with the second electronic device according to the first connection information.
  15. 根据权利要求14所述的电子设备,其特征在于,所述第一连接信息包括:所述第二电子设备用于建立Wi-Fi P2P连接的固有信息和/或所述第二电子设备用于建立Wi-Fi P2P连接的可变信息;The electronic device according to claim 14, wherein the first connection information comprises: inherent information used by the second electronic device to establish a Wi-Fi P2P connection and/or the second electronic device is used for Variable information for establishing a Wi-Fi P2P connection;
    其中,所述第二电子设备用于建立Wi-Fi P2P连接的固有信息包括:Wherein, the inherent information used by the second electronic device to establish a Wi-Fi P2P connection includes:
    所述第二电子设备支持的信道列表、所述第二电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的SSID、所述第二电子设备创建Wi-Fi P2P群组时Wi-Fi P2P群组的PWD、所述第二电子设备是否支持Wi-Fi P2P连接、所述第二电子设备是否支持宽频、所述第二电子设备的设备信息中的至少一种;The list of channels supported by the second electronic device, the SSID of the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group, and the Wi-Fi P2P group when the second electronic device creates a Wi-Fi P2P group at least one of the PWD of the Fi P2P group, whether the second electronic device supports Wi-Fi P2P connection, whether the second electronic device supports broadband, and device information of the second electronic device;
    所述第二电子设备用于建立Wi-Fi P2P连接的可变信息包括:The variable information used by the second electronic device to establish a Wi-Fi P2P connection includes:
    所述第二电子设备的Wi-Fi P2P连接状态和/或所述第二电子设备连接的Wi-Fi热点的频率。The Wi-Fi P2P connection status of the second electronic device and/or the frequency of the Wi-Fi hotspot to which the second electronic device is connected.
  16. 根据权利要求14或15所述的电子设备,其特征在于,所述电子设备还执行以下步骤:The electronic device according to claim 14 or 15, wherein the electronic device further performs the following steps:
    所述电子设备和所述第二电子设备建立第一连接,所述第一连接包括Wi-Fi或蓝牙连接;establishing a first connection between the electronic device and the second electronic device, where the first connection includes a Wi-Fi or Bluetooth connection;
    所述电子设备通过所述第一连接,接收所述第二电子设备发送的所述第一连接信息。The electronic device receives the first connection information sent by the second electronic device through the first connection.
  17. 根据权利要求14至16中任一项所述的电子设备,其特征在于,所述电子设备还执行以下步骤:The electronic device according to any one of claims 14 to 16, wherein the electronic device further performs the following steps:
    所述电子设备通过第一广播报文,接收所述第二电子设备发送的所述第一连接信息。The electronic device receives the first connection information sent by the second electronic device through the first broadcast message.
  18. 根据权利要求14至17中任一项所述的电子设备,其特征在于,所述电子设备还执行以下步骤:The electronic device according to any one of claims 14 to 17, wherein the electronic device further performs the following steps:
    所述电子设备向所述第二电子设备发送所述电子设备的第二连接信息,所述二连接信息用于建立Wi-Fi P2P连接,所述第二连接信息包括:所述电子设备用于建立Wi-Fi P2P连接的固有信息和/或所述电子设备用于建立Wi-Fi P2P连接的可变信息。The electronic device sends second connection information of the electronic device to the second electronic device, where the second connection information is used to establish a Wi-Fi P2P connection, and the second connection information includes: the electronic device is used for Intrinsic information for establishing a Wi-Fi P2P connection and/or variable information for the electronic device to establish a Wi-Fi P2P connection.
  19. 根据权利要求14至18中任一项所述的电子设备,其特征在于,所述电子设备还执行以下步骤:The electronic device according to any one of claims 14 to 18, wherein the electronic device further performs the following steps:
    在所述电子设备接收所述第一操作后,所述电子设备获取所述第二电子设备的第三连接信息,所述第三连接信息包括:除过所述第一连接信息之外、所述第二电子设备用于建立Wi-Fi P2P连接的信息。After the electronic device receives the first operation, the electronic device acquires third connection information of the second electronic device, where the third connection information includes: in addition to the first connection information, all The information used by the second electronic device to establish a Wi-Fi P2P connection.
  20. 根据权利要求14至19中任一项所述的电子设备,其特征在于,所述电子设备还执行以下步骤:The electronic device according to any one of claims 14 to 19, wherein the electronic device further performs the following steps:
    所述电子设备根据所述第一连接信息,或者根据所述第一连接信息和所述第三连接信息,确定Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、所述Wi-Fi P2P 群组的SSID和PWD;The electronic device determines, according to the first connection information, or according to the first connection information and the third connection information, the frequency of Wi-Fi P2P group establishment, the role assignment of GC devices and GO devices, the Wi-Fi - SSID and PWD of the Fi P2P group;
    所述电子设备向所述第二电子设备发送第二广播报文,所述第二广播报文用于使得所述第二电子设备加入所述Wi-Fi P2P群组,所述第二广播报文包括:所述电子设备的MAC地址、IP地址以及端口号、所述Wi-Fi P2P群组建立的频率、GC设备和GO设备角色分配、所述Wi-Fi P2P群组的SSID和PWD。The electronic device sends a second broadcast message to the second electronic device, where the second broadcast message is used to make the second electronic device join the Wi-Fi P2P group, and the second broadcast message The document includes: the MAC address, IP address and port number of the electronic device, the frequency of the Wi-Fi P2P group establishment, the role assignment of the GC device and the GO device, and the SSID and PWD of the Wi-Fi P2P group.
  21. 根据权利要求16所述的电子设备,在所述电子设备和所述第二电子设备建立第一连接之后,所述电子设备通过所述第一连接接收所述第一连接信息之前,所述电子设备还执行以下步骤:The electronic device according to claim 16, after the electronic device and the second electronic device establish a first connection, before the electronic device receives the first connection information through the first connection, the electronic device The device also performs the following steps:
    所述电子和所述第二电子设备基于所述第一连接,进行安全认证;The electronic device and the second electronic device perform security authentication based on the first connection;
    在所述安全认证通过后,所述电子设备确定所述第二电子设备为可信设备。After the security authentication is passed, the electronic device determines that the second electronic device is a trusted device.
  22. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, characterized in that the electronic device comprises:
    处理器;存储器;以及计算机程序,所述计算机程序存储在所述存储器上,当所述计算机程序被所述处理器执行时,使得所述电子设备执行以下步骤:a processor; a memory; and a computer program, the computer program being stored on the memory, which, when executed by the processor, causes the electronic device to perform the following steps:
    在所述电子设备接收用户的第一操作之前,所述电子设备获取第二电子设备的第四连接信息,所述第四连接信息用于建立通信连接,所述第一操作用于指示与所述第二电子设备建立所述通信连接,所述第四连接信息要信息包括:所述第二电子设备的工作频率信息和/或通信信道信息;Before the electronic device receives the user's first operation, the electronic device obtains fourth connection information of the second electronic device, where the fourth connection information is used to establish a communication connection, and the first operation is used to instruct the electronic device to communicate with the user. The second electronic device establishes the communication connection, and the required information for the fourth connection information includes: operating frequency information and/or communication channel information of the second electronic device;
    所述电子设备接收所述第一操作;the electronic device receives the first operation;
    所述电子设备响应于所述第一操作,根据所述第四连接信息,与所述第二电子设备建立所述通信连接。The electronic device establishes the communication connection with the second electronic device according to the fourth connection information in response to the first operation.
  23. 根据权利要求22所述的电子设备,其特征在于,所述电子设备还执行以下步骤:The electronic device according to claim 22, wherein the electronic device further performs the following steps:
    所述电子设备和所述第二电子设备建立第一连接;establishing a first connection between the electronic device and the second electronic device;
    所述电子设备通过所述第一连接,接收所述第四连接信息。The electronic device receives the fourth connection information through the first connection.
  24. 根据权利要求22或23所述的电子设备,其特征在于,所述电子设备执行以下步骤:The electronic device according to claim 22 or 23, wherein the electronic device performs the following steps:
    所述电子设备通过第三广播报文,接收所述第四连接信息。The electronic device receives the fourth connection information through a third broadcast message.
  25. 根据权利要求22至24中任一项所述的电子设备,其特征在于,所述电子设备执行以下步骤:The electronic device according to any one of claims 22 to 24, wherein the electronic device performs the following steps:
    所述电子设备向所述第二电子设备发送第五连接信息,所述第五连接信息包括所述电子设备的工作频率信息和/或通信信道信息。The electronic device sends fifth connection information to the second electronic device, where the fifth connection information includes operating frequency information and/or communication channel information of the electronic device.
  26. 根据权利要求23所述的电子设备,其特征在于,The electronic device according to claim 23, wherein,
    所述通信连接为Wi-Fi连接,所述第一连接为蓝牙连接。The communication connection is a Wi-Fi connection, and the first connection is a Bluetooth connection.
  27. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储了计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1至8中任一项所述的方法,或者执行如权利要求9至13中任一项所述的方法。A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions, and the program instructions, when executed by a processor, cause the processor to execute a program such as A method as claimed in any one of claims 1 to 8, or performing a method as claimed in any one of claims 9 to 13.
  28. 一种芯片,其特征在于,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的通信设备执行如权利要求1至8中任一项所述的方法, 或者执行如权利要求9至13中任一项所述的方法。A chip, characterized by comprising: a processor for calling and running a computer program from a memory, so that a communication device installed with the chip executes the method according to any one of claims 1 to 8, or A method as claimed in any one of claims 9 to 13 is performed.
PCT/CN2022/087673 2021-04-28 2022-04-19 Method for establishing wi-fi p2p connection, and electronic device WO2022228207A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110469588.5A CN115348563A (en) 2021-04-28 2021-04-28 Method and electronic equipment for establishing Wi-Fi P2P connection
CN202110469588.5 2021-04-28

Publications (1)

Publication Number Publication Date
WO2022228207A1 true WO2022228207A1 (en) 2022-11-03

Family

ID=83846647

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/087673 WO2022228207A1 (en) 2021-04-28 2022-04-19 Method for establishing wi-fi p2p connection, and electronic device

Country Status (2)

Country Link
CN (1) CN115348563A (en)
WO (1) WO2022228207A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104412664A (en) * 2014-05-05 2015-03-11 华为终端有限公司 Wi-Fi network connection method, Wi-Fi controller and Wi-Fi device
US20190053302A1 (en) * 2017-08-08 2019-02-14 Samsung Electronics Co., Ltd. Electronic device and method for forming wi-fi direct group thereof
CN110996404A (en) * 2019-12-16 2020-04-10 联想(北京)有限公司 Method, device and system for establishing wireless connection
CN112291862A (en) * 2020-10-27 2021-01-29 中兴通讯股份有限公司 Method for establishing connection between terminal devices and terminal devices
CN112654074A (en) * 2020-09-28 2021-04-13 华为技术有限公司 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104412664A (en) * 2014-05-05 2015-03-11 华为终端有限公司 Wi-Fi network connection method, Wi-Fi controller and Wi-Fi device
US20190053302A1 (en) * 2017-08-08 2019-02-14 Samsung Electronics Co., Ltd. Electronic device and method for forming wi-fi direct group thereof
CN110996404A (en) * 2019-12-16 2020-04-10 联想(北京)有限公司 Method, device and system for establishing wireless connection
CN112654074A (en) * 2020-09-28 2021-04-13 华为技术有限公司 Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium
CN112291862A (en) * 2020-10-27 2021-01-29 中兴通讯股份有限公司 Method for establishing connection between terminal devices and terminal devices

Also Published As

Publication number Publication date
CN115348563A (en) 2022-11-15

Similar Documents

Publication Publication Date Title
JP6324982B2 (en) Wifi direct service method using NFC and apparatus therefor
US8873523B2 (en) Methods and apparatus for solicited activation for protected wireless networking
US9699715B2 (en) Discovery method and device in a wireless communication system
JP6110507B2 (en) Communication setting method and apparatus therefor in WiFi direct service system
US20180359633A1 (en) Neighbor Awareness Networking Device Pairing
CN107852590B (en) Method and apparatus for performing discovery in wireless communication system
US20230337303A1 (en) Method for transmitting data under wi-fi direct and electronic device
EP4271006A1 (en) Connection establishment method and electronic device
JP6599541B2 (en) Application service platform session forming method and apparatus in wireless communication system
CN112654074B (en) Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium
CN114390491A (en) Networking method, device and system
US20240121840A1 (en) Network connection method, related apparatus, and system
KR102036686B1 (en) Apparatus and method for selecting channel in wireless communication system
WO2012026932A1 (en) Method and apparatus for over-the-air configuration of a wireless device
WO2022228207A1 (en) Method for establishing wi-fi p2p connection, and electronic device
KR20230150380A (en) Method and system for WLAN multilink TDLS key derivation
US10264441B2 (en) Method and apparatus for performing discovery by device supporting Wi-Fi Direct in wireless communication system
JP2015176536A (en) Communication device, communication method, communication program, and storage medium
CN116963054B (en) WLAN multilink TDLS key derivation
WO2024093708A1 (en) Network connection method and apparatus
WO2022206672A1 (en) Method for discovering and connecting electronic device, and electronic device
WO2022166891A1 (en) Method, apparatus, and device for supporting network selection, and readable storage medium
WO2022021433A1 (en) Method for device access authentication, terminal device, and cloud platform
CN114286423A (en) Wi-Fi P2P connection method, electronic equipment and computer-readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22794678

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22794678

Country of ref document: EP

Kind code of ref document: A1