Network connection method, electronic device and readable storage medium

By establishing a WiFi network connection between the STA interface of the electronic device and the AP device in one frequency band, and using the P2P interface to establish a second network connection in another frequency band, the problem of the inability of electronic devices to achieve multi-link connection in the existing technology is solved, and the problem is improved. It improves the throughput and stability of data transmission and is suitable for a variety of application scenarios.

WO2024193086A1PCT designated stage expired Publication Date: 2024-09-26HONOR DEVICE CO LTD

Patent Information

Application Number
PCT/CN2023/134459
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-21
Filing Date
2023-11-27
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

Existing electronic devices only support one STA interface and cannot establish multiple link connections with AP devices, which limits the throughput and stability of data transmission.

Method used

By establishing a WiFi network connection between the STA interface of the electronic device and the AP device in one frequency band, the P2P interface is used to establish a second network connection in another frequency band to achieve multi-link connections and dynamically switch when needed to avoid resource waste.

Benefits of technology

It achieves higher data transmission throughput and stability, and is suitable for application scenarios that require low latency and high throughput, such as games and video calls, improving the real-time and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023134459_26092024_PF_FP
    Figure CN2023134459_26092024_PF_FP
Patent Text Reader

Abstract

The present application belongs to the technical field of terminals. Disclosed are a network connection method, an electronic device and a readable storage medium. The method comprises: starting a first application, wherein the first application is an application in an electronic device; and during the process of data interaction between the first application and an AP device, performing data transmission with the AP device by means of a first network connection and / or a second network connection, wherein the first network connection is a wireless fidelity (WiFi) network connection that is established with the AP device in a first frequency band by means of an STA interface, the second network connection is a WiFi network connection that is established with the AP device in a second frequency band by means of a P2P interface, and the second frequency band is different from the first frequency band. In the present application, when a WiFi network connection is established with an AP device in a frequency band by means of an STA interface, a WiFi network connection can also be established with the AP device in another frequency band by means of a P2P interface, thereby realizing multi-link connection.
Need to check novelty before this filing date? Find Prior Art

Description

Network connection method, electronic device and readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 21, 2023, with application number 202310304073.9 and application name “Network connection method, electronic device and readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a network connection method, an electronic device, and a readable storage medium. Background Art

[0003] Wireless fidelity (WiFi) technology has matured. WiFi operates in multiple frequency bands, including 2.4G, 5G, and 6G, and supports multi-link communication. With the advancement of terminal technology, access points (APs) supporting multi-link technology have become increasingly popular. Electronic devices typically establish WiFi connections with APs through station (STA) interfaces.

[0004] In some scenarios, to achieve higher throughput, more stable data transmission, and shorter transmission times, it is necessary to establish multiple links between an electronic device and the AP. However, since most electronic devices only support one STA interface and not two or more, they can usually only establish one link with the AP and cannot achieve multi-link connections.

[0005] Summary of the Invention

[0006] This application provides a network connection method, an electronic device, and a readable storage medium, which can solve the problem in related technologies that electronic devices cannot establish multi-link connections with AP devices. The technical solution is as follows:

[0007] In a first aspect, a network connection method is provided, which is applied to an electronic device, and the method includes:

[0008] A first application is started, where the first application is an application in the electronic device;

[0009] During data interaction between the first application and the AP device, data is transmitted with the access point AP device through the first network connection and / or the second network connection. The first network connection is a wireless fidelity WiFi network connection established with the AP device in the first frequency band through the site STA interface of the electronic device, and the second network connection is a WiFi network connection established with the AP device in the second frequency band through the point-to-point P2P interface of the electronic device, and the second frequency band is different from the first frequency band.

[0010] In this way, when the electronic device establishes a WiFi network connection with the AP device through the STA interface in one frequency band, it can also establish a WiFi network connection with the AP device in another frequency band through the P2P interface, thereby realizing a multi-link connection between the electronic device and the AP device.

[0011] As an example of the present application, the first network connection is established before the first application is started; and the method further includes:

[0012] After the first application is started or when the first application is triggered to interact with the AP device, the electronic device establishes the second network connection with the AP device in the second frequency band through the P2P interface.

[0013] In this way, after the first application is started or triggered to interact with the AP device, the electronic device establishes a second network connection with the AP device through the P2P interface, that is, it will be established only when needed. While realizing multi-link connection, it can also avoid occupying air interface resources, thereby avoiding resource waste.

[0014] As an example of the present application, the electronic device includes a scanning module and a result storage module, and the P2P interface includes a first interface, and the first interface is used to transmit data related to the second network connection;

[0015] After the first application is started or when the first application is triggered to interact with the AP device, the electronic device establishes the second network connection with the AP device in the second frequency band through the P2P interface, including:

[0016] After the first application is started or when the first application is triggered to interact with the AP device, the first application triggers the scanning module to scan for WiFi signals and obtain a scanning result;

[0017] The scanning module stores the scanning result in the result storage module;

[0018] The first application reads the scan result from the result storage module and parses the scan result to obtain network connection parameters of the second frequency band;

[0019] The first application sends a first connection instruction to the P2P interface through the first interface, where the first connection instruction carries the network connection parameters;

[0020] In response to the first connection instruction, the P2P interface establishes the second network connection with the AP device in the second frequency band according to the network connection parameters.

[0021] In this way, the first application triggers the scanning module to scan for WiFi signals and obtains network connection parameters for connecting to the second frequency band based on the scan results. The first application then calls the first interface provided by the P2P interface to send the network connection parameters to the P2P interface, so that the second network connection can be established with the AP device in the second frequency band through the P2P interface.

[0022] As an example of the present application, the P2P interface includes an instruction receiving module, a service module, a P2P connection management module, an interface conversion module and a network configuration module;

[0023] The step of establishing, in response to the first connection instruction, the second network connection between the P2P interface and the AP device in the second frequency band according to the network connection parameters includes:

[0024] After receiving the first connection instruction through the first interface, the instruction receiving module sends the network connection parameters to the service module;

[0025] The service module sends the network connection parameters to the P2P connection management module through a second interface, where the second interface is used for the service module to transmit data related to the second network connection to the P2P connection management module;

[0026] The P2P connection management module sends the network connection parameters to the interface conversion module;

[0027] The interface conversion module performs interface conversion on the network connection parameters and sends the converted network connection parameters to the network configuration module;

[0028] The network configuration module establishes the second network connection with the AP device in the second frequency band based on the converted network connection parameters.

[0029] In this way, by establishing a data transmission channel among the instruction receiving module, the service module, the P2P connection management module, the interface conversion module and the network configuration module, a second network connection is established between the P2P interface and the AP device.

[0030] As an example of the present application, the method further includes:

[0031] The electronic device receives a P2P connection operation;

[0032] In response to the P2P connection operation, the electronic device monitors a probe request frame through the P2P interface, where the probe request frame refers to a probe request frame broadcast by other P2P devices;

[0033] After receiving the probe request frame through the P2P interface, the electronic device sends a probe response frame to the other P2P device through the P2P interface;

[0034] When a P2P connection request sent by the other P2P device is received through the P2P interface, the electronic device disconnects the second network connection established with the AP device through the P2P interface in the second frequency band;

[0035] The electronic device establishes a P2P connection with the other P2P device through the P2P interface.

[0036] In this way, when the electronic device establishes a second network connection with the AP device, if it receives a P2P connection operation, it will enable the listening function for the probe request frame and reply with a probe response frame on the AP channel. This ensures that it can still be discovered by other P2P devices while connected to the AP device. When other P2P devices scan the electronic device, the P2P interface disconnects from the AP device and returns to the P2P connection process, thus avoiding the problem of P2P function being unavailable due to connection to the AP device.

[0037] As an example of the present application, the method further includes:

[0038] In the case of receiving a P2P connection request sent by the other P2P device through the P2P interface, if the first application transmits data between the AP device and the P2P interface, the electronic device sends a transmission switching instruction to the first application before disconnecting the second network connection, and the transmission switching instruction is used to indicate that the second network connection cannot be used for data transmission.

[0039] In this way, when data is transmitted with an AP device through a P2P interface, if the electronic device receives a P2P connection request sent by another P2P device, it sends a data transmission instruction to the first application before disconnecting the second network connection to instruct the first application to switch the network, thereby improving the stability of data transmission.

[0040] As an example of the present application, when receiving a P2P connection request sent by the other P2P device through the P2P interface, the electronic device disconnecting the second network connection established with the AP device through the P2P interface in the second frequency band includes:

[0041] When a P2P connection request sent by the other P2P device is received through the P2P interface, the electronic device sends a disconnection request to the AP device through the P2P interface;

[0042] After receiving the disconnection response sent by the AP device, the electronic device disconnects the second network connection established with the AP device in the second frequency band through the P2P interface, and the disconnection response is sent after receiving the disconnection request.

[0043] In this way, when a P2P connection request is received from another P2P device through the P2P interface, a disconnection request is sent to the AP device through the P2P interface to disconnect the second network connection, thereby facilitating the establishment of a P2P connection with other P2P devices through the P2P interface.

[0044] As an example of the present application, the P2P interface includes an instruction receiving module, a service module, a P2P connection management module, an interface conversion module and a network configuration module;

[0045] During the process of data interaction between the first application and the AP device, the data transmission with the access point AP device through the first network connection and / or the second network connection includes:

[0046] During data interaction between the first application and the AP device, when data transmission is selected through the second network connection, the first application calls a first interface to send data to be transmitted to the instruction receiving module through the first interface, where the first interface is used to transmit data related to the second network connection;

[0047] The instruction receiving module receives the data through the first interface and sends the data to the service module;

[0048] The service module sends the data to the P2P connection management module through a second interface, where the second interface is used for the service module to transmit data related to the second network connection to the P2P connection management module;

[0049] The P2P connection management module sends the data to the interface conversion module;

[0050] The interface conversion module performs interface conversion on the data and sends the converted data to the network configuration module;

[0051] The network configuration module sends the data to the AP device through the second network connection.

[0052] In this way, by establishing a data transmission channel between each module, the data to be transmitted can be transmitted through the data channel after the second network connection is successfully established, that is, data interaction with the AP device is achieved through the P2P interface.

[0053] As an example of the present application, the method further includes:

[0054] When the first application is closed, the electronic device disconnects the second network connection established with the AP device in the second frequency band through the P2P interface.

[0055] In this way, when the first application is closed, the second network connection established between the P2P interface and the AP device is disconnected, thereby releasing the air interface resources of the second frequency band, saving resources and avoiding resource waste.

[0056] In a second aspect, a network connection device is provided, which has the function of implementing the network connection method described in the first aspect. The network connection device includes at least one module, which is used to implement the network connection method described in the first aspect.

[0057] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the network connection method described in the first aspect when executing the computer program.

[0058] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the network connection method described in the first aspect.

[0059] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the network connection method described in the first aspect.

[0060] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] FIG1 is a schematic diagram showing a multi-link connection according to an exemplary embodiment;

[0062] FIG2 is a schematic diagram showing a method of establishing a WiFi network connection between an electronic device and an AP device according to an exemplary embodiment;

[0063] FIG3 is a schematic diagram showing a second network connection established between an electronic device and an AP device according to an exemplary embodiment;

[0064] FIG4 is a schematic diagram showing a second network connection established between an electronic device and an AP device according to another exemplary embodiment;

[0065] FIG5 is a schematic diagram showing establishment of a second network connection between an electronic device and an AP device according to another exemplary embodiment;

[0066] FIG6 is a schematic diagram showing a second network connection established between an electronic device and an AP device according to another exemplary embodiment;

[0067] FIG7 is a schematic diagram showing a software system of an electronic device according to an exemplary embodiment;

[0068] FIG8 is a schematic diagram showing a process of a network connection method according to an exemplary embodiment;

[0069] FIG9 is a schematic diagram showing data transmission between an electronic device and an AP device according to an exemplary embodiment;

[0070] FIG10 is a schematic diagram showing a flow chart of data transmission between an electronic device and an AP device according to an exemplary embodiment;

[0071] FIG11 is a schematic diagram showing a process of a network connection method according to another exemplary embodiment;

[0072] Fig. 12 is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0073] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0074] It should be understood that the “multiple” mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, words such as “first” and “second” are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not necessarily limit them to be different.

[0075] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in 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 "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0076] Currently, WiFi is gradually able to support more data streams and can use multiple frequency bands for data transmission simultaneously. For example, WiFi7 can use the 2.4GHz, 5GHz, and 6GHz frequency bands simultaneously. More and more electronic devices support the WiFi7 protocol, and AP devices that support WiFi7 multi-link technology are becoming increasingly popular. For WiFi7 technology, a multi-link device (MLD) is defined, which can simultaneously establish multiple wireless data links with an AP device. As shown in Figure 1, different STA interfaces can establish links including 2.4GHz, 5GHz, and 6GHz with the same AP device, thereby supporting multi-link communication. However, the systems (such as Android or Linux) and WiFi drivers of most electronic devices only support one STA interface, do not support two or more STA interfaces, and do not support MLD, resulting in these electronic devices and AP devices being able to establish a WiFi network connection in only one frequency band. For example, as shown in Figure 2 (a), the electronic device can only establish a WiFi network connection with the AP device in the 2.4GHz frequency band, or as shown in Figure 2 (b), the electronic device can only establish a WiFi network connection with the AP device in the 5GHz frequency band, that is, multi-link communication cannot be achieved. To this end, an embodiment of the present application provides a network connection method, which can establish a network connection with the AP device in one frequency band through the STA interface while also establishing a network connection with the AP device in another frequency band through the P2P interface, thereby achieving multi-link communication.

[0077] Before introducing the network connection method provided by the embodiment of the present application in detail, the application scenarios involved in the embodiment of the present application are introduced below. In some application scenarios, such as gaming, downloading data, real-time calls, etc., it is necessary to simultaneously establish multiple WiFi network connections of different frequency bands between the electronic device and the AP device to obtain higher throughput, more stable data transmission, and shorter transmission delay. As an example, the embodiment of the present application lists the following exemplary application scenarios:

[0078] As an example, after the electronic device is turned on, the user triggers the electronic device to connect to the AP device. At this time, the electronic device establishes a WiFi network connection (hereinafter referred to as the first network connection) between the AP device and the STA interface in a frequency band (hereinafter referred to as the first frequency band), where the first frequency band is related to the WiFi network name selected by the user, for example, the first network connection is established in the 2.4GHz frequency band. After an application in the electronic device is started or triggered to interact with the AP device for data, the electronic device establishes a WiFi network connection (hereinafter referred to as the second network connection) with the AP device in another frequency band (hereinafter referred to as the second frequency band) through the P2P interface. For example, the following exemplary application scenarios are included:

[0079] In one example, please refer to Figure 3, which is a schematic diagram of an application scenario according to an exemplary embodiment. A game application is installed in an electronic device. Before the game application is started, the electronic device only establishes a first network connection with the AP device in the 2.4GHz frequency band through the STA interface. After the user triggers the electronic device to start the game application, the game application triggers the electronic device to establish a second network connection with the AP device in the 5GHz frequency band through the P2P interface. In this way, please refer to Figure 4, a dual-link connection is established between the electronic device and the AP device, that is, a first network connection link1 is established on the 2.4GH frequency band through the STA interface, and a second network connection link2 is established on the 5GHz frequency band, so that the game application can transmit data through any one network connection during operation, or transmit data through two network connections at the same time. That is, in the game scenario, due to the high latency requirement, after the game application is started, the electronic device can be triggered to establish a network connection with the AP device through the P2P interface, thereby realizing dual-link communication.

[0080] In another example, please refer to Figure 5, which is a schematic diagram of an application scenario according to another exemplary embodiment. Before a video call is made through an instant messaging application (such as WeChat™), the electronic device only establishes a first network connection with the AP device in the 2.4GHz frequency band through the STA interface. When the user triggers the electronic device to initiate a video call through the instant messaging application, the instant messaging application triggers the electronic device to establish a second network connection with the AP device in the 5GHz frequency band through the P2P interface. In this way, during the video call, the instant messaging application can select at least one WiFi network connection for transmitting data from the first network connection and the second network connection as needed, thereby ensuring stable data transmission and improving the real-time performance of the transmission.

[0081] Of course, it should be noted that the application scenario shown in Figure 5 is only exemplary. In another example, after starting the instant messaging application, the electronic device may establish a second network connection with the AP device through the P2P interface in the 5GHz frequency band. This embodiment of the present application is not limited to this.

[0082] In another example, please refer to Figure 6, which is a schematic diagram of an application scenario according to another exemplary embodiment. An application management application (such as an application market) is provided in the electronic device. Before the application installation package is downloaded through the application management application, the electronic device only establishes a first network connection with the AP device in the 2.4GHz frequency band through the STA interface. When the user triggers the electronic device to download the application installation package through the application management application, the application management application triggers the electronic device to establish a second network connection with the AP device in the 5GHz frequency band through the P2P interface. In this way, when downloading the application installation package, the application management application can flexibly select a data link from the first network connection and the second network connection to facilitate fast and complete downloading of the application installation package.

[0083] Similarly, the application scenario shown in Figure 6 is exemplary. In another example, after the application management application is started, the electronic device may establish a second network connection with the AP device through the P2P interface in the 5GHz frequency band. This embodiment of the present application is not limited to this.

[0084] It should be noted that the above description is based solely on the example of establishing a first network connection in a first frequency band before the application is run, and establishing a second network connection in a second frequency band with the AP device via a P2P interface after the application is run or when the application is triggered to interact with the AP device. In another example, after the application is run or when the application is triggered to interact with the AP device, the electronic device may be simultaneously triggered to establish a first network connection in the first frequency band via a STA interface, and to establish a second network connection in the second frequency band via a P2P interface. This embodiment of the present application is not limited to this.

[0085] It should also be noted that the above-mentioned application scenarios are merely exemplary and do not limit the application of the method provided in the embodiments of the present application. The method can also be applied to other application scenarios with low latency, high throughput, and load balancing requirements, which are not limited in the embodiments of the present application.

[0086] The method provided in the embodiment of the present application can be applied to the Android system or the Linux system. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to exemplify the software system of the electronic device. Figure 7 is a block diagram of a software system of an electronic device provided in the embodiment of the present application. Referring to Figure 7, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, the application layer, the application framework layer, the Android runtime (Android runtime) and the system layer, and the kernel layer.

[0087] The application layer can include a series of application packages. As shown in Figure 7, the application package can include but is not limited to games, instant messaging, application management (such as application market) and other applications. For example, it can also include calling, maps, navigation, WLAN, Bluetooth, music, video, short messaging and other applications.

[0088] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As an example of this application, as shown in Figure 7, the application layer includes a WiFi connection module, a scanning module, a result storage module, a command receiving module, a service module, a P2P connection management module, an interface conversion module, and a network configuration module. The WiFi connection module is used to trigger the electronic device to establish a WiFi network connection with the AP device via the STA interface. The scanning module is used to scan for WiFi signals. The result storage module is used to store the scanning results of the scanning module. The command receiving module is used to receive commands or data sent by the application layer application to the P2P interface. The service module is used to establish a data transmission channel between the command receiving module and the P2P connection management module, thereby enabling data exchange between the command interface module and the P2P connection management module. The P2P connection management module and the interface conversion module are used to perform interface conversion on data sent from the upper layer. The network configuration module is used to establish a network connection with other electronic devices (such as AP devices).

[0089] The Android Runtime consists of core libraries and a virtual machine (VM). The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one for Java-based functions and the other for the Android core library. The application layer and application framework layer run in the VM. The VM executes Java files from the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

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

[0091] The kernel layer is the layer between hardware and software. The kernel layer includes at least WiFi driver, display driver, camera driver, audio driver, and sensor driver.

[0092] On the basis of the electronic device provided in the above embodiment, the network connection method provided in the embodiment of the present application is described in detail below. As an example of the present application, after the electronic device is turned on, the user triggers the electronic device to connect to the AP device, that is, the electronic device is connected to the WiFi network. In this case, the electronic device establishes a WiFi network connection with the AP device through the STA interface in the first frequency band of the WiFi network, that is, establishes a first network connection. Afterwards, when an application (hereinafter referred to as the first application) in the electronic device needs to establish a dual-channel connection, the first application triggers the electronic device to establish a WiFi network connection with the AP device through the P2P interface at the same time in the second frequency band, that is, establishes a second network connection. Specifically, please refer to Figure 8, which is a schematic diagram of the process of a network connection method according to an exemplary embodiment. As an example and not a limitation, taking the method applied to the electronic device shown in Figure 7 above, and the electronic device being implemented through the interaction of the above-mentioned modules as an example, the method may include some or all of the following contents:

[0093] Step 801: After the electronic device is powered on, upon receiving a WiFi connection instruction, the WiFi connection module establishes a first network connection with an AP device in a first frequency band through a STA interface.

[0094] The WiFi connection instruction can be triggered by the user. For example, the electronic device may include a WiFi connection control. When the user wishes to connect the electronic device to a WiFi network, the control can be triggered. A WiFi connection module in the electronic device then receives the WiFi connection instruction. The WiFi connection module then triggers the electronic device to establish a first network connection with the AP device in the first frequency band via the STA interface.

[0095] The first frequency band can be selected by the user. For example, when establishing a first network connection with an AP device via a STA interface, the electronic device can display a list of scanned WiFi network names, and the user can select a wireless network name to connect to as needed. Each wireless network name corresponds to a frequency band. Alternatively, the first frequency band can be any connectable frequency band scanned by the electronic device, which can be selected and connected autonomously by the electronic device.

[0096] Step 802: The first application is started.

[0097] The first application is an application in the electronic device. In one example, the first application is an application in the electronic device that has specified requirements for one or more network services, where the specified requirements include one or more of low latency, high throughput, or stable transmission. For example, the first application is a gaming application.

[0098] In another example, the first application is an application in the electronic device that has a specific function or functions. For example, if the first application is an instant messaging application, the specific function may be, but is not limited to, a video call function. Another example is if the first application is an application management application, the specific function may be, but is not limited to, an application installation package download function.

[0099] Alternatively, the first application may also be any application in the electronic device that needs to connect to a network.

[0100] Step 803: The first application receives an execution operation of the network service.

[0101] The network service may refer to any network communication-related service executed by the first application, or may refer to a network communication-related service executed by the first application with specified requirements. When the first application receives an execution operation for the network service, the first application is triggered to exchange data with the AP device to implement the corresponding network service.

[0102] For example, taking the case where the first application is an application market and the network service is downloading an application package, in one possible scenario, as shown in FIG6 , after the application market is launched, the electronic device displays the application market's application interface. Subsequently, the user triggers a download control for an application in the application interface (such as the "Install" control in FIG6 ). Accordingly, the application market receives the user-triggered execution operation of the network service of downloading the application package, and then interacts with the AP device to obtain the application package.

[0103] It should be noted that step 803 is optional. That is, the present embodiment of the application is merely illustrative of an example in which a user triggers the first application to subsequently execute a network service through a network service execution operation. In another example, the first application may also automatically execute a network service after startup. For example, the first application may also automatically request network data under certain preset conditions after startup. This embodiment of the application is not limited to this.

[0104] Step 804: In response to the execution operation, the first application triggers the scanning module to perform WiFi signal scanning.

[0105] As an example of the present application, after receiving the execution operation, the first application triggers the electronic device to establish a second network connection with the AP device through the P2P interface before interacting with the AP device. To this end, the first application triggers the scanning module to perform WiFi signal scanning to obtain relevant data for connecting to the second network connection.

[0106] For example, continuing with the above example, when a user clicks a download control for an application on the application interface of the application market, the application market triggers the scanning module to perform a WiFi signal scan in response to the user's triggering operation on the download control. For example, the application market can send a scan instruction to the scanning module to trigger the scanning module to perform a WiFi signal scan.

[0107] It should be noted that steps 803 to 804 are optional. As another example of the present application, the first application may also trigger the scanning module to perform WiFi signal scanning after startup. That is, the first application does not trigger the scanning module to perform WiFi signal scanning only when it is triggered to interact with the AP device. Instead, the first application triggers the scanning module to perform WiFi signal scanning after startup. This embodiment of the present application is not limited to this.

[0108] Step 805: The scanning module performs WiFi signal scanning to obtain scanning results.

[0109] In implementation, the scanning module may trigger the WiFi hardware to scan for WiFi signals, thereby obtaining a scanning result.

[0110] Step 806: The scanning module stores the scanning result in the result storage module.

[0111] That is, after obtaining the scanning result, the scanning module stores the scanning result in the result storage module, so that the first application can obtain the scanning result from the result storage module.

[0112] Step 807: The first application program reads the scan result from the result storage module and parses the scan result to obtain the network connection parameters of the second frequency band.

[0113] In one example, network connection parameters may include, but are not limited to, the wireless network name, password, network frequency band, and physical address. For example, network connection parameters include a service set identifier (SSID), psk, freq, and madAddr, where SSID is the wireless network name, psk is the password, freq is the network frequency band, and madAddr is the physical address. Network connection parameters vary for different frequency bands.

[0114] In one possible case, the parsed result after parsing the scan result may only include the network connection parameters of an unconnected frequency band. In this case, the network connection parameters of the unconnected frequency band are directly used to determine the network connection parameters of the second frequency band. The unconnected frequency band refers to the frequency bands other than the first frequency band. That is, when selecting, if the electronic device has previously established a WiFi network connection with the AP device in the first frequency band, and the parsing result includes the network connection parameters of the first frequency band and another frequency band, the first application can also query the first frequency band corresponding to the currently established first network connection, and select the network connection parameters of the other frequency band other than the first frequency band from the parsing result as the network connection parameters of the second frequency band, so as to perform deduplication processing and avoid establishing different WiFi network connections in the same frequency band.

[0115] In another case, the parsed scan results may include network connection parameters for multiple unconnected frequency bands, such as network connection parameters for a 5 GHz band and a 6 GHz band. In this case, the first application can select the network connection parameters for one frequency band from the multiple unconnected frequency bands as the network connection parameters for the second frequency band. By way of example and not limitation, the first application can make this selection based on the network type.

[0116] It should be noted that, in one possible case, the network connection parameters may not include the password of the WiFi network of the second frequency band, but the first application has pre-stored the password of the WiFi network of the second frequency band. In this case, after the first application obtains the parsing result, it can obtain the corresponding password locally according to the SSID, and then execute the following step 808 and subsequent operations.

[0117] It should be noted that the above description is based on the example that the electronic device has been previously connected to the second frequency band, that is, the network connection parameters include a password, or the password of the WiFi network of the second frequency band is stored in the first application. In another possible case, the electronic device may not have been previously connected to the second frequency band. In this case, after the scanning module performs a WiFi signal scan, the scanning result does not include the password of the second frequency band, and the password of the second frequency band is not stored in the first application. In this case, after the first application parses and obtains the network connection parameters, it can display part or all of the information in the network connection parameters to facilitate the user to enter the password based on the displayed information. For example, the first application can display the SSID in the network connection parameters, and then the user can enter the password corresponding to the displayed SSID. Accordingly, the first application can obtain the password corresponding to the SSID and then perform the following step 808 and subsequent operations.

[0118] Step 808: The first application sends a first connection instruction to the instruction receiving module through the first interface, where the first connection instruction carries network connection parameters of the second frequency band.

[0119] The first connection instruction is used to request the P2P interface to establish a second network connection with the AP device in the second frequency band based on the network connection parameters.

[0120] The first interface is an interface in the P2P interface that the first application calls to establish a WiFi network connection with the AP device through the P2P interface. In one example, the following content can be encapsulated in the AddGroup() function of the FWK layer of the electronic device, thereby providing the first application with a callable first interface, where the first interface is connect():

[0121] public boolean p2pGroupAdd(String networkName,String passphrase,int freq,String peerAddress);

[0122] public void connect(@NonNull WifiConfiguration config,@Nullable ActionListener listener);

[0123] The AddGroup() function is used to implement related functions of the P2P interface, such as establishing a network connection channel.

[0124] In one example, the instruction receiving module is named wifiP2pManager module. In this case, the first application sends the first connection instruction to the wifiP2pManager module by calling the connect() interface.

[0125] Step 809: After receiving the first connection instruction through the first interface, the instruction receiving module sends the network connection parameters to the service module.

[0126] In one example, after receiving the first connection instruction, the instruction receiving module can parse the first connection instruction to obtain the network connection parameters of the second frequency band, and then send the second connection instruction to the service module, which carries the network connection parameters of the second frequency band.

[0127] Exemplarily, the second connection instruction is a wifiP2pManager.CONNECT connection instruction, and the service module is named wifiP2pService1mpl module. In this case, the specific implementation of the instruction receiving module sending the network connection parameters to the service module may include: the wifiP2pManager module sending the wifiP2pManager.CONNECT connection instruction to the wifiP2pService1mpl module, where the wifiP2pManager.CONNECT connection instruction carries the network connection parameters.

[0128] Of course, the above implementation is only exemplary. In another example, the instruction receiving module may also directly forward the first connection instruction to the service module to transmit the network connection parameters of the second frequency band to the service module.

[0129] Step 810: The service module sends the network connection parameters to the P2P connection management module through the second interface.

[0130] The second interface is an interface in the P2P connection management module, and is called by the service module to pass data used for interacting with the AP device (such as establishing a WiFi network connection) to the P2P connection management module.

[0131] In one example, the P2P connection management module is named wifP2PNative module. In implementation, wifiP2pServicelmpl calls wifiNative.p2pGroupAdd(ssid, psk, freq, macAddr) to send network connection parameters, including ssid, psk, freq, and macAddr, to the wifP2PNative module.

[0132] Step 811: The P2P connection management module sends the network connection parameters to the interface conversion module.

[0133] In one example, the interface conversion module is named SupplicantP2plfaceHal.

[0134] In one example, the P2P connection management module calls the mSupplicantP2pIfaceHal.groupAdd interface of the wpa_supplicant_hal of the SupplicantP2plfaceHal to send the network connection parameters to the interface conversion module. Exemplarily, the P2P connection management module calls mSupplicantP2pIfaceHal.groupAdd(ssid, psk, false, freq, macAddr, true) to send the network connection parameters to the interface conversion module.

[0135] Step 812: The interface conversion module performs interface conversion on the network connection parameters.

[0136] In one example, the interface conversion module performs interface conversion on the network connection parameters, for example, performs interface conversion according to the parameter transmission format defined by the network configuration module, thereby converting the parameters into a format recognizable by the network configuration module.

[0137] Step 813: The interface conversion module sends the converted network connection parameters to the network configuration module.

[0138] In one example, the interface conversion module calls the ifaceV12.addGroup_1_2() interface of the network configuration module to transmit the network connection parameters to the network configuration module. For example, in an implementation, the interface conversion module calls ifaceV12.addGroup_1_2(ssid, psk, isPersistent, freq, macAddr, join) to send the network connection parameters to the network configuration module.

[0139] Step 814: The network configuration module establishes a second network connection with the AP device in the second frequency band based on the converted network connection parameters.

[0140] After receiving the network connection parameters, the network configuration module establishes a WiFi network connection with the AP device in the second frequency band based on the network connection parameters, thereby establishing a second network connection with the AP device via the P2P interface. In one example, the network configuration module is named wpa_supplicant. In implementation, wpa_supplicant establishes the second network connection with the AP device in the second frequency band based on the ssid, psk, freq, and macAddr.

[0141] In this way, the electronic device can establish a first network connection with the AP device in the first frequency band through the STA interface, and also establish a second network connection with the AP device in the second frequency band through the P2P interface. For example, please refer to Figure 4, taking the first frequency band as 2.4GHz and the second frequency band as 5GHz as an example, the electronic device establishes a first network connection with the AP device in the 2.4GHz frequency band through the STA interface, and establishes a second network connection with the AP device in the 5GHz frequency band through the P2P interface. In this case, a dual-link connection will occur through air interface packet capture.

[0142] It should be noted that, in one possible scenario, the AP device connected via the P2P interface and the AP device connected via the STA interface may be the same AP device. In another possible scenario, the AP device connected via the P2P interface and the AP device connected via the STA interface may not be the same AP device.

[0143] It should be noted that the embodiment of the present application is described by taking the example of triggering the electronic device to establish a second network connection with the AP device through the P2P interface in the second frequency band after the first application is started or when the first application is triggered to interact with the AP device. In another example, the second network connection can also be established before the first application is started, for example, the electronic device establishes the second network connection at the same time as establishing the first network connection; in another example, the first network connection and the second network connection can be triggered by the first application to establish the electronic device at the same time. For example, after the first application is started or when it is triggered to interact with the AP device, the first interface is called to send a first connection instruction to the P2P interface, and at the same time, a third connection instruction is sent to the STA interface, thereby triggering the electronic device to establish different WiFi network connections with the AP device through the P2P interface and the STA interface respectively. The embodiment of the present application does not limit this.

[0144] Step 815: When the WiFi network connection is established, the network configuration module returns a network establishment completion notification to the first application.

[0145] The network establishment completion notification is used to indicate that a second network connection has been established with the AP device in the second frequency band through the P2P interface. That is, in order for the first application to know whether data can be transmitted through the P2P interface, the network configuration module can return a network establishment completion notification to the first application after completing the establishment of the second network connection in the second frequency band based on the network connection parameters. In one example, as shown in Figure 8, the specific implementation of the network configuration module returning the network establishment completion notification to the first application includes: the network configuration module sends a network establishment completion notification to the interface conversion module, the interface conversion module sends a network establishment completion notification to the P2P connection management module, the P2P connection management module sends a network establishment completion notification to the service module, the service module sends a network establishment completion notification to the instruction receiving module, and the instruction receiving module sends a network establishment completion notification to the first application.

[0146] It should be noted that step 815 is an optional operation. In another possible implementation, the first application can also actively request the network configuration module to query whether the second network connection is successfully established, which is not limited in this embodiment of the present application.

[0147] In this way, for electronic devices that do not support multiple STA interfaces, since the WiFi drivers of most electronic devices support the coexistence of STA interfaces and P2P interfaces, multi-link connections can be achieved without additional modification of the WiFi driver, thereby enabling more flexible data link selection during data transmission, making WiFi network transmission more stable and real-time performance more guaranteed. In addition, since electronic devices support multi-link independent data transmission, they can have higher throughput and more stable data transmission in interference environments. For example, the data transmission process may include the following steps 816:

[0148] Step 816: During data interaction between the first application and the AP device, the first application transmits data with the AP device through the first network connection and / or the second network connection.

[0149] That is, after the first application determines that the second network connection has been established in the second frequency band, it can choose to transmit data with the AP device through the first network connection and / or the second network connection as needed during data interaction with the AP device.

[0150] In one example, during the process of data interaction between the first application and the AP device, it can select one link from the two links for data transmission based on the air interface load level, thereby achieving air interface load balanced transmission. When both frequency bands are idle, the first application selects a frequency band for data transmission. Later, if the selected frequency band is busy, it can also dynamically switch to another frequency band for data transmission. For example, when both the 2.4GHz band and the 5GHz band are idle, the first application can select the 5GHz band for data transmission. In an interference environment, if the 5GHz band is busy, it can dynamically switch to the 2.4GHz band for data transmission. In this way, the stability of data transmission is guaranteed.

[0151] In another example, for scenarios with high data stability requirements, such as gaming scenarios, the first application can also transmit data simultaneously through two frequency bands during data interaction with the AP device. In this way, as long as the receiving end receives the data sent by the electronic device on one frequency band, it can ensure normal data reception, thereby ensuring the stability and real-time performance of data transmission. For example, as shown in Figure 9, the electronic device simultaneously transmits data on the 2.4GHz frequency band (data transmission delay is 100ms) and the 5GHz frequency band (data transmission delay is 5ms). After the electronic device fails to transmit data on the 2.4GHz frequency band, it waits for retransmission on the 2.4GHz frequency band. During this period, the electronic device receives data normally on the 5GHz frequency band, ensuring the reliability of data transmission. In addition, since the data transmission delay on the 5GHz frequency band is relatively small, while ensuring the reliability of data transmission, the real-time performance of data transmission is also improved.

[0152] As an example of this application, the data transmission process is described by taking the first application selecting to transmit data via the second network connection as an example. Specifically, please refer to Figure 10, which may include the following content:

[0153] A1: The first application sends data to be transmitted to the instruction receiving module through the first interface.

[0154] The first application calls the first interface to send data to be transmitted to the instruction receiving module through the first interface. In one example, the first application calls the first interface and sends a data transmission instruction to the first interface, the data transmission instruction carrying the data to be transmitted.

[0155] A2: The instruction receiving module sends data to the service module.

[0156] A3: The service module sends data to the P2P connection management module through the second interface.

[0157] In one example, the service module receives a data transmission instruction, parses the instruction to obtain data to be transmitted, and then sends the transmitted data to the P2P connection management module.

[0158] A4: The P2P connection management module sends data to the interface conversion module.

[0159] A5: The interface conversion module performs interface conversion on the data and sends the converted data to the network configuration module.

[0160] The interface conversion module performs interface conversion on the data to be transmitted according to the data format defined by the network configuration module, and then sends the converted data to the network configuration module.

[0161] A6: The network configuration module sends data to the AP device through the second network connection.

[0162] During the data interaction process, since the data is transmitted through the P2P interface, the sent data contains P2P IE.

[0163] It should be noted that the above description is based on an example of a first application sending data to an AP device. In one possible scenario, the AP device may also send data to the first application. In this case, the data transmission direction is opposite to the data transmission direction shown in Figure 10 above, and will not be repeated here.

[0164] It should be noted that the above description is based on an example in which a first application triggers an electronic device to establish a second network connection with an AP device via a P2P interface in a second frequency band during network data transmission. In another possible scenario, when a first application is performing network data transmission, if a second application has already triggered an electronic device to establish a second network connection with an AP device via a P2P interface in a second frequency band, the first application can directly select the first network connection and / or the second network connection for network data transmission, i.e., there is no need to trigger the electronic device to establish a second network connection via the P2P interface in the second frequency band again.

[0165] As an example of the present application, after the first application ends the connection via the first network and / or the second network, for example, when the first application is closed, the electronic device may be triggered to disconnect the second network connection established with the AP device via the P2P interface. For example, please continue to refer to FIG. 8 , and its specific implementation may include the following:

[0166] Step 817: The first application receives a close operation.

[0167] The closing operation is an operation triggered by a user to instruct the electronic device to close the first application.

[0168] Step 818: The first application sends a WiFi disconnect instruction to the instruction receiving module through the first interface.

[0169] The WiFi disconnect instruction is used to instruct to disconnect the second network connection established with the AP device in the second frequency band through the P2P interface. After receiving the shutdown operation, the first application not only sends the WiFi disconnect instruction to the instruction receiving module, but also exits the running state, that is, the first application is closed.

[0170] Step 819: The instruction receiving module sends a WiFi disconnect instruction to the service module.

[0171] Step 820: The service module sends a WiFi disconnect instruction to the P2P connection management module through the second interface.

[0172] Step 821: The P2P connection management module sends a WiFi disconnect instruction to the interface conversion module.

[0173] Step 822: The interface conversion module performs interface conversion on the WiFi disconnect instruction and sends the converted WiFi disconnect instruction to the network configuration module.

[0174] The interface conversion module performs interface conversion on the WiFi disconnect instruction according to the data format defined by the network configuration module, and then sends the converted WiFi disconnect instruction to the network configuration module.

[0175] Step 823: In response to the WiFi disconnect instruction, the network configuration module disconnects the second network connection established with the AP device in the second frequency band.

[0176] Exemplarily, the network configuration module sends a WiFi disconnect request to the AP device to disconnect the second network connection established with the AP device.

[0177] It should be noted that the embodiment of the present application is only for the purpose of explanation, in which the electronic device is triggered to disconnect the second network connection established with the AP device through the P2P interface when the first application is closed. In another optional example, since the user may not use the first application for a long time (such as more than one day) after opening it, that is, when the first application is in a running state, the first application does not perform network data interaction or does not execute a function with specified requirements within a preset time period. In this case, the first application can also trigger the electronic device to disconnect the second network connection established with the AP device through the P2P interface, and then, when the first application needs to perform network data interaction or execute a function with specified requirements, it will trigger the electronic device to establish a second network connection with the AP device through the P2P interface.

[0178] In an embodiment of the present application, after the first application is started, during the process of data interaction with the AP device, it can be selected to transmit data with the AP device through the first network connection and / or the second network connection. The first network connection is a WiFi network connection established with the AP device in the first frequency band through the STA interface of the electronic device, and the second network connection is a WiFi network connection established with the AP device in the second frequency band through the P2P interface of the electronic device, and the second frequency band is different from the first frequency band. That is, when the electronic device establishes a WiFi network connection with the AP device in one frequency band through the STA interface, it can also establish a WiFi network connection with the AP device in another frequency band through the P2P interface, thereby realizing a multi-link connection between the electronic device and the AP device.

[0179] When an electronic device establishes a second network connection with an AP device through a P2P interface, the electronic device is a P2P device. Under normal circumstances, as a P2P device, the P2P protocol will prohibit it from being scanned by other P2P devices after connecting to the AP device (or organizer (group owner, GO)). However, in this way, in the process of establishing a second network connection between the electronic device and the AP device through the P2P interface, it is easy for other P2P devices to be unable to scan the device. In order to avoid this situation, the embodiment of the present application also provides a network connection method. Specifically, please refer to Figure 11. The following is an example of applying this method to the above-mentioned electronic device. The method may include some or all of the following contents:

[0180] Step 1101: After the electronic device is powered on, upon receiving a WiFi connection instruction, a first network connection is established with an AP device in a first frequency band via a STA interface.

[0181] Step 1102: After receiving the start operation for the first application, the electronic device starts the first application.

[0182] Step 1103: After the first application is started or triggered to interact with the AP device, the electronic device establishes a second network connection with the AP device in the second frequency band through the P2P interface.

[0183] Step 1104: The electronic device transmits data to the AP device via the first network connection and / or the second network connection.

[0184] The specific implementation of the above steps 1101 to 1104 can refer to steps 801 to 816 in the embodiment shown in Figure 8 above, and will not be repeated here.

[0185] Step 1105: The electronic device receives the P2P connection operation.

[0186] The P2P connection operation is an operation for requesting a P2P connection. In one example, a third application is installed in the electronic device. When the user wants the electronic device to perform a P2P connection, the P2P connection operation can be triggered in the application interface of the third application.

[0187] Step 1106: In response to the P2P connection operation, the electronic device monitors the probe request frame through the P2P interface.

[0188] The probe request frame refers to a probe request frame broadcast by other P2P devices. In some examples, the probe request frame is a probe response frame.

[0189] That is, after the electronic device connects to the AP device through the P2P interface, upon receiving a P2P connection operation, the P2P interface's monitoring function for probe request frames is enabled to monitor probe request frames broadcast by other P2P devices. In one example, the electronic device can enable a filter for probe request frames in the aforementioned network configuration module (i.e., wpa_supplicant) to enable the WiFi driver to receive probe request frames. The filter is used to enable or disable the monitoring function for probe request frames. In one example, the filter is a WiFi driver P2P response filter.

[0190] Step 1107: After receiving the probe request frame through the P2P interface, the electronic device sends a probe response frame to other P2P devices through the P2P interface.

[0191] The probe response frame is used to reply to other P2P devices that have received the probe request frame broadcast by the P2P device. In some examples, the probe response frame is a probe request frame.

[0192] That is, when the electronic device receives a detection request frame through the P2P interface, it replies with a detection response frame from other P2P devices on the corresponding AP channel. In this way, the electronic device can still be discovered by other P2P devices when it is connected to the AP device through the P2P interface, avoiding the inability of other P2P devices to scan the electronic device, thereby avoiding the inability to use the P2P function during the process of connecting to the AP device through the P2P interface.

[0193] Step 1108: The electronic device receives a P2P connection request sent by another P2P device through the P2P interface.

[0194] Exemplarily, the P2P connection request is an auth request.

[0195] Step 1109: When the first application transmits data to the AP device via the P2P interface, the electronic device sends a transmission switching instruction to the first application, where the transmission switching instruction is used to indicate that the second network connection cannot be used for data transmission.

[0196] In one case, if a P2P connection request is received from another P2P device via a P2P interface, indicating that the other P2P device has requested to establish a P2P connection with the electronic device, in this case, if a first application in the electronic device transmits data via a second network connection, a transmission switching instruction may be sent to the first application in order to enable the first application to quickly switch to transmitting data via the first network connection. In one example, the specific implementation of sending the transmission switching instruction to the first application may include: the network configuration module sends the transmission switching instruction to the interface conversion module, the interface conversion module sends the transmission switching instruction to the P2P connection management module, the P2P connection management module sends the transmission switching instruction to the service module, the service module sends the transmission switching instruction to the instruction receiving module, and the instruction receiving module sends the transmission switching instruction to the first application.

[0197] Step 1110: The electronic device sends a disconnection request to the AP device.

[0198] The disconnection request is used to instruct the AP device to disconnect the second network connection established in the second frequency band. In one example, the electronic device sends the disconnection request to the AP device through the network configuration module. Exemplarily, the disconnection request is deauth_request.

[0199] It should be noted that steps 1108 to 1110 are optional. In another example, upon receiving a P2P connection request from another P2P device via the P2P interface, the electronic device may directly disconnect the second network connection established with the AP device via the P2P interface in the second frequency band, without notifying the first application to initiate the switch. In this case, the first application can proactively detect when sending data that it is unable to send data via the P2P interface. This can improve P2P connection speed.

[0200] Step 1111: The AP device sends a disconnect response to the electronic device.

[0201] When receiving the disconnection request sent by the electronic device, the AP device disconnects the second network connection and feeds back a disconnection response to the electronic device. In one example, the electronic device receives the disconnection response through the network configuration module, and illustratively, the disconnection response is a deauth response.

[0202] The above steps 1110 and 1111 are an optional specific implementation method for the electronic device to disconnect the second network connection established with the AP device in the second frequency band through the P2P interface.

[0203] Step 1112: The electronic device establishes a P2P connection with other P2P devices through the P2P interface.

[0204] Specifically, after the electronic device disconnects from the AP device, it executes a process for establishing a P2P connection with another P2P device. For example, the electronic device sends a P2P connection response, such as an auth response, to the other P2P device via a P2P interface. The other P2P device then sends an authentication request (e.g., an assoc request) to the electronic device, and the electronic device sends an authentication response (e.g., an assoc response) to the other P2P device, thereby establishing the P2P connection through data exchange.

[0205] It should be noted that the embodiment of the present application is only described by taking the example of an electronic device monitoring the probe request frames broadcast by other P2P devices. In another example, the electronic device can also broadcast the probe request frame to request to establish a P2P connection with other P2P devices.

[0206] In an embodiment of the present application, when an electronic device establishes a second network connection with an AP device, if a P2P connection operation is received, the electronic device enables the monitoring function of the probe request frame and replies with a probe response frame on the AP channel. This ensures that the electronic device can still be discovered by other P2P devices during the process of connecting to the AP device. When other P2P devices scan the electronic device, the P2P interface disconnects from the AP device and returns to the P2P connection process, thus avoiding the problem of the P2P function being unusable due to the connection to the AP device.

[0207] The electronic device in the embodiments of the present application can be a mobile phone sports camera (GoPro), a digital camera, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, a mobile phone, etc., and the embodiments of the present application are not limited to this.

[0208] FIG12 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Referring to FIG12 , the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0209] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0210] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0211] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0212] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0213] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0214] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0215] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 100 via the power management module 141.

[0216] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0217] 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), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0218] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0219] 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 can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0220] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor 180K can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.

[0221] The keys 190 include a power button, a volume button, etc. The keys 190 may be mechanical keys or touch keys. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0222] In the above embodiments, it 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 instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The 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, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (such as a coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0223] The above are optional embodiments provided for this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope disclosed in this application should be included in the scope of protection of this application.

Claims

1. A network connection method, characterized in that: Applied in an electronic device, the method comprises: A first application is started, wherein the first application is an application in the electronic device; During data interaction between the first application and the AP device, data is transmitted with the access point AP device through the first network connection and / or the second network connection. The first network connection is a wireless fidelity WiFi network connection established with the AP device in the first frequency band through the site STA interface of the electronic device, and the second network connection is a WiFi network connection established with the AP device in the second frequency band through the point-to-point P2P interface of the electronic device, and the second frequency band is different from the first frequency band.

2. The method according to claim 1, characterized in that The first network connection is established before the first application is started; the method further includes: After the first application is started or when the first application is triggered to perform data interaction with the AP device, the electronic device establishes the second network connection with the AP device in the second frequency band through the P2P interface.

3. The method according to claim 2, characterized in that The electronic device includes a scanning module and a result storage module, and the P2P interface includes a first interface, and the first interface is used to transmit data related to the second network connection; After the first application is started or when the first application is triggered to interact with the AP device, the electronic device establishes the second network connection with the AP device in the second frequency band through the P2P interface, including: After the first application is started or when the first application is triggered to perform data interaction with the AP device, the first application triggers the scanning module to perform WiFi signal scanning to obtain a scanning result; The scanning module stores the scanning result in the result storage module; The first application reads the scan result from the result storage module and parses the scan result to obtain the network connection parameter of the second frequency band; The first application sends a first connection instruction to the P2P interface through the first interface, wherein the first connection instruction carries the network connection parameters; In response to the first connection instruction, the P2P interface establishes the second network connection with the AP device in the second frequency band according to the network connection parameters.

4. The method according to claim 3, characterized in that The P2P interface includes an instruction receiving module, a service module, a P2P connection management module, an interface conversion module and a network configuration module; The step of, in response to the first connection instruction, establishing, by the P2P interface, the second network connection with the AP device in the second frequency band according to the network connection parameters, comprising: After receiving the first connection instruction through the first interface, the instruction receiving module sends the network connection parameters to the service module; The service module sends the network connection parameters to the P2P connection management module through a second interface, and the second interface is used for the service module to transmit data related to the second network connection to the P2P connection management module; The P2P connection management module sends the network connection parameters to the interface conversion module; The interface conversion module performs interface conversion on the network connection parameters and sends the converted network connection parameters to the network configuration module; The network configuration module establishes the second network connection with the AP device in the second frequency band based on the converted network connection parameters.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The electronic device receives a P2P connection operation; In response to the P2P connection operation, the electronic device monitors a probe request frame through the P2P interface, where the probe request frame refers to a probe request frame broadcasted by other P2P devices; After receiving the probe request frame through the P2P interface, the electronic device sends a probe response frame to the other P2P device through the P2P interface; When receiving a P2P connection request sent by the other P2P device through the P2P interface, the electronic device disconnects the second network connection established with the AP device through the P2P interface in the second frequency band; The electronic device establishes a P2P connection with the other P2P device through the P2P interface.

6. The method according to claim 5, characterized in that The method further comprises: In the case where a P2P connection request sent by the other P2P device is received through the P2P interface, if the first application transmits data with the AP device through the P2P interface, the electronic device sends a transmission switching instruction to the first application before disconnecting the second network connection, and the transmission switching instruction is used to indicate that the second network connection cannot be used to transmit data.

7. The method according to claim 5, characterized in that When receiving the P2P connection request sent by the other P2P device through the P2P interface, the electronic device disconnects the second network connection established with the AP device through the P2P interface in the second frequency band, including: In case of receiving a P2P connection request sent by the other P2P device through the P2P interface, the electronic device sends a disconnection request to the AP device through the P2P interface; After receiving the disconnection response sent by the AP device, the electronic device disconnects the second network connection established with the AP device in the second frequency band through the P2P interface, and the disconnection response is sent after receiving the disconnection request.

8. The method according to any one of claims 1 to 4, characterized in that The P2P interface includes an instruction receiving module, a service module, a P2P connection management module, an interface conversion module and a network configuration module; In the process of data interaction between the first application and the AP device, the data transmission with the access point AP device through the first network connection and / or the second network connection includes: During data interaction between the first application and the AP device, when data transmission is selected through the second network connection, the first application calls a first interface to send data to be transmitted to the instruction receiving module through the first interface, and the first interface is used to transmit data related to the second network connection; The instruction receiving module receives the data through the first interface and sends the data to the service module; The service module sends the data to the P2P connection management module through a second interface, and the second interface is used for the service module to transmit data related to the second network connection to the P2P connection management module; The P2P connection management module sends the data to the interface conversion module; The interface conversion module performs interface conversion on the data and sends the converted data to the network configuration module; The network configuration module sends the data to an AP device through the second network connection.

9. The method according to any one of claims 1 to 4 and 8, characterized in that: The method further comprises: When the first application is closed, the electronic device disconnects the second network connection established with the AP device in the second frequency band through the P2P interface.

10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 9 when executing the computer program.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for establishing network connection and electronic equipment

    CN111182614A

  • WiFi P2P connection method, electronic device, program product and medium

    CN113645693A

  • Channel access method and communication device

    CN114080049A

  • Wireless transmission method and system based on WIFI multiplexing technology

    WO2021253273A1

  • Dual WIFI connection method and electronic device

    WO2022089515A1

Cited By

  • Task control method and device, electronic equipment and computer readable storage medium

    CN120812756A