CN118695402A - Network connection method, electronic device, and readable storage medium - Google Patents
Network connection method, electronic device, and readable storage medium Download PDFInfo
- Publication number
- CN118695402A CN118695402A CN202310304073.9A CN202310304073A CN118695402A CN 118695402 A CN118695402 A CN 118695402A CN 202310304073 A CN202310304073 A CN 202310304073A CN 118695402 A CN118695402 A CN 118695402A
- Authority
- CN
- China
- Prior art keywords
- interface
- network connection
- module
- connection
- application program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 70
- 230000005540 biological transmission Effects 0.000 claims abstract description 70
- 230000003993 interaction Effects 0.000 claims abstract description 37
- 230000008569 process Effects 0.000 claims abstract description 24
- 238000006243 chemical reaction Methods 0.000 claims description 45
- 230000001960 triggered effect Effects 0.000 claims description 27
- 230000004044 response Effects 0.000 claims description 26
- 238000001514 detection method Methods 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 7
- 238000007726 management method Methods 0.000 description 57
- 230000006870 function Effects 0.000 description 29
- 239000000523 sample Substances 0.000 description 20
- 238000004891 communication Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 17
- 238000012545 processing Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 6
- 238000000060 site-specific infrared dichroism spectroscopy Methods 0.000 description 6
- 238000012546 transfer Methods 0.000 description 6
- 238000009434 installation Methods 0.000 description 5
- 230000003190 augmentative effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/15—Setup of multiple wireless link connections
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application discloses a network connection method, electronic equipment and a readable storage medium, and belongs to the technical field of terminals. Comprising the following steps: a first application is launched, the first application being one of the applications in the electronic device. In the process of data interaction between the first application program and the AP equipment, data transmission is carried out between the first application program and the AP equipment through a first network connection and/or a second network connection, wherein the first network connection is a wireless fidelity WiFi network connection established between the first application program and the AP equipment in a first frequency band through an STA interface, the second network connection is a WiFi network connection established between the first application program and the AP equipment in a second frequency band through a P2P interface, and the second frequency band is different from the first frequency band. Under the condition that the WiFi network connection is established between the STA interface and the AP equipment in one frequency band, the WiFi network connection can be established between the P2P interface and the AP equipment in the other frequency band, so that the multilink connection is realized.
Description
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a network connection method, an electronic device, and a readable storage medium.
Background
Currently, wireless fidelity (WIRELESS FIDELITY, wiFi) technology has gradually matured, and the operating frequency band of WiFi includes multiple, such as 2.4G, 5G, and 6G, supporting multi-link communications. With the development of terminal technology, access Point (AP) devices supporting a multi-link technology are widely popularized gradually, and an electronic device generally establishes a WiFi connection with the AP devices through a Station (STA) interface.
In some scenarios, in order to obtain higher throughput, more stable data transmission, and smaller transmission duration, it is required that multiple link connections can be established between the electronic device and the AP at the same time. However, since most electronic devices support only one STA interface and do not support two or more STA interfaces, the electronic devices generally can only establish one link with the AP device, and cannot implement multi-link connection.
Disclosure of Invention
The application provides a network connection method, electronic equipment and a readable storage medium, which can solve the problem that multi-link connection cannot be established between the electronic equipment and AP equipment in the related technology. The technical scheme is as follows:
in a first aspect, a network connection method is provided and applied to an electronic device, and the method includes:
A first application program is started, wherein the first application program is one application program in the electronic equipment;
In the process of data interaction between the first application program and the AP equipment, data transmission is carried out between the first application program and the AP equipment through first network connection and/or second network connection, wherein the first network connection is wireless fidelity WiFi network connection established between a station STA interface of the electronic equipment and the AP equipment in a first frequency band, the second network connection is WiFi network connection established between a point-to-point P2P interface of the electronic equipment and the AP equipment in a second frequency band, and the second frequency band is different from the first frequency band.
Therefore, under the condition that the WiFi network connection is established between the electronic equipment and the AP equipment in one frequency band through the STA interface, the WiFi network connection can also be established between the electronic equipment and the AP equipment in the other frequency band through the P2P interface, and therefore the multilink connection between the electronic equipment and the AP equipment is achieved.
As an example of the present application, the first network connection is established prior to the first application program being launched; the method further comprises the steps of:
After the first application program is started or when the first application program is triggered to perform data interaction with the AP equipment, the electronic equipment establishes the second network connection with the AP equipment in the second frequency band through the P2P interface.
Therefore, after the first application program is started or triggered to perform data interaction with the AP equipment, the electronic equipment establishes second network connection with the AP equipment through the P2P interface, namely, the second network connection can be established when needed, and the occupation of air interface resources can be avoided while the multilink connection is realized, so that the resource waste can be avoided.
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 for transmitting data related to the second network connection;
After the first application program is started or when the first application program 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, including:
After the first application program is started or when the first application program is triggered to perform data interaction with the AP equipment, the first application program triggers the scanning module to perform WiFi signal scanning, and a scanning result is obtained;
The scanning module stores the scanning result into the result storage module;
The first application program reads the scanning result from the result storage module and analyzes the scanning result to obtain network connection parameters of the second frequency band;
The first application program sends a first connection instruction to the P2P interface through the first interface, wherein the first connection instruction carries the network connection parameter;
and responding to the first connection instruction, and establishing the second network connection between the P2P interface and the AP equipment in the second frequency band according to the network connection parameters.
Therefore, the first application program scans WiFi signals by triggering the scanning module, and acquires network connection parameters for connecting the second frequency band according to the scanning result. And then, the network connection parameters are sent to the P2P interface by calling the first interface provided by the P2P interface so as to be convenient for establishing a second network connection with the AP equipment in a second frequency band through the P2P interface.
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;
The responding 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 parameter, including:
The instruction receiving module receives the first connection instruction through the first interface and then 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;
and the network configuration module establishes the second network connection with the AP equipment in the second frequency band based on the converted network connection parameters.
In this way, a data transmission channel is established among the instruction receiving module, the service module, the P2P connection management module, the interface conversion module and the network configuration module, so that a second network connection is established between the P2P interface and the AP equipment.
As an example of the present application, the method further comprises:
the electronic equipment receives P2P connection operation;
Responding to the P2P connection operation, the electronic equipment monitors a detection request frame through the P2P interface, wherein the detection request frame refers to a detection request frame broadcast by other P2P equipment;
after receiving the detection request frame through the P2P interface, the electronic equipment sends a detection response frame to the other P2P equipment through the P2P interface;
Under the condition that a P2P connection request sent by other P2P devices is received through the P2P interface, the electronic device disconnects the second network connection established by the P2P interface and the AP device in the second frequency band;
and the electronic equipment establishes P2P connection with the other P2P equipment through the P2P interface.
Thus, if the second network connection is established between the electronic device and the AP device, the electronic device opens the listening function of the probe request frame and replies the probe response frame on the AP channel if the P2P connection operation is received. Thereby ensuring that the device can be found by other P2P devices in the process of connecting the AP device. When other P2P devices scan the electronic device, the P2P interface is disconnected with the AP device and returns to the P2P connection process, so that the problem that the P2P function cannot be used due to the connection of the AP device is avoided.
As an example of the present application, the method further comprises:
And under the condition that the P2P connection request sent by the other P2P devices is received through the P2P interface, if the first application program performs data transmission between the P2P interface and the AP device, before disconnecting the second network connection, the electronic device sends a transmission switching instruction to the first application program, wherein the transmission switching instruction is used for indicating that the second network connection cannot be used for transmitting data.
In this way, under the condition that data transmission is performed with the AP device through the P2P interface, if the electronic device receives a P2P connection request sent by another P2P device, a data transmission instruction is sent to the first application program before the second network connection is disconnected, so as to instruct the first application program to perform network switching, thereby improving stability of data transmission.
As an example of the present application, in a case where 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 in the second frequency band through the P2P interface, including:
under the condition that the P2P connection request sent by the other P2P devices is received through the P2P interface, the electronic device sends a disconnection request to the AP device through the P2P interface;
and after receiving a disconnection response sent by the AP equipment, the electronic equipment disconnects the second network connection established between the P2P interface and the AP equipment in the second frequency band, wherein the disconnection response is sent after receiving the disconnection request.
In this way, when the P2P connection request sent by the other P2P devices is received through the P2P interface, a disconnection request is sent to the AP device through the P2P interface to disconnect the second network connection, so that the P2P connection is conveniently established with the other P2P devices through the P2P interface.
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;
in the process of performing data interaction with the AP device by the first application program, the data transmission with the AP device by the first network connection and/or the second network connection includes:
In the process of data interaction between the first application program and the AP equipment, under the condition of selecting data transmission through the second network connection, the first application program calls a first interface, and the data to be transmitted is sent to the instruction receiving module through the first interface, wherein the first interface is used for transmitting data related to the second network connection;
the instruction receiving module receives the data through a 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 the 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;
and the network configuration module sends the data to the AP equipment through the second network connection.
Therefore, by establishing the data transmission channel among the modules, the data to be transmitted can be transmitted through the data channel after the second network connection is successfully established, namely, the data interaction between the P2P interface and the AP equipment is realized.
As an example of the present application, the method further comprises:
And under the condition that the first application program is closed, the electronic equipment disconnects the second network connection established by the P2P interface and the AP equipment in the second frequency band.
Therefore, under the condition that the first application program is closed, the second network connection established between the P2P interface and the AP equipment is disconnected, so that the air interface resources of the second frequency band can be released, resources are saved, and resource waste is avoided.
In a second aspect, a network connection device is provided, which has a function of implementing the network connection method behavior in the first aspect. The network connection device comprises at least one module for implementing the network connection method provided in the first aspect.
In a third aspect, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the network connection method according to the first aspect when executing the computer program.
In a fourth aspect, a computer readable storage medium is provided, in which instructions are stored which, when run on a computer, cause the computer to perform the network connection method according to the first aspect described above.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the network connection method of the first aspect described above.
The technical effects obtained by the second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described in detail herein.
Drawings
FIG. 1 is a schematic diagram of a multi-link connection shown in accordance with an exemplary embodiment;
FIG. 2 is a schematic diagram illustrating a WiFi network connection established between an electronic device and an AP device according to an example embodiment;
Fig. 3 is a schematic diagram illustrating a second network connection established between an electronic device and an AP device according to an exemplary embodiment;
Fig. 4 is a schematic diagram illustrating a second network connection established between an electronic device and an AP device according to another exemplary embodiment;
Fig. 5 is a schematic diagram illustrating a second network connection established between an electronic device and an AP device according to another exemplary embodiment;
fig. 6 is a schematic diagram illustrating a second network connection established between an electronic device and an AP device according to another exemplary embodiment;
FIG. 7 is a schematic diagram of a software system of an electronic device, shown according to an exemplary embodiment;
FIG. 8 is a schematic diagram illustrating a flow of a network connection method according to an example embodiment;
Fig. 9 is a schematic diagram illustrating data transmission between an electronic device and an AP device according to an exemplary embodiment;
fig. 10 is a schematic flow chart of data transmission between an electronic device and an AP device according to an exemplary embodiment;
fig. 11 is a schematic diagram showing a flow of a network connection method according to another exemplary embodiment;
Fig. 12 is a schematic diagram showing a structure of an electronic device according to an exemplary embodiment.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that references to "a plurality" in this disclosure refer to two or more. In the description of the present application, "/" means or, unless otherwise indicated, for example, A/B may represent A or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of the present application, the words "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and function. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
Currently, wiFi is gradually capable of supporting more data streams, and multiple frequency bands can be used for data transmission at the same time, for example, wiFi7 can use three frequency bands of 2.4GHz, 5GHz and 6GHz at the same time. More and more electronic devices support the WiFi7 protocol, and AP devices supporting the WiFi7 multilink technology are also becoming more and more popular. For WiFi7 technology, a multi-link device (multilinkdevice, MLD) is defined, that is, a plurality of wireless data links can be simultaneously established with an AP device, as shown in fig. 1, links including 2.4GHz, 5GHz and 6GHz can be respectively established between different STA interfaces and the same AP device, so that multi-link communication can be supported. However, most systems (such as Android or Linux) and WiFi drivers of electronic devices only support one STA interface, do not support 2 or more STA interfaces, and do not support MLD, so that a WiFi network connection between these electronic devices and an AP device can only be established in one frequency band, for example, as shown in fig. 2 (a), the electronic device can only establish a WiFi network connection between a 2.4GHz frequency band and the AP device, or as shown in fig. 2 (b), the electronic device can only establish a WiFi network connection between a 5GHz frequency band and the AP device, that is, cannot realize multi-link communication. Therefore, the embodiment of the application provides a network connection method, which can establish network connection with the AP equipment in one frequency band through the STA interface and simultaneously establish network connection with the AP equipment in another frequency band through the P2P interface, thereby realizing multi-link communication.
Before describing the network connection method provided by the embodiment of the present application in detail, an application scenario related to the embodiment of the present application is described next. In some application scenarios, such as games, downloading data, real-time conversation, and the like, it is required to simultaneously establish WiFi network connections in multiple different frequency bands between an electronic device and an AP device, so as to obtain higher throughput, more stable data transmission, and smaller transmission delay. As an example, the embodiment of the present application lists the following exemplary application scenarios:
As an example, after the electronic device is powered on, the user triggers the electronic device to connect to the AP device, where the electronic device establishes a WiFi network connection (hereinafter referred to as a first network connection) with the AP device through the STA interface between a frequency band (hereinafter referred to as a first frequency band), where the first frequency band is related to a WiFi network name selected by the user, for example, the first network connection is established in the 2.4GHz frequency band. When an application program in the electronic device is started or triggered to perform data interaction with the AP device, the electronic device establishes a WiFi network connection (hereinafter referred to as a second network connection) with the AP device in another frequency band (hereinafter referred to as a second frequency band) through a P2P interface, which includes, for example, the following several exemplary application scenarios:
In an example, referring to fig. 3, fig. 3 is a schematic diagram of an application scenario shown in an exemplary embodiment, in which a game application is installed in an electronic device, and the electronic device establishes a first network connection with an AP device in a 2.4GHz band only through an STA interface before the game application is not started. After the user triggers the electronic equipment to start the game application program, the game application program triggers the electronic equipment to establish a second network connection with the AP equipment in the 5GHz frequency band through the P2P interface. In this way, referring to fig. 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 program can transmit data through any one network connection or simultaneously transmit data through two network connections in the running process. In other words, in the game scene, because the requirement on time delay is higher, after the game application is started, the electronic equipment can be triggered to establish network connection with the AP equipment through the P2P interface, so that the dual-link communication is realized.
In another example, referring to fig. 5, fig. 5 is a schematic diagram of an application scenario according to another exemplary embodiment, where the electronic device establishes a first network connection with the AP device at the 2.4GHz band only through the STA interface before the video call is performed through the instant messaging application (e.g., the WeChat TM). When the user triggers the electronic equipment to initiate video call through the instant messaging application program, the instant messaging application program triggers the electronic equipment to establish a second network connection with the AP equipment in the 5GHz frequency band through the P2P interface. Therefore, in the video call, the instant messaging application program can select at least one WiFi network connection for transmitting data from the first network connection and the second network connection according to the requirements, so that stable data transmission is ensured, and the real-time performance of the transmission can be improved.
It should be noted that, of course, the application scenario shown in fig. 5 is merely exemplary, and in another example, it is also possible that after the instant messaging application is started, the electronic device establishes the second network connection with the AP device in the 5GHz band through the P2P interface, which is not limited in the embodiment of the present application.
In yet another example, referring to fig. 6, fig. 6 is a schematic diagram illustrating an application scenario according to another exemplary embodiment, in which an application management application (such as an application market) is provided in an electronic device, and the electronic device establishes a first network connection with an AP device in a 2.4GHz band only through an STA interface before an application installation package is downloaded through the application management application. When the user triggers the electronic equipment to download the application installation package through the application management application program, the application management application program triggers the electronic equipment to establish a second network connection with the AP equipment in the 5GHz frequency band through the P2P interface, so that the application management application program can flexibly select a data link from the first network connection and the second network connection when the application installation package is downloaded, and the application installation package can be downloaded quickly and completely.
Similarly, the application scenario shown in fig. 6 is exemplary, and in another example, the electronic device may establish, through the P2P interface, a second network adhesion with the AP device in the 5GHz band after the application management application is started, which is not limited by the embodiment of the present application.
It should be noted that the foregoing only describes an example of establishing the first network connection in the first frequency band before the application program is running, and establishing the second network connection in the second frequency band with the AP device through the P2P interface when the application program is running or when the data interaction is triggered with the AP device. In another example, after the application program is run or when the application program is triggered to perform data interaction with the AP device, the electronic device may be triggered to establish a first network connection in a first frequency band through the STA interface and establish a second network connection in a second frequency band through the P2P interface at the same time.
In addition, it should be noted that the above-mentioned several application scenarios are only exemplary, and are not limited to the application configuration of the method provided by the embodiment of the present application. The method can also be applied to other application scenes with low time delay, high throughput and load balancing requirements, and the embodiment of the application is not limited to the application scenes.
The method provided by the embodiment of the application can be applied to an Android (Android) system and also can be applied to a Linux system. The software system of the electronic device may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the application, an Android (Android) system with a layered architecture is taken as an example, and a software system of electronic equipment is exemplified. Fig. 7 is a block diagram of a software system of an electronic device according to an embodiment of the present application. Referring to fig. 7, the hierarchical architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun lines (Android runtime) and a system layer, and a kernel layer, respectively.
The application layer may include a series of application packages. As shown in fig. 7, the application package may include, but is not limited to, applications such as games, instant messaging, application management (e.g., application market), and applications such as phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, and the like.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for the application of the application layer. The application framework layer includes a number of predefined functions. As an example of the present application, as shown in fig. 7, the application layer includes a WiFi connection module, a scanning module, a result storage module, an instruction 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 for triggering the electronic equipment to establish WiFi network connection with the AP equipment through the STA interface. The scanning module is used for scanning WiFi signals. The result storage module is used for storing the scanning result of the scanning module. The instruction receiving module is used for receiving instructions or data issued by an application program of the application layer to the P2P interface. The service module is used for establishing a data transmission channel between the instruction receiving module and the P2P connection management module, so that data interaction can be carried out between the instruction interface module and the P2P connection management module. The P2P connection management module and the interface conversion module are used for carrying out interface conversion on data issued by an upper layer. The network configuration module is used for establishing network connection with other electronic devices (such as AP devices).
Android run time includes a core library and virtual machines. Android runtime is responsible for scheduling and management of the android system. The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android. The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules, such as: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc. The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The kernel layer at least comprises a WiFi drive, a display drive, a camera drive, an audio drive and a sensor drive.
Based on 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, a user triggers the electronic device to connect to the AP device, that is, the electronic device is connected to the WiFi network, where in this case, the electronic device establishes a WiFi network connection with the AP device at a first frequency band of the WiFi network through the STA interface, that is, establishes a first network connection. And then, when a certain application program (hereinafter referred to as a first application program) in the electronic equipment needs to establish dual-channel connection, the first application program triggers the electronic equipment to simultaneously establish WiFi network connection with the AP equipment in a second frequency band through the P2P interface, namely, establish second network connection. Specifically, referring to fig. 8, fig. 8 is a schematic diagram illustrating a flow of a network connection method according to an exemplary embodiment. By way of example, and not limitation, the method is applied to the electronic device shown in fig. 7, and the electronic device is described by using the interaction implementation of the modules as an example, where the method may include some or all of the following:
Step 801: after the electronic equipment is started, under the condition of receiving a WiFi connection instruction, the WiFi connection module establishes a first network connection with the AP equipment in a first frequency band through the STA interface.
The WiFi connection instruction may be triggered by the user. For example, a WiFi connection control is provided in the electronic device, and when the user wants the electronic device to connect to the WiFi network, the WiFi connection control may be triggered, and at this time, a WiFi connection module in the electronic device may receive a WiFi connection instruction. And then, triggering the electronic equipment to establish a first network connection with the AP equipment in a first frequency band through the STA interface by the WiFi connection module.
The first frequency band may be selected by a user, for example, in a process of establishing a first network connection with the AP device through the STA interface, the electronic device may display a list of wireless network names of scanned WiFi networks, and then the user may select a wireless network name to be connected according to a requirement, where a wireless network name corresponds to a frequency band. Or the first frequency band can be any connectable frequency band scanned by the electronic equipment, namely, the first frequency band can be selected and connected by the electronic equipment.
Step 802: the first application is launched.
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 a network service or services, wherein the specified requirements include one or more of low latency, high throughput, or stable transmission. For example, the first application is a game application.
In another example, the first application is an application in the electronic device where some or some function has a specified requirement. For example, the first application is an instant messaging application, and the function with the specified requirement can be, but is not limited to, a video call function; for example, the first application program is an application management application program, and the function with the specified requirement can be, but is not limited to, an application installation package downloading function.
Or the first application program can be any application program which needs to be connected with a network in the electronic equipment.
Step 803: the first application receives an execution operation of the network service.
The network service may refer to any one of services related to network communication executed by the first application program, or may refer to a service related to network communication and having a specified requirement executed by the first application program. And under the condition that the first application program receives the execution operation of the network service, the first application program is triggered to perform data interaction with the AP equipment so as to realize the corresponding network service.
Illustratively, the first application is an application marketplace and the network service is a download application package. In one possible scenario, as shown in fig. 6, after the application market is started, the electronic device displays an application interface of the application market, then, a user triggers a download control (such as an "install" control in fig. 6) of a certain application program in the application interface, accordingly, the application market receives an execution operation of a network service, which is triggered by the user and is used for downloading an application program package, and then, data interaction is to be performed with the AP device to obtain the application program package.
It should be noted that, step 803 is optional, that is, the embodiment of the present application is merely described by taking the example that the user triggers the first application program to execute the network service subsequently through the execution operation of the network service. In another example, the first application may also automatically perform network services after being launched, e.g., the first application may also automatically request to obtain network data under some preset condition after being launched, which is not limited by the embodiment of the present application.
Step 804: in response to performing the operation, the first application program triggers the scanning module to scan for WiFi signals.
As an example of the present application, after receiving the execution operation, before the first application program performs data interaction with the AP device, the electronic device is triggered to establish a second network connection with the AP device through the P2P interface, and for this purpose, the first application program triggers the scanning module to perform WiFi signal scanning to obtain relevant data for connecting to the second network connection.
Illustratively, continuing with the above example, when the user clicks the download control for a certain application program on the application interface of the application market, the application market triggers the scanning module to perform WiFi signal scanning in response to the triggering operation of the download control by the user. For example, the application marketplace may send a scan instruction to the scan module to trigger the scan module to scan for WiFi signals.
It should be noted that steps 803 to 804 are optional. As another example of the present application, the first application may trigger the scanning module to perform WiFi signal scanning after being started, that is, the first application may trigger the scanning module to perform WiFi signal scanning after being started, instead of triggering the scanning module to perform WiFi signal scanning when being triggered to perform data interaction with the AP device, which is not limited by the embodiment of the present application.
Step 805: and the scanning module scans the WiFi signals to obtain a scanning result.
In an implementation, the scanning module may trigger the WiFi hardware to scan the WiFi signal, so as to obtain a scanning result.
Step 806: the scanning module stores the scanning result in the result storage module.
That is, after the scanning module obtains the scanning result, the scanning result is stored in the result storage module, so that the first application program can obtain the scanning result from the result storage module.
Step 807: the first application program reads the scanning result from the result storage module and analyzes the scanning result to acquire the network connection parameters of the second frequency band.
In one example, the network connection parameters may include, but are not limited to, a wireless network name, a password, a network frequency band, and a physical address. For example, the network connection parameters include a service identifier (SERVICEETDENTIFIER, SSID), psk, freq, and madAddr, where SSID is a wireless network name, psk is a password, freq is a network band, and madAddr is a physical address. The network connection parameters of different frequency bands are different.
In one possible case, the analysis result after the analysis of the scanning result may only include the network connection parameter of one unconnected frequency band, and in this case, the network connection parameter of the unconnected frequency band is directly determined to the network connection parameter of the second frequency band. Wherein unconnected frequency bands refer to 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 analysis result includes network connection parameters of the first frequency band and another frequency band, the first application may further query the first frequency band corresponding to the first network connection that has been currently established, and select the network connection parameters of the other frequency band except the first frequency band from the analysis 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.
In another case, the analysis result after analyzing the scan result may include network connection parameters of a plurality of unconnected frequency bands, for example, may include network connection parameters of a 5GHz frequency band and network connection parameters of a 6GHz frequency band. In this case, the first application program may select, as the network connection parameter of the second frequency band, the network connection parameter of one frequency band from the network connection parameters of the plurality of unconnected frequency bands according to the requirement. By way of example and not limitation, the first application may be selected based on the type of network.
It should be noted that, in a possible case, the network connection parameter may not include the password of the WiFi network of the second frequency band, but the first application program stores the password of the WiFi network of the second frequency band in advance, in this case, after the first application program obtains the analysis result, the first application program may obtain the corresponding password from the local according to the SSID, and then execute the following operations in step 808 and following steps.
It should be noted that the foregoing description is given by taking the example that the electronic device has been connected to the second frequency band in advance, that is, the network connection parameter includes the password, or the password of the WiFi network of the second frequency band is stored in the first application program. In another possible case, the electronic device may not be connected to the second frequency band in advance, and in this case, after the scanning module scans the WiFi signal, the scanning result does not include the password of the second frequency band, and the first application program does not store the password of the second frequency band. In this case, after the first application program analyzes the network connection parameters, part or all of the information in the network connection parameters may be displayed, so that the user may input the password according to the displayed information. For example, the first application may display the SSID in the network connection parameter, and then the user may input the password corresponding to the displayed SSID, and accordingly, the first application may obtain the password corresponding to the SSID, and then perform the following operations in step 808 and following steps.
Step 808: the first application program sends a first connection instruction to the instruction receiving module through the first interface, wherein the first connection instruction carries network connection parameters of the second frequency band.
The first connection instruction is used for requesting the P2P interface to establish a second network connection with the AP equipment in a second frequency band based on the network connection parameters.
The first interface is an interface in the P2P interface for the first application to call to establish a WiFi network connection with the AP device through the P2P interface. In one example, the following may be encapsulated in an AddGroup () function of the FWK layer of the electronic device, thereby providing a first application with a callable first interface, where the first interface is connect ():
public boolean p2pGroupAdd(String networkName,String passphrase,int freq,String peerAddress);
public void connect(@NonNull WifiConfiguration config,@Nullable ActionListener listener);
Wherein the AddGroup () function is used to implement the relevant functions of the P2P interface, such as establishing a network connection channel, etc.
In one example, the instruction receiving module is named wifiP < 2 > pManager module. In this case, the first application issues a first connection instruction to the wifiP < 2 > -pManager module by calling the connect () interface.
Step 809: the instruction receiving module receives a first connection instruction through the first interface and then sends network connection parameters to the service module.
In one example, after receiving the first connection instruction, the instruction receiving module may parse the first connection instruction to obtain a network connection parameter of the second frequency band, and then the instruction receiving module sends the second connection instruction to the service module, where the second connection instruction carries the network connection parameter of the second frequency band.
Illustratively, the second connection instruction is a wifi p2 pmmanager connection instruction, and the service module is named wifiP2PSERVICELMPL module. In this case, the specific implementation of the instruction receiving module to send the network connection parameter to the service module may include: the wifiP2pManager module sends a wifi 2pmanager.connect connection instruction to the wifiP2PSERVICELMPL module, where the network connection parameter is carried in the wifi 2pmanager.connect connection instruction.
Of course, the above implementation is merely exemplary, and in another example, the instruction receiving module may also directly forward the first connection instruction to the service module to transmit the network connection parameter of the second frequency band to the service module.
Step 810: the service module sends network connection parameters to the P2P connection management module through the second interface.
The second interface is an interface in the P2P connection management module, and the second interface is called by the service module to transfer data for interaction with the AP device (e.g., establishing a WiFi network connection) to the P2P connection management module. Illustratively, the second interface is the p2pGroupAdd () interface above.
In one example, the P2P connection management module is named wifP2PNative module. In implementation wifiP2PSERVICELMPL calls with wifitive.p2pgrouppadd (ssid, psk, freq, macAddr) to send network connection parameters including ssid, psk, freq, macAddr to the wifP2PNative module.
Step 811: the P2P connection management module sends the network connection parameters to the interface conversion module.
In one example, the interface conversion module is named SupplicantP2PLFACEHAL.
In one example, the P2P connection management module invokes SupplicantP p_suppantant_hal's msupplicant P2 pfancehal's groupadd interface of wpa_suppiant_hal of PLFACEHAL to send network connection parameters to the interface conversion module. Illustratively, the P2P connection management module invokes msupplicant P2 pfancehal. Groupadd (ssid, psk, false, freq, macAddr, true) to send the network connection parameters to the interface conversion module.
Step 812: the interface conversion module performs interface conversion on the network connection parameters.
In one example, the interface conversion module performs interface conversion on the network connection parameters, such as according to a parameter transmission form defined by the network configuration module, so as to convert the network connection parameters into a form recognizable by the network configuration module.
Step 813: the interface conversion module sends the converted network connection parameters to the network configuration module.
In one example, the interface conversion module invokes an ifacev12.addgroup_1_2 () interface of the network configuration module to communicate the network connection parameters to the network configuration module. For example, in implementation, the interface conversion module invokes the ifacev12.add group_1_2 (ssid, psk, ISPERSISTENT, freq, macAddr, join) to send the network connection parameters to the network configuration module.
Step 814: the network configuration module establishes a second network connection with the AP equipment in a second frequency band based on the converted network connection parameters.
After the network configuration module receives the network connection parameters, wiFi network connection can be established between the network configuration module and the AP equipment in the second frequency band based on the network connection parameters, so that the second network connection is established between the network configuration module and the AP equipment through the P2P interface. In one example, the network configuration module is named wpa_supplicant. In an implementation, wpa_suppicant establishes a second network connection with the AP device in a second frequency band based on ssid, psk, freq, and macAddr.
In this way, the electronic device realizes that, under the condition that the first network connection is established with the AP device in the first frequency band through the STA interface, the second network connection is also established with the AP device in the second frequency band through the P2P interface, for example, please refer to fig. 4, taking the first frequency band as 2.4GHz and the second frequency band as 5GHz as an example, the electronic device establishes the first network connection with the AP device in the 2.4GHz frequency band through the STA interface, and establishes the second network connection with the AP device in the 5GHz frequency band through the P2P interface. In this case, a double-link connection occurs by the packet being grasped through the air interface.
It should be noted that, in one possible case, the AP device connected through the P2P interface and the AP device connected through the STA interface may be the same AP device. In another possible scenario, the AP device connected through the P2P interface may not be the same AP device as the AP device connected through the STA interface.
It should be noted that, in the embodiment of the present application, after the first application program is started or when the first application program is triggered to perform data interaction with the AP device, the triggering electronic device establishes a second network connection with the AP device in a second frequency band through the P2P interface. In another example, the second network connection may also be established prior to the first application being launched, such as the electronic device establishing the second network connection at the same time as the first network connection is established; in yet another example, the first network connection and the second network connection may be simultaneously triggered by the first application program to be established by the electronic device, and, for example, after the first application program is started or when the first application program is triggered to perform data interaction with the AP device, the first interface is invoked to send a first connection instruction to the P2P interface, and meanwhile, send a third connection instruction to the STA interface, so as to trigger the electronic device to establish different WiFi network connections with the AP device through the P2P interface and the STA interface, which is not limited by the embodiment of the present application.
Step 815: and under the condition that the establishment of the WiFi network connection is completed, the network configuration module returns a network establishment completion notification to the first application program.
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 to facilitate the first application program to know whether the data transmission can be performed through the P2P interface, the network configuration module may return a network establishment completion notification to the first application program after completing establishment of the second network connection in the second frequency band based on the network connection parameter. In one example, as shown in fig. 8, a specific implementation of the network configuration module returning a 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 program.
It should be noted that step 815 is an optional operation. In another possible implementation manner, the first application program may also actively request to the network configuration module to query whether the second network connection is successfully established, which is not limited by the embodiment of the present application.
Therefore, for the electronic equipment which does not support a plurality of STA interfaces, as the WiFi drive of a large part of electronic equipment supports the coexistence of the STA interfaces and the P2P interfaces, the multilink connection can be realized without additionally modifying the WiFi drive, so that more flexible data link selection can be realized during data transmission, the WiFi network transmission is more stable, and the real-time performance is more ensured. In addition, the electronic equipment supports the independent data transmission of multiple links, so that the electronic equipment can have higher throughput and can obtain more stable data transmission in an interference environment. Illustratively, the data transfer process may include the contents of step 816 as follows:
Step 816: and in the process of data interaction between the first application program and the AP equipment, the first application program performs data transmission with the AP equipment through the first network connection and/or the second network connection.
That is, after the first application program determines that the second network connection is established in the second frequency band, the first application program can select to perform data transmission with the AP device through the first network connection and/or the second network connection according to the requirement in the process of performing data interaction with the AP device.
In one example, in the process of performing data interaction with the AP device, the first application may select, according to the air interface load degree, one link from the two links to perform data transmission, so as to implement air interface load balancing transmission. When the two frequency bands are in the idle state, after the first application program selects one frequency band for data transmission, if the selected frequency band is busy, the first application program can be dynamically switched to the other frequency band for data transmission. For example, in the case where the 2.4GHz band and the 5GHz band are both in an idle state, the first application may select the 5GHz band for data transmission. Under the interference environment, if the 5GHz frequency band is busy, the data transmission can be dynamically switched to the 2.4GHz frequency band. Thus, the stability of data transmission is ensured.
In another example, for a scenario with a higher data stability requirement, such as a game scenario, the first application program may also perform data transmission through two frequency bands simultaneously during the data interaction with the AP device. Therefore, the receiving end can ensure normal data receiving as long as the receiving end receives the data sent by the electronic equipment on one frequency band, thereby ensuring the stability and instantaneity of data transmission. As illustrated in fig. 9, the electronic device performs data transmission in both the 2.4GHz band (data transmission delay of 100 ms) and the 5GHz band (data transmission delay of 5 ms) at the same time. And after the electronic equipment fails to transmit data in the 2.4GHz frequency band, the electronic equipment waits for retransmission in the 2.4GHz frequency band, and during the period, the electronic equipment normally receives the data in the 5GHz frequency band, so that the reliability of data transmission is ensured. In addition, because the data transmission delay of the 5GHz frequency band is smaller, the data transmission reliability is ensured and the real-time performance of the data transmission is improved.
As an example of the present application, the data transfer process is described using the example where the first application chooses to transfer data over the second network connection. Specifically, referring to fig. 10, the following may be included:
A1: the first application program sends data to be transmitted to the instruction receiving module through the first interface.
The first application program calls the first interface to send data to be transmitted to the instruction receiving module through the first interface. In one example, a first application invokes a first interface and sends a data transfer instruction to the first interface, the data transfer instruction carrying data to be transferred.
A2: the instruction receiving module sends data to the service module.
A3: and the service module sends data to the P2P connection management module through the second interface.
In one example, the service module receives a data transmission instruction, parses data to be transmitted therefrom, and then sends the transmitted data to the P2P connection management module.
A4: the P2P connection management module sends data to the interface conversion module.
A5: the interface conversion module performs interface conversion on the data and sends the converted data to the network configuration module.
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.
A6: the network configuration module sends data to the AP device over the second network connection.
In the data interaction process, the data is transmitted through the P2P interface, so that the sent data contains P2P IE.
The foregoing describes an example in which the first application program transmits data to the AP device. In one possible case, the AP device may also send data to the first application, where the data transmission direction is opposite to the data transmission direction shown in fig. 10, and the description is not repeated here.
It should be noted that, the foregoing is described taking as an example that the first application program triggers the electronic device to establish the second network connection with the AP device in the second frequency band through the P2P interface when the network data transmission is performed. In another possible case, when the first application program performs network data transmission, if the second application program has triggered the electronic device to establish a second network connection with the AP device in the second frequency band through the P2P interface, the first application program may directly select the first network connection and/or the second network connection to perform network data transmission, that is, it is not required to trigger the electronic device to establish the second network connection in the second frequency band through the P2P interface again.
As an example of the present application, after the first application program ends through the first network connection and/or the second network connection, such as when the first application program is closed, the electronic device may be triggered to disconnect the second network connection established with the AP device through the P2P interface. For example, please continue to refer to fig. 8, the specific implementation may include the following:
step 817: the first application receives a close operation.
The closing operation is a user-triggered operation for instructing the electronic device to close the first application.
Step 818: the first application program sends a WiFi disconnection instruction to the instruction receiving module through the first interface.
The WiFi disconnection instruction is used for indicating to disconnect a second network connection established with the AP equipment in a second frequency band through the P2P interface. After receiving the closing operation, the first application program not only sends a WiFi disconnection instruction to the instruction receiving module, but also exits the running state, namely the first application program is closed.
Step 819: the instruction receiving module sends a WiFi disconnection instruction to the service module.
Step 820: and the service module sends a WiFi disconnection instruction to the P2P connection management module through the second interface.
Step 821: and the P2P connection management module sends a WiFi disconnection instruction to the interface conversion module.
Step 822: the interface conversion module performs interface conversion on the WiFi disconnection instruction and sends the converted WiFi disconnection instruction to the network configuration module.
The interface conversion module performs interface conversion on the WiFi disconnection instruction according to the data format defined by the network configuration module, and then sends the converted WiFi disconnection instruction to the network configuration module.
Step 822: and responding to the WiFi disconnection instruction, and disconnecting the second network connection established with the AP equipment in the second frequency band by the network configuration module.
The network configuration module sends a WiFi disconnect request to the AP device to disconnect the second network connection established with the AP device.
It should be noted that, in the embodiment of the present application, only in the case where the first application program is closed, the electronic device is triggered to disconnect the second network connection established with the AP device through the P2P interface for illustration. In another optional example, since the user may open the first application program and then not use it for a long time (e.g., more than one day), that is, if the first application program is in an operating state, the first application program does not perform network data interaction or does not perform a function with a specified requirement for a preset period of time, in this case, the first application program may also trigger the electronic device to disconnect the second network connection established with the AP device through the P2P interface, and then trigger the electronic device to establish the second network connection with the AP device through the P2P interface when the first application program needs to perform network data interaction or perform a function with a specified requirement.
In the embodiment of the application, after the first application program is started, in the process of data interaction with the AP equipment, the data transmission with the AP equipment through the first network connection and/or the second network connection can be selected. The first network connection is a WiFi network connection established between the STA interface of the electronic equipment and the AP equipment in a first frequency band, the second network connection is a WiFi network connection established between the P2P interface of the electronic equipment and the AP equipment in a second frequency band, and the second frequency band is different from the first frequency band. Namely, under the condition that the electronic equipment establishes WiFi network connection with the AP equipment in one frequency band through the STA interface, the electronic equipment can also establish WiFi network connection with the AP equipment in the other frequency band through the P2P interface, so that multi-link connection between the electronic equipment and the AP equipment is realized.
The electronic device is a P2P device in case of establishing a second network connection with the AP device via the P2P interface. Conventionally, as a P2P device, the P2P protocol prohibits scanning by other P2P devices after the AP device (or organizer (GO)) is connected, however, in this way, during the process of establishing the second network connection between the electronic device and the AP device through the P2P interface, other P2P devices are easily caused to fail to scan the device. To avoid this, the embodiment of the present application further provides a network connection method, specifically, referring to fig. 11, the following description will take an application of the method in the electronic device as an example, where the method may include some or all of the following:
Step 1101: after the electronic equipment is started, under the condition of receiving a WiFi connection instruction, a first network connection is established between the STA interface and the AP equipment in a first frequency band.
Step 1102: and after the electronic equipment receives the starting operation of the first application program, starting the first application program.
Step 1103: and after the first application program is started or when the first application program is triggered to perform data interaction with the AP equipment, the electronic equipment establishes a second network connection with the AP equipment in a second frequency band through the P2P interface.
Step 1104: and the electronic equipment performs data transmission with the AP equipment through the first network connection and/or the second network connection.
Specific implementations of the steps 1101 to 1104 may be referred to steps 801 to 816 in the embodiment shown in fig. 8, and will not be described in detail herein.
Step 1105: the electronic device receives a P2P connection operation.
The P2P connection operation is an operation for requesting P2P connection. In one example, a third application program is installed in the electronic device, and when the user wants the electronic device to perform P2P connection, the P2P connection operation may be triggered in an application interface of the third application program.
Step 1106: in response to the P2P connection operation, the electronic device listens for probe request frames over the P2P interface.
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.
That is, after the electronic device connects to the AP device through the P2P interface, in the case of receiving the P2P connection operation, the monitoring function of the P2P interface on the probe request frame is turned on to monitor the probe request frames broadcast by other P2P devices. In one example, the electronic device may turn on a filter of the probe request frame in the network configuration module (i.e., wpa_supplicant) described above to cause the WiFi driver to receive the probe request frame, where the filter is used to enable or disable a listening function to the probe request frame, and in one example, the filter is WIFI DRIVER P < 2 > P response filter.
Step 1107: after receiving the detection request frame through the P2P interface, the electronic device sends a detection response frame to other P2P devices through the P2P interface.
Wherein, the probe response frame is used for replying to the probe request frames which other P2P devices have received the broadcast of. In some examples, the probe response frame is a probe request frame.
That is, when the electronic device receives the probe request frame through the P2P interface, the corresponding AP channel replies with probe response frames of other P2P devices, so that the electronic device can be found by other P2P devices when the electronic device is connected to the AP device through the P2P interface, so that the situation that the other P2P devices cannot scan the electronic device is avoided, and the situation that the P2P function cannot be used in the process of connecting the AP device through the P2P interface is avoided.
Step 1108: and the electronic equipment receives P2P connection requests sent by other P2P equipment through the P2P interface.
Illustratively, the P2P connection request is an authrequest.
Step 1109: under the condition that the first application program transmits data with the AP equipment through the P2P interface, the electronic equipment sends a transmission switching instruction to the first application program, wherein the transmission switching instruction is used for indicating that the second network connection cannot be used for transmitting the data.
In one case, if a P2P connection request sent by another P2P device is received through the P2P interface, it indicates that the other P2P device requests to establish a P2P connection with the electronic device, and in this case, if a first application in the electronic device transmits data through a second network connection, in order to enable the first application to quickly switch to transmitting data through the first network connection, a transmission switching instruction may be sent to the first application. In one example, a specific implementation of sending a transmission switch instruction to a first application may include: the network configuration module sends a transmission switching instruction to the interface conversion module, the interface conversion module sends a 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 program.
Step 1110: the electronic device sends a disconnection request to the AP device.
The disconnection request is used to instruct disconnection of the second network connection established in the second frequency band from the AP device. In one example, an electronic device sends a disconnect request to an AP device through a network configuration module. Illustratively, the disconnect request is deauth _request.
It should be noted that, the steps 1108 to 1110 are optional operations. In another example, when the electronic device receives a P2P connection request sent by another P2P device through the P2P interface, the electronic device may also directly disconnect the second network connection established between the electronic device and the AP device in the second frequency band through the P2P interface, that is, may also not notify the first application program to perform handover. In this case, the first application program may actively perceive that the data cannot be transmitted through the P2P interface when transmitting the data. In this way, the P2P connection speed can be increased.
Step 1111: the AP device sends a disconnect response to the electronic device.
And under the condition that a disconnection request sent by the electronic equipment is received, the AP equipment disconnects the second network connection and feeds back a disconnection response to the electronic equipment. In one example, the electronic device receives a disconnect response, illustratively deauth response, through the network configuration module.
The steps 1110 and 1111 are an optional implementation manner in which the electronic device disconnects the second network connection established between the AP device and the P2P interface in the second frequency band.
Step 1112: the electronic device establishes P2P connection with other P2P devices through the P2P interface.
That is, after the second network connection is disconnected between the electronic device and the AP device, a process of establishing P2P connection with other P2P devices is performed. Illustratively, the electronic device sends a P2P connection response to other P2P devices over the P2P interface, such as the P2P connection response being an authresponse. And then the other P2P devices send authentication requests (such as an authentication request is an assoc request) to the electronic device, and the electronic device sends authentication responses (such as an authentication response is an assoc response) to the other P2P devices, so that the P2P connection is established through data interaction.
It should be noted that, in the embodiment of the present application, only the case where the electronic device listens to the probe request frames broadcast by other P2P devices is taken as an example, and in another example, the electronic device may also broadcast the probe request frames, so as to request to establish P2P connection with other P2P devices.
In the embodiment of the application, under the condition that the electronic equipment and the AP equipment establish the second network connection, if P2P connection operation is received, the electronic equipment opens the monitoring function of the detection request frame and replies the detection response frame on an AP channel. Thereby ensuring that the device can be found by other P2P devices in the process of connecting the AP device. When other P2P devices scan the electronic device, the P2P interface is disconnected with the AP device and returns to the P2P connection process, so that the problem that the P2P function cannot be used due to the connection of the AP device is avoided.
The electronic device in the embodiment of the present application may be a mobile phone motion camera (go pro), a digital camera, a tablet computer, a desktop, a laptop, a handheld computer, a notebook, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an augmented reality (augmented reality, AR) \virtual reality (VR) device, a mobile phone, etc., which is not limited in this embodiment of the present application.
Fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 12, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, a subscriber identity module (subscriber identification module, SIM) card interface 195, and the like. The sensor module 180 may 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 sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a memory, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, and/or a neural Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces, such as may include an integrated circuit (inter-INTEGRATED CIRCUIT, I2C) interface, an integrated circuit built-in audio (inter-INTEGRATED CIRCUIT SOUND, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device 100 through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (WIRELESS FIDELITY, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation SATELLITE SYSTEM, GNSS), frequency modulation (frequency modulation, FM), near field communication (NEAR FIELD communication, NFC), infrared (IR), etc., applied to the electronic device 100. The wireless communication module 160 may 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, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. Such as storing files of music, video, etc. in an external memory card.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (e.g., audio data, phonebook, etc.) created by the electronic device 100 during use, and so forth. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor 180K may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys or touch keys. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 processes or functions described in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, data subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital versatile disk (DIGITAL VERSATILE DISC, DVD)), or a semiconductor medium (e.g., solid state disk (Solid STATE DISK, SSD)), etc.
The above embodiments are not intended to limit the present application, and any modifications, equivalent substitutions, improvements, etc. within the technical scope of the present application should be included in the scope of the present application.
Claims (11)
1. A network connection method, characterized by being applied to an electronic device, the method comprising:
A first application program is started, wherein the first application program is one application program in the electronic equipment;
In the process of data interaction between the first application program and the AP equipment, data transmission is carried out between the first application program and the AP equipment through first network connection and/or second network connection, wherein the first network connection is wireless fidelity WiFi network connection established between a station STA interface of the electronic equipment and the AP equipment in a first frequency band, the second network connection is WiFi network connection established between a point-to-point P2P interface of the electronic equipment and the AP equipment in a second frequency band, and the second frequency band is different from the first frequency band.
2. The method of claim 1, wherein the first network connection is established prior to the first application being launched; the method further comprises the steps of:
After the first application program is started or when the first application program is triggered to perform data interaction with the AP equipment, the electronic equipment establishes the second network connection with the AP equipment in the second frequency band through the P2P interface.
3. The method of claim 2, wherein the electronic device comprises a scan module and a result storage module, the P2P interface comprising a first interface for transmitting data related to the second network connection;
After the first application program is started or when the first application program 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, including:
After the first application program is started or when the first application program is triggered to perform data interaction with the AP equipment, the first application program triggers the scanning module to perform WiFi signal scanning, and a scanning result is obtained;
The scanning module stores the scanning result into the result storage module;
The first application program reads the scanning result from the result storage module and analyzes the scanning result to obtain network connection parameters of the second frequency band;
The first application program sends a first connection instruction to the P2P interface through the first interface, wherein the first connection instruction carries the network connection parameter;
and responding to the first connection instruction, and establishing the second network connection between the P2P interface and the AP equipment in the second frequency band according to the network connection parameters.
4. The method of claim 3, wherein the P2P interface comprises an instruction receiving module, a service module, a P2P connection management module, an interface conversion module, and a network configuration module;
The responding 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 parameter, including:
The instruction receiving module receives the first connection instruction through the first interface and then 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;
and the network configuration module establishes the second network connection with the AP equipment in the second frequency band based on the converted network connection parameters.
5. The method of any one of claims 1-4, wherein the method further comprises:
the electronic equipment receives P2P connection operation;
Responding to the P2P connection operation, the electronic equipment monitors a detection request frame through the P2P interface, wherein the detection request frame refers to a detection request frame broadcast by other P2P equipment;
after receiving the detection request frame through the P2P interface, the electronic equipment sends a detection response frame to the other P2P equipment through the P2P interface;
Under the condition that a P2P connection request sent by other P2P devices is received through the P2P interface, the electronic device disconnects the second network connection established by the P2P interface and the AP device in the second frequency band;
and the electronic equipment establishes P2P connection with the other P2P equipment through the P2P interface.
6. The method of claim 5, wherein the method further comprises:
And under the condition that the P2P connection request sent by the other P2P devices is received through the P2P interface, if the first application program performs data transmission between the P2P interface and the AP device, before disconnecting the second network connection, the electronic device sends a transmission switching instruction to the first application program, wherein the transmission switching instruction is used for indicating that the second network connection cannot be used for transmitting data.
7. The method of claim 5, wherein the electronic device disconnecting the second network connection established with an AP device in the second frequency band through the P2P interface if a P2P connection request sent by the other P2P device is received through the P2P interface, comprising:
under the condition that the P2P connection request sent by the other P2P devices is received through the P2P interface, the electronic device sends a disconnection request to the AP device through the P2P interface;
and after receiving a disconnection response sent by the AP equipment, the electronic equipment disconnects the second network connection established between the P2P interface and the AP equipment in the second frequency band, wherein the disconnection response is sent after receiving the disconnection request.
8. The method of any of claims 1-4, wherein the P2P interface comprises 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 performing data interaction with the AP device by the first application program, the data transmission with the AP device by the first network connection and/or the second network connection includes:
In the process of data interaction between the first application program and the AP equipment, under the condition of selecting data transmission through the second network connection, the first application program calls a first interface, and the data to be transmitted is sent to the instruction receiving module through the first interface, wherein the first interface is used for transmitting data related to the second network connection;
the instruction receiving module receives the data through a 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 the 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;
and the network configuration module sends the data to the AP equipment through the second network connection.
9. The method of any one of claims 1-4, 8, wherein the method further comprises:
And under the condition that the first application program is closed, the electronic equipment disconnects the second network connection established by the P2P interface and the AP equipment in the second frequency band.
10. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the method according to any one of claims 1-9 when executing the computer program.
11. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of claims 1-9.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310304073.9A CN118695402A (en) | 2023-03-21 | 2023-03-21 | Network connection method, electronic device, and readable storage medium |
PCT/CN2023/134459 WO2024193086A1 (en) | 2023-03-21 | 2023-11-27 | Network connection method, electronic device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310304073.9A CN118695402A (en) | 2023-03-21 | 2023-03-21 | Network connection method, electronic device, and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118695402A true CN118695402A (en) | 2024-09-24 |
Family
ID=92763436
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310304073.9A Pending CN118695402A (en) | 2023-03-21 | 2023-03-21 | Network connection method, electronic device, and readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN118695402A (en) |
WO (1) | WO2024193086A1 (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111182614B (en) * | 2020-01-08 | 2021-10-01 | 华为技术有限公司 | Method and device for establishing network connection and electronic equipment |
WO2021253273A1 (en) * | 2020-06-17 | 2021-12-23 | 天彩电子(深圳)有限公司 | Wireless transmission method and system based on wifi multiplexing technology |
CN114080049A (en) * | 2020-08-14 | 2022-02-22 | 华为技术有限公司 | Channel access method and communication device |
CN114531742B (en) * | 2020-10-30 | 2023-03-03 | 荣耀终端有限公司 | Dual Wi-Fi connection method and electronic equipment |
CN115988643A (en) * | 2021-10-14 | 2023-04-18 | 荣耀终端有限公司 | WiFi P2P connection method, electronic device and medium |
-
2023
- 2023-03-21 CN CN202310304073.9A patent/CN118695402A/en active Pending
- 2023-11-27 WO PCT/CN2023/134459 patent/WO2024193086A1/en unknown
Also Published As
Publication number | Publication date |
---|---|
WO2024193086A1 (en) | 2024-09-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114390501B (en) | Data transmission method and electronic equipment | |
CN110602686B (en) | Method for using remote SIM module and electronic equipment | |
CN110730448A (en) | Method for establishing connection between devices and electronic device | |
JP2023535966A (en) | Channel adjustment method and electronic device | |
WO2023061146A9 (en) | Method for monitoring link and terminal device | |
CN114615660A (en) | Access method, system and electronic equipment | |
CN113038627A (en) | File sharing method, mobile device and computer storage medium | |
CN115022872B (en) | Data transmission method, electronic equipment and readable storage medium | |
CN115633340A (en) | File transmission method, terminal, electronic device and storage medium | |
CN118695402A (en) | Network connection method, electronic device, and readable storage medium | |
CN116471707B (en) | Method, device and system for connecting router | |
CN116761222B (en) | Method for switching base station, terminal equipment and readable storage medium | |
CN117880885B (en) | Audio playing optimization method and electronic equipment | |
CN114173315B (en) | Bluetooth reconnection method and terminal equipment | |
CN116709582B (en) | Method for assisting conversation and electronic equipment | |
CN117119097B (en) | Method, equipment and storage medium for incoming call resonance | |
CN116033597B (en) | Bluetooth connection method and device, electronic equipment and storage medium | |
CN115942253B (en) | Prompting method and related device | |
CN115022853B (en) | Device discovery method and electronic device | |
WO2023051204A1 (en) | Cross-device connection method, electronic device and storage medium | |
CN114020286A (en) | Application program installation method, terminal, electronic device and storage medium | |
CN118264709A (en) | Service discovery method and electronic equipment | |
CN117956548A (en) | Data transmission method, device and storage medium | |
CN117880885A (en) | Audio playing optimization method and electronic equipment | |
CN116264600A (en) | Incoming call reminding method, electronic device and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |