CN111148188B - Network connection method, device, storage medium and electronic equipment - Google Patents

Network connection method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111148188B
CN111148188B CN201911400260.7A CN201911400260A CN111148188B CN 111148188 B CN111148188 B CN 111148188B CN 201911400260 A CN201911400260 A CN 201911400260A CN 111148188 B CN111148188 B CN 111148188B
Authority
CN
China
Prior art keywords
network
application
security level
accessible
module
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.)
Active
Application number
CN201911400260.7A
Other languages
Chinese (zh)
Other versions
CN111148188A (en
Inventor
李雄
黄园
黄俊源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911400260.7A priority Critical patent/CN111148188B/en
Publication of CN111148188A publication Critical patent/CN111148188A/en
Application granted granted Critical
Publication of CN111148188B publication Critical patent/CN111148188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/18Selecting a network or a communication service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a network connection method, a network connection device, a storage medium and electronic equipment. The method is applied to an electronic device, the electronic device comprises a first Wi-Fi module and a second Wi-Fi module, the electronic device is connected to a first Wi-Fi network through the first Wi-Fi module, and the method comprises the following steps: acquiring security level information of foreground application and background application; determining a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application; connecting to the target Wi-Fi network through the second Wi-Fi module to serve as a second Wi-Fi network. The embodiment of the application can improve the flexibility of data transmission by using the dual Wi-Fi.

Description

Network connection method, device, storage medium and electronic equipment
Technical Field
The present application relates to the field of network technologies, and in particular, to a network connection method and apparatus, a storage medium, and an electronic device.
Background
Wi-Fi is a wireless network transmission technology that is currently in wide use. In the related art, the electronic device can be connected to two Wi-Fi networks for surfing the internet by using the dual Wi-Fi technology. By using the dual Wi-Fi technology, the electronic equipment can acquire higher network speed and actual throughput. However, in the related art, when the application in the electronic device uses the dual Wi-Fi technology for data transmission, the flexibility is poor.
Disclosure of Invention
The embodiment of the application provides a method, a device, a storage medium and an electronic device, which can improve the flexibility of data transmission by using dual Wi-Fi.
In a first aspect, an embodiment of the present application provides a network connection method, which is applied to an electronic device, where the electronic device includes a first Wi-Fi module and a second Wi-Fi module, and the electronic device is connected to a first Wi-Fi network through the first Wi-Fi module, and the method includes:
acquiring security level information of foreground application and background application;
determining a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application;
connecting to the target Wi-Fi network through the second Wi-Fi module to serve as a second Wi-Fi network.
In a second aspect, an embodiment of the present application provides a network connection apparatus, applied to an electronic device, where the electronic device includes a first Wi-Fi module and a second Wi-Fi module, and the electronic device is connected to a first Wi-Fi network through the first Wi-Fi module, and the apparatus includes:
the acquisition module is used for acquiring the security level information of foreground application and background application;
the determining module is used for determining a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application;
and the connection module is used for connecting to the target Wi-Fi network through the second Wi-Fi module so as to be used as a second Wi-Fi network.
In a third aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer program is enabled to execute the procedures in the network connection method provided by the embodiment of the present application.
In a fourth aspect, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the procedure in the network connection method provided in the embodiment of the present application by calling a computer program stored in the memory.
In the embodiment of the application, when the Wi-Fi network needs to be connected through the second Wi-Fi module, the electronic device can select the second Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application. That is, according to the embodiment of the application, the second Wi-Fi network can be selected according to the security level information of the application, so that the flexibility of the application in the electronic device when the dual Wi-Fi technology is used for data transmission is improved.
Drawings
The technical solutions and advantages of the present application will become apparent from the following detailed description of specific embodiments of the present application when taken in conjunction with the accompanying drawings.
Fig. 1 is a first flowchart of a network connection method according to an embodiment of the present application.
Fig. 2 is a second flowchart of a network connection method according to an embodiment of the present disclosure.
Fig. 3 to fig. 4 are schematic scene diagrams of a network connection method according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a network connection device according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Fig. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
It is understood that the execution subject of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a first flowchart illustrating a network connection method according to an embodiment of the present disclosure. The network connection method can be applied to an electronic device, the electronic device can comprise a first Wi-Fi module and a second Wi-Fi module, and the electronic device is connected to a first Wi-Fi network through the first Wi-Fi module. The flow of the network connection method may include:
101. and acquiring security level information of foreground application and background application.
Wi-Fi is a wireless network transmission technology that is currently in wide use. In the related art, the electronic device can be connected to two Wi-Fi networks for surfing the internet by using the dual Wi-Fi technology. By using the dual Wi-Fi technology, the electronic equipment can acquire higher network speed and actual throughput. However, in the related art, when the application in the electronic device uses the dual Wi-Fi technology for data transmission, the flexibility is poor.
In the embodiment of the application, for example, the electronic device is already connected to a first Wi-Fi network through a first Wi-Fi module of the electronic device, and when the dual Wi-Fi functions need to be started, that is, the electronic device needs to be connected to the Wi-Fi network through a second Wi-Fi module, the electronic device may first acquire security level information of a foreground application and a background application.
102. And determining a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application.
For example, after obtaining the security level information of the foreground application and the background application, the electronic device may determine a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application.
103. And connecting to the target Wi-Fi network through the second Wi-Fi module to be used as the second Wi-Fi network.
For example, after determining the target Wi-Fi network, the electronic device may connect to the target Wi-Fi network through the second Wi-Fi module thereof, so as to use the target Wi-Fi network as the second Wi-Fi network in the dual Wi-Fi function.
For example, when a Wi-Fi network needs to be connected through the second Wi-Fi module, the electronic device may first acquire security level information of a foreground application a and background applications B, C, D, E. The electronic device may then determine a target Wi-Fi network from the accessible Wi-Fi networks based on the security level information of the applications a, B, C, D, E. For example, accessible Wi-Fi networks include network 1, network 2, network 3. The electronic equipment determines the network 3 as a target Wi-Fi network according to the security level information of the applications A, B, C, D and E, and then the electronic equipment can be connected through the second Wi-Fi module to obtain the target Wi-Fi network, namely the electronic equipment uses the network 3 as the second Wi-Fi network, so that the double Wi-Fi function formed by the first Wi-Fi network and the second Wi-Fi network is realized.
It can be understood that, in the embodiment of the present application, when a Wi-Fi network needs to be connected through the second Wi-Fi module, the electronic device may select the second Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application. That is, according to the embodiment of the application, the second Wi-Fi network can be selected according to the security level information of the application, so that the flexibility of the application in the electronic device when the application uses the dual Wi-Fi technology for data transmission is improved.
Referring to fig. 2, fig. 2 is a second flowchart illustrating a network connection method according to an embodiment of the present disclosure. The network connection method can be applied to an electronic device which can comprise a first Wi-Fi module and a second Wi-Fi module, and the electronic device is connected to a first Wi-Fi network through the first Wi-Fi module. The flow of the network connection method may include:
201. the electronic equipment acquires the security level information of foreground application and background application.
For example, the electronic device is already connected to a first Wi-Fi network through a first Wi-Fi module, and when the dual Wi-Fi function needs to be started, that is, when the Wi-Fi network needs to be connected through a second Wi-Fi module, the electronic device may first acquire security level information of foreground application and background application.
In one embodiment, an electronic device may preset a security level for each application installed on the electronic device. For example, each time a new application is installed, the electronic device may prompt the user to enter security level information for the application. Alternatively, the electronic device may classify applications and set different security level information for different classes. For example, the security level of a payment-type application, a mailbox-type application, an instant messaging-type application, etc. may be a first higher level, while the security level of a game-type, a news-reading-type application, a music-type application, etc. may be a second lower level, and so on. Of course, in other embodiments, the security level of the application may include not only two levels, but also three or more levels, which is not specifically limited in this embodiment.
202. According to the safety level information, the electronic equipment detects whether the foreground application and the background application contain the application of which the safety level is not lower than the preset level.
For example, after obtaining the security level information of the foreground application and the background application, the electronic device may detect whether the foreground application and the background application include an application having a security level not lower than a preset level.
If detecting that the foreground application and the background application contain applications with the security level not lower than the preset level, entering the flow of 203.
If the foreground application and the background application are detected not to contain the application of which the security level is not lower than the preset level, the electronic equipment can select a Wi-Fi network with the highest network rate from the current accessible Wi-Fi networks to access, or select a Wi-Fi network with the lowest network delay to access, or select a Wi-Fi network with the lowest network packet loss rate to access.
In another embodiment, if it is detected that the foreground application and the background application do not include an application having a security level not lower than a preset level, the electronic device may also score each accessible Wi-Fi network according to network parameters such as a network rate, a network packet loss rate, and a network delay of each accessible Wi-Fi network. Higher scores indicate higher network quality. The electronic equipment can access the accessible Wi-Fi network with the highest score through the second Wi-Fi module to serve as the second Wi-Fi network.
In some embodiments, the electronic device may score each accessible Wi-Fi network according to network parameters such as a network rate, a network packet loss rate, and a network delay of each accessible Wi-Fi network to obtain a network score value of each Wi-Fi network, where the network score value may be used to indicate overall quality of the network, and a higher network score value indicates that the network is more stable and the network quality is higher. In some embodiments, the network score value may be calculated according to a network rate, a network delay, a network packet loss rate, and the like.
For example, the electronic device may set different score values for network rates in different numerical intervals in advance, set different score values for network delays in different numerical intervals, and set different score values for network packet loss rates in different numerical intervals. Then, the electronic device may first obtain the network rate, the network delay, and the network packet loss rate of each accessible Wi-Fi network, and then, the electronic device may obtain a score value corresponding to the network rate, a score value corresponding to the network delay, and a score value corresponding to the network packet loss rate, and may obtain a network score value of the corresponding accessible Wi-Fi network by comprehensive calculation according to the three score values.
The electronic device may then determine the Wi-Fi network with the higher network rating as the second Wi-Fi network that needs to be connected.
In one embodiment, the electronic device may set different weight values for the network rate, the network delay, and the network packet loss rate in advance. Then, when the electronic device comprehensively calculates the network score value of each accessible Wi-Fi network according to the score value corresponding to the network rate, the score value corresponding to the network delay and the score value corresponding to the network packet loss rate, the electronic device may perform weighting calculation according to the weight values respectively corresponding to the network rate, the network delay and the network packet loss rate to obtain the network score value of each accessible Wi-Fi network.
For example, the weight value corresponding to the network rate is 0.5, the weight value corresponding to the network delay is 0.25, the weight value corresponding to the network packet loss rate is 0.25, and the like, although the weight values may also be other preset values, which is not specifically limited herein in this embodiment of the application.
In other embodiments, for example, the network rate corresponds to a first weight, the network delay corresponds to a second weight, and the network packet loss rate corresponds to a third weight. Then, the electronic device may also adjust the values of the first weight, the second weight, and the third weight in real time or according to requirements.
For example, for a certain accessible Wi-Fi network, the electronic device may obtain a plurality of historical network rates within a preset time period and calculate a first standard deviation of the plurality of historical network rates. If the first standard deviation is less than or equal to the preset first threshold, the electronic device may not adjust the value of the first weight. If the first standard deviation is greater than the preset first threshold, the electronic device may decrease the value of the first weight. The electronic device may obtain a plurality of historical time delays within a preset time period, and calculate a second standard deviation of the plurality of historical time delays. If the second standard deviation is less than or equal to the preset second threshold, the electronic device may not adjust the value of the second weight. If the second standard deviation is greater than the preset second threshold, the electronic device may decrease the value of the second weight. The electronic device may obtain a plurality of historical packet loss rates within a preset time period, and calculate a third standard deviation of the plurality of historical packet loss rates. If the third standard deviation is less than or equal to the preset third threshold, the electronic device may not adjust the value of the third weight. If the second standard deviation is greater than the preset second threshold, the electronic device may decrease the value of the third weight.
When some weight values in the first weight, the second weight and the third weight in each accessible Wi-Fi network need to be adjusted, other weight values also need to be adjusted adaptively. For example, according to the above manner, the first weight and the third weight do not need to be adjusted, but the second weight needs to be adjusted smaller, so the first weight and the third weight need to be adjusted adaptively, for example, the first weight is adjusted larger, or the third weight is adjusted larger, or both the first weight and the third weight are adjusted larger.
And then, the electronic equipment can calculate the network credit values of the accessible Wi-Fi networks according to the respective adjusted weight values. For example, the electronic device may calculate the network credit values for accessible Wi-Fi networks 1 according to the adjusted weight values for accessible Wi-Fi networks 1. The electronic device may calculate the network credit value of the accessible Wi-Fi network 2 based on the adjusted weight value of the accessible Wi-Fi network 2, and so on.
203. And if detecting that the foreground application and the background application comprise applications with the security level not lower than the preset level, the electronic equipment acquires the security level of each accessible Wi-Fi network.
For example, the electronic device detects that the foreground application and the background application include an application with a security level not lower than a preset level. For example, the foreground application is a, and the background application includes B, C, D, E. The security level of the application A is the second level, the security level of the application B is the second level, the security level of the application C is the first level, and the security levels of the applications D and E are also the second levels. And the preset level is the first level. Then, the electronic device may detect that the security level of application C in the background application is not lower than the preset level. That is, the foreground application and the background application include applications with high security requirements. In this case, the electronic device may obtain the security level of each accessible Wi-Fi network.
In one embodiment, the electronic device may obtain the security level of each accessible Wi-Fi network by:
the electronic equipment acquires access authentication mode information of each accessible Wi-Fi network;
and according to the access authentication mode information of each accessible Wi-Fi network, the electronic equipment acquires the security level of each accessible Wi-Fi network.
For example, when the security level of each accessible Wi-Fi network needs to be obtained, the electronic device may first obtain access authentication manner information of each accessible Wi-Fi network, and obtain the security level of each accessible Wi-Fi network according to the access authentication manner of each accessible Wi-Fi network.
For example, the access authentication method of the Wi-Fi network can be divided into: requiring password login, requiring login authentication, and requiring no login verification. The security level of the Wi-Fi network needing password login can be the highest, the security level of the Wi-Fi network needing login authentication is the second order, and the security level of the Wi-Fi network not needing login verification is the lowest. The Wi-Fi network needing password login can be a Wi-Fi network deployed in a home or a company, for example, and the network needs to verify the login password when being accessed, otherwise, the network cannot be accessed. The Wi-Fi network needing login authentication can be a Wi-Fi network in a public place, for example, the network needs to input identity information of user login when accessing, and the identity information can be information such as a mobile phone number and the like, but password authentication is not needed. Wi-Fi networks that do not require login authentication are likely to be "phishing" networks, which are often accessed without any authentication information.
Based on the information, the electronic equipment can acquire the security level of each accessible Wi-Fi network according to the access authentication mode information of each accessible Wi-Fi network. For example, the security level of a Wi-Fi network requiring password login is a first security level, the security level of a Wi-Fi network requiring login authentication may be a second security level, and the security level of a Wi-Fi network not requiring login authentication may be a third security level.
Alternatively, the electronic device may further obtain the security level of each accessible Wi-Fi network by:
acquiring service set identification information and/or MAC address information of each accessible Wi-Fi network;
judging whether the service set identification information and/or the MAC address information of each accessible Wi-Fi network exists in a blacklist of preset third-party applications; and if so, determining the security level of the corresponding Wi-Fi network as the lowest security level.
For example, the electronic device may also utilize a third party application to determine a security level of the accessible Wi-Fi network. For example, a blacklist is maintained in the third party application that records service set identification information (SSID) and/or addresses of unsecured Wi-Fi networks, such as "phishing" networks. The blacklist may be generated according to information of the insecure Wi-Fi network reported by the user.
Based on this, when the security level of the accessible Wi-Fi network needs to be acquired, the electronic device may acquire the service set identification information and/or the MAC address information of each accessible Wi-Fi network, and detect whether the service set identification information and/or the MAC address information of each accessible Wi-Fi network exists in a preset blacklist of third-party applications. If the service set identification information and/or the MAC address information of a certain Wi-Fi network exists in a preset blacklist of third party applications, the electronic device may determine the security level of the corresponding Wi-Fi network as a lowest security level, for example, a third security level.
204. The electronic equipment determines the accessible Wi-Fi network with the highest current security level as a target Wi-Fi network, and is connected to the target Wi-Fi network through the second Wi-Fi module to serve as the second Wi-Fi network.
For example, after determining the security level of each accessible Wi-Fi network, the electronic device may determine the accessible Wi-Fi network with the highest current security level as a target Wi-Fi network, and connect to the target Wi-Fi network through the second Wi-Fi module to serve as the second Wi-Fi network.
For example, in this embodiment, the security level of the Wi-Fi network is divided into three levels, namely, a first security level, a second security level, and a third security level. Wherein the security levels of the first security level, the second security level and the third security level are sequentially reduced. That is, the first security level is the highest level of security, the second security level is the lowest level of security, and the third security level is the lowest level of security.
For example, accessible Wi-Fi networks include network 1, network 2, network 3. The security level of the network 1 is the second security level, the security level of the network 2 is the third security level, and the security level of the network 3 is the first security level. Then the electronic device may determine network 3 as the target Wi-Fi network. The electronic device may then connect to the target Wi-Fi network via the second Wi-Fi module, i.e., the electronic device uses the network 3 as a second Wi-Fi network, thereby implementing dual Wi-Fi functionality consisting of the first Wi-Fi network and the second Wi-Fi network.
205. The electronic equipment determines the application with the security level not lower than the preset level as the target application.
206. When detecting that the target application carries out data transmission, the electronic equipment transmits the data of the target application by using the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network.
For example, 205 and 206 may include:
after the electronic device is simultaneously connected to two Wi-Fi networks, the electronic device may determine an application having a security level not lower than a preset level installed therein as a target application. When detecting that the target application performs data transmission, the electronic device may transmit data of the target application by using the Wi-Fi network with the highest security level of the two Wi-Fi networks, namely the first Wi-Fi network and the second Wi-Fi network.
For example, the preset level is the first level. Then, the electronic device may determine an application having a security level not lower than the first level installed therein as a target application. For example, applications having a security level not lower than the first level in the electronic device include applications C, G, J, K, L, and the like, which are determined as target applications. Then, when detecting that any one or more of the applications C, G, J, K, L are performing data transmission, the electronic device may compare the security levels of the first and second Wi-Fi networks and transmit data of the target applications using the Wi-Fi network with the higher security level.
It can be understood that the data transmission security can be improved by utilizing the Wi-Fi network with the higher security level of the first Wi-Fi network to transmit the data of the target applications.
207. When the data of the target application is transmitted by using the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network, the electronic equipment detects whether the security level of the Wi-Fi network for transmitting the data of the target application is lower than a preset level.
208. And if the security level of the Wi-Fi network for transmitting the data of the target application is lower than the preset level, the electronic equipment generates prompt information, and the prompt information is used for prompting that the security risk exists in data transmission.
For example, 207 and 208 may include:
when the data of the target application are transmitted by using the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network, the electronic equipment can further detect whether the security level of the Wi-Fi network for transmitting the data of the target application is lower than a preset level.
If it is detected that the security level of the Wi-Fi network used for transmitting the data of the target application is lower than the preset level, the electronic device may generate a prompt message, where the prompt message may be used to prompt a user that the security level of the Wi-Fi network used for transmitting the data of the target application is lower than the preset level, so that a security risk may exist in the current data transmission.
For example, the security levels of the first Wi-Fi network and the second Wi-Fi network are both the third security level, that is, there is no accessible Wi-Fi network with a higher security level, so the security level of the Wi-Fi network to which the electronic device is currently connected is lower, in this case, when data of the target application needs to be transmitted, the electronic device may generate a prompt message for prompting that there is a security risk in data transmission.
If the security level of the Wi-Fi network for transmitting the data of the target application is detected to be not lower than the preset level, the electronic equipment can normally transmit the data.
209. When the electronic equipment detects that the non-target application carries out data transmission, the electronic equipment transmits the data of the non-target application by using the Wi-Fi network with the lowest load in the first Wi-Fi network and the second Wi-Fi network.
For example, when a non-target application is detected to perform data transmission while transmitting data using the first Wi-Fi network and the second Wi-Fi network, the electronic device may transmit data of the non-target application using a Wi-Fi network with the lowest load of the two Wi-Fi networks, i.e., the first Wi-Fi network and the second Wi-Fi network.
It can be understood that the data of the non-target applications are transmitted by using the Wi-Fi network with the lowest load in the first Wi-Fi network and the second Wi-Fi network, so that the data flow in the double Wi-Fi networks can be reasonably distributed, and the data transmission efficiency is improved.
Referring to fig. 3 to 4, fig. 3 to 4 are schematic views of a network connection method according to an embodiment of the present disclosure.
For example, the electronic device has a dual Wi-Fi function switch. When the double Wi-Fi function switch is turned on, the electronic equipment is connected to a first Wi-Fi network through the first Wi-Fi module to serve as a main Wi-Fi network. Upon connecting to the host Wi-Fi network, the electronic device may detect a network quality of the host Wi-Fi network. When the network quality of the main Wi-Fi network is poor, the electronic equipment can be connected with a second Wi-Fi network through a second Wi-Fi module and used as a secondary Wi-Fi network. That is, the electronic device is now connected to two Wi-Fi networks at the same time, thereby forming a dual Wi-Fi function.
For example, when the user comes to a shopping mall with the electronic device, and clicks the Wi-Fi network 3 on the Wi-Fi setup interface in the shopping mall, the connection interface of the Wi-Fi network 3 is popped up, and the user is asked to input a password, as shown in fig. 3. After the user inputs the correct password, the electronic device is connected to the network 3 through the first Wi-Fi module, that is, the network 3 is the first Wi-Fi network. Since the access authentication method of the network 3 requires password login, the security level of the network 3 may be the first security level.
Then, as more and more consumers enter the store nail, more and more electronic devices are connected to the Wi-Fi network 3, resulting in deterioration of the network quality of the Wi-Fi network 3, such as a network rate lower than a preset rate, or a network delay higher than a preset delay, etc. At this time, the dual Wi-Fi working mode is triggered to enter. For example, the electronic device may scan for accessible Wi-Fi networks and determine a security level for each accessible Wi-Fi network. For example, wi-Fi networks currently accessible include network 1, network 2, network 4. The security level of the network 1 is the second security level, the security level of the network 2 is the third security level, and the security level of the network 4 is the third security level. That is, the network 1 is the highest security level network among the accessible Wi-Fi networks.
Thereafter, the electronic device may obtain security level information for applications running in the foreground and the background. In this embodiment, the electronic device may preset the security level of each application installed on the electronic device. For example, the security level of a payment-type application, a mailbox-type application, an instant messaging-type application, etc. may be a first higher level, while the security level of a game-type, a news-reading-type application, a music-type application, etc. may be a second lower level, and so on. Wherein the safety requirements of the first level are higher than those of the second level.
After that, the electronic device may detect whether the foreground application and the background application include an application with a security level not lower than the first level. For example, the electronic device detects that foreground application C is a first level application. In this case, the electronic device may determine the network 1 with the highest security level among the currently accessible Wi-Fi networks as the target Wi-Fi network. The electronic device may then connect to network 1 via a second Wi-Fi module to operate as a second Wi-Fi network, i.e. network 1 is a secondary Wi-Fi network. A schematic diagram of a dual Wi-Fi network connection may be as shown in fig. 4.
Thereafter, the electronic device may determine an application having a security level not lower than the first level installed therein as a target application. When detecting that the target application carries out data transmission, the electronic equipment can utilize the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network to transmit the data of the target application. Since the security level of the network 3 is higher than that of the network 1, when it is detected that the applications of the first level with higher security requirements are in data transmission, the electronic device may transmit the data of the applications by using the network 3.
When detecting that the non-target application performs data transmission, the electronic device may transmit the data of the non-target application by using the Wi-Fi network with the lowest load in the network 3 and the network 1.
It can be understood that, in the embodiments of the present application, on one hand, the electronic device may select the secondary Wi-Fi network according to the security level of the application, thereby improving the flexibility of the application to use the dual Wi-Fi technology for data transmission. On the other hand, the electronic device may transmit data of an application with a higher security level by using a Wi-Fi network with a higher security level, so the embodiment may also improve security of data transmission performed by the application. Moreover, when data of applications with general security levels are transmitted, the electronic device may transmit the data of the applications by using a network with a low load, so that the embodiment may also improve the efficiency of data transmission by the Wi-Fi network.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a network connection device according to an embodiment of the present disclosure. The network connection device may be applied to an electronic apparatus. The electronic device includes a first Wi-Fi module and a second Wi-Fi module, the electronic device being connected to a first Wi-Fi network through the first Wi-Fi module. The network connection device 300 may include: the device comprises an acquisition module 301, a determination module 302 and a connection module 303.
An obtaining module 301, configured to obtain security level information of a foreground application and a background application.
A determining module 302, configured to determine a target Wi-Fi network from accessible Wi-Fi networks according to the security level information of the foreground application and the background application.
A connection module 303, configured to connect to the target Wi-Fi network through the second Wi-Fi module, so as to serve as a second Wi-Fi network.
In one embodiment, the determining module 302 may be configured to:
detecting whether applications with security levels not lower than a preset level are included in the foreground application and the background application according to the security level information;
if yes, obtaining the security level of each accessible Wi-Fi network;
and determining the accessible Wi-Fi network with the highest current security level as the target Wi-Fi network.
In one embodiment, the connection module 303 may be further configured to:
determining the application with the security level not lower than the preset level in the electronic equipment as a target application;
when the target application is detected to carry out data transmission, transmitting the data of the target application by using the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network.
In one embodiment, the connection module 303 may be further configured to:
when detecting that the non-target application carries out data transmission, transmitting the data of the non-target application by using the Wi-Fi network with the lowest load in the first Wi-Fi network and the second Wi-Fi network.
In one embodiment, the connection module 303 may be further configured to:
detecting whether the security level of the Wi-Fi network transmitting the data of the target application is lower than a preset level or not when the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network is used for transmitting the data of the target application;
and if so, generating prompt information, wherein the prompt information is used for prompting that the data transmission has a safety risk.
In one embodiment, the determining module 302 may be configured to:
acquiring access authentication mode information of each accessible Wi-Fi network;
and acquiring the security level of each accessible Wi-Fi network according to the access authentication mode information of each accessible Wi-Fi network.
In one embodiment, the determining module 302 may be further configured to:
acquiring service set identification information and/or MAC address information of each accessible Wi-Fi network;
judging whether the service set identification information and/or the MAC address information of each accessible Wi-Fi network exists in a blacklist of preset third-party applications; and if so, determining the security level of the corresponding Wi-Fi network as the lowest security level.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute the procedures in the network connection method provided by the embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the procedure in the network connection method provided in this embodiment by calling a computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The electronic device 400 may include Wi-Fi module 401, memory 402, processor 403, and the like. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Wi-Fi module 401 may include a first Wi-Fi module and a second Wi-Fi module. The first Wi-Fi module may include a first MAC address and a first Wi-Fi antenna. The second Wi-Fi module may include a second MAC address and a second Wi-Fi antenna. The electronic device may establish a connection with the first access point AP through the first Wi-Fi antenna based on the first MAC address to connect to the first Wi-Fi network. The electronic device may also establish a connection with a second access point AP via a second Wi-Fi antenna based on the second MAC address to connect to a second Wi-Fi network.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing executable code. The application programs may constitute various functional modules. The processor 403 executes various functional applications and data processing by running an application program stored in the memory 402.
The processor 403 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
In this embodiment, after the electronic device is connected to the first Wi-Fi network through the first Wi-Fi module, the processor 403 in the electronic device loads executable code corresponding to processes of one or more application programs into the memory 402 according to the following instructions, and the processor 403 runs the application programs stored in the memory 402, so as to execute:
acquiring security level information of foreground application and background application;
determining a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application;
connecting to the target Wi-Fi network through the second Wi-Fi module to serve as a second Wi-Fi network.
Referring to fig. 7, the electronic device 400 may include a Wi-Fi module 401, a memory 402, a processor 403, an input unit 404, an output unit 405, a speaker 406, and the like.
Wi-Fi module 401 may include a first Wi-Fi module and a second Wi-Fi module. The first Wi-Fi module may include a first MAC address and a first Wi-Fi antenna. The second Wi-Fi module may include a second MAC address and a second Wi-Fi antenna. The electronic device may establish a connection with the first access point AP through the first Wi-Fi antenna based on the first MAC address to connect to the first Wi-Fi network. The electronic device may also establish a connection with a second access point AP via a second Wi-Fi antenna based on the second MAC address to connect to a second Wi-Fi network.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing executable code. The application programs may constitute various functional modules. The processor 403 executes various functional applications and data processing by running the application program stored in the memory 402.
The processor 403 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
The input unit 404 may be used to receive input numbers, character information, or user characteristic information, such as a fingerprint, and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The output unit 405 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The output unit may include a display panel.
In this embodiment, the processor 403 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 403 runs the application programs stored in the memory 402, so as to execute:
acquiring security level information of foreground application and background application;
determining a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application;
connecting to the target Wi-Fi network through the second Wi-Fi module to serve as a second Wi-Fi network.
In one embodiment, when the processor 403 determines a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application, the processor may perform: detecting whether applications with security levels not lower than a preset level are included in the foreground application and the background application according to the security level information; if so, acquiring the security level of each accessible Wi-Fi network; and determining the accessible Wi-Fi network with the highest current security level as the target Wi-Fi network.
In one embodiment, processor 403 may further perform: determining the application with the security level not lower than the preset level in the electronic equipment as a target application; when the data transmission of the target application is detected, transmitting the data of the target application by utilizing the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network.
In one embodiment, processor 403 may further perform: when detecting that the non-target application carries out data transmission, transmitting the data of the non-target application by using the Wi-Fi network with the lowest load in the first Wi-Fi network and the second Wi-Fi network.
In one embodiment, processor 403 may further perform: detecting whether the security level of the Wi-Fi network transmitting the data of the target application is lower than a preset level or not when the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network is used for transmitting the data of the target application; and if so, generating prompt information, wherein the prompt information is used for prompting that the data transmission has a safety risk.
In one embodiment, the obtaining of the security level of each accessible Wi-Fi network performed by processor 403 may perform: acquiring access authentication mode information of each accessible Wi-Fi network; and acquiring the security level of each accessible Wi-Fi network according to the access authentication mode information of each accessible Wi-Fi network.
In one embodiment, the obtaining of the security level of each accessible Wi-Fi network performed by processor 403 may perform: acquiring service set identification information and/or MAC address information of each accessible Wi-Fi network; judging whether the service set identification information and/or the MAC address information of each accessible Wi-Fi network exists in a blacklist of preset third-party applications; and if so, determining the security level of the corresponding Wi-Fi network as the lowest security level.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the network connection method, and are not described herein again.
The network connection device provided in the embodiment of the present application and the network connection method in the foregoing embodiment belong to the same concept, and any method provided in the network connection method embodiment may be run on the network connection device, and a specific implementation process thereof is described in the network connection method embodiment in detail, and is not described herein again.
It should be noted that, for the network connection method described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the network connection method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and during the execution, the process of the embodiment of the network connection method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the network connection device according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The network connection method, apparatus, storage medium, and electronic device provided in the embodiments of the present application are described in detail above, and specific examples are applied herein to explain the principles and implementations of the present application, and the description of the embodiments is only used to help understand the method and its core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A network connection method is applied to electronic equipment, the electronic equipment comprises a first Wi-Fi module and a second Wi-Fi module, the electronic equipment is connected to a first Wi-Fi network through the first Wi-Fi module, and the method comprises the following steps:
acquiring security level information of foreground application and background application, wherein the foreground application and the background application comprise applications with security levels not lower than a preset level and applications with security levels lower than the preset level;
determining a target Wi-Fi network from accessible Wi-Fi networks according to the security level information of the foreground application and the background application, comprising: if the foreground application and the background application are detected to contain the application with the security level not lower than the preset level, the security level of each accessible Wi-Fi network is obtained, and the accessible Wi-Fi network with the highest current security level is determined as the target Wi-Fi network; if the foreground application and the background application comprise applications with the security level lower than the preset level, selecting a Wi-Fi network with the highest network rate from the current accessible Wi-Fi networks for access, or selecting a Wi-Fi network with the smallest network delay for access, or selecting a Wi-Fi network with the smallest network packet loss rate for access, or grading the accessible Wi-Fi networks according to a plurality of network parameters of the accessible Wi-Fi networks, and determining the accessible Wi-Fi network with the highest grade as the target Wi-Fi network;
connecting, by the second Wi-Fi module, to the target Wi-Fi network for use as a second Wi-Fi network, thereby using the first Wi-Fi network and the second Wi-Fi network simultaneously.
2. The network connection method of claim 1, wherein the method further comprises:
determining the application with the security level not lower than the preset level in the electronic equipment as a target application;
when the target application is detected to carry out data transmission, transmitting the data of the target application by using the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network.
3. The network connection method according to claim 2, further comprising:
when data transmission of a non-target application is detected, transmitting data of the non-target application by using the Wi-Fi network with the lowest load in the first Wi-Fi network and the second Wi-Fi network.
4. The network connection method according to claim 2, further comprising:
when the data of the target application are transmitted by using the Wi-Fi network with the highest security level in the first Wi-Fi network and the second Wi-Fi network, detecting whether the security level of the Wi-Fi network for transmitting the data of the target application is lower than a preset level;
and if so, generating prompt information, wherein the prompt information is used for prompting that the data transmission has a safety risk.
5. The network connection method according to claim 1, wherein the obtaining the security level of each accessible Wi-Fi network comprises:
acquiring access authentication mode information of each accessible Wi-Fi network;
and acquiring the security level of each accessible Wi-Fi network according to the access authentication mode information of each accessible Wi-Fi network.
6. The network connection method according to claim 1, wherein the obtaining the security level of each accessible Wi-Fi network comprises:
acquiring service set identification information and/or MAC address information of each accessible Wi-Fi network;
judging whether the service set identification information and/or the MAC address information of each accessible Wi-Fi network exists in a blacklist of preset third-party applications; and if so, determining the security level of the corresponding Wi-Fi network as the lowest security level.
7. A network connection device applied to an electronic device, wherein the electronic device comprises a first Wi-Fi module and a second Wi-Fi module, and the electronic device is connected to a first Wi-Fi network through the first Wi-Fi module, the device comprises:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring security level information of foreground application and background application, and the foreground application and the background application comprise applications with security levels not lower than a preset level and applications with security levels lower than the preset level;
the determining module is used for determining a target Wi-Fi network from the accessible Wi-Fi networks according to the security level information of the foreground application and the background application, and comprises the following steps: if the foreground application and the background application are detected to contain the application with the security level not lower than the preset level, the security level of each accessible Wi-Fi network is obtained, and the accessible Wi-Fi network with the highest current security level is determined as the target Wi-Fi network; if the foreground application and the background application are detected to contain the application with the security level lower than the preset level, selecting a Wi-Fi network with the highest network rate from the current accessible Wi-Fi networks for access, or selecting a Wi-Fi network with the lowest network delay for access, or selecting a Wi-Fi network with the lowest network packet loss rate for access, or grading the accessible Wi-Fi networks according to a plurality of network parameters of the accessible Wi-Fi networks, and determining the accessible Wi-Fi network with the highest grade as the target Wi-Fi network;
a connection module for connecting to the target Wi-Fi network through the second Wi-Fi module to be used as a second Wi-Fi network, thereby simultaneously using the first Wi-Fi network and the second Wi-Fi network.
8. A computer-readable storage medium, on which a computer program is stored, which, when executed on a computer, causes the computer to carry out the method according to any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, wherein the processor is configured to perform the method of any one of claims 1 to 6 by invoking a computer program stored in the memory.
CN201911400260.7A 2019-12-30 2019-12-30 Network connection method, device, storage medium and electronic equipment Active CN111148188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911400260.7A CN111148188B (en) 2019-12-30 2019-12-30 Network connection method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911400260.7A CN111148188B (en) 2019-12-30 2019-12-30 Network connection method, device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111148188A CN111148188A (en) 2020-05-12
CN111148188B true CN111148188B (en) 2022-11-04

Family

ID=70522115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911400260.7A Active CN111148188B (en) 2019-12-30 2019-12-30 Network connection method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111148188B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187751A (en) * 2020-09-17 2021-01-05 海尔优家智能科技(北京)有限公司 Network access method and device for equipment, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717653A (en) * 2015-03-12 2015-06-17 惠州Tcl移动通信有限公司 Network connection control method and system of mobile terminal
CN107148060A (en) * 2017-05-23 2017-09-08 维沃移动通信有限公司 A kind of method for connecting network and its mobile terminal of application
CN107404740A (en) * 2017-08-07 2017-11-28 广东欧珀移动通信有限公司 Method for switching network, device and the terminal device of safety
CN107635234A (en) * 2017-09-29 2018-01-26 努比亚技术有限公司 Wi Fi control methods, mobile terminal and computer-readable recording medium
CN107770841A (en) * 2017-09-29 2018-03-06 努比亚技术有限公司 Hotspot connection method, mobile terminal and computer-readable recording medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9355261B2 (en) * 2013-03-14 2016-05-31 Appsense Limited Secure data management
CN109992362B (en) * 2017-12-29 2021-08-13 Oppo广东移动通信有限公司 Application program processing method and device, electronic equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717653A (en) * 2015-03-12 2015-06-17 惠州Tcl移动通信有限公司 Network connection control method and system of mobile terminal
CN107148060A (en) * 2017-05-23 2017-09-08 维沃移动通信有限公司 A kind of method for connecting network and its mobile terminal of application
CN107404740A (en) * 2017-08-07 2017-11-28 广东欧珀移动通信有限公司 Method for switching network, device and the terminal device of safety
CN107635234A (en) * 2017-09-29 2018-01-26 努比亚技术有限公司 Wi Fi control methods, mobile terminal and computer-readable recording medium
CN107770841A (en) * 2017-09-29 2018-03-06 努比亚技术有限公司 Hotspot connection method, mobile terminal and computer-readable recording medium

Also Published As

Publication number Publication date
CN111148188A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
US11310239B2 (en) Network connection method, hotspot terminal and management terminal
CN106658652B (en) Method and device for connecting WiFi hotspot
CN107533596B (en) Fingerprint identification method and mobile terminal
US20220338289A1 (en) Device control method, apparatus, storage medium and electronic device
WO2019000813A1 (en) Communication method and device
WO2019085703A1 (en) Method for controlling data transmission, device, and storage medium
CN112804697A (en) Network distribution method and device for equipment to be networked, electronic equipment and computer readable medium
CN111148188B (en) Network connection method, device, storage medium and electronic equipment
US20190159111A1 (en) Method for Wireless Fidelity Network Scanning and Terminal Device
CN108650594B (en) Sound box management method, user terminal and computer storage medium
CN113179509B (en) Ad hoc network method and device based on WiFi, storage medium and wireless node
US9854406B2 (en) Control method and controller
CN103781188A (en) Virtual network card constructing method and electronic equipment
CN106714181B (en) Method and device for connecting WiFi hotspot
CN113242301A (en) Method and device for selecting real server, computer equipment and storage medium
CN111093238B (en) Wireless network control method and device, storage medium and electronic equipment
WO2018103403A1 (en) Wireless fidelity (wi-fi) scanning method and related product
CN111148278A (en) Data transmission method, device, storage medium and electronic equipment
CN107819761B (en) Data processing method and device and readable storage medium
CN111065126A (en) Hotspot sharing method and device, storage medium and electronic equipment
CN112291788B (en) Data processing method, device, storage medium, terminal and network access point equipment
CN112953794B (en) Network detection method, device, equipment and storage medium of router
CN113746909A (en) Network connection method, device, electronic equipment and computer readable storage medium
CN112867171A (en) WIFI connection method and device, storage medium and mobile terminal
CN107360634B (en) Data transmission method and device and mobile terminal

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
GR01 Patent grant
GR01 Patent grant