WiFi communication method and electronic equipment

By directly executing the negotiation process using public behavior frames on the WiFi channel, the problem of low negotiation efficiency before WiFi P2P link establishment is solved, the connection speed and stability are improved, and communication security is enhanced.

CN118870547APending Publication Date: 2024-10-29HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310488105.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

The existing technology requires negotiation through an out-of-band channel before establishing a WiFi P2P connection between terminal devices, which is inefficient, resulting in slower link establishment and possible degradation of WiFi link performance in the case of dual-band adaptive concurrency.

Method used

By using public behavior frames on the WiFi channel to carry negotiation information, the negotiation process is performed directly on the WiFi channel, avoiding out-of-band channels, improving the speed and efficiency of the negotiation process, and encrypting information through session keys to improve communication security.

Benefits of technology

It realizes an efficient negotiation process before WiFi P2P link establishment, improves the speed and stability of establishing WiFi P2P connections, avoids performance degradation caused by dual-band adaptive concurrency, and enhances communication security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118870547A_ABST
    Figure CN118870547A_ABST
Patent Text Reader

Abstract

The invention provides a WiFi communication method and electronic equipment, the method is applied to first electronic equipment, and the method comprises the following steps: sending first information to second electronic equipment; wherein the first information comprises an identifier of a first WiFi channel and an address of the first electronic equipment; receiving a first public behavior frame sent by the second electronic equipment through the first WiFi channel; wherein the first public behavior frame comprises an address of the first electronic equipment; and in response to the first public behavior frame, executing a negotiation process for establishing a WiFi point-to-point (P2P) connection with the second electronic equipment through the first WiFi channel. According to the scheme provided by the invention, the negotiation process before the WiFi P2P link establishment can be efficiently realized, and the speed of establishing the WiFi P2P connection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a WiFi communication method and electronic equipment. Background Art

[0002] Terminal devices can transmit business data and the like through wireless fidelity (WiFi) peer-to-peer (P2P) connections. Before establishing a WiFi P2P connection, terminal devices need to negotiate the mode of establishing the WiFi P2P connection, the channel to be used, and the network identifier and key to be used, and then establish the WiFi P2P connection based on this information. In the absence of a wireless local area network (WLAN), the current terminal devices need to complete the negotiation before WiFi P2P link establishment through an out-of-band channel (such as a Bluetooth link, etc.), which is inefficient and will also reduce the speed of WiFi P2P link establishment. Summary of the invention

[0003] The present application provides a WiFi communication method and an electronic device, which are used to efficiently implement the negotiation process before WiFi P2P link establishment and improve the speed of establishing WiFi P2P connection.

[0004] In a first aspect, an embodiment of the present application provides a WiFi communication method, applied to a first electronic device, the method comprising: sending first information to a second electronic device; wherein the first information comprises an identifier of a first WiFi channel and an address of the first electronic device; receiving a first public behavior frame sent by the second electronic device via the first WiFi channel; wherein the first public behavior frame comprises the address of the first electronic device; and in response to the first public behavior frame, executing a negotiation process for establishing a WiFi point-to-point P2P connection with the second electronic device via the first WiFi channel.

[0005] In this method, the first WiFi channel can be a WiFi channel that the first electronic device expects to perform a negotiation process with the second electronic device. After the first electronic device sends the identifier of the first WiFi channel to the second electronic device, after receiving the response information sent by the second electronic device, that is, the first public behavior frame, it can use the first WiFi channel to perform the negotiation process with the second electronic device. Among them, the public behavior frame is a management message reserved for manufacturers in the WiFi protocol. The transmission of the public behavior frame can be carried on the WiFi channel (i.e., the first WiFi channel). Therefore, when the public behavior frame is transmitted between the first electronic device and the second electronic device, it does not need to be implemented through an out-of-band channel, and the transmission efficiency is high. And the execution of the negotiation process before the first electronic device and the second electronic device establish a link (i.e., establish a WiFi P2P connection) can also be carried on the first WiFi channel, without the need to be implemented through an out-of-band channel, so the execution speed and efficiency of the negotiation process are high, and the stability is good. On the one hand, it helps to improve the speed of establishing a WiFi P2P connection, and on the other hand, it can avoid the problem of reduced WiFi link performance caused by the occurrence of dual-band adaptive concurrency in the first electronic device or the second electronic device.

[0006] In one possible design, the negotiation process includes: authenticating with the second electronic device, and after successful authentication, sending a second public behavior frame to the second electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of a WiFi channel supported by the first electronic device, an identifier of a second WiFi channel, and information indicating a P2P role of the first electronic device; receiving a third public behavior frame sent by the second electronic device through the first WiFi channel; wherein the third public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information indicating the P2P role of the first electronic device, information indicating the P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet Protocol IP information of the first electronic device.

[0007] In this method, the information in the second public behavior frame is the negotiation information of the first electronic device. By sending the negotiation information of the first electronic device to the second electronic device, the second electronic device can determine the information that needs to be referenced when the first electronic device and the second electronic device establish a WiFi P2P connection based on the information. The information in the third public behavior frame is the information that needs to be referenced when the first electronic device and the second electronic device establish a WiFi P2P connection. Through the above method, the first electronic device and the second electronic device can carry the negotiation information through a public signaling frame that can be transmitted on the WiFi channel, thereby completing the negotiation process before the WiFi P2P link is established. Therefore, the speed and efficiency of the negotiation process are high, which helps to improve the speed of establishing a WiFi P2P connection.

[0008] In one possible design, the authentication with the second electronic device includes: sending a fourth public behavior frame to the second electronic device through the first WiFi channel; wherein the fourth public behavior frame includes authentication information; receiving a fifth public behavior frame sent by the second electronic device through the first WiFi channel; wherein the fifth public behavior frame is used to notify successful authentication.

[0009] In this method, the first electronic device and the second electronic device can carry the interactive information in the authentication process through a common signaling frame that can be transmitted on the WiFi channel, thereby completing the authentication process in the negotiation process before the WiFi P2P link is established. The execution speed and efficiency are both high, which helps to improve the speed of establishing a WiFi P2P connection.

[0010] In one possible design, after successful authentication, before sending a second public behavior frame to the second electronic device through the first WiFi channel, the method further includes: negotiating a second key with the second electronic device through the first WiFi channel and the public behavior frame; wherein the second key is used to: encrypt information sent to the second electronic device, or decrypt information from the second electronic device.

[0011] In this method, the first electronic device and the second electronic device can carry the interactive information in the key negotiation process through the public signaling frame that can be transmitted on the WiFi channel, thereby completing the key negotiation process in the negotiation process before the WiFi P2P link is established, and the execution speed and efficiency are both high, which helps to improve the speed of establishing the WiFi P2P connection. In addition, the interactive information between the first electronic device and the second electronic device is encrypted by the key, which can improve the security of communication.

[0012] In one possible design, sending the first information to the second electronic device includes: sending the first information to the second electronic device via a low-power Bluetooth communication method or a StarFlash low-power communication method.

[0013] In this method, information is sent in a low-power manner, which is easy to implement and has a high communication success rate and efficiency.

[0014] In one possible design, the first public behavior frame also includes at least one of the following: an identifier of a WiFi channel supported by the second electronic device, an identifier of the second WiFi channel, and information indicating a P2P role of the second electronic device.

[0015] In this method, the above information is the negotiation information of the second electronic device. By carrying the negotiation information of the second electronic device on the first public behavior frame and sending it to the first electronic device, on the one hand, the first electronic device can determine the information that needs to be referenced when the first electronic device and the second electronic device establish a WiFi P2P connection based on the information. On the other hand, by using a public signaling frame that can be transmitted on a WiFi channel to carry the negotiation information, the negotiation information can be sent and received without the aid of an out-of-band channel, which can improve the speed and efficiency of executing the negotiation process, thereby improving the speed of establishing a WiFi P2P connection.

[0016] In one possible design, the negotiation process includes: sending a second public behavior frame to the second electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information used to indicate the P2P role of the first electronic device, information used to indicate the P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet Protocol IP information of the first electronic device.

[0017] In this method, the information in the second public behavior frame is the information that the first electronic device and the second electronic device need to refer to when establishing a WiFi P2P connection. By using a public signaling frame that can be transmitted on a WiFi channel to carry this information, it is possible to send and receive negotiation information without the help of an out-of-band channel, which can improve the speed and efficiency of executing the negotiation process, thereby improving the speed of establishing a WiFi P2P connection.

[0018] In one possible design, before sending the first information to the second electronic device, the method also includes: establishing a communication connection with the second electronic device; authenticating the second electronic device, and after successful authentication, negotiating a second key with the second electronic device; sending the first information to the second electronic device includes: when initiating a service, sending the first information encrypted by the second key to the second electronic device; receiving the first public behavior frame sent by the second electronic device via the first WiFi channel includes: receiving the first public behavior frame encrypted by the second key sent by the second electronic device via the first WiFi channel.

[0019] In this method, the first electronic device can establish a communication connection and perform authentication with the second electronic device in advance before initiating a service. Then, when initiating a service, the first electronic device and the second electronic device do not need to perform the authentication again during the negotiation process, thereby improving the speed of executing the negotiation process. In addition, the first electronic device and the second electronic device can carry the interactive information in the key negotiation process through a public signaling frame that can be transmitted on the WiFi channel, thereby completing the key negotiation process in the negotiation process before the WiFi P2P link is established. The execution speed and efficiency are both high, which helps to improve the speed of establishing a WiFi P2P connection. By encrypting the interactive information between the first electronic device and the second electronic device through a key, the security of the communication can be improved.

[0020] In a possible design, the method further includes: establishing a WiFi P2P connection with the second electronic device after executing the negotiation process; wherein the establishing a WiFi P2P connection with the second electronic device specifically includes: executing an authentication process and an association process with the second electronic device, and not executing a four-way handshake process; and determining, based on the second key, an encryption key for a WiFi P2P link used after establishing the WiFi P2P connection. wherein the WiFi P2P link used after establishing the WiFi P2P connection is the second WiFi link.

[0021] In this method, the encryption key of the WiFi P2P link used after the WiFi P2P connection is established can be determined according to the second key determined in the negotiation process, so the four-way handshake process for negotiating the key (the key is used to determine the encryption key of the WiFi P2P link used after the WiFi P2P connection is established) can be omitted, thereby further improving the speed and efficiency of WiFi P2P link establishment.

[0022] In a second aspect, an embodiment of the present application provides a WiFi communication method, applied to a second electronic device, the method comprising: receiving first information from a first electronic device; wherein the first information comprises an identifier of a first WiFi channel and an address of the first electronic device;

[0023] Sending a first public behavior frame to the second electronic device through the first WiFi channel; wherein the first public behavior frame includes the address of the first electronic device;

[0024] A negotiation process for establishing a WiFi point-to-point (P2P) connection is performed with the first electronic device through the first WiFi channel.

[0025] In one possible design, the negotiation process includes: authenticating with the first electronic device, and after successful authentication, receiving a second public behavior frame sent by the first electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of the WiFi channel supported by the first electronic device, an identifier of the second WiFi channel, and information indicating the P2P role of the first electronic device; sending a third public behavior frame to the first electronic device through the first WiFi channel; wherein the third public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information indicating the P2P role of the first electronic device, information indicating the P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet Protocol IP information of the first electronic device.

[0026] In one possible design, the authentication with the first electronic device includes: receiving a fourth public behavior frame sent by the first electronic device through the first WiFi channel; wherein the fourth public behavior frame includes authentication information; and sending a fifth public behavior frame to the first electronic device through the first WiFi channel; wherein the fifth public behavior frame is used to notify successful authentication.

[0027] In one possible design, after successful authentication, before receiving a second public behavior frame sent by the first electronic device through the first WiFi channel, the method further includes: negotiating a second key with the first electronic device through the first WiFi channel and the public behavior frame; wherein the second key is used to: decrypt information from the first electronic device, or encrypt information sent to the first electronic device.

[0028] In one possible design, the receiving of the first information from the first electronic device includes: receiving the first information sent by the first electronic device via a low-power Bluetooth communication method or a StarFlash low-power communication method.

[0029] In one possible design, the first public behavior frame also includes at least one of the following: an identifier of a WiFi channel supported by the second electronic device, an identifier of the second WiFi channel, and information indicating a P2P role of the second electronic device.

[0030] In one possible design, the negotiation process includes: receiving a second public behavior frame sent by the first electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information used to indicate the P2P role of the first electronic device, information used to indicate the P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet Protocol IP information of the first electronic device.

[0031] In one possible design, before receiving the first information from the first electronic device, the method also includes: establishing a communication connection with the first electronic device; authenticating the first electronic device, and after successful authentication, negotiating a second key with the first electronic device; the receiving of the first information from the first electronic device includes: receiving the first information encrypted by the second key from the first electronic device; the sending of the first public behavior frame to the first electronic device through the first WiFi channel includes: sending the first public behavior frame encrypted by the second key to the first electronic device through the first WiFi channel.

[0032] In a possible design, the method further includes: establishing a WiFi P2P connection with the first electronic device after executing the negotiation process; wherein the establishing a WiFi P2P connection with the first electronic device specifically includes: executing an authentication process and an association process with the first electronic device, and not executing a four-way handshake process; and determining, based on the second key, an encryption key for a WiFi P2P link used after establishing the WiFi P2P connection. wherein the WiFi P2P link used after establishing the WiFi P2P connection is the second WiFi link.

[0033] In a third aspect, an embodiment of the present application provides a WiFi communication method, applied to a first electronic device, the method comprising: sending first information to a second electronic device; wherein the first information includes an identifier of a first WiFi channel; receiving second information from the second electronic device; wherein the second information includes an identifier of the first WiFi channel; in response to the second information, establishing a WiFi connection with a soft access point of the second electronic device through the first WiFi channel; wherein the soft access point is a soft access point pre-negotiated by the first electronic device and the second electronic device.

[0034] In this method, the first WiFi channel may be a working channel that the first electronic device expects to use after establishing a WiFi connection with the second electronic device. After the first electronic device sends the identifier of the first WiFi channel to the second electronic device, after receiving the response information, i.e., the second information, sent by the second electronic device, it may use the first WiFi channel to perform a link establishment process with the second electronic device. Without the aid of a local area network and when the electronic device cannot customize the message in the private protocol to accelerate the WiFi link establishment speed, this method can quickly establish a WiFi connection. In addition, the first electronic device may negotiate with the second electronic device in advance to determine the soft access point corresponding to the establishment of the WiFi connection, which can further improve the speed of WiFi link establishment. In this method, the first electronic device and / or the second electronic device may be a PC device, and this method can quickly and efficiently establish a WiFi link for the PC device.

[0035] In one possible design, before sending the first information to the second electronic device, the method also includes: after establishing a communication connection with the second electronic device, negotiating a first key with the second electronic device; sending the first information to the second electronic device includes: when initiating a service, sending the first information encrypted by the first key to the second electronic device; receiving the second information from the second electronic device includes: receiving the second information encrypted by the first key from the second electronic device.

[0036] In this method, the first electronic device can perform a key negotiation process with the second electronic device before initiating a service. When initiating a service, the first electronic device does not need to perform a key negotiation process with the second electronic device, thereby improving the efficiency of WiFi link establishment. In addition, by encrypting the interactive information between the first electronic device and the second electronic device with a key, the security of communication can be improved.

[0037] In one possible design, establishing a WiFi connection with a soft access point of the second electronic device through the first WiFi channel includes: connecting to the soft access point of the second electronic device through the first WiFi channel using a second key, and authenticating with the second electronic device; wherein the second key is: a key pre-negotiated between the first electronic device and the second electronic device, or a set key.

[0038] In this method, the first electronic device can use the key pre-negotiated with the second electronic device or the set key to connect to the soft access point of the second electronic device. In the link establishment process, the first electronic device does not need to negotiate the key with the second electronic device, which can improve the link establishment speed and efficiency.

[0039] In one possible design, sending the first information to the second electronic device includes: sending the first information to the second electronic device via a low-power Bluetooth communication method or a Starflash low-power communication method; receiving the second information from the second electronic device includes: receiving the second information sent by the second electronic device via a low-power Bluetooth communication method or a Starflash low-power communication method.

[0040] In this method, information is sent in a low-power manner, which is easy to implement and has a high communication success rate and efficiency.

[0041] In a fourth aspect, an embodiment of the present application provides a WiFi communication method, applied to a second electronic device, the method comprising: receiving first information from a first electronic device; wherein the first information includes an identifier of a first WiFi channel; creating a soft access point, and sending second information to the first electronic device; wherein the second information includes an identifier of the first WiFi channel; establishing a WiFi connection between the soft access point and the first electronic device through the first WiFi channel; wherein the soft access point is a soft access point pre-negotiated by the first electronic device and the second electronic device.

[0042] In one possible design, before receiving the first information from the first electronic device, the method also includes: after establishing a communication connection with the first electronic device, negotiating a first key with the first electronic device; the receiving the first information from the first electronic device includes: receiving the first information encrypted using the first key from the first electronic device; the sending the second information to the first electronic device includes: sending the second information encrypted using the first key to the first electronic device.

[0043] In one possible design, establishing a WiFi connection between the soft access point and the first electronic device through the first WiFi channel includes: establishing a connection with the first electronic device through the first WiFi channel using a second key, and authenticating with the first electronic device; wherein the second key is: a key pre-negotiated by the first electronic device and the second electronic device, or a set key.

[0044] In one possible design, the receiving of first information from a first electronic device includes: receiving the first information sent by the first electronic device via a low-power Bluetooth communication method or a Starflash low-power communication method; the sending of second information to the first electronic device includes: sending the second information to the first electronic device via a low-power Bluetooth communication method or a Starflash low-power communication method.

[0045] In a fifth aspect, the present application provides an electronic device, comprising a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the one or more processors, the electronic device executes the method described in the first aspect or any possible design of the first aspect, or executes the method described in the second aspect or any possible design of the second aspect, or executes the method described in the third aspect or any possible design of the third aspect, or executes the method described in the fourth aspect or any possible design of the fourth aspect.

[0046] In a sixth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on an electronic device, the electronic device executes the method described in the first aspect or any possible design of the first aspect, or executes the method described in the second aspect or any possible design of the second aspect, or executes the method described in the third aspect or any possible design of the third aspect, or executes the method described in the fourth aspect or any possible design of the fourth aspect.

[0047] In the seventh aspect, the present application provides a computer program product, comprising a computer program or instructions. When the computer program or instructions are run on an electronic device, the electronic device executes the method described in the first aspect or any possible design of the first aspect, or executes the method described in the second aspect or any possible design of the second aspect, or executes the method described in the third aspect or any possible design of the third aspect, or executes the method described in the fourth aspect or any possible design of the fourth aspect.

[0048] In an eighth aspect, the present application provides a chip system, the chip system includes a processor and a memory, and the memory stores instructions; when the instructions are executed by the processor, the method described in the first aspect or any possible design of the first aspect is implemented, or the method described in the second aspect or any possible design of the second aspect is implemented, or the method described in the third aspect or any possible design of the third aspect is implemented, or the method described in the fourth aspect or any possible design of the fourth aspect is implemented. The chip system can be composed of chips, or it can include chips and other discrete devices.

[0049] For the beneficial effects of the above-mentioned second aspect, please refer to the description of the beneficial effects of the above-mentioned first aspect. For the beneficial effects of the above-mentioned fourth aspect, please refer to the description of the beneficial effects of the above-mentioned third aspect. For the beneficial effects of the above-mentioned fifth to eighth aspects, please refer to the beneficial effects of the above-mentioned first to fourth aspects, and they will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;

[0052] Figure 3 A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0053] Figure 4 A schematic diagram of a negotiation process method provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0055] Figure 6 A schematic diagram of a WiFi P2P link establishment method provided in an embodiment of the present application;

[0056] Figure 7 A schematic diagram of a WiFi P2P link establishment method provided in an embodiment of the present application;

[0057] Figure 8 A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0058] Fig. 9 A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0059] Fig.10A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0060] Fig.11 A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0061] Fig.12 A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0062] Fig.13 A schematic diagram of a WiFi communication method provided in an embodiment of the present application;

[0063] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0065] In the description of the embodiments of the present application, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0066] To facilitate understanding, exemplary descriptions of concepts related to the present application are provided for reference.

[0067] 1) Electronic equipment, which may be equipment with processing and communication functions. In the embodiments of the present application, the electronic equipment may also be referred to as a terminal or terminal equipment.

[0068] In some embodiments of the present application, the electronic device may be a portable device, such as a mobile phone, a tablet computer, a laptop computer, a PDA, a wearable device with a wireless communication function (for example, a watch, a bracelet, a helmet, a headset, etc.), a vehicle, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home device (for example, a smart TV, a smart speaker, etc.), an intelligent robot, a workshop equipment, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, or a wireless terminal in a smart home, a flying device (for example, an intelligent robot, a hot air balloon, a drone, an airplane), etc.

[0069] Among them, a wearable device is a portable device that a user can wear directly on the body or integrate into the user's clothes or accessories.

[0070] In some embodiments of the present application, the electronic device may also be a portable terminal device that also includes other functions such as a personal digital assistant and / or a music player. Exemplary embodiments of the portable terminal device include but are not limited to: Or a portable terminal device with other operating systems. The portable terminal device may also be other portable terminal devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present application, the electronic device may not be a portable terminal device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0071] 2) Station (STA), also known as workstation or wireless workstation, STA refers to a device connected to a wireless network. These devices can communicate with other devices within the wireless network or with the outside of the wireless network through an access point.

[0072] In the embodiment of the present application, STA may be an electronic device that supports WiFi connection.

[0073] 3) Access Point (AP), also known as access node, wireless access point or hotspot, is a device used to connect STA to a wireless network. AP can realize communication between wireless network and wired network and is the core device for building a wireless LAN.

[0074] AP can be an access point in a WiFi system, or a module or unit that performs some functions of an access point, for example, a centralized unit (CU), a distributed unit (DU), a router, a bridge, a wireless gateway, etc. This application does not limit the specific technology and specific device form used by AP.

[0075] In the embodiment of the present application, the AP may be an electronic device with a WiFi access function.

[0076] 4) WiFi P2P, also known as WiFi direct connection, is a technology launched by the WiFi Alliance that allows devices to connect directly to each other based on WiFi technology. Based on WiFi P2P technology, devices can communicate one-to-one or one-to-many without the help of a local area network or AP. The application scenarios of WiFi P2P technology are very wide. As long as the device supports the relevant protocols of WiFi P2P, various business interactions (such as file transfer, screen sharing, etc.) can be realized based on WiFi P2P technology.

[0077] The WiFi P2P architecture defines two device roles, namely group owner (GO) (or group owner) and group client (GC). A GO device has the same functions as an AP, and a GC device has the same functions as a STA and needs to connect to a GO. Multiple devices networked based on WiFi P2P technology can determine the role of each device through negotiation.

[0078] 5) Dual band adaptive concurrent (DBAC) mode refers to a mode in which WLAN devices (i.e., devices that support WLAN communication) communicate using time-division multiplexing of different frequency bands.

[0079] Currently, WLAN devices support frequency bands including 2.4GHz and 5GHz. When a software architecture including the media access control layer, physical layer, and radio frequency is integrated into a WLAN device, and the radio frequency has only one set of channels, the WLAN device can only work in one frequency band (usually the 2.4GHz band). This working mode is called single band single concurrent (SBSC) mode. When a software architecture including the media access control layer, physical layer, and radio frequency is integrated into a WLAN device, and the radio frequency has two sets of channels, one of the two channels supports the 2.4GHz band and the other supports the 5GHz band. The WLAN device can support switching to one of the 2.4GHz and 5GHz bands, but cannot support working in both bands at the same time. This working mode is called dual band single concurrent (DBSC) mode. When two sets of software architectures including the media access control layer, physical layer, and radio frequency are integrated into a WLAN device and the radio frequency has two sets of paths, one of the two paths supports the 2.4 GHz band and the other supports the 5 GHz band. The WLAN device can support working in the 2.4 GHz band and the 5 GHz band respectively, or it can support working in the 2.4 GHz band and the 5 GHz band at the same time. This working mode is called dual band dual concurrent (DBSC) mode.

[0080] Since the cost of WLAN devices supporting DBDC mode is relatively high, there are currently few devices that support DBDC mode. For devices that do not support DBDC mode, if such devices support DBSC mode, such devices can be used to dynamically switch back and forth between the 2.4GHz band and the 5GHz band to achieve the effect of time-division multiplexing communication in the two bands. This working mode is the DBAC mode. In DBAC mode, the WLAN device can only work in one band at a time and cannot truly work in multiple bands at the same time. In DBAC mode, the WLAN device needs to dynamically switch back and forth between the two bands, which will result in a decrease in service quality.

[0081] It should be understood that in the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.

[0082] When the terminal devices interact with each other, the service data can be transmitted through the WiFi P2P connection. Furthermore, in order to improve the security of the service interaction, the terminal devices can transmit the service data through the encrypted WiFi P2P connection channel. At present, the terminal device needs to know at least the service set identifier (SSID) or basic service set identifier (BSSID) of the other device in advance, as well as the pre-shared key (PSK) to establish an encrypted WiFi P2P channel with the other device. In addition, the current terminal device can support working in multiple modes. When the WiFi chip in the terminal device coexists in the STA mode (i.e., the mode in which the terminal device works as a STA) and the P2P mode (i.e., the mode in which the terminal device works as a P2P device), if the terminal device works in different channels in the STA mode and the P2P mode, it will enter the DBAC mode, that is, the terminal device time-division multiplexing two channels, which will greatly reduce the communication performance of the terminal device. Currently, in order to solve this problem, before establishing a link between terminal devices, a suitable working channel can be negotiated by performing a two-way channel negotiation, so that the terminal devices establishing the link can all work on the negotiated working channel, thereby avoiding the terminal devices establishing the link from entering the DBAC mode, thereby improving the communication performance of the terminal devices. In addition, the terminal devices can also negotiate the WiFi P2P roles (GO or GC) of both ends before establishing a WiFi P2P connection.

[0083] In summary, when establishing a WiFi P2P connection or accessing an encrypted AP between terminal devices, it is necessary to negotiate the connection mode and channel to be used, exchange information such as SSID and key, and negotiate the roles of both ends. Currently, the above negotiation can be achieved between terminal devices in the following ways:

[0084] Method 1: User scans the code to establish WiFi P2P

[0085] In this method, the GO / AP side device can present the information required for WiFi P2P link establishment to the user through a QR code. The user can use a terminal device (such as a mobile phone) to actively scan the QR code to obtain the information required for link establishment with the GO / AP side device, and then establish a WiFi P2P connection with the GO / AP side device based on this information.

[0086] This method requires users to actively participate in the negotiation and chain building process, so the user experience is poor and it takes a long time, resulting in a very slow chain building speed.

[0087] Method 2: Negotiate via wireless LAN

[0088] In this method, two devices that need to establish a WiFi P2P connection connect to the same WiFi hotspot, and the information required for link establishment on both ends is forwarded through the WiFi hotspot, thereby achieving negotiation and interaction of link establishment information. Currently, the time required for negotiation based on this method is generally 1.2 to 1.5 seconds.

[0089] This method requires that both devices are connected to the same WiFi hotspot. If both devices are not connected to the same WiFi hotspot, the solution will fail. In addition, the latency of the interaction between the two ends is affected by the network quality of the connected WiFi hotspot and the services currently being transmitted using WiFi. Therefore, the latency of the interaction between the two ends is unstable, which will lead to unstable link establishment speed between the two ends.

[0090] Method 3: Negotiate by temporarily establishing a Bluetooth link

[0091] In this method, two devices that need to establish a WiFi P2P connection first establish a Bluetooth connection, and then use the Bluetooth link to forward the two-end connection information, thereby achieving negotiation interaction of the link information. Currently, the negotiation based on this method generally takes 2 to 3 seconds.

[0092] As Bluetooth is increasingly used by various electronic peripherals, the success rate of establishing Bluetooth links will continue to decrease, and the Bluetooth transmission delay may also fluctuate greatly. Therefore, using the Bluetooth channel to negotiate link establishment information in this method may affect the speed of WiFi P2P link establishment, resulting in a decrease in user experience.

[0093] Method 4: WiFi P2P self-discovery connection

[0094] In this method, two devices that are connected via WiFi P2P can negotiate through processes such as provision discovery (PD), GO negotiation, and WiFi protected setup, and then establish a WiFi P2P connection. Currently, the negotiation time based on this method is more than 5 seconds.

[0095] This method involves many negotiation processes and takes a long time, so the link establishment speed is low.

[0096] Method 5: Negotiation through neighbor awareness networking (NAN)

[0097] NAN is a method developed by the WiFi Alliance to achieve connections between devices. It can coexist with P2P, WiFi hotspot, and WiFi STA functions. Two devices that are connected via WiFi P2P can use the NAN connection to negotiate after establishing a NAN connection. Currently, the time required for negotiation based on this method is generally more than 2 seconds.

[0098] This method also takes a long time to implement negotiation, so the speed of WiFi P2P link establishment is low. In addition, there are currently few devices that can support NAN features, so this method cannot support the current demand for the interconnection of a large number of devices.

[0099] Based on the above problems, in order to improve the speed and success rate of WiFi P2P link establishment, the embodiments of the present application provide a WiFi communication method and electronic device. The scheme can quickly implement the negotiation process before WiFi P2P link establishment without an out-of-band negotiation channel, thereby reducing the connection delay and improving the speed and success rate of WiFi P2P link establishment.

[0100] The technical solution provided in the embodiments of the present application can be executed by any computing device with processing and computing capabilities, and the computing device can be an electronic device, etc. The performance of the electronic device can refer to the description in the above concept description. The following description takes the application of the technical solution of the present application in an electronic device as an example, and the implementation process of the application in other computing devices is similar and will not be repeated.

[0101] See below Figure 1 , the structure of the electronic device to which the method provided in the embodiments of the present application is applicable is introduced.

[0102] like Figure 1As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a SIM card interface 195, etc.

[0103] The sensor module 180 may include a gyroscope sensor, an acceleration sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an ambient light sensor, an air pressure sensor, a bone conduction sensor, and the like.

[0104] Understandably, Figure 1 The electronic device 100 shown is merely an example and does not constitute a limitation on the electronic device, and the electronic device may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different component configuration. Figure 1 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0105] The processor 110 may include one or more processing units, for example: the processor 110 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 memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0106] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0107] The execution of the WiFi communication method provided in the embodiment of the present application can be controlled by the processor 110 or completed by calling other components, such as calling the processing program of the embodiment of the present application stored in the internal memory 121, or calling the processing program of the embodiment of the present application stored in a third-party device through the external memory interface 120, to control the wireless communication module 160 to communicate data with other devices, improve the intelligence and convenience of the electronic device 100, and enhance the user experience. The processor 110 can include different devices, such as when the CPU and GPU are integrated, the CPU and GPU can cooperate to execute the WiFi communication method provided in the embodiment of the present application, such as part of the algorithm in the WiFi communication method is executed by the CPU, and another part of the algorithm is executed by the GPU, so as to obtain faster processing efficiency.

[0108] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. The display screen 194 can be used to display information input by a user or information provided to a user and various graphical user interfaces (GUIs). For example, the display screen 194 can display photos, videos, web pages, or files, etc.

[0109] In the embodiment of the present application, the display screen 194 may be an integrated flexible display screen, or a spliced ​​display screen consisting of two rigid screens and a flexible screen located between the two rigid screens.

[0110] The camera 193 (a front camera or a rear camera, or one camera can be used as both a front camera and a rear camera) is used to capture still images or videos. Generally, the camera 193 may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex lenses or concave lenses) for collecting light signals reflected by the object to be photographed and transmitting the collected light signals to the image sensor. The image sensor generates an original image of the object to be photographed based on the light signal.

[0111] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store codes of an operating system, an application program (such as functions corresponding to a WiFi communication method, etc.). The data storage area may store data created during the use of the electronic device 100, etc.

[0112] The internal memory 121 may also store one or more computer programs corresponding to the algorithm corresponding to the WiFi communication method provided in the embodiment of the present application. The one or more computer programs are stored in the internal memory 121 and configured to be executed by one or more processors 110. The one or more computer programs include instructions, which may be used to execute the various steps in the following embodiments.

[0113] In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0114] Of course, the code of the algorithm corresponding to the WiFi communication method provided in the embodiment of the present application can also be stored in an external memory. In this case, the processor 110 can run the code of the algorithm corresponding to the WiFi communication method stored in the external memory through the external memory interface 120.

[0115] The sensor module 180 may include a gyro sensor, an acceleration sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, and the like.

[0116] The touch sensor is also called a "touch panel". The touch sensor can be arranged on the display screen 194, and the touch sensor and the display screen 194 form a touch display screen, also called a "touch screen". The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0117] Exemplarily, the display screen 194 of the electronic device 100 displays a main interface, which includes icons of multiple applications (such as a camera application, etc.). For example, a user can click the icon of the camera application in the main interface through a touch sensor to trigger the processor 110 to start the camera application and turn on the camera 193. The display screen 194 displays the interface of the camera application, such as a viewfinder interface.

[0118] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0119] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0120] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110. In an embodiment of the present application, the mobile communication module 150 can also be used to interact with other devices for information.

[0121] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0122] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering processing, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. In the embodiment of the present application, the wireless communication module 160 is used to establish a connection with other electronic devices and exchange data. Or the wireless communication module 160 can be used to access the access point device, send control instructions to other electronic devices, or receive data sent from other electronic devices.

[0123] In addition, the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. For example, music playback, recording, etc. The electronic device 100 can receive input from the key 190 and generate key signal input related to the user settings and function control of the electronic device 100. The electronic device 100 can use the motor 191 to generate a vibration prompt (such as an incoming call vibration prompt). The indicator 192 in the electronic device 100 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 in the electronic device 100 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195, to achieve contact and separation with the electronic device 100.

[0124] It should be understood that in practical applications, the electronic device 100 may include Figure 1 The embodiments of the present application are not limited to the more or fewer components shown. The illustrated electronic device 100 is only an example, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0125] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. For example, Figure 2 As shown, the software architecture can be divided into four layers, from top to bottom, namely the application layer, the application framework layer (Framework, FWK), the runtime and system library, and the (Linux) kernel layer.

[0126] The application layer is the top layer of the operating system, including native applications of the operating system, such as camera, gallery, calendar, Bluetooth, music, video, information, etc., and may also include third-party applications. The application involved in the embodiment of the present application is referred to as application (APP), which is a software program that can implement one or more specific functions. Typically, multiple applications can be installed in an electronic device, such as camera applications, email applications, learning applications, etc. The applications mentioned below may be system applications installed when the electronic device leaves the factory, or they may be third-party applications downloaded from the Internet or obtained from other electronic devices by the user while using the electronic device.

[0127] Of course, for developers, developers can write applications and install them in this layer. In a possible implementation, applications can be developed using the Java language by calling the application programming interface (API) provided by the application framework layer. Developers can interact with the bottom layer of the operating system (such as the kernel layer) through the application framework to develop their own applications.

[0128] The application framework layer is the API and programming framework of the application layer. The application framework layer may include some predefined functions. The application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0129] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the display screen (or screen), capture the display screen, etc.

[0130] Content providers are used to store and retrieve data and make these data accessible to applications. The data may include files (such as documents, videos, images, audio), text and other information.

[0131] The view system includes visual controls, such as controls for displaying text, images, documents, etc. The view system can be used to build applications. The interface in the display window can be composed of one or more views. For example, the display interface including the SMS notification icon can include a view for displaying text and a view for displaying images.

[0132] The phone manager is used to provide communication functions for electronic devices. The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction.

[0133] In some embodiments of the present application, the application framework layer may include a communication unit and a WiFi P2P link building unit. Among them, the communication unit can be used to trigger the electronic device to prepare to establish a WiFi P2P connection with other electronic devices, and it can also be understood that the communication unit can be used to trigger the electronic device to perform a negotiation process before establishing a WiFi P2P connection with other electronic devices. Optionally, the communication unit can use a low-power Bluetooth low energy (BLE) communication method or a sparklink low energy (SLE) access technology when communicating with other electronic devices. The WiFi P2P link building unit is used to use the public action frame (public action) reserved for manufacturers in the WiFi protocol to carry authentication and negotiation data before the electronic device establishes a WiFi P2P connection with other electronic devices, to complete the authentication with other electronic devices and the negotiation of WiFi P2P link building information such as working channels and keys. The WiFi P2P link building unit can also be used to establish a WiFi P2P connection with other electronic devices based on the negotiated information after the negotiation is completed. Among them, the public behavior frame (i.e., public action message or action message) is a management message defined in the WiFi protocol and reserved for manufacturers to use. The public behavior frame can also be called an action frame or a public signaling frame, etc. The name of the public behavior frame is not restricted in the embodiments of the present application.

[0134] The runtime includes the core library and the virtual machine. The runtime is responsible for the scheduling and management of the system.

[0135] The core library of the system consists of two parts: one is the function that the Java language needs to call, and the other is the core library of the system. The application layer and the application framework layer run in the virtual machine. Taking Java as an example, the virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0136] The system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), image processing library, etc. The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications. The media library supports a variety of commonly used audio and video format playback and recording, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.564, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

[0137] The kernel layer provides the core system services of the operating system, such as security, memory management, process management, network protocol stack and driver model, which are all implemented based on the kernel layer. The kernel layer also serves as an abstraction layer between the hardware and software stacks. This layer has many drivers related to electronic devices, the main drivers are: display driver; keyboard driver as input device; Flash driver based on memory technology device; camera driver; audio driver; Bluetooth driver; WiFi driver, etc.

[0138] In some embodiments of the present application, the Bluetooth driver can be used to drive the Bluetooth of the electronic device to perform low-power Bluetooth communication with other electronic devices under the control of the low-power communication unit. The WiFi driver can be used to drive the WiFi chip of the electronic device to perform WiFi communication with other electronic devices under the control of the WiFi P2P link building unit.

[0139] It should be understood that the functional services described above are only examples, and in actual applications, electronic devices may also be divided into more or fewer functional services according to other factors, or the functions of each service may be divided in other ways, or the functional services may not be divided but work as a whole.

[0140] Combined with the above Figure 1 The hardware architecture of the electronic device shown and Figure 2 The software architecture of the electronic device shown is described in detail below in conjunction with specific embodiments of the present application.

[0141] The solution provided in the embodiment of the present application can be applied in a scenario where two electronic devices with low-power communication capability and WiFi P2P communication capability automatically negotiate to establish a WiFi P2P connection. Among them, establishing a WiFi P2P connection can also be understood as establishing WiFi P2P communication or establishing a WiFi P2P communication link, etc. After the WiFi P2P connection is established, the two electronic devices can exchange business data.

[0142] For ease of explanation, in the embodiment of the present application, establishing a WiFi P2P connection is referred to as link establishment, and the process of authentication before establishing a WiFi P2P connection and negotiating the information required to establish the WiFi P2P connection (such as working channel, key, etc.) is referred to as the negotiation process.

[0143] Exemplarily, the two electronic devices mentioned above can be a mobile phone and a tablet, a mobile phone and a personal computer (PC), a mobile phone and a smart screen, a tablet and a smart screen, etc.

[0144] In some embodiments of the present application, in addition to the above-mentioned low-power communication capability and WiFi P2P communication capability, the electronic device that establishes the WiFi P2P connection also has the ability to customize the public behavior frame interaction of the private protocol (that is, the electronic device can use the private protocol). Among them, the private protocol is a protocol that is customized by the manufacturer itself without being adopted or approved by the international or national standardization organization and is only used between devices produced or authorized by the manufacturer itself. The private protocol described in the embodiment of the present application may be a protocol related to the public behavior frame reserved for manufacturers in the WiFi protocol, and the ability to customize the public behavior frame interaction of the private protocol described in the embodiment of the present application may be the ability to communicate using the public behavior frame.

[0145] The WiFi P2P negotiation and link establishment process in this scenario is exemplarily described below in conjunction with Embodiment 1 and Embodiment 2.

[0146] Embodiment 1

[0147] Reference Figure 3 Taking the scenario where a first electronic device establishes a WiFi P2P connection with a second electronic device as an example, a WiFi communication method provided by an embodiment of the present application may include:

[0148] S301: The first electronic device sends a negotiation request to the second electronic device; wherein the negotiation request is used to request execution of a negotiation process, and the negotiation process is used to establish a WiFi P2P connection.

[0149] Specifically, the negotiation process is used to negotiate and determine information required to establish a WiFi P2P connection, and the first electronic device can establish a WiFi P2P connection with the second electronic device based on the information.

[0150] In this embodiment, when the first electronic device initiates a service that needs to be interacted with the second electronic device, it can start executing step S301 and subsequent steps to establish a WiFi P2P connection with the second electronic device. After establishing the WiFi P2P connection with the second electronic device, the first electronic device can start executing the service that needs to be interacted with the second electronic device.

[0151] In some embodiments of the present application, the negotiation request may include at least one of the following: an identifier of the first electronic device, an identifier of the second electronic device, an address of the first electronic device, and a channel through which the first electronic device expects to interact with the second electronic device in public behavior frames.

[0152] In some embodiments of the present application, the identification of the electronic device may be information that can uniquely identify the electronic device, such as a device name, a device identification code (identity document, ID), a device address, etc. The address of the electronic device may be the address of the WiFi P2P interface of the electronic device, and the address of the WiFi P2P interface may be a media access control (MAC) address.

[0153] In some embodiments of the present application, the first electronic device can send a negotiation request to the second electronic device through a directional broadcast method, wherein the communication method adopted can be a low-power communication method such as BLE, SLE (not using a Bluetooth connection method), and sending a negotiation request can trigger the second electronic device to perform a negotiation process before establishing a WiFi P2P connection with the first electronic device. Specifically, the first electronic device can send a negotiation request through a broadcast message carrying the identification of the second electronic device. After the second electronic device receives the broadcast message, it can determine that the broadcast message is a directional broadcast message sent to the second electronic device based on the identification of the second electronic device carried in the broadcast message, and then respond to the broadcast message.

[0154] S302: The second electronic device sends a first public action frame to the first electronic device in response to the received negotiation request; wherein the first public action frame is used to confirm the execution of the negotiation process.

[0155] The first public action frame may be used as a negotiation response message for confirming the negotiation request.

[0156] In the embodiment of the present application, the first public behavior frame belongs to the management frame (also called management message) defined in the WiFi protocol.

[0157] In some embodiments of the present application, the first public action frame may include at least one of the following: an address of the first electronic device, an address of the second electronic device, and an identifier of the second electronic device, wherein the identifier of the second electronic device may be carried in a payload of the first public action frame.

[0158] S303: The first electronic device and the second electronic device execute a negotiation process; wherein, during the negotiation process, the interaction information between the first electronic device and the second electronic device is sent via a public behavior frame.

[0159] In some embodiments of the present application, Figure 4 As shown in , the negotiation process may include the following steps:

[0160] S401: The first electronic device sends a second public behavior frame to the second electronic device; wherein the second public behavior frame is used to request authentication of the first electronic device.

[0161] The second public behavior frame may be used as an authentication request, and the authentication data corresponding to the authentication request is encapsulated in the second public behavior frame.

[0162] In some embodiments of the present application, after the first electronic device receives the first public behavior frame from the second electronic device, it can confirm that the second electronic device agrees to perform the negotiation process before establishing a WiFi connection with the first electronic device, and it can be considered that a communication link based on the public behavior frame is established with the second electronic device.

[0163] S402: The second electronic device sends a third public action frame to the first electronic device; wherein the third public action frame is used to confirm that the authentication is successful.

[0164] S403: The first electronic device and the second electronic device negotiate to determine a session key.

[0165] S404: The first electronic device sends a fourth public behavior frame to the second electronic device; wherein the fourth public behavior frame includes negotiation information of the first electronic device encrypted by using the session key.

[0166] In some embodiments of the present application, the destination address of the fourth public behavior frame is the address of the second electronic device, for example, it may be the address of the second electronic device carried in the negotiation request. The negotiation information of the first electronic device may include at least one of the following: the WiFi capability of the first electronic device (for example, it may include the WiFi channels supported by the first electronic device, etc.), the expected channel of the first electronic device, the expected P2P role of the first electronic device (GC or GO), etc. Among them, the expected channel is the working channel that the first electronic device expects to use after establishing a WiFi P2P connection with the second electronic device. The expected channel can be a channel selected by the electronic device from the supported channels (for example, a channel with better communication quality, etc.).

[0167] S405: The second electronic device determines link establishment information according to the negotiation information of the first electronic device obtained after decrypting the fourth public behavior frame and the negotiation information of the second electronic device; wherein the link establishment information is used to indicate information required for the first electronic device to establish a WiFi P2P connection with the second electronic device.

[0168] After receiving the fourth public behavior frame from the first electronic device, the second electronic device can use the session key determined by negotiation with the first electronic device to decrypt the fourth public behavior frame to obtain the negotiation information of the first electronic device contained therein. The second electronic device can determine the most appropriate channel to be used after the first electronic device and the second electronic device establish a WiFi P2P connection, as well as the P2P roles of the first electronic device and the second electronic device, based on the negotiation information of the first electronic device and the negotiation information of the second electronic device.

[0169] In some embodiments of the present application, the negotiation information of the second electronic device may include at least one of the following: the WiFi capability of the second electronic device (for example, it may include the WiFi channels supported by the second electronic device, etc.), the desired channel of the second electronic device, the desired P2P role of the second electronic device (GC or GO), etc.

[0170] In some embodiments of the present application, the link establishment information may include at least one of the following: the P2P role of the first electronic device, the P2P role of the second electronic device, the channel used to establish the WiFi P2P connection, the pre-shared key (also referred to as a pre-shared password or shared key, etc.), and the Internet protocol (IP) information of the first electronic device.

[0171] S406: The second electronic device sends a fifth public action frame to the first electronic device; wherein the fifth public action frame includes link establishment information encrypted by using the session key.

[0172] After receiving the fifth public behavior frame, the first electronic device may use the session key negotiated and determined with the second electronic device to decrypt the fifth public behavior frame to obtain link establishment information, and further determine the information required to establish a WiFi P2P connection with the second electronic device based on the link establishment information.

[0173] Optionally, after step S303, the following step S304 may be further included:

[0174] S304: The first electronic device establishes a WiFi P2P connection with the second electronic device.

[0175] Among them, in one possible solution, if the P2P role of the first electronic device is GC and the P2P role of the second electronic device is GO, the second electronic device can wait for the first electronic device to connect, and the first electronic device can determine that the P2P role of the first electronic device is GC based on the fifth public behavior frame from the second electronic device. Then the first electronic device can send a connection request to the second electronic device, and the second electronic device can establish a WiFi P2P connection with the first electronic device in response to the connection request.

[0176] In another possible solution, if the P2P role of the first electronic device is GO and the P2P role of the second electronic device is GC, the second electronic device can send a connection request to the first electronic device, and the first electronic device can establish a WiFi P2P connection with the second electronic device in response to the connection request after receiving the connection request from the second electronic device.

[0177] After the first electronic device establishes a WiFi P2P connection with the second electronic device, an encrypted WiFi P2P communication link is established between the first electronic device and the second electronic device, and the first electronic device and the second electronic device can exchange business data based on the communication link.

[0178] Through the method provided in the above embodiment, the negotiation process before WiFi P2P link establishment can be completed quickly and efficiently between the first electronic device and the second electronic device based on the public behavior frame in the WiFi protocol, which can improve the subsequent link establishment speed. The above scheme can achieve an encrypted WiFi P2P connection within 1 second. In addition, through the negotiation process before link establishment, the DBAC problem that may occur in the WiFi P2P connection can also be solved, so that a more stable transmission channel can be established for subsequent services.

[0179] It should be noted that the implementation process provided in the above embodiment is only an example of the method process applicable to the embodiment of the present application, and the execution order of each step can be adjusted accordingly according to actual needs, and other steps can be added or some steps can be reduced.

[0180] Embodiment 2

[0181] Reference Figure 5 Taking the scenario where a first electronic device establishes a WiFi P2P connection with a second electronic device as an example, a WiFi communication method provided by an embodiment of the present application may include:

[0182] S501: The first electronic device and the second electronic device establish a communication connection in advance, complete device authentication, and negotiate to determine a session key.

[0183] The session key is used to encrypt or decrypt the interactive information between the first electronic device and the second electronic device. The first electronic device and the second electronic device can use the session key to encrypt information sent to the other end, and use the session key to decrypt information from the other end.

[0184] In some embodiments of the present application, the first electronic device and the second electronic device may establish a communication connection after being close to each other. The communication connection may be established by a Bluetooth communication method, a wireless local area network communication method, etc. The communication connection may be established by the first electronic device or the second electronic device.

[0185] In some embodiments of the present application, after the first electronic device establishes a communication connection with the second electronic device, after completing device authentication and negotiating and determining the session key, the communication link can be disconnected, and the device can be kept alive only through low-power communication methods, and then the following steps S502 and subsequent steps can be continued.

[0186] The device authentication process and the session key negotiation process may refer to the relevant methods in the negotiation method before the traditional WiFi P2P link establishment, which will not be described in detail in the embodiments of the present application.

[0187] S502: When initiating a service that requires interaction with a second electronic device, the first electronic device sends a negotiation request encrypted with a session key to the second electronic device; wherein the negotiation request is used to request execution of a negotiation process, and the negotiation process is used to establish a WiFi P2P connection.

[0188] Specifically, the negotiation process is used to negotiate and determine information required to establish a WiFi P2P connection, and the first electronic device can establish a WiFi P2P connection with the second electronic device based on the information.

[0189] Regarding the negotiation request, please refer to the introduction in the aforementioned step S301, which will not be repeated here.

[0190] In some embodiments of the present application, a first electronic device may send a negotiation request encrypted with a session key to a second electronic device by using a directed broadcast method, wherein the communication method adopted may be a low-power communication method such as BLE, SLE (without using a Bluetooth connection method). By sending the negotiation request, the second electronic device may be triggered to execute a negotiation process before establishing a WiFi P2P connection with the first electronic device.

[0191] S503: The second electronic device sends a first public action frame to the first electronic device in response to the decrypted negotiation request; wherein the first public action frame includes the negotiation information of the second electronic device encrypted by using the session key.

[0192] After receiving the encrypted negotiation request from the first electronic device, the second electronic device may decrypt the encrypted negotiation request using the session key determined in advance through negotiation with the first electronic device to obtain a decrypted negotiation request.

[0193] The destination address of the first public behavior frame is the address of the first electronic device, for example, the address of the first electronic device carried in the negotiation request. For the negotiation information of the second electronic device, reference may be made to the related description in the first embodiment, which will not be repeated here.

[0194] S504: The first electronic device determines link establishment information according to the negotiation information of the second electronic device obtained after decrypting the first public behavior frame and the negotiation information of the first electronic device; wherein the link establishment information is used to indicate information required for the first electronic device to establish a WiFi P2P connection with the second electronic device.

[0195] After receiving the first public behavior frame from the second electronic device, the first electronic device can use the session key negotiated and determined in advance with the first electronic device to decrypt the first public behavior frame to obtain the negotiation information of the second electronic device contained therein.

[0196] Regarding the negotiation information and link establishment information of the first electronic device, reference may be made to the relevant descriptions in the aforementioned embodiment 1, and will not be repeated here.

[0197] S505: The first electronic device sends a second public action frame to the second electronic device; wherein the second public action frame includes link establishment information encrypted by using a session key.

[0198] After receiving the second public action frame, the second electronic device may use the session key pre-negotiated and determined with the first electronic device to decrypt the second public action frame to obtain link establishment information, and then determine the information required to establish a WiFi P2P connection with the first electronic device based on the link establishment information.

[0199] Optionally, after step S505, the following step S506 may be further included:

[0200] S506: The first electronic device establishes a WiFi P2P connection with the second electronic device.

[0201] Among them, in a possible solution, if the P2P role of the first electronic device is GO and the P2P role of the second electronic device is GC, the first electronic device can wait for the second electronic device to connect. The second electronic device can determine that the P2P role of the second electronic device is GC based on the second public behavior frame from the first electronic device, and the second electronic device can send a connection request to the first electronic device, and the first electronic device can respond to the connection request and establish a WiFi P2P connection with the second electronic device.

[0202] In another possible solution, if the P2P role of the first electronic device is GC and the P2P role of the second electronic device is GO, the first electronic device can send a connection request to the second electronic device, and the second electronic device can establish a WiFi P2P connection with the first electronic device in response to the connection request after receiving the connection request from the first electronic device.

[0203] After the first electronic device establishes a WiFi P2P connection with the second electronic device, an encrypted WiFi P2P communication link is established between the first electronic device and the second electronic device, and the first electronic device can start to execute services that require interaction with the second electronic device.

[0204] Through the method provided by the above embodiment, when initiating an interactive service, the first electronic device and the second electronic device can quickly and efficiently complete the negotiation process before WiFi P2P link establishment based on the public behavior frame in the WiFi protocol, which can improve the subsequent link establishment speed. The above scheme can achieve an encrypted WiFi P2P connection within 1 second. In addition, through the negotiation process before link establishment, the DBAC problem that may occur in the WiFi P2P connection can also be solved, so that a more stable transmission channel can be established for subsequent services.

[0205] Compared with the method provided in the first embodiment, the method provided in the above embodiment further reduces the number of interactions through public behavior frames, so it can achieve a faster negotiation effect than the first embodiment, and can further improve the WiFi P2P link establishment speed. At the same time, the negotiation request is encrypted by the session key, which can further improve security and prevent maliciously triggered link establishment attacks.

[0206] It should be noted that the specific implementation process provided in the above embodiment is only an example of the method process applicable to the embodiment of the present application, and the execution order of each step can be adjusted accordingly according to actual needs, and other steps can be added or some steps can be reduced.

[0207] In the method described in the first or second embodiment, as an optional implementation, the first electronic device and the second electronic device may establish a WiFi P2P connection through a traditional link establishment method. Figure 6 As shown in , the method for establishing a WiFi P2P connection between a first electronic device and a second electronic device through a traditional link establishment method may include:

[0208] S601: The first electronic device and the second electronic device perform an authentication process.

[0209] Among them, the authentication (authentication, Auth) process can be an authentication process that needs to be performed to establish a WiFi connection as specified in the WiFi protocol or standard, and will not be described in detail in the embodiments of the present application.

[0210] S602: The first electronic device and the second electronic device execute an association process.

[0211] Among them, the association (Assoc) process can be an association process that needs to be executed to establish a WiFi connection as specified in the WiFi protocol or standard, and will not be described in detail in the embodiments of the present application.

[0212] S603: The first electronic device and the second electronic device perform a four-way handshake process.

[0213] Among them, the four-way handshake (4aay handshake) process can be a four-way handshake process specified in the WiFi protocol or standard (used for negotiating keys), which will not be described in detail in the embodiments of the present application.

[0214] S604: The first electronic device determines the encryption key of the WiFi P2P link after the WiFi P2P connection is established according to the key determined by executing the four-way handshake process.

[0215] S605: The second electronic device determines the encryption key of the WiFi P2P link after the WiFi P2P connection is established according to the key determined by executing the four-way handshake process.

[0216] The specific implementation process of the above method can be implemented by referring to the method for establishing a WiFi connection specified in the WiFi protocol or standard, and will not be described in detail in the embodiments of the present application.

[0217] As another optional implementation scheme, according to the introduction in the aforementioned embodiment, the first electronic device and the second electronic device have negotiated and determined the session key during the negotiation process. Therefore, when the first electronic device and the second electronic device establish a WiFi P2P connection, they may not execute the four-way handshake process (for key negotiation), but may use the session key determined in the negotiation process to replace the function of the key determined in the four-way handshake process (it can also be considered that the session key determined in the negotiation process is used as the key determined in the four-way handshake process). Figure 7 As shown in , based on this solution, the method for establishing a WiFi P2P connection between a first electronic device and a second electronic device may include:

[0218] S701: The first electronic device and the second electronic device execute an authentication process.

[0219] S702: The first electronic device and the second electronic device execute an association process.

[0220] The specific implementation process of the above steps S701 to S702 can be implemented by referring to the method for establishing a WiFi connection specified in the WiFi protocol or standard, and will not be described in detail in the embodiments of the present application.

[0221] S703: The first electronic device determines the encryption key of the WiFi P2P link after the WiFi P2P connection is established according to the session key determined by executing the negotiation process.

[0222] S704: The second electronic device determines the encryption key of the WiFi P2P link after the WiFi P2P connection is established according to the session key determined by executing the negotiation process.

[0223] Through the above method, the link establishment process between the first electronic device and the second electronic device can be further simplified, thereby improving the link establishment efficiency between the first electronic device and the second electronic device.

[0224] Currently, there are some electronic devices that do not have the ability to customize the public behavior frame interaction of the private protocol. Such electronic devices cannot perform WiFi P2P negotiation and link establishment with other electronic devices through the method provided in the above-mentioned embodiment 1 or embodiment 2.

[0225] In view of this, an embodiment of the present application further provides a WiFi communication method, which can be applied to a scenario in which an electronic device that cannot customize a public behavior frame interaction of a private protocol performs WiFi P2P negotiation and link establishment with other electronic devices.

[0226] The WiFi P2P negotiation and link establishment process in this scenario is exemplarily described below in conjunction with Embodiment 3 and Embodiment 4.

[0227] Embodiment 3

[0228] Reference Figure 8 Taking the scenario where a first electronic device establishes a WiFi P2P connection with a second electronic device, and the P2P role of the first electronic device is GC and the P2P role of the second electronic device is GO as an example, a WiFi communication method provided in an embodiment of the present application may include:

[0229] S801: The first electronic device and the second electronic device establish a communication connection in advance, and negotiate to determine a session key, a network identifier of the second electronic device, and a pre-shared key; wherein the session key is used to encrypt or decrypt interactive information between the first electronic device and the second electronic device.

[0230] The network identifier of the second electronic device is used to identify a soft AP created by the second electronic device, and the network identifier may be an SSID. The pre-shared key may be used to access the soft AP created by the second electronic device.

[0231] In some embodiments of the present application, the first electronic device and the second electronic device may establish a communication connection after being close to each other. The communication connection may be established by a Bluetooth communication method, a wireless local area network communication method, etc. The communication connection may be established by the first electronic device or the second electronic device.

[0232] In some embodiments of the present application, after the first electronic device establishes a communication connection with the second electronic device, after completing the negotiation, the communication link can be disconnected, and the device can be kept alive only through a low-power communication method, and then the following steps S802 and subsequent steps can be continued.

[0233] S802: When initiating a service that requires interaction with a second electronic device, the first electronic device sends a connection request to the second electronic device; wherein the connection request is used to request to establish a WiFi P2P connection with the second electronic device.

[0234] The first electronic device may use the session key to encrypt the information carried in the connection request, and the second electronic device may use the session key to decrypt the information carried in the connection request.

[0235] In some embodiments of the present application, the connection request carries the identifier of the first electronic device, the identifier of the second electronic device, and the desired channel of the first electronic device. Optionally, the identifier of the electronic device can be a universally unique identifier (UUID) of the electronic device or a hash value of the UUID of the electronic device.

[0236] S803: The second electronic device determines, in response to the connection request, a channel for establishing a WiFi P2P connection with the first electronic device.

[0237] The second electronic device may determine the best channel available when establishing a WiFi P2P connection with the first electronic device according to the desired channel of the first electronic device and the channels supported by the second electronic device, and then create a soft AP.

[0238] S804: The second electronic device sends first indication information to the first electronic device; wherein the first indication information is used to indicate the channel.

[0239] The second electronic device may use the session key to encrypt the first indication information, and the first electronic device may use the session key to decrypt the first indication information.

[0240] S805: The first electronic device establishes a WiFi P2P connection with the second electronic device according to the channel, the network identifier of the second electronic device, and the pre-shared key.

[0241] The first electronic device can work in the channel and connect to the soft AP created by the second electronic device based on the network identifier and pre-shared key of the second electronic device, thereby establishing a WiFi P2P connection with the second electronic device.

[0242] S806: The first electronic device and the second electronic device perform device authentication.

[0243] After the authentication is completed, an encrypted WiFi P2P communication link is successfully established between the first electronic device and the second electronic device, and the first electronic device can start to execute services that require interaction with the second electronic device.

[0244] Through the method provided by the above embodiment, when initiating an interactive service, the first electronic device and the second electronic device can quickly and efficiently complete the negotiation process before WiFi P2P link establishment when the public behavior frame interaction of the private protocol cannot be customized, which can improve the subsequent link establishment speed. The above scheme can achieve an encrypted WiFi P2P connection within 1 second. In addition, by negotiating in advance the pre-shared key required to establish the WiFi P2P connection, the link establishment speed can be further improved.

[0245] Embodiment 4

[0246] Reference Fig. 9 Taking the scenario where a first electronic device establishes a WiFi P2P connection with a second electronic device, and the P2P role of the first electronic device is GC and the P2P role of the second electronic device is GO as an example, a WiFi communication method provided in an embodiment of the present application may include:

[0247] S901: The first electronic device sends a connection request to the second electronic device; wherein the connection request is used to request to establish a WiFi P2P connection with the second electronic device.

[0248] Regarding the connection request, reference may be made to the introduction in step S602 in the aforementioned third embodiment, which will not be repeated here.

[0249] S902: The second electronic device determines, in response to the connection request, a channel for establishing a WiFi P2P connection with the first electronic device.

[0250] Regarding the specific implementation of this step, reference may be made to the method described in step S603 in the aforementioned embodiment 3, which will not be repeated here.

[0251] S903: The second electronic device sends first indication information to the first electronic device; wherein the first indication information is used to indicate the channel and the network identifier of the second electronic device.

[0252] In some embodiments of the present application, in the above steps S701 to S703, the interaction process between the first electronic device and the second electronic device can be implemented through a low-power communication method (such as BLE communication, SLE communication, etc.).

[0253] S904: The first electronic device establishes a WiFi P2P connection with the second electronic device according to the channel, the network identifier of the second electronic device and the set pre-shared key.

[0254] The set pre-shared key may be pre-negotiated between the first electronic device and the second electronic device, or may be a pre-set key obtained from the cloud.

[0255] In some embodiments of the present application, the link establishment process may also be initiated by the second electronic device, and the steps S901 to S902 may be replaced by the following steps S1 to S3:

[0256] S1: The second electronic device sends a connection request to the first electronic device, wherein the connection request is used to request to establish a WiFi P2P connection with the second electronic device.

[0257] In some embodiments of the present application, the connection request includes the identifier of the second electronic device, and may also include the identifier of the first electronic device and the desired channel of the second electronic device. Optionally, the identifier of the electronic device may be a universally unique identifier (UUID) of the electronic device or a hash value of the UUID of the electronic device.

[0258] S2: The first electronic device sends a connection response to the second electronic device; wherein the connection response is used to confirm the establishment of the WiFi P2P connection.

[0259] In some embodiments of the present application, the connection request carries the desired channel of the first electronic device.

[0260] S3: The second electronic device determines a channel for establishing a WiFi P2P connection with the first electronic device.

[0261] The second electronic device may determine the best channel available when establishing a WiFi P2P connection with the first electronic device according to the desired channel of the first electronic device and the channels supported by the second electronic device, and then create a soft AP.

[0262] Through the method provided by the above embodiment, when initiating an interactive service, the first electronic device and the second electronic device can quickly and efficiently complete the negotiation process before WiFi P2P link establishment when the public behavior frame interaction of the private protocol cannot be customized, which can improve the subsequent link establishment speed. The above scheme can achieve an encrypted WiFi P2P connection within 1 second. In addition, by negotiating in advance the pre-shared key required to establish the WiFi P2P connection, the link establishment speed can be further improved.

[0263] Based on the above embodiments and the same technical concept, the present application embodiment also provides a WiFi communication method, such as Fig.10 As shown in , the method includes:

[0264] S1001: A first electronic device sends first information to a second electronic device, wherein the first information includes an identifier of a first WiFi channel and an address of the first electronic device.

[0265] The first WiFi channel may be a channel through which the first electronic device expects to exchange public behavior frames with the second electronic device.

[0266] In some embodiments of the present application, the first information may further include at least one of the following: an identifier of the first electronic device, an identifier of the second electronic device.

[0267] Exemplarily, the first information may be the information included in the negotiation request described in the aforementioned embodiment, and the first electronic device may send the first information to the second electronic device by sending a negotiation request to the second electronic device. For the specific content of the first information, reference may be made to the introduction of the corresponding content in the aforementioned embodiment, which will not be described in detail here.

[0268] In some embodiments of the present application, the first electronic device may send the first information to the second electronic device when initiating a service. The first electronic device may send the first information to the second electronic device via a low-power Bluetooth communication method or a Star Flash low-power communication method. The specific implementation method can refer to the introduction in the aforementioned embodiment and will not be described in detail here.

[0269] S1002: The first electronic device receives a first public behavior frame sent by the second electronic device through a first WiFi channel; wherein the first public behavior frame includes an address of the first electronic device.

[0270] Among them, since the first public behavior frame includes the address of the first electronic device, the first public behavior frame can be used as response information fed back by the second electronic device to the first electronic device, and can be used to indicate agreement to use the first WiFi channel to interact with the public signaling frame.

[0271] In some embodiments of the present application, the first public behavior frame may also include information such as the address of the second electronic device, the identifier of the second electronic device, and the identifier of the first WiFi channel.

[0272] Exemplarily, the first public behavior frame may be the first public behavior frame described in the foregoing embodiment.

[0273] S1003: The first electronic device executes a negotiation process for establishing a WiFi point-to-point P2P connection with the second electronic device through the first WiFi channel in response to the first public behavior frame.

[0274] In a possible solution, the negotiation process may include the following steps: the first electronic device authenticates the second electronic device, and after the authentication is successful, sends a second public behavior frame to the second electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of the WiFi channel supported by the first electronic device, an identifier of the second WiFi channel (which is the working channel that the first electronic device expects to use after establishing a WiFi P2P connection with the second electronic device), and information indicating the P2P role of the first electronic device (which is the P2P role expected by the first electronic device). After sending the second public behavior frame, the first electronic device may receive a third public behavior frame sent by the second electronic device through the first WiFi channel; wherein the third public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information indicating the P2P role of the first electronic device (which is the P2P role of the first electronic device that is finally assigned), information indicating the P2P role of the second electronic device (which is the P2P role of the second electronic device that is finally assigned), a first key for establishing a WiFi P2P connection (which may be, for example, the pre-shared key described in the aforementioned embodiment), and Internet Protocol IP information of the first electronic device.

[0275] The information included in the second public behavior frame is the negotiation information of the first electronic device. After the first electronic device sends the second public behavior frame to the second electronic device, the second electronic device can determine the link establishment information based on the information included in the second public behavior frame and the negotiation information of the second electronic device itself, that is, the information that can be referenced when the first electronic device and the second electronic device establish a WiFi P2P connection. And the third public behavior frame can be sent to the first electronic device through the first WiFi channel. The information included in the third public behavior frame is the link establishment information.

[0276] In some embodiments of the present application, when the first electronic device and the second electronic device are authenticated, the first electronic device may send a fourth public behavior frame to the second electronic device through the first WiFi channel; wherein the fourth public behavior frame includes authentication information. After the second electronic device receives the fourth public behavior frame, it may authenticate the first electronic device based on the authentication information in the fourth public behavior frame. And after the authentication is successful, the fifth public behavior frame may be sent to the first electronic device, wherein the fifth public behavior frame is used to notify the authentication success. The first electronic device may determine that the authentication is successful after receiving the fifth public behavior frame sent by the second electronic device through the first WiFi channel.

[0277] In some embodiments of the present application, the interactive information between the first electronic device and the second electronic device can be encrypted using a key. Specifically, after determining that the authentication is successful, the first electronic device can negotiate a second key with the second electronic device through the first WiFi channel and the public behavior frame before sending the second public behavior frame to the second electronic device through the first WiFi channel; wherein the second key is used to encrypt the interactive information between the first electronic device and the second electronic device. Specifically, the first electronic device can use the second key to encrypt information sent to the second electronic device, or decrypt information from the second electronic device. The second electronic device can use the second key to encrypt information sent to the first electronic device, or decrypt information from the first electronic device.

[0278] For example, the specific implementation process of the negotiation process described in the above solution can be referred to Figure 4 The method shown in the figure is implemented, the second public action frame can be the fourth public action frame described in step S404 of the above embodiment, the third public action frame can be the fifth public action frame described in step S406 of the above embodiment. The second key can be the session key described in step S403 of the above embodiment.

[0279] In some embodiments of the present application, when the WiFi channel used by the second electronic device to establish a WiFi P2P connection determined by the second electronic device according to the negotiation information of the first electronic device and the negotiation information of the second electronic device is not the second WiFi channel expected by the first electronic device, the identifier of the second WiFi channel in the third public signaling frame may also be replaced with the identifier of the third WiFi channel, wherein the third WiFi channel is the WiFi channel used by the second electronic device to establish a WiFi P2P connection determined by the second electronic device according to the negotiation information of the first electronic device and the negotiation information of the second electronic device. In this scenario, after receiving the third public signaling frame, the first electronic device can establish a WiFi P2P connection with the second electronic device through the third WiFi channel.

[0280] In another possible solution, the first public behavior frame also includes at least one of the following: an identifier of a WiFi channel supported by the second electronic device, an identifier of a second WiFi channel (a working channel that the second electronic device expects to use after establishing a WiFi P2P connection with the first electronic device), and information for indicating the P2P role of the second electronic device (the P2P role expected by the second electronic device). In this solution, the information included in the first public behavior frame is the negotiation information of the second electronic device. In this solution, the negotiation process may include the following steps: the first electronic device sends a second public behavior frame to the second electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information for indicating the P2P role of the first electronic device (the P2P role of the first electronic device that is finally determined), information for indicating the P2P role of the second electronic device (the P2P role of the second electronic device that is finally determined), a first key for establishing a WiFi P2P connection (for example, the pre-shared key described in the aforementioned embodiment), and Internet Protocol IP information of the first electronic device.

[0281] After the first electronic device receives the first public action frame sent by the second electronic device, the first electronic device can determine the link establishment information, i.e., the information that can be referenced when the first electronic device and the second electronic device establish a WiFi P2P connection, based on the information contained in the first public action frame and the negotiation information of the first electronic device itself. And the second public action frame can be sent to the second electronic device through the first WiFi channel. The information included in the second public action frame is the link establishment information.

[0282] In some embodiments of the present application, before the first electronic device sends the first information to the second electronic device, the first electronic device may establish a communication connection with the second electronic device in advance, authenticate the second electronic device, and negotiate a second key with the second electronic device after the authentication is successful. Based on this, the first electronic device may send the first information encrypted with the second key to the second electronic device when initiating a service, and after sending the first information, the first electronic device may receive the first public behavior frame encrypted with the second key sent by the second electronic device through the first WiFi channel.

[0283] For example, the specific implementation process of the negotiation process described in the above solution can be referred to Figure 5 The first public action frame may be the first public action frame described in steps S503-S504 of the aforementioned embodiment, and the second public action frame may be the second public action frame described in step S505 of the aforementioned embodiment. The second key may be the session key described in step S501 of the aforementioned embodiment.

[0284] In some embodiments of the present application, after the first electronic device and the second electronic device perform a negotiation process, the first electronic device can establish a WiFi P2P connection with the second electronic device. Figure 6 or Figure 7 The method shown in is implemented and will not be repeated here.

[0285] In the above method, the specific steps executed by the first electronic device can refer to the relevant introduction in the above embodiments, which will not be described in detail here.

[0286] Based on the above embodiments and the same technical concept, the present application embodiment also provides a WiFi communication method, such as Fig.11 As shown in , the method includes:

[0287] S1101: The second electronic device receives first information from the first electronic device; wherein the first information includes an identifier of a first WiFi channel and an address of the first electronic device.

[0288] S1102: The second electronic device sends a first public behavior frame to the second electronic device through the first WiFi channel; wherein the first public behavior frame includes the address of the first electronic device.

[0289] S1103: The second electronic device and the first electronic device perform a negotiation process for establishing a WiFi point-to-point P2P connection through the first WiFi channel.

[0290] In the above method, the specific steps executed by the second electronic device can refer to the relevant introduction in the above embodiments, which will not be described in detail here.

[0291] Based on the above embodiments and the same technical concept, the present application embodiment also provides a WiFi communication method, such as Fig.12 As shown in , the method includes:

[0292] S1201: A first electronic device sends first information to a second electronic device, wherein the first information includes an identifier of a first WiFi channel.

[0293] In some embodiments of the present application, the first information may further include an identifier of the second electronic device and a desired channel of the first electronic device.

[0294] Exemplarily, the first information may be information included in the connection request described in step S802 or step S901 in the aforementioned embodiment.

[0295] S1202: The first electronic device receives second information from the second electronic device; wherein the second information includes an identifier of the first WiFi channel.

[0296] Exemplarily, the second information may be the first indication information described in step S804 or S903 in the aforementioned embodiment.

[0297] In some embodiments of the present application, the first WiFi channel is the working channel that the first electronic device expects to use after establishing a WiFi P2P connection with the second electronic device. When the second electronic device determines to use the first WiFi channel as the channel used after the first electronic device and the second electronic device establish a WiFi P2P connection, the second electronic device can send the above-mentioned second information to the first electronic device. When the working channel determined by the second electronic device to be used after the first electronic device and the second electronic device establish a WiFi P2P connection is not the first WiFi channel, the identifier of the first WiFi channel included in the above-mentioned second information can be replaced with the identifier of the third WiFi channel, wherein the third WiFi channel is the working channel determined by the second electronic device to be used after the first electronic device and the second electronic device establish a WiFi P2P connection.

[0298] In some embodiments of the present application, the interactive information between the first electronic device and the second electronic device can be encrypted using a key. Specifically, before the first electronic device sends the first information to the second electronic device, the first electronic device and the second electronic device can negotiate and determine the first key (for example, it can be Figure 8 or Fig. 9 Based on this, when initiating a service, the first electronic device can send the first information encrypted with the first key to the second electronic device, and the second electronic device can receive the first information decrypted with the first key sent by the first electronic device, and use the first key to decrypt the information before using it. The second electronic device can send the second information encrypted with the first key to the first electronic device, and the first electronic device can receive the second information encrypted with the first key from the second electronic device, and use the first key to decrypt the information before using it.

[0299] S1203: The first electronic device establishes a WiFi connection with a soft access point of the second electronic device through the first WiFi channel in response to the second information; wherein the soft access point is a soft access point pre-negotiated by the first electronic device and the second electronic device.

[0300] Before initiating the service, the first electronic device and the second electronic device may establish a communication connection in advance, and negotiate to determine information related to the software access point of the second electronic device (for the first electronic device and the second electronic device to establish a WiFi connection) (such as SSID, etc.). Optionally, after negotiating to determine the soft access point of the second electronic device, the first electronic device and the second electronic device may disconnect. When initiating the service, the first electronic device and the second electronic device may establish a WiFi connection between the soft access point of the first electronic device and the second electronic device.

[0301] When the first electronic device and the second electronic device establish a WiFi connection, the first electronic device can connect to the soft access point of the second electronic device through the first WiFi channel using the second key and authenticate with the second electronic device; wherein the second key is: a key pre-negotiated by the first electronic device and the second electronic device, or a set key.

[0302] In the above method, the specific steps performed by the second electronic device can refer to the above embodiments. Figure 8 or Fig. 9 The relevant introduction in the method shown will not be repeated here.

[0303] Based on the above embodiments and the same technical concept, the present application embodiment also provides a WiFi communication method, such as Fig.13 As shown in , the method includes:

[0304] S1301: The second electronic device receives first information from the first electronic device; wherein the first information includes an identifier of a first WiFi channel.

[0305] S1302: The second electronic device creates a soft access point, and sends second information to the first electronic device; wherein the second information includes an identifier of the first WiFi channel.

[0306] S1303: The second electronic device establishes a WiFi connection between a soft access point and the first electronic device through the first WiFi channel; wherein the soft access point is a soft access point pre-negotiated by the first electronic device and the second electronic device.

[0307] In the above method, the specific steps performed by the second electronic device can refer to the above embodiments. Figure 8 or Fig. 9 The relevant introduction in the method shown will not be repeated here.

[0308] Based on the above embodiments and the same technical concept, the present application embodiment also provides an electronic device, which is used to implement the WiFi communication method provided in the present application embodiment. Fig.14As shown in FIG. 1 , the electronic device 1400 may include: a memory 1401, one or more processors 1402, and one or more computer programs (not shown in the figure). The above components may be coupled via one or more communication buses 1403. Optionally, the electronic device 1400 may also include a display screen 1404.

[0309] Among them, one or more computer programs (codes) are stored in the memory 1401, and the one or more computer programs include computer instructions; one or more processors 1402 call the computer instructions stored in the memory 1401, so that the electronic device 1400 executes the WiFi communication method provided in the above-mentioned embodiment of the present application.

[0310] In a specific implementation, the memory 1401 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices. The memory 1401 may store an operating system (hereinafter referred to as system), such as ANDROID, IOS, WINDOWS, or an embedded operating system such as LINUX. The memory 1401 may be used to store an implementation program of an embodiment of the present application. The memory 1401 may also store a network communication program, which may be used to communicate with one or more additional devices, one or more user devices, or one or more network devices.

[0311] The one or more processors 1402 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0312] Display screen 1404 is used to display application interface and other related user interfaces.

[0313] It should be noted that Fig.14 This is only one implementation of the electronic device 1400 provided in the embodiment of the present application. In actual applications, the electronic device 1400 may also include more or fewer components. For details, please refer to Figure 1 The specific structure and description shown are not limited here.

[0314] Based on the above embodiments and the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program runs on an electronic device, the electronic device executes the method provided in the above embodiments.

[0315] Based on the above embodiments and the same technical concept, the embodiments of the present application also provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on an electronic device, the electronic device executes the method provided in the above embodiments.

[0316] Based on the above embodiments and the same technical concept, the embodiment of the present application further provides a chip system, which includes a processor and a memory, wherein instructions are stored in the memory; when the instructions are executed by the processor, the display method provided in the above embodiments can be implemented. The chip system can be composed of a chip, or it can include a chip and other discrete devices.

[0317] The method provided in the embodiment of the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using 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 instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. Available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., digital video discs (DVDs), or semiconductor media (e.g., SSDs), etc.

[0318] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A wireless fidelity WiFi communication method, applied to a first electronic device, characterized in that: The method comprises: Sending first information to a second electronic device; wherein the first information includes an identifier of a first WiFi channel and an address of the first electronic device; Receiving a first public behavior frame sent by the second electronic device through the first WiFi channel; wherein the first public behavior frame includes an address of the first electronic device; In response to the first public behavior frame, a negotiation process for establishing a WiFi point-to-point (P2P) connection is performed with the second electronic device through the first WiFi channel.

2. The method according to claim 1, characterized in that The negotiation process includes: Authenticate with the second electronic device, and after successful authentication, send a second public behavior frame to the second electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of a WiFi channel supported by the first electronic device, an identifier of a second WiFi channel, and information indicating a P2P role of the first electronic device; Receive a third public behavior frame sent by the second electronic device through the first WiFi channel; wherein the third public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information used to indicate a P2P role of the first electronic device, information used to indicate a P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet protocol IP information of the first electronic device.

3. The method according to claim 2, characterized in that The authenticating with the second electronic device includes: Sending a fourth public behavior frame to the second electronic device through the first WiFi channel; wherein the fourth public behavior frame includes authentication information; Receive a fifth public action frame sent by the second electronic device through the first WiFi channel; wherein the fifth public action frame is used to notify that the authentication is successful.

4. The method according to claim 2 or 3, characterized in that After the authentication is successful, before sending the second public behavior frame to the second electronic device through the first WiFi channel, the method further includes: A second key is negotiated with the second electronic device via the first WiFi channel and a public behavior frame; wherein the second key is used to: encrypt information sent to the second electronic device, or decrypt information from the second electronic device.

5. The method according to any one of claims 1 to 4, characterized in that: The sending the first information to the second electronic device includes: The first information is sent to the second electronic device via a low-power Bluetooth communication method or a StarFlash low-power communication method.

6. The method according to claim 1, characterized in that The first public behavior frame also includes at least one of the following: an identifier of a WiFi channel supported by the second electronic device, an identifier of a second WiFi channel, and information indicating a P2P role of the second electronic device.

7. The method according to claim 6, characterized in that The negotiation process includes: A second public behavior frame is sent to the second electronic device via the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information indicating the P2P role of the first electronic device, information indicating the P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet Protocol IP information of the first electronic device.

8. The method according to claim 6 or 7, characterized in that Before sending the first information to the second electronic device, the method further includes: establishing a communication connection with the second electronic device; Authenticating with the second electronic device, and after successful authentication, negotiating a second key with the second electronic device; The sending the first information to the second electronic device includes: When initiating a service, sending the first information encrypted by the second key to the second electronic device; The receiving a first public behavior frame sent by the second electronic device through the first WiFi channel includes: The first public behavior frame encrypted by the second key and sent by the second electronic device through the first WiFi channel is received.

9. The method according to claim 4 or 8, characterized in that The method further comprises: After executing the negotiation process, establishing a WiFi P2P connection with the second electronic device; The step of establishing a WiFi P2P connection with the second electronic device specifically includes: Performing an authentication process and an association process with the second electronic device without performing a four-way handshake process; An encryption key of a WiFi P2P link used after establishing a WiFi P2P connection is determined according to the second key.

10. A WiFi communication method, applied to a second electronic device, characterized in that: The method comprises: Receiving first information from a first electronic device; wherein the first information includes an identifier of a first WiFi channel and an address of the first electronic device; Sending a first public behavior frame to the second electronic device through the first WiFi channel; wherein the first public behavior frame includes the address of the first electronic device; A negotiation process for establishing a WiFi point-to-point (P2P) connection is performed with the first electronic device through the first WiFi channel.

11. The method according to claim 10, characterized in that The negotiation process includes: Authenticate with the first electronic device, and after successful authentication, receive a second public behavior frame sent by the first electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of a WiFi channel supported by the first electronic device, an identifier of a second WiFi channel, and information indicating a P2P role of the first electronic device; A third public behavior frame is sent to the first electronic device through the first WiFi channel; wherein the third public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information indicating a P2P role of the first electronic device, information indicating a P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet Protocol IP information of the first electronic device.

12. The method according to claim 11, characterized in that The authenticating with the first electronic device includes: Receiving a fourth public behavior frame sent by the first electronic device through the first WiFi channel; wherein the fourth public behavior frame includes authentication information; A fifth public action frame is sent to the first electronic device through the first WiFi channel; wherein the fifth public action frame is used to notify that the authentication is successful.

13. The method according to claim 11 or 12, characterized in that After the authentication is successful, before receiving a second public behavior frame sent by the first electronic device through the first WiFi channel, the method further includes: A second key is negotiated with the first electronic device via the first WiFi channel and a public behavior frame; wherein the second key is used to: decrypt information from the first electronic device, or encrypt information sent to the first electronic device.

14. The method according to any one of claims 10 to 13, characterized in that: The receiving first information from the first electronic device includes: Receive the first information sent by the first electronic device via a low-power Bluetooth communication method or a StarFlash low-power communication method.

15. The method according to claim 10, characterized in that The first public behavior frame also includes at least one of the following: an identifier of a WiFi channel supported by the second electronic device, an identifier of a second WiFi channel, and information indicating a P2P role of the second electronic device.

16. The method according to claim 15, characterized in that The negotiation process includes: Receive a second public behavior frame sent by the first electronic device through the first WiFi channel; wherein the second public behavior frame includes at least one of the following: an identifier of the second WiFi channel, information used to indicate the P2P role of the first electronic device, information used to indicate the P2P role of the second electronic device, a first key for establishing a WiFi P2P connection, and Internet Protocol IP information of the first electronic device.

17. The method according to claim 15 or 16, characterized in that Before receiving the first information from the first electronic device, the method further includes: Establishing a communication connection with the first electronic device; Authenticating with the first electronic device, and after successful authentication, negotiating a second key with the first electronic device; The receiving first information from the first electronic device includes: receiving the first information encrypted by using the second key from the first electronic device; The sending a first public behavior frame to the first electronic device through the first WiFi channel includes: The first public behavior frame encrypted by using the second key is sent to the first electronic device through the first WiFi channel.

18. The method according to claim 13 or 17, characterized in that The method further comprises: After executing the negotiation process, establishing a WiFi P2P connection with the first electronic device; The step of establishing a WiFi P2P connection with the first electronic device specifically includes: Performing an authentication process and an association process with the first electronic device without performing a four-way handshake process; An encryption key of a WiFi P2P link used after establishing a WiFi P2P connection is determined according to the second key.

19. An electronic device, characterized in that: The electronic device includes a memory and one or more processors; The memory is used to store computer program code, which includes computer instructions; when the computer instructions are executed by the one or more processors, the electronic device executes the method as claimed in any one of claims 1 to 9, or executes the method as claimed in any one of claims 10 to 18.

20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program runs on an electronic device, the electronic device executes the method according to any one of claims 1 to 9, or executes the method according to any one of claims 10 to 18.