Method, apparatus and device for optimizing WiFi P2P connection and storage medium

CN122934553APending Publication Date: 2026-10-16GEER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510423360.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]本申请的主要目的在于提供一种WiFi P2P连接优化方法、装置、设备及存储介质,旨在解决如何减少设备间建立WiFi P2P连接的时间的技术问题

Benefits of technology

[0032] This application proposes a WiFi P2P connection optimization method, apparatus, device, and storage medium. In this WiFi P2P connection optimization method, since the first device and the second device have pre-established a Bluetooth connection, the first device can send a WiFi wake-up request to the second device via Bluetooth. After the second device responds to the WiFi wake-up request, the first device exchanges WiFi P2P connection parameters with the second device. In this way, when the first device receives a WiFi P2P connection request from the second device, it can directly and quickly establish a WiFi P2P connection with the second device based on the pre-exchanged WiFi P2P connection parameters. During the establishment of the WiFi P2P connection, there is no need to spend a lot of time on events such as channel traversal and capability information negotiation, which speeds up the WiFi P2P connection speed. This means that neither the first device nor the second device needs to keep the WiFi radio frequency on for a long time, thereby saving device power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122934553A_ABST
    Figure CN122934553A_ABST
Patent Text Reader

Abstract

The application discloses a WiFi P2P connection optimization method and device, equipment and a storage medium, and belongs to the technical field of wireless communication. The WiFi P2P connection optimization method is applied to a first device that has established a Bluetooth connection with a second device, and comprises the following steps: sending a WiFi wake-up request to the second device, and exchanging WiFi P2P connection parameters with the second device in the case that the WiFi wake-up request is responded by the second device; and establishing a WiFi P2P connection with the second device based on the WiFi P2P connection parameters in response to a WiFi P2P connection request sent by the second device. According to the application, the WiFi P2P connection parameters are exchanged in advance through the established Bluetooth connection, and information synchronization is completed before the physical layer is established, so that the time consumed for establishing the WiFi P2P connection is shortened, and the device power consumption is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless communication technology, and in particular to WiFi P2P connection optimization methods, apparatus, devices and storage media. Background Technology

[0002] WiFi P2P (Wireless Fidelity Peer-to-Peer) is a technology that establishes connections directly between devices without the need for an access point (AP), and is widely used for data transmission. Currently, the WiFi P2P standard connection process in related technologies results in long connection times and high power consumption due to the need to traverse multiple channels and perform multiple rounds of information exchange. Summary of the Invention

[0003] The main objective of this application is to provide a WiFi P2P connection optimization method, apparatus, device, and storage medium, aiming to solve the technical problem of how to reduce the time required to establish WiFi P2P connections between devices.

[0004] To achieve the above objectives, this application provides a WiFi P2P connection optimization method, which is applied to a first device that has established a Bluetooth connection with a second device, and includes:

[0005] Send a WiFi wake-up request to the second device, and if the WiFi wake-up request is responded to by the second device, exchange WiFi P2P connection parameters with the second device;

[0006] In response to the WiFi P2P connection request sent by the second device, a WiFi P2P connection is established with the second device based on the WiFi P2P connection parameters.

[0007] In one embodiment, the step of exchanging WiFi P2P connection parameters with the second device includes:

[0008] Exchange at least one of the following WiFi P2P connection parameters with the second device: device capability set, GO role preference, security credentials, and IP address allocation policy.

[0009] In one embodiment, the step of establishing a WiFi P2P connection with the second device based on the WiFi P2P connection parameters includes at least one of the following:

[0010] Determine the target channel based on the device capability set;

[0011] Complete GO negotiation based on the aforementioned GO role preferences;

[0012] Authentication and association are completed based on the security credentials;

[0013] The network layer configuration is completed based on the IP address allocation strategy.

[0014] Furthermore, to achieve the above objectives, this application also provides a WiFi P2P connection optimization method, which is applied to a second device that has established a Bluetooth connection with a first device, and includes:

[0015] In response to the WiFi wake-up request sent by the first device, exchange WiFi P2P connection parameters with the first device;

[0016] Send a WiFi P2P connection request to the first device, and if the WiFi P2P connection request is responded to by the first device, establish a WiFi P2P connection with the first device based on the WiFi P2P connection parameters.

[0017] In one embodiment, the step of exchanging WiFi P2P connection parameters with the first device includes:

[0018] Exchange at least one of the following WiFi P2P connection parameters with the first device: device capability set, GO role preference, security credentials, and IP address allocation policy.

[0019] In one embodiment, the step of establishing a WiFi P2P connection with the first device based on the WiFi P2P connection parameters includes at least one of the following:

[0020] Determine the target channel based on the device capability set;

[0021] Complete GO negotiation based on the aforementioned GO role preferences;

[0022] Authentication and association are completed based on the security credentials;

[0023] The network layer configuration is completed based on the IP address allocation strategy.

[0024] Furthermore, to achieve the above objectives, this application also provides a WiFi P2P connection optimization device, which is applied to a first device that has established a Bluetooth connection with a second device, and includes:

[0025] The first transmission module is used to send a WiFi wake-up request to the second device, and exchange WiFi P2P connection parameters with the second device when the WiFi wake-up request is responded to by the second device.

[0026] A first establishment module is configured to respond to a WiFi P2P connection request sent by the second device and establish a WiFi P2P connection with the second device based on the WiFi P2P connection parameters.

[0027] Furthermore, to achieve the above objectives, this application also provides a WiFi P2P connection optimization device, which is applied to a second device that has already established a Bluetooth connection with a first device, and includes:

[0028] The second transmission module is used to exchange WiFi P2P connection parameters with the first device in response to the WiFi wake-up request sent by the first device.

[0029] The second establishment module is used to send a WiFi P2P connection request to the first device, and when the WiFi P2P connection request is responded to by the first device, establish a WiFi P2P connection with the first device based on the WiFi P2P connection parameters.

[0030] In addition, to achieve the above objectives, this application also provides an electronic device, the electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the WiFi P2P connection optimization method as described above.

[0031] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the WiFi P2P connection optimization method as described above.

[0032] This application proposes a WiFi P2P connection optimization method, apparatus, device, and storage medium. In this WiFi P2P connection optimization method, since the first device and the second device have pre-established a Bluetooth connection, the first device can send a WiFi wake-up request to the second device via Bluetooth. After the second device responds to the WiFi wake-up request, the first device exchanges WiFi P2P connection parameters with the second device. In this way, when the first device receives a WiFi P2P connection request from the second device, it can directly and quickly establish a WiFi P2P connection with the second device based on the pre-exchanged WiFi P2P connection parameters. During the establishment of the WiFi P2P connection, there is no need to spend a lot of time on events such as channel traversal and capability information negotiation, which speeds up the WiFi P2P connection speed. This means that neither the first device nor the second device needs to keep the WiFi radio frequency on for a long time, thereby saving device power consumption. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only a part of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 A flowchart illustrating a WiFi P2P connection optimization method provided in an embodiment of this application;

[0035] Figure 2 This is a schematic diagram illustrating an application environment for an example of a WiFi P2P connection optimization method provided in this application embodiment;

[0036] Figure 3 This is a schematic diagram of the structure of a WiFi P2P connection optimization device provided in an embodiment of this application;

[0037] Figure 4 A flowchart illustrating another WiFi P2P connection optimization method provided in this application embodiment;

[0038] Figure 5 A schematic diagram of another WiFi P2P connection optimization device provided in this application embodiment;

[0039] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that the embodiments of this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the embodiments of this application with unnecessary detail.

[0041] In related technologies, the standard connection process for establishing a WiFi P2P (such as WiFi Direct) connection between devices includes the following stages:

[0042] 1. Regular Scan Phase: This phase can be divided into a scan phase and a find phase. During the scan phase, the device scans all working WiFi signals, including channels 1 to 13 of the 2.4GHz band and channels 36 to 165 of the 5GHz band, a total of 36 channels. This process takes approximately 2 seconds. After the scan phase, the device enters the find phase and alternates between search and listen states. If at a certain moment one device that needs to establish a WiFi P2P connection is in the search state while another device is in the listen state, the devices complete mutual discovery and end the regular scan phase. This process takes 0.1 to 120 seconds (actually measured to be approximately several seconds).

[0043] 2. GO (Group Owner) Negotiation Phase: Both devices exchange their respective GO intent (intnet) parameters (requiring three frame exchanges: request, response, and confirmation). By comparing their respective GO intent parameters, they negotiate and determine the GO (Group Owner) and GC (Group Client) in the WiFi P2P connection. This process takes several seconds.

[0044] 3. EAP (Extensible Authentication Protocol) authentication phase: The EAP phase mainly verifies the identity of the peer device through a four-way handshake protocol. This process takes several seconds and has a certain probability of failure.

[0045] 4. Dynamic IP Address Allocation Phase: After the WiFi P2P connection is established between devices, GO allocates a dynamic IP address to GC according to the DHCP (Dynamic Host Configuration Protocol) so that the devices can communicate with each other based on the IP address. This process takes 0.5 to 2 seconds.

[0046] Obviously, the process of establishing a WiFi P2P connection using the solutions provided by related technologies is cumbersome, time-consuming, and consumes a lot of power. It also results in a poor user experience in latency-sensitive scenarios. In some scenarios, the entire process needs to be repeated, and historical connection parameters cannot be reused.

[0047] Based on this, embodiments of this application provide a WiFi P2P connection optimization method, apparatus, device, and storage medium. By pre-establishing a Bluetooth connection between a first device and a second device, when a WiFi P2P connection needs to be established, the first device can send a WiFi wake-up request to the second device via Bluetooth. After the second device responds to the WiFi wake-up request, the first device exchanges WiFi P2P connection parameters with the second device. In this way, when the first device receives a WiFi P2P connection request from the second device, it can directly and quickly establish a WiFi P2P connection with the second device based on the pre-exchanged WiFi P2P connection parameters. This reduces the probability of channel collisions in multi-device competition scenarios. During the WiFi P2P connection establishment process, there is no need to spend a lot of time on events such as channel traversal and capability information negotiation, which speeds up the WiFi P2P connection speed. This means that neither the first nor the second device needs to keep the WiFi radio frequency on for a long time, thereby saving device power consumption.

[0048] The WiFi P2P connection optimization method, apparatus, device, and storage medium provided in this application are specifically described through the following embodiments. First, the WiFi P2P connection optimization method in this application embodiment is described.

[0049] This application provides a WiFi P2P connection optimization method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating a WiFi P2P connection optimization method provided in an embodiment of this application. This WiFi P2P connection optimization method can be applied to electronic devices. The electronic device can be a first device that has already established a Bluetooth connection with a second device. The first device can be a smartphone, tablet, or other mobile terminal device. The second device can be AI glasses, etc. Figure 1 As shown, the WiFi P2P connection optimization method provided in this embodiment includes steps S10 to S20.

[0050] Step S10: Send a WiFi wake-up request to the second device. If the WiFi wake-up request is responded to by the second device, exchange WiFi P2P connection parameters with the second device.

[0051] It should be noted that, in order to avoid unnecessary power consumption, in this embodiment, the WiFi radio frequency function of the first device and the second device is turned off by default. When a WiFi P2P connection needs to be established, the first device will turn on its own WiFi radio frequency function and wake up the WiFi radio frequency function of the second device through Bluetooth. This allows the first device and the second device to exchange WiFi P2P connection parameters in advance through Bluetooth before establishing a WiFi P2P connection. This completes the necessary steps in the standard connection process, such as capability information exchange, capability information negotiation, and parameter setting, in advance, so as to facilitate the rapid establishment of the subsequent WiFi P2P connection.

[0052] As an example, refer to Figure 2 , Figure 2 This illustration shows an example application environment diagram of the WiFi P2P connection optimization method provided in this application embodiment. The application environment includes a first device 01 and a second device 02. Both the first device 01 and the second device 02 are electronic devices configured with Bluetooth / WiFi dual-mode chips, and can be smartphones, tablets, smart TVs, wearable devices, or personal portable computers, etc. Figure 2 In this embodiment, the first device 01 is a smartphone and the second device 02 is AI glasses, as an example. Both the first device 01 and the second device 02 have a specific application installed. This application is used for data transmission via WiFi P2P connection. The transmitted data may include images, files, videos, audio, or other applications. In this embodiment, when data transmission between the first device 01 and the second device 02 via WiFi P2P connection is required, the user opens the specific application on both devices and selects to wake up the WiFi of the second device 02 in the application interface displayed on the first device 01. The first device 01 then sends a WiFi wake-up request to the second device 02 via Bluetooth. After the second device 02 responds to the WiFi wake-up request and wakes up its own WiFi, the first device 01 and the second device 02 can exchange WiFi P2P connection parameters via Bluetooth before establishing a true WiFi P2P connection.

[0053] In some feasible embodiments, the step of exchanging WiFi P2P connection parameters with the second device in step S10 above may specifically include:

[0054] Step S101: Exchange at least one of the following WiFi P2P connection parameters with the second device: device capability set, GO role preference, security credentials, and IP address allocation policy.

[0055] It is understood that in this embodiment, as long as the first device and the second device have pre-exchanged WiFi P2P connection parameters, the time spent establishing a WiFi P2P connection can be reduced. The more WiFi P2P connection parameters are pre-exchanged, the more time is reduced.

[0056] In this embodiment, the device capability set refers to device identifiers (such as MAC address, device name, etc.) and WiFi radio frequency capabilities (such as supported channels, frequency bands, MIMO configurations, etc.); GO role preferences include whether the current device is acting as a group server or a group client, whether the group server transmits data to the group client, or whether the group client independently obtains data from the group server; security credentials may include a pre-shared key (PSK) or a public key certificate; IP address allocation strategies may include using predefined static addresses or DHCP caching for IP allocation.

[0057] Step S20: In response to the WiFi P2P connection request sent by the second device, establish a WiFi P2P connection with the second device based on the WiFi P2P connection parameters.

[0058] In this embodiment, after the first device and the second device exchange WiFi P2P connection parameters via Bluetooth, the first device and the second device meet the conditions for quickly establishing a WiFi P2P connection. When the second device needs to obtain data from the first device, the second device will actively send a WiFi P2P connection request to the first device. After receiving the WiFi P2P connection request, the first device will respond to the WiFi P2P connection request and quickly establish a WiFi P2P connection with the second device based on the pre-exchanged WiFi P2P connection parameters. After the connection is established, the first device will transmit the data required by the second device to the second device. After the data transmission is completed, both the first device and the second device will turn off their own WiFi to save device power consumption.

[0059] In some feasible embodiments, the step of establishing a WiFi P2P connection with the second device based on WiFi P2P connection parameters in step S20 above may include at least one of the following:

[0060] Step S201: Determine the target channel based on the device capability set;

[0061] Step S202: Complete GO negotiation based on GO role preferences;

[0062] Step S203: Complete authentication and association based on security credentials;

[0063] Step S204: Complete the network layer configuration based on the IP address allocation policy.

[0064] It is understood that in this embodiment, the first device and the second device will optimize the standard connection process based on the WiFi P2P connection parameters exchanged via Bluetooth in the aforementioned steps. Specifically, if the WiFi P2P connection parameters exchanged via Bluetooth include a set of device capabilities, the first device and the second device can skip the channel scanning process and directly determine the agreed target channel. If the WiFi P2P connection parameters exchanged via Bluetooth include GO role preferences, the first device and the second device can skip the GO negotiation process and directly specify the group server and group client based on the agreed role preferences. If the WiFi P2P connection parameters exchanged via Bluetooth include security credentials, the first device and the second device can reuse the pre-shared key to skip the four-way handshake. If the WiFi P2P connection parameters exchanged via Bluetooth include an IP address allocation policy, the first device and the second device can directly complete the network layer configuration based on the agreed IP address allocation policy. As long as any one of the above process optimizations is met, the total time for establishing a WiFi P2P connection can be shortened. If all of them are met, the total time can be significantly shortened, for example, from the usual 15-30 seconds to 2-5 seconds.

[0065] Furthermore, although this embodiment specifies that the first device and the second device are pre-paired and connected via Bluetooth and exchange WiFi P2P connection parameters based on the Bluetooth connection, in practical applications, Bluetooth can also be replaced with other non-WiFi P2P connection methods, such as NFC (Near Field Communication), ZigBee, Z-Wave, Thread, UWB (Ultra-Wideband), etc., as long as it is a communication connection method that can support the first device and the second device to exchange WiFi P2P connection parameters in advance when establishing a WiFi P2P connection. This embodiment will not elaborate further on this.

[0066] This embodiment provides a WiFi P2P connection optimization method. By pre-establishing a Bluetooth connection between a first device and a second device, when a WiFi P2P connection needs to be established, the first device can send a WiFi wake-up request to the second device via Bluetooth. After the second device responds to the WiFi wake-up request, the first device exchanges WiFi P2P connection parameters with the second device. In this way, when the first device receives a WiFi P2P connection request from the second device, it can directly and quickly establish a WiFi P2P connection with the second device based on the pre-exchanged WiFi P2P connection parameters. This reduces the probability of channel collisions in multi-device contention scenarios. During the WiFi P2P connection establishment process, there is no need to spend a lot of time on events such as channel traversal and capability information negotiation, which speeds up the WiFi P2P connection speed. This means that neither the first nor the second device needs to keep the WiFi radio frequency on for a long time, thereby saving device power consumption.

[0067] Furthermore, this application also proposes a WiFi P2P connection optimization device, referring to... Figure 3 , Figure 3 This is a schematic diagram of the structure of a WiFi P2P connection optimization device provided in an embodiment of this application, as shown below. Figure 3 As shown, in this embodiment, the WiFi P2P connection optimization device is applied to a first device that has established a Bluetooth connection with a second device, and includes: a first transmission module 10 and a first establishment module 20.

[0068] The first transmission module 10 is used to send a WiFi wake-up request to the second device, and exchange WiFi P2P connection parameters with the second device when the WiFi wake-up request is responded to by the second device.

[0069] The first establishment module 20 is used to respond to the WiFi P2P connection request sent by the second device and establish a WiFi P2P connection with the second device based on the WiFi P2P connection parameters.

[0070] In some feasible embodiments, the first transmission module 10 is also used to exchange at least one of the following WiFi P2P connection parameters with the second device: device capability set, GO role preference, security credentials, and IP address allocation policy.

[0071] In some feasible embodiments, the first establishment module 20 is also used to determine the target channel based on the device capability set; complete GO negotiation based on GO role preferences; complete authentication and association based on security credentials; and complete network layer configuration based on IP address allocation policy.

[0072] The WiFi P2P connection optimization device provided in this embodiment belongs to the same technical concept as the WiFi P2P connection optimization method for a first device that has established a Bluetooth connection with a second device provided in the above embodiment. Technical details not described in detail in this embodiment can be found in any of the above embodiments. Furthermore, this embodiment has the same beneficial effects as performing the WiFi P2P connection optimization method described above.

[0073] Furthermore, this application also provides a WiFi P2P connection optimization method, referring to... Figure 4 , Figure 4 This is a flowchart illustrating another WiFi P2P connection optimization method provided in an embodiment of this application. This WiFi P2P connection optimization method can be applied to an electronic device, which can be a second device that has already established a Bluetooth connection with a first device, such as... Figure 4 As shown, the WiFi P2P connection optimization method provided in this embodiment includes steps S11 to S21.

[0074] Step S11: In response to the WiFi wake-up request sent by the first device, exchange WiFi P2P connection parameters with the first device;

[0075] Step S21: Send a WiFi P2P connection request to the first device. If the WiFi P2P connection request is responded to by the first device, establish a WiFi P2P connection with the first device based on the WiFi P2P connection parameters.

[0076] In some feasible embodiments, the step of exchanging WiFi P2P connection parameters with the first device in step S11 above may specifically include:

[0077] Step S111: Exchange at least one of the following WiFi P2P connection parameters with the first device: device capability set, GO role preference, security credentials, and IP address allocation policy.

[0078] In some feasible embodiments, the step of establishing a WiFi P2P connection with the first device based on WiFi P2P connection parameters in step S21 above includes at least one of the following:

[0079] Step S211: Determine the target channel based on the device capability set;

[0080] Step S212: Complete GO negotiation based on GO role preferences;

[0081] Step S213: Complete authentication and association based on security credentials;

[0082] Step S214: Complete the network layer configuration based on the IP address allocation policy.

[0083] The WiFi P2P connection optimization method for a second device that has established a Bluetooth connection with a first device provided in this embodiment belongs to the same technical concept as the WiFi P2P connection optimization method for a first device that has established a Bluetooth connection with a second device provided in the above embodiments. Technical details not described in detail in this embodiment can be found in any of the above embodiments, and this embodiment has the same beneficial effects as performing the above WiFi P2P connection optimization method.

[0084] Furthermore, this application also proposes a WiFi P2P connection optimization device, referring to... Figure 5 , Figure 5 This is a schematic diagram of another WiFi P2P connection optimization device provided in an embodiment of this application, as shown below. Figure 5 As shown, in this embodiment, the WiFi P2P connection optimization device is applied to a second device that has established a Bluetooth connection with the first device, and includes: a second transmission module 11 and a second establishment module 21.

[0085] The second transmission module 11 is used to respond to the WiFi wake-up request sent by the first device and exchange WiFi P2P connection parameters with the first device;

[0086] The second establishment module 21 is used to send a WiFi P2P connection request to the first device, and when the WiFi P2P connection request is responded to by the first device, establish a WiFi P2P connection with the first device based on the WiFi P2P connection parameters.

[0087] In some feasible embodiments, the second transmission module 11 is also used to exchange at least one of the following WiFi P2P connection parameters with the first device: device capability set, GO role preference, security credentials, and IP address allocation policy.

[0088] In some feasible embodiments, the second establishment module 21 is also used to determine the target channel based on the device capability set; complete GO negotiation based on GO role preferences; complete authentication and association based on security credentials; and complete network layer configuration based on IP address allocation policy.

[0089] The WiFi P2P connection optimization device provided in this embodiment belongs to the same technical concept as the WiFi P2P connection optimization method for a second device that has established a Bluetooth connection with the first device provided in the above embodiment. Technical details not described in detail in this embodiment can be found in any of the above embodiments. Furthermore, this embodiment has the same beneficial effects as performing the WiFi P2P connection optimization method described above.

[0090] Furthermore, embodiments of this application also provide an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the WiFi P2P connection optimization method in any of the above embodiments.

[0091] As an example, in this embodiment, the electronic device is equipped with a Bluetooth / WiFi dual-mode chip.

[0092] The following is for reference. Figure 6 The diagram illustrates a structural schematic of an electronic device suitable for implementing the embodiments of this application. The electronic devices in the embodiments of this application may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0093] like Figure 6As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. The communication device 1009 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.

[0094] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0095] The beneficial effects of the electronic device provided in this application are the same as those of the WiFi P2P connection optimization method provided in the above embodiments, and other technical features of the electronic device are the same as those disclosed in the method of the previous embodiment, which will not be repeated here.

[0096] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0097] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0098] Furthermore, embodiments of this application also provide a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the WiFi P2P connection optimization method provided in any of the above embodiments.

[0099] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0100] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0101] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by an electronic device, enable the electronic device to implement the aforementioned WiFi P2P connection optimization method.

[0102] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0103] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0104] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0105] The readable storage medium provided in this embodiment is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer program) for executing the WiFi P2P connection optimization method described above. The beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the WiFi P2P connection optimization method provided in the above embodiment, and will not be repeated here.

[0106] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the WiFi P2P connection optimization method provided in any of the above embodiments.

[0107] The computer program product provided in this embodiment belongs to the same technical concept as the WiFi P2P connection optimization method proposed in the above embodiment. Compared with related technologies, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the WiFi P2P connection optimization method provided in the above embodiment, and will not be repeated here.

[0108] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown in the flowchart. The terms "first," "second," etc., in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0109] It should also be understood that references to "one embodiment" or "some embodiments" in the specification of embodiments of this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0110] The above describes some implementation methods of the embodiments of this application. However, the embodiments of this application are not limited to the above implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the embodiments of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of the embodiments of this application.

Claims

1. A WiFi P2P connection optimization method, characterized in that, The WiFi P2P connection optimization method is applied to a first device that has already established a Bluetooth connection with a second device, including: Send a WiFi wake-up request to the second device, and if the WiFi wake-up request is responded to by the second device, exchange WiFi P2P connection parameters with the second device; In response to the WiFi P2P connection request sent by the second device, a WiFi P2P connection is established with the second device based on the WiFi P2P connection parameters.

2. The WiFi P2P connection optimization method as described in claim 1, characterized in that, The step of exchanging WiFi P2P connection parameters with the second device includes: Exchange at least one of the following WiFi P2P connection parameters with the second device: device capability set, GO role preference, security credentials, and IP address allocation policy.

3. The WiFi P2P connection optimization method as described in claim 2, characterized in that, The step of establishing a WiFi P2P connection with the second device based on the WiFi P2P connection parameters includes at least one of the following: Determine the target channel based on the device capability set; Complete GO negotiation based on the aforementioned GO role preferences; Authentication and association are completed based on the security credentials; The network layer configuration is completed based on the IP address allocation strategy.

4. A WiFi P2P connection optimization method, characterized in that, The WiFi P2P connection optimization method is applied to a second device that has already established a Bluetooth connection with the first device, including: In response to the WiFi wake-up request sent by the first device, exchange WiFi P2P connection parameters with the first device; Send a WiFi P2P connection request to the first device, and if the WiFi P2P connection request is responded to by the first device, establish a WiFi P2P connection with the first device based on the WiFi P2P connection parameters.

5. The WiFi P2P connection optimization method as described in claim 4, characterized in that, The step of exchanging WiFi P2P connection parameters with the first device includes: Exchange at least one of the following WiFi P2P connection parameters with the first device: device capability set, GO role preference, security credentials, and IP address allocation policy.

6. The WiFi P2P connection optimization method as described in claim 5, characterized in that, The step of establishing a WiFi P2P connection with the first device based on the WiFi P2P connection parameters includes at least one of the following: Determine the target channel based on the device capability set; Complete GO negotiation based on the aforementioned GO role preferences; Authentication and association are completed based on the security credentials; The network layer configuration is completed based on the IP address allocation strategy.

7. A WiFi P2P connection optimization device, characterized in that, The WiFi P2P connection optimization device is applied to a first device that has already established a Bluetooth connection with a second device, and includes: The first transmission module is used to send a WiFi wake-up request to the second device, and exchange WiFi P2P connection parameters with the second device when the WiFi wake-up request is responded to by the second device. A first establishment module is configured to respond to a WiFi P2P connection request sent by the second device and establish a WiFi P2P connection with the second device based on the WiFi P2P connection parameters.

8. A WiFi P2P connection optimization device, characterized in that, The WiFi P2P connection optimization device is applied to a second device that has already established a Bluetooth connection with the first device, and includes: The second transmission module is used to exchange WiFi P2P connection parameters with the first device in response to the WiFi wake-up request sent by the first device. The second establishment module is used to send a WiFi P2P connection request to the first device, and when the WiFi P2P connection request is responded to by the first device, establish a WiFi P2P connection with the first device based on the WiFi P2P connection parameters.

9. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the WiFi P2P connection optimization method as described in any one of claims 1 to 3, or to implement the WiFi P2P connection optimization method as described in any one of claims 4 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the WiFi P2P connection optimization method as described in any one of claims 1 to 3, or implements the WiFi P2P connection optimization method as described in any one of claims 4 to 6.