Network connection method, electronic equipment and computer readable storage medium
By automatically selecting a wireless LAN with saved connection credentials in the operating system of electronic devices, the problem of not being able to automatically reconnect after Wi-Fi is disconnected, and the user's Internet experience is improved.
Patent Information
- Application Number
- CN202510040961.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2025-05-16
AI Technical Summary
When the Wi-Fi is disconnected, the electronic device cannot automatically reconnect to the wireless LAN, resulting in a poor user experience.
Provides a network connection method. If an electronic device detects that Wi-Fi is disconnected, the operating system attempts to reconnect according to the preset self-connection recovery mechanism; if it fails, the wireless LAN with the wireless LAN with the saved connection credentials is selected from the scanned candidate wireless LAN to connect.
Even if the operating system's self-connection recovery mechanism fails, electronic devices can still be automatically connected to the wireless LAN, improving the user's Internet experience.
Smart Images

Figure CN120018324A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202310912323.7, and the original application date is July 21, 2023. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The embodiments of the present application relate to the field of communication technology, and in particular, to a network connection method, an electronic device, and a computer-readable storage medium. Background Art
[0003] When an electronic device is connected to a network, if the electronic device encounters an abnormal disconnection of the connected Wi-Fi due to an abnormality in the Wi-Fi (Wireless Fidelity) driver, wireless access point (AP) or operating system, the operating system of the electronic device will perform the Wi-Fi recovery connection operation according to the preset Wi-Fi recovery mechanism. That is, when the electronic device is disconnected from the network, it will rescan the Wi-Fi and connect to the Wi-Fi that has been connected in the past and set to automatically connect in the Wi-Fi scan results.
[0004] However, if there is no Wi-Fi set for automatic connection among the scanned Wi-Fi, the electronic device cannot reconnect to the Wi-Fi. If the electronic device fails to reconnect to the Wi-Fi, the electronic device remains disconnected from the Wi-Fi, resulting in a poor user experience. Summary of the invention
[0005] The present application provides a network connection method, an electronic device and a computer-readable storage medium, which can automatically connect to a wireless local area network even when the operating system of the electronic device fails to restore the wireless local area network connection according to a preset wireless local area network recovery mechanism, thereby improving the user's Internet experience.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, a network connection method is provided, the method comprising: if an electronic device detects that a wireless local area network is disconnected, the operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism; if the operating system fails to successfully connect to the wireless local area network according to the preset self-connection recovery mechanism, the electronic device determines a first target wireless local area network from the scanned candidate wireless local area networks; wherein the candidate wireless local area network is a wireless local area network for which the electronic device has saved connection credentials; and the electronic device is connected to the first target wireless local area network.
[0008] In the embodiment of the present application, even if the operating system of the electronic device fails to reconnect to the wireless LAN according to the preset self-connection recovery mechanism, the electronic device can select a target wireless LAN from the known wireless LANs scanned by the electronic device and control the electronic device to connect to the target wireless LAN. In this way, even if the operating system of the electronic device fails to restore the wireless LAN connection according to the preset self-connection recovery mechanism, the electronic device can automatically connect to the wireless LAN, thereby improving the user's Internet experience.
[0009] In a possible implementation of the first aspect, if the electronic device detects that the wireless local area network is disconnected, the operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism, including: if the electronic device detects that the wireless local area network is abnormally disconnected, the operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism; wherein the abnormal disconnection of the wireless local area network includes disconnecting the wireless local area network without detecting a user disconnection instruction.
[0010] In a possible implementation of the first aspect, an electronic device is provided with a third-party application, and if the electronic device detects that a wireless local area network is disconnected, the method includes: if an operating system detects that the wireless local area network is disconnected, sending wireless local area network disconnection information to the third-party application; if the operating system fails to successfully connect to the wireless local area network according to a preset self-connection recovery mechanism, the electronic device determines a first target wireless local area network from scanned candidate wireless local area networks, including: the operating system receives the wireless local area network disconnection information sent by the third-party application, if the operating system fails to successfully connect to the wireless local area network according to the preset self-connection recovery mechanism, and the electronic device scans a candidate wireless local area network, the operating system sends information with candidate wireless local area networks to the third-party application; the third-party application determines the first target wireless local area network from the candidate wireless local area networks in response to receiving the information with candidate wireless local area networks; the electronic device connects to the first target wireless local area network, including: the third-party application controls the electronic device to connect to the first target wireless local area network.
[0011] It can be understood that in the related art, when an electronic device is disconnected from the network, the operating system of the electronic device will perform a wireless LAN recovery connection operation according to a preset self-connection recovery mechanism. When a third-party application receives information about a candidate wireless LAN sent by the operating system, it will execute the wireless LAN recovery mechanism in the third-party application and perform a wireless LAN recovery connection operation, rather than executing the self-connection recovery mechanism in the third-party application when the wireless LAN of the electronic device is disconnected at the beginning. In this way, the conflict between the self-connection recovery mechanism in the third-party application and the self-connection recovery mechanism in the operating system can be avoided.
[0012] In a possible implementation of the first aspect, determining a first target wireless local area network from scanned candidate wireless local area networks includes: based on the first method, determining wireless local area network quality indicators of each wireless local area network in the candidate wireless local area network according to network parameters of the wireless local area networks in the candidate wireless local area networks; wherein the network parameters include any combination of network signal strength parameters, network signal quality parameters, network frequency band parameters, network protocol parameters, network connection rate or network protocol security parameters; determining the first target wireless local area network according to the wireless local area network quality indicators of each wireless local area network in the candidate wireless local area networks.
[0013] In a possible implementation manner of the first aspect, the candidate wireless local area network is a network capable of communicating with a wide area network.
[0014] The candidate wireless LAN is a network that has the ability to communicate with the wide area network, which can broaden the user's Internet access range and improve the user experience.
[0015] In a possible implementation of the first aspect, the operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism, including: the operating system of the electronic device controls the electronic device to scan the wireless local area network to obtain a candidate wireless local area network; if the candidate wireless local area network includes a wireless local area network set to automatically connect, the operating system determines a second target wireless local area network based on a second method, and the network parameters in the second method are different from the network parameters in the first method. The network signal strength parameter; the operating system controls the electronic device to connect to the second target wireless local area network.
[0016] In a possible implementation of the first aspect, the operating system fails to successfully connect to the wireless local area network according to a preset self-connection recovery mechanism, including: the candidate wireless local area network does not include a wireless local area network set for automatic connection; or the electronic device fails to connect to the second target wireless local area network.
[0017] In a possible implementation manner of the first aspect, after controlling the electronic device to connect to the second target wireless local area network, the method further includes: when the electronic device is successfully connected to the second target wireless local area network, if a third target wireless local area network is determined from the candidate wireless local area networks based on the first method, and the third target wireless local area network is different from the third target wireless local area network, then controlling the electronic device to connect to the first target wireless local area network.
[0018] In a possible implementation manner of the first aspect, the candidate wireless local area network is a wireless local area network whose signal strength is greater than or equal to a preset signal strength threshold.
[0019] In a possible implementation manner of the first aspect, the method further includes:
[0020] In response to detecting the user's instruction to disconnect the wireless local area network, the electronic device remains disconnected from the wireless local area network.
[0021] In a second aspect, an electronic device is provided, which includes a processor and a memory; the memory is used to store code instructions; the processor is used to run the code instructions to execute a network connection method in any possible design manner as in the first aspect.
[0022] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes a network connection method in any possible design manner in the first aspect.
[0023] In a fourth aspect, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the network connection method in any possible design manner in the first aspect.
[0024] Among them, the technical effects brought about by any design method in the second aspect, the third aspect and the fourth aspect can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of a scenario in which a laptop computer rescans Wi-Fi is shown;
[0026] Figure 2 An exemplary table diagram of scanned Wi-Fi is shown;
[0027] Figure 3 A schematic diagram showing a flow chart of a Wi-Fi connection method of the related art;
[0028] Figure 4 based on Figure 2 The content in shows a schematic diagram of selecting a target Wi-Fi from the scanned Wi-Fi;
[0029] Figure 5 A schematic diagram of the structure of a laptop computer provided in an embodiment of the present application is shown;
[0030] Figure 6 A schematic diagram of a process of a Wi-Fi connection method is shown;
[0031] Figure 7 A schematic diagram showing a network and Internet user interface of an operating system of a notebook computer 100;
[0032] Figure 8 A schematic diagram of a process of optimal Wi-Fi confirmation is shown;
[0033] Fig. 9 A schematic diagram of a Wi-Fi quality indicator is shown;
[0034] Fig.10 A schematic diagram showing a ranking of Wi-Fi connection priorities for automatically connecting to Wi-Fi is shown;
[0035] Fig.11 A schematic diagram of a target Wi-Fi confirmation process is shown;
[0036] Fig.12 A schematic diagram showing a ranking of Wi-Fi connection priorities of a known Wi-Fi is shown;
[0037] Fig.13 A schematic diagram showing the ranking of Wi-Fi connection priorities of a Wi-Fi that can be automatically connected is shown. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The following terms "first", "second", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features.
[0039] In the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0040] In the embodiments of the present application, "and / or" is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0041] In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "set", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0042] In order to better illustrate the technical solution of the present application, the following is a brief overview of the terms involved in the present application.
[0043] (1) Wireless network: A wireless network is a network that can interconnect various communication devices without the need for wiring. Common wireless networks include Wi-Fi, Bluetooth, ZigBee, hotspots, etc.
[0044] According to the different network coverage, wireless networks can be divided into wireless wide area networks (WWAN), wireless local area networks (WLAN) and wireless metropolitan area networks (WMAN).
[0045] (2) Local Area Network (LAN): LANs generally cover an area of several thousand meters. They are easy to install, cost-effective, and easy to expand, making them widely used in various offices. LANs can realize functions such as file management, application software sharing, and printer sharing.
[0046] (3) Wide Area Network (WAN), also known as extranet or public network, is a long-distance network that connects computers in local area networks or metropolitan area networks in different regions. It usually spans a large physical range, ranging from tens of kilometers to thousands of kilometers. It can connect multiple regions, cities and countries, or span several continents and provide long-distance communications, forming an international long-distance network. A WAN is not the same as the Internet. The Internet generally refers to a public WAN.
[0047] As described in the background technology above, when the electronic device is disconnected from the Internet, it will rescan the Wi-Fi and connect to the Wi-Fi that has been previously connected and set to automatically connect in the Wi-Fi scan results. However, if there is no Wi-Fi with automatic connection set in the scanned Wi-Fi, the electronic device cannot reconnect to the Wi-Fi, and the electronic device fails to reconnect to the Wi-Fi, and the electronic device will remain in the Wi-Fi disconnected state, resulting in a poor user experience.
[0048] For example, Figure 1FIG. 4 shows a schematic diagram of a scenario in which a laptop computer rescans Wi-Fi. Figure 1 As shown, the operating system of the notebook computer 100 will perform a Wi-Fi recovery connection operation. First, the notebook computer 100 will rescan the Wi-Fi.
[0049] The laptop computer 100 may scan multiple Wi-Fi networks. For example, Figure 2 FIG. 1 shows an exemplary table diagram of scanned Wi-Fi networks. Figure 2 As shown, the scanned Wi-Fi may include Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-D, Wi-Fi-E, Wi-Fi-F and Wi-Fi-G, among which the previously connected Wi-Fi scanned include Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F. It is understandable that the previously connected Wi-Fi may be referred to as a known Wi-Fi. The previously connected Wi-Fi may be a Wi-Fi for which the laptop 100 has saved connection credentials, and the connection credentials may be a network connection password, a network account, or a network connection digital certificate. The laptop 100 can access the Internet through a network connection password, a network account, or a network connection digital certificate.
[0050] The automatically connectable Wi-Fi is a Wi-Fi that the notebook computer 100 sets as automatically connected in response to a user operation. Figure 1 As shown in FIG. 1 , the user operation may be an operation in which the user clicks an automatic connection button. Figure 2 As shown, the previously connected Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F scanned are not set to automatic connection. That is, the notebook computer 100 scans that there is no Wi-Fi set to automatic connection.
[0051] Here is a Wi-Fi connection method: Figure 3 FIG. 1 is a flow chart showing a Wi-Fi connection method of a related art. Figure 3 As shown, the process includes the following steps:
[0052] Step 301: the operating system of the notebook computer 100 detects that the Wi-Fi is disconnected, controls the notebook computer 100 to scan the Wi-Fi, and obtains the Wi-Fi scanning result.
[0053] Step 302: The operating system of the notebook computer 100 determines a known Wi-Fi and a Wi-Fi that can be automatically connected from the Wi-Fi scanning results.
[0054] Step 303: The operating system of the notebook computer 100 determines whether there is a Wi-Fi network that can be automatically connected.
[0055] When the operating system of the laptop computer 100 determines that there is a Wi-Fi that can be automatically connected, the operating system of the laptop computer 100 determines a Wi-Fi quality indicator that can automatically connect to the Wi-Fi according to the Wi-Fi parameters, and determines a target Wi-Fi based on the Wi-Fi quality indicator that can automatically connect to the Wi-Fi, that is, executes step 305. When the operating system of the laptop computer 100 determines that there is no Wi-Fi that can be automatically connected, the operating system of the laptop computer 100 controls the laptop computer 100 to keep the Wi-Fi disconnected.
[0056] Step 304: The operating system of the notebook computer 100 controls the notebook computer 100 to maintain a Wi-Fi disconnected state.
[0057] When the Wi-Fi of the laptop 100 is disconnected, the operating system will scan the network at a high frequency and regularly, so that the laptop 100 can quickly and automatically connect to the corresponding automatically connectable network when it enters the automatically connectable network range. Frequent scanning will increase the power consumption of the wireless LAN adapter in the laptop 100.
[0058] Step 305: The operating system of the notebook computer 100 determines a Wi-Fi quality indicator for automatically connecting to the Wi-Fi according to the Wi-Fi parameters, and determines a target Wi-Fi based on the Wi-Fi quality indicator for automatically connecting to the Wi-Fi.
[0059] Wi-Fi parameters include network signal strength parameters.
[0060] Step 306: The operating system of the notebook computer 100 controls the notebook computer 100 to connect to the target Wi-Fi.
[0061] The operating system of the laptop computer 100 will perform the Wi-Fi recovery connection operation according to the preset Wi-Fi recovery mechanism, such as steps 301 to 306 above. That is, the Wi-Fi that is scanned and set to automatically connect is connected. However, the previously scanned Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E, and Wi-Fi-F are not set to automatically connect. There is no Wi-Fi that is set to automatically connect among the Wi-Fi scanned by the laptop computer 100. The laptop computer 100 cannot reconnect to the Wi-Fi. The laptop computer 100 fails to reconnect to the Wi-Fi. The laptop computer 100 will still remain in the Wi-Fi disconnected state, and the user experience is poor.
[0062] In order to solve the aforementioned technical problems, an embodiment of the present application proposes a network connection method, which includes: if the electronic device detects that the wireless local area network is disconnected, the operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism; if the operating system fails to successfully connect to the wireless local area network according to the preset self-connection recovery mechanism, the electronic device determines a first target wireless local area network from the scanned candidate wireless local area networks; wherein the candidate wireless local area network is a wireless local area network for which the electronic device has saved connection credentials. Then, the electronic device is connected to the first target wireless local area network.
[0063] In the embodiment of the present application, even if the operating system of the electronic device fails to reconnect to the wireless LAN according to the preset self-connection recovery mechanism, the electronic device can select a target wireless LAN from the known wireless LANs scanned by the electronic device and control the electronic device to connect to the target wireless LAN. In this way, even if the operating system of the electronic device fails to restore the wireless LAN connection according to the preset self-connection recovery mechanism, the electronic device can automatically connect to the wireless LAN, thereby improving the user's Internet experience.
[0064] The wireless local area network here may include various wireless networks such as Wi-Fi, Bluetooth, ZigBee, hotspots, etc. In this application, the wireless local area network is mainly described by taking Wi-Fi as an example.
[0065] In the case where the Wi-Fi is Wi-Fi, when the electronic device detects that the Wi-Fi is disconnected, the operating system of the electronic device controls the electronic device to connect to the Wi-Fi according to a preset self-connection recovery mechanism; if the operating system fails to successfully connect to the Wi-Fi according to the preset self-connection recovery mechanism, the electronic device determines a first target Wi-Fi from the scanned candidate Wi-Fi; wherein the candidate Wi-Fi is a Wi-Fi for which the electronic device has saved connection credentials; and the electronic device connects to the first target Wi-Fi.
[0066] It can be understood that the preset self-connection recovery mechanism can also be called a preset Wi-Fi recovery mechanism.
[0067] For example, Figure 4 based on Figure 2 The content in FIG. 1 shows a schematic diagram of selecting a target Wi-Fi from the scanned Wi-Fi. Figure 4As shown, the scanned Wi-Fi may include Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-D, Wi-Fi-E, Wi-Fi-F and Wi-Fi-G, among which the scanned known Wi-Fi include Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F. If the operating system of the notebook computer 100 still fails to successfully connect to the Wi-Fi according to the preset Wi-Fi recovery mechanism, a target Wi-Fi, for example, Wi-Fi-A, can be determined from Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F, and the notebook computer 100 is controlled to connect to the target Wi-Fi.
[0068] The electronic device provided in the embodiment of the present application is a variety of devices with the function of connecting to a wireless local area network. The electronic device provided in the embodiment of the present application can be a laptop, a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in a smart city (smart city), a wireless terminal in a smart home (smart home), etc.
[0069] The technical solution of the present application is further described in detail below by taking a laptop computer as an example of an electronic device.
[0070] Please refer to Figure 5 , which shows a schematic diagram of the structure of a notebook computer provided by an embodiment of the present application. Figure 5 As shown, the laptop computer may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a display screen 150, an antenna, a wireless communication module 160, an audio module 170, a speaker (i.e., a horn) 170A, a microphone 170C, a headphone interface 170B, a touchpad 180, a keyboard 190, and a camera 191, etc.
[0071] Among them, the other components except the display screen 150 (such as the processor 110, the external memory interface 120, the internal memory 121, the USB interface 130, the charging management module 140, the power management module 141, the battery 142, the antenna, the wireless communication module 160, the audio module 170, the touchpad 180, the speaker 170A, the microphone 170C, the headphone interface 170B, the keyboard 190 and the camera 191, etc.) can be set on the base of the laptop computer. The above-mentioned camera 191 can be set on the base of the laptop computer or on the frame of the display screen 150.
[0072] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the laptop computer. In other embodiments, the laptop computer may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0073] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. The processor 110 can execute the network connection method provided in the embodiment of the present application.
[0074] The controller can be the nerve center and command center of the laptop computer. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0075] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0076] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0077] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the notebook computer. In other embodiments, the notebook computer may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0078] The charging management module 140 is used to receive charging input from a charger (such as a wireless charger or a wired charger) to charge the battery 142. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power various components of the laptop computer.
[0079] The wireless communication function of the notebook computer can be realized through the antenna and the wireless communication module 160, the modem processor and the baseband processor.
[0080] Antennas are used to transmit and receive electromagnetic wave signals. Each antenna in a laptop can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
[0081] In some embodiments, the antenna of the laptop computer is coupled to the wireless communication module 160, so that the laptop computer can communicate with a wireless local area network and other devices through wireless communication technology. The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., which are applied to the laptop computer. The wireless local area network can be Wi-Fi, a hotspot generated based on a cellular mobile network, or Bluetooth (BT).
[0082] The laptop computer can realize the display function through a GPU, a display screen 150, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 150 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen 150 is used to display images, videos, etc.
[0083] A touch sensor is integrated in the touch panel 180. The notebook computer can receive control commands from the user to the notebook computer through the touch panel 180 and the keyboard 190.
[0084] The laptop computer can realize the shooting function through the ISP, the camera 191, the video codec, the GPU, the display screen 150 and the application processor. The ISP is used to process the data fed back by the camera 191. In some embodiments, the ISP can be set in the camera 191. The camera 191 is used to capture a static image or a video. In some embodiments, the laptop computer can include 1 or N cameras 191, where N is a positive integer greater than 1.
[0085] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the laptop computer. The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the laptop computer by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0086] The notebook computer can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the microphone 170C, the headphone jack 170B, and the application processor.
[0087] The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio inputs into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170B is used to connect wired headphones. The headphone jack 170B can be a USB interface 130, or it can be a 1.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, the American Cellular Telecommunications Industry Association (cellular telecommunicationsindustry association of the USA, CTIA) standard interface.
[0088] The embodiments of the present application are applied to a wireless local area network, and the following description will be given taking the wireless local area network as Wi-Fi as an example.
[0089] In order to solve the aforementioned technical problems, an embodiment of the present application proposes a Wi-Fi connection method, which includes: if the operating system of the laptop computer 100 still cannot connect to the Wi-Fi according to the preset Wi-Fi recovery mechanism, the laptop computer 100 will use the Wi-Fi recovery mechanism set in the third-party application to continue the Wi-Fi connection. Specifically, if the operating system of the laptop computer 100 still cannot connect to the Wi-Fi according to the preset Wi-Fi recovery mechanism, the operating system can send information about known networks in the scanned Wi-Fi to the third-party application. When the laptop computer 100 disconnects the Wi-Fi and the third-party application receives the information about known networks in the scanned Wi-Fi, it will determine the target Wi-Fi from the scanned known Wi-Fi and control the laptop computer 100 to connect to the target Wi-Fi. The preset Wi-Fi recovery mechanism can also be called a preset self-connection recovery mechanism.
[0090] In the embodiment of the present application, even if the operating system of the laptop computer 100 fails to reconnect to the Wi-Fi according to the preset Wi-Fi recovery mechanism, the third-party application will select a target Wi-Fi from the known Wi-Fi scanned by the laptop computer 100 and control the laptop computer 100 to connect to the target Wi-Fi. In this way, even if the operating system of the laptop computer 100 fails to restore the Wi-Fi connection according to the preset Wi-Fi recovery mechanism, it can still automatically connect to the Wi-Fi, thereby improving the user's Internet experience.
[0091] Figure 6 A schematic diagram of a Wi-Fi connection method is shown. Figure 6 As shown, the process includes the following steps:
[0092] Step 601 : the operating system of the notebook computer 100 detects that the Wi-Fi is disconnected, and sends Wi-Fi disconnection information to a third-party application of the notebook computer 100 .
[0093] If the laptop computer 100 detects an abnormal Wi-Fi disconnection, the operating system of the laptop computer 100 can control the laptop computer 100 to connect to the wireless LAN according to the preset self-recovery mechanism; wherein the abnormal Wi-Fi disconnection includes disconnecting the Wi-Fi when no user's Wi-Fi disconnection instruction is detected, that is, the abnormal Wi-Fi disconnection is a Wi-Fi disconnection triggered by a non-user Wi-Fi disconnection operation. The normal Wi-Fi disconnection includes disconnecting the Wi-Fi when a user's Wi-Fi disconnection instruction is detected, that is, the normal Wi-Fi disconnection is a Wi-Fi disconnection triggered by a user's Wi-Fi disconnection operation.
[0094] It is understandable that in some embodiments, a third-party application of the laptop computer 100 can apply to the operating system to register an event monitoring callback. After the operating system agrees to register the event monitoring callback, the operating system of the laptop computer 100 can send the monitored Wi-Fi information and some trigger information to the third-party application.
[0095] For example, when the laptop computer 100 detects that the Wi-Fi connection is disconnected, it will send a Wi-Fi disconnection message and a Wi-Fi disconnection reason to the third-party application. The Wi-Fi disconnection message includes a wlan_notification_acm_disconnected event. The wlan_notification_acm_disconnected event is used to indicate that the Wi-Fi connection is disconnected.
[0096] The third-party application of the laptop computer 100 can determine whether the Wi-Fi disconnection is a normal disconnection or an abnormal disconnection according to the disconnection reason. A normal disconnection refers to a Wi-Fi disconnection triggered by the laptop computer 100 in response to a user's operation to disconnect the Wi-Fi. An abnormal Wi-Fi disconnection is a Wi-Fi disconnection triggered by an operation other than the user disconnecting the Wi-Fi. The abnormal disconnection reason can be a Wi-Fi driver, a wireless access point, or an operating system that causes an abnormal disconnection of the connected Wi-Fi. The wlan_notification_acm_disconnected event is used to indicate that the Wi-Fi connection is disconnected.
[0097] Step 602: The third-party application of the notebook computer 100 receives a Wi-Fi disconnection message.
[0098] Step 603: The operating system of the notebook computer 100 controls the notebook computer 100 to scan Wi-Fi and obtain the Wi-Fi scanning result.
[0099] When the operating system of the notebook computer 100 detects that the Wi-Fi is disconnected, a mechanism for reconnecting to the Wi-Fi can be started. First, the notebook computer 100 can scan the Wi-Fi, try to obtain the Wi-Fi that can be reconnected, and obtain the Wi-Fi scanning result.
[0100] Step 604: The operating system of the notebook computer 100 determines known Wi-Fi and automatically connectable Wi-Fi from the Wi-Fi scanning results.
[0101] The laptop computer 100 may or may not scan Wi-Fi. If the laptop computer 100 cannot scan Wi-Fi, the number of Wi-Fi scanned in the Wi-Fi scan result is 0; if the laptop computer 100 scans Wi-Fi, the number of Wi-Fi scanned in the Wi-Fi scan result is at least 1. When the number of Wi-Fi scanned in the Wi-Fi scan result is greater than or equal to 1, the laptop computer 100 can determine known Wi-Fi and Wi-Fi that can be automatically connected from the Wi-Fi scan result.
[0102] It is understandable that the number of known Wi-Fi in the Wi-Fi scan result may be 0, or may be greater than or equal to 1, and the number of automatically connectable Wi-Fi may be 0, or may be greater than or equal to 1.
[0103] It is known that Wi-Fi can also be called a candidate wireless local area network, from which the notebook computer 100 can select a network to connect.
[0104] The operating system of the notebook computer 100 stores the known Wi-Fi and automatically connectable Wi-Fi in a period of time before the current time. In this way, the operating system of the notebook computer 100 can match the Wi-Fi in the Wi-Fi scan result with the known Wi-Fi and automatically connectable Wi-Fi stored in the operating system of the notebook computer 100, and determine the known Wi-Fi and automatically connectable Wi-Fi from the Wi-Fi scan result.
[0105] The known Wi-Fi networks within a period of time before the current time stored in the operating system of the notebook computer 100 can be displayed on the display screen of the notebook computer 100 .
[0106] For example, Figure 7 FIG. 1 is a schematic diagram showing a network and Internet user interface of an operating system of a notebook computer 100. Figure 7 As shown, the network and Internet user interface of the operating system of the notebook computer 100 displays the manage known network entry. In response to the user opening the manage known network entry with a cursor, the notebook computer 100 can display the known Wi-Fi within a period of time before the current time.
[0107] The Wi-Fi scan result can be displayed on the display screen of the laptop computer 100. The network and Internet user interface of the operating system of the laptop computer 100 displays available network entries. In response to the user's operation of opening the display available network entry with a cursor, the laptop computer 100 can display the Wi-Fi scan result.
[0108] Step 605: The operating system of the notebook computer 100 determines whether there is a Wi-Fi network that can be automatically connected.
[0109] If the number of automatically connected Wi-Fi is 0, the notebook computer 100 determines that there is no automatically connected Wi-Fi; if the number of automatically connected Wi-Fi is greater than or equal to 1, the notebook computer 100 determines that there is an automatically connected Wi-Fi.
[0110] When the laptop computer 100 determines that there is a Wi-Fi that can be automatically connected, the operating system of the laptop computer 100 determines the Wi-Fi quality indicator of the Wi-Fi that can be automatically connected according to the Wi-Fi parameters, and determines the target Wi-Fi based on the Wi-Fi quality indicator of the Wi-Fi that can be automatically connected, that is, executing step 611. When the laptop computer 100 determines that there is no Wi-Fi that can be automatically connected, the laptop computer 100 controls the laptop computer 100 to keep the Wi-Fi disconnected, and sends the information of the known Wi-Fi in the Wi-Fi scan result to the third-party application, that is, executing step 606.
[0111] Step 606: The operating system of the notebook computer 100 controls the notebook computer 100 to keep the Wi-Fi disconnected state, and sends the information of the known Wi-Fi in the Wi-Fi scan result to the third-party application.
[0112] The operating system of the notebook computer 100 can send the information of the known Wi-Fi in the Wi-Fi scan result to the third-party application of the notebook computer 100. In this way, the third-party application can receive the information of the known Wi-Fi in the Wi-Fi scan result sent by the operating system, and when receiving the information of the known Wi-Fi in the Wi-Fi scan result sent by the operating system, execute the Wi-Fi recovery mechanism in the third-party application and perform the Wi-Fi recovery connection operation.
[0113] It can be understood that in the related art, when the laptop computer 100 is disconnected from the network, the operating system of the laptop computer 100 will perform the Wi-Fi recovery connection operation according to the preset Wi-Fi recovery mechanism. The third-party application will only execute the Wi-Fi recovery mechanism in the third-party application and perform the Wi-Fi recovery connection operation when it receives the Wi-Fi scan result sent by the operating system with the information of the known Wi-Fi, instead of executing the Wi-Fi recovery mechanism in the third-party application when the Wi-Fi is disconnected at the beginning of the laptop computer 100. In this way, the conflict between the Wi-Fi recovery mechanism in the third-party application and the Wi-Fi recovery mechanism in the operating system can be avoided.
[0114] When the Wi-Fi of the laptop computer 100 is disconnected and the wireless service in the operating system determines that there is a known Wi-Fi, the operating system can send information about the known Wi-Fi in the Wi-Fi scan result to the third-party application, and the information about the known Wi-Fi in the Wi-Fi scan result includes a wlan_notification_acm_network_available event; wherein the wlan_notification_acm_network_available event is used to indicate that there is a known Wi-Fi in the Wi-Fi scan result.
[0115] It is understandable that in some embodiments, a third-party application of the laptop computer 100 can apply to the operating system to register an event monitoring callback. After the operating system agrees to register the event monitoring callback, the operating system of the laptop computer 100 can send the monitored Wi-Fi information and some trigger information to the third-party application.
[0116] For example, the laptop computer 100 can send information about known Wi-Fi in the Wi-Fi scan results to a third-party application if it determines that there is no Wi-Fi that can be automatically connected, or send information about known Wi-Fi in the Wi-Fi scan results to a third-party application if the target Wi-Fi connection fails.
[0117] It can be understood that in some embodiments, after the notebook computer 100 is turned on and the third-party application of the notebook computer 100 is opened, the software has been running in the background, and the software registers an event monitoring callback with the operating system when it is just started.
[0118] It is understandable that in some embodiments, when the number of known Wi-Fi networks is greater than 0, the operating system of the laptop computer 100 sends information about known Wi-Fi networks in the Wi-Fi scan result to the third-party application of the laptop computer 100. In this way, the third-party application can receive the information about known Wi-Fi networks in the Wi-Fi scan result sent by the operating system, and when receiving the information about known Wi-Fi networks in the Wi-Fi scan result sent by the operating system, the third-party application executes the Wi-Fi recovery mechanism in the third-party application and performs the Wi-Fi recovery connection operation.
[0119] If the number of known Wi-Fis is 0, the operating system of the laptop computer 100 still sends the information of the known Wi-Fis in the Wi-Fi scan result to the third-party application of the laptop computer 100. In this way, even if the third-party application receives the information of the known Wi-Fis in the Wi-Fi scan result sent by the operating system, and executes the Wi-Fi recovery mechanism in the third-party application, the reconnection to the Wi-Fi will fail because the number of known Wi-Fis is 0, and the power consumption of the operating system of the laptop computer 100 sending the information of the known Wi-Fis in the Wi-Fi scan result to the third-party application of the laptop computer 100 will be wasted. Therefore, the operating system of the laptop computer 100 sends the information of the known Wi-Fis in the Wi-Fi scan result to the third-party application of the laptop computer 100 only when the number of known Wi-Fis is greater than 0. In this way, unnecessary Wi-Fi connection power consumption of the laptop computer 100 can be reduced.
[0120] Step 607: The third-party application of the notebook computer 100 receives information about known Wi-Fi in the Wi-Fi scanning result sent by the operating system.
[0121] Step 608: The third-party application of the notebook computer 100 determines a known Wi-Fi from the Wi-Fi scanning result.
[0122] The operating system of the laptop computer 100 stores the known Wi-Fi in a period of time before the current time. When the third-party application of the laptop computer 100 receives the information of the known Wi-Fi in the Wi-Fi scan result sent by the operating system, the known Wi-Fi stored in the operating system of the laptop computer 100 can be obtained from the operating system of the laptop computer 100. In this way, the third-party application of the laptop computer 100 can match the Wi-Fi in the Wi-Fi scan result with the known Wi-Fi obtained from the operating system of the laptop computer 100, and determine the known Wi-Fi from the Wi-Fi scan result.
[0123] Step 609 : The third-party application of the notebook computer 100 determines the best Wi-Fi from the known Wi-Fi.
[0124] It can be understood that the quality of Wi-Fi depends to a certain extent on various quality indicators of Wi-Fi, and various quality indicators of Wi-Fi can be parameter values of Wi-Fi parameters. In order to improve the user experience, the laptop 100 can select a better quality Wi-Fi to be connected according to the Wi-Fi parameters. Specifically, in some embodiments, the laptop 100 can determine the Wi-Fi quality indicators of known Wi-Fi according to the Wi-Fi parameters, rank the connection priorities according to the Wi-Fi quality indicators, and determine the optimal Wi-Fi based on the ranked connection priorities.
[0125] Specifically, Figure 8 FIG. 1 shows a schematic diagram of a process for optimal Wi-Fi confirmation. Figure 8 As shown, the process includes the following steps:
[0126] Step 801: The third-party application of the notebook computer 100 determines the Wi-Fi quality indicator of each Wi-Fi among the known Wi-Fi according to the Wi-Fi parameters of the Wi-Fi among the known Wi-Fi.
[0127] The Wi-Fi parameter may include at least one, and the Wi-Fi quality indicator may be the sum of at least one Wi-Fi parameter score. The Wi-Fi parameter may include any one or more combinations of a network signal strength parameter, a network signal quality parameter, a Wi-Fi frequency band, a Wi-Fi protocol, a Wi-Fi connection rate, and Wi-Fi protocol security.
[0128] The following uses Wi-Fi parameters including network signal quality parameters, Wi-Fi frequency band, Wi-Fi protocol, Wi-Fi connection rate, and Wi-Fi protocol security as an example to illustrate the quality indicator determination solution.
[0129] For example, Fig. 9FIG. 1 is a schematic diagram showing a Wi-Fi quality indicator. Fig. 9 As shown, the Wi-Fi parameters may include Wi-Fi signal quality parameters, Wi-Fi frequency band parameters, Wi-Fi protocol parameters, Wi-Fi connection rate parameters, and Wi-Fi protocol security parameters, and the Wi-Fi quality indicator may be the sum of the Wi-Fi signal quality parameter score, the Wi-Fi frequency band parameter score, the Wi-Fi protocol parameter score, the Wi-Fi connection rate parameter score, and the Wi-Fi protocol security parameter score.
[0130] The following is an example of a scoring standard for Wi-Fi signal quality parameters, Wi-Fi frequency band parameters, Wi-Fi protocol parameters, Wi-Fi connection rate parameters, and Wi-Fi protocol security parameters.
[0131] Table 1 shows an exemplary table of signal quality parameter scores.
[0132] Table 1
[0133]
[0134] As shown in Table 1, if the signal quality parameter is in the range of greater than 0 and less than 30, the Wi-Fi signal quality parameter score is 0; if the signal quality parameter is in the range of greater than or equal to 30 and less than 50, the Wi-Fi signal quality parameter score is 20; if the signal quality parameter is in the range of greater than or equal to 50 and less than 70, the Wi-Fi signal quality parameter score is 60; if the signal quality parameter is in the range of greater than or equal to 70 and less than or equal to 100, the Wi-Fi signal quality parameter score is 80.
[0135] Table 2 shows an exemplary table of Wi-Fi frequency band scores.
[0136] Table 2
[0137]
[0138] As shown in Table 2, if the Wi-Fi frequency band parameter is 2.4 GHz, the Wi-Fi frequency band score is 20; if the Wi-Fi frequency band parameter is 5 GHz, the Wi-Fi frequency band score is 50.
[0139] Table 3 shows an exemplary table of Wi-Fi protocol type parameter scores.
[0140] Table 3
[0141]
[0142] As shown in Table 3, if the Wi-Fi protocol type parameter is b / a / g / n, the Wi-Fi protocol type parameter score is 0; if the Wi-Fi protocol type parameter is ac, the Wi-Fi protocol type parameter score is 5; if the Wi-Fi protocol type parameter is ax, the Wi-Fi protocol type parameter score is 10; if the Wi-Fi protocol type parameter is be, the Wi-Fi protocol type score is 15.
[0143] Table 4 shows an exemplary table of Wi-Fi connection rate parameter scores.
[0144] Table 4
[0145]
[0146] As shown in Table 4, if the Wi-Fi connection rate parameter is in the range of greater than or equal to 0 and less than 287, the Wi-Fi connection rate parameter score is 0; if the Wi-Fi connection rate parameter is in the range of greater than or equal to 287 and less than 574, the Wi-Fi connection rate parameter score is 5; if the Wi-Fi connection rate parameter is in the range of greater than or equal to 574 and less than 1201, the Wi-Fi connection rate parameter score is 10; if the Wi-Fi connection rate parameter is greater than or equal to 1201, the Wi-Fi connection rate parameter score is 15.
[0147] Table 5 shows an exemplary table of Wi-Fi protocol security scores.
[0148] Table 5
[0149]
[0150] As shown in Table 5, if the Wi-Fi protocol security parameter is secure, the Wi-Fi protocol security parameter score is 40; if the Wi-Fi protocol security parameter is open, the Wi-Fi protocol security parameter score is 0.
[0151] In some embodiments, the known Wi-Fi may be a Wi-Fi whose signal strength is greater than or equal to a preset signal strength threshold. The preset signal strength threshold may be -75dbm.
[0152] In some embodiments, the laptop computer 100 can obtain Wi-Fi parameter contents such as Wi-Fi protocol type parameters, Wi-Fi connection rate parameters, Wi-Fi signal quality parameters, Wi-Fi signal strength parameters, and Wi-Fi security parameters for connecting to Wi-Fi through some public interfaces provided by the operating system.
[0153] 1) Through the operating system public interface: WlanQueryInterface function, set the parameter OpCode to wlan_intf_opcode_current_connection, which can be used to obtain the Wi-Fi protocol type parameters, Wi-Fi connection rate parameters, Wi-Fi signal quality parameters, and Wi-Fi security parameters of the current Wi-Fi connection.
[0154] 2) Through the operating system public interface: WlanQueryInterface function, set the parameter OpCode to wlan_intf_opcode_channel_number, which can be used to obtain the channel of the current Wi-Fi connection. According to the channel, it can be mapped to the frequency band parameters.
[0155] 3) Through the operating system public interface: WlanQueryInterface function, set the parameter OpCode to wlan_intf_opcode_rssi, which can be used to obtain the Wi-Fi signal strength parameters of the currently connected Wi-Fi.
[0156] Step 802: The third-party application of the notebook computer 100 ranks the connection priority of each Wi-Fi among the known Wi-Fi according to the Wi-Fi quality indicator of each Wi-Fi among the known Wi-Fi.
[0157] Specifically, in some embodiments, the laptop computer 100 may rank the Wi-Fi quality indicators of each Wi-Fi in the known Wi-Fi in order from high to low, and then the laptop computer assigns the connection priority of the Wi-Fi in order from high to low according to the ranking of the Wi-Fi quality indicators from high to low.
[0158] Step 803: The third-party application of the notebook computer 100 determines the optimal Wi-Fi based on the ranking of the connection priority of each Wi-Fi among the known Wi-Fis.
[0159] The notebook computer 100 may determine the optimal Wi-Fi network from among the known Wi-Fi networks, the Wi-Fi network having the highest connection priority among the Wi-Fi networks.
[0160] For example, Fig.10 As shown, the notebook computer 100 may determine Wi-Fi-F as the optimal Wi-Fi.
[0161] The network can be divided into wide area network, local area network and metropolitan area network according to the different network coverage. Broadening the Internet access range of electronic devices can improve the user's Internet experience. In some other embodiments, the electronic device can preferentially connect to the network with the ability to communicate with the wide area network among the scanned Wi-Fi, and the Wi-Fi with a higher connection priority. The connection priority is the connection priority determined according to the above scheme.
[0162] Specifically, Fig.11 FIG. 1 shows a schematic diagram of a process for optimal Wi-Fi confirmation. Fig.11 As shown, the process includes the following steps:
[0163] Step 1101: The third-party application of the notebook computer 100 determines whether the known Wi-Fi networks include a Wi-Fi network capable of communicating with a wide area network.
[0164] If the known Wi-Fis include at least one Wi-Fi having the capability to communicate with a wide area network, a Wi-Fi quality indicator of the Wi-Fi having the capability to communicate with a wide area network among the known Wi-Fis is determined according to the Wi-Fi parameters of the Wi-Fi having the capability to communicate with a wide area network among the known Wi-Fis, that is, step 1102 is performed; if the known Wi-Fis do not include a Wi-Fi having the capability to communicate with a wide area network, a Wi-Fi quality indicator of the Wi-Fi having no capability to communicate with a wide area network among the known Wi-Fis is determined according to the Wi-Fi parameters of the Wi-Fi having no capability to communicate with a wide area network among the known Wi-Fis, that is, step 1105 is performed.
[0165] In some embodiments, the laptop computer 100 can determine whether the currently connected Wi-Fi is a Wi-Fi capable of communicating with a wide area network by detecting a public server or the like. For example, the laptop computer 100 sends an Internet Control Message Protocol (ICMP) request to a search engine domain name system server, and the laptop computer 100 receives an ICMP response to determine whether the Wi-Fi is a Wi-Fi capable of communicating with a wide area network; the laptop computer 100 can also send an HTTP request to a cloud server for detecting the connectivity of the laptop computer 100, and the laptop computer 100 receives an HTTP response, and determines whether the Internet is available based on the HTTP response code. If the Internet is available, it is determined that the Wi-Fi is a Wi-Fi capable of communicating with a wide area network.
[0166] In some embodiments, the known Wi-Fi may be a Wi-Fi whose signal strength is greater than or equal to a preset signal strength threshold. The preset signal strength threshold may be -75dbm.
[0167] Step 1102: The third-party application of the notebook computer 100 determines a Wi-Fi quality indicator of the known Wi-Fi capable of communicating with the wide area network according to the Wi-Fi parameters of the known Wi-Fi capable of communicating with the wide area network.
[0168] The Wi-Fi quality indicator of the Wi-Fi capable of communicating with the wide area network is the same as the determination scheme of the aforementioned Wi-Fi quality indicator, which is not repeated here.
[0169] Step 1103: The third-party application of the notebook computer 100 ranks the connection priorities of the known Wi-Fi networks capable of communicating with the wide area network according to the Wi-Fi quality indicators of the known Wi-Fi networks capable of communicating with the wide area network.
[0170] The connection priority ranking of Wi-Fi capable of communicating with a wide area network is the same as the connection priority ranking scheme of the aforementioned Wi-Fi connection priority ranking, and will not be repeated here.
[0171] Step 1104 : The third-party application of the notebook computer 100 determines the optimal Wi-Fi based on the ranking of the connection priorities of all Wi-Fis among the known Wi-Fis that have the ability to communicate with the wide area network.
[0172] The determination of the optimal Wi-Fi among the Wi-Fis capable of communicating with the wide area network is the same as the aforementioned determination scheme of the optimal Wi-Fi, which will not be repeated here.
[0173] Step 1105: The third-party application of the notebook computer 100 determines the Wi-Fi quality indicator of the known Wi-Fi network that does not have the ability to communicate with the wide area network according to the Wi-Fi parameters of the known Wi-Fi network that does not have the ability to communicate with the wide area network.
[0174] The Wi-Fi quality indicator of the Wi-Fi that does not have the ability to communicate with the wide area network is the same as the determination scheme of the aforementioned Wi-Fi quality indicator, which is not repeated here.
[0175] Step 1106 : The third-party application of the notebook computer 100 ranks the connection priorities of the known Wi-Fi networks that do not have the ability to communicate with the wide area network according to the Wi-Fi quality indicators of the known Wi-Fi networks that do not have the ability to communicate with the wide area network.
[0176] The connection priority ranking of Wi-Fi that does not have the ability to communicate with a wide area network is the same as the connection priority ranking scheme of the aforementioned Wi-Fi connection priority ranking, and will not be repeated here.
[0177] Step 1107 : The third-party application of the notebook computer 100 determines the optimal Wi-Fi based on the ranking of the connection priorities of all Wi-Fis that do not have the capability of communicating with the wide area network among the known Wi-Fis.
[0178] The Wi-Fi quality indicator of the Wi-Fi that does not have the ability to communicate with the wide area network is the same as the determination scheme of the aforementioned Wi-Fi quality indicator, which is not repeated here.
[0179] It is understandable that the laptop computer 100 can also determine the Wi-Fi quality index of the known Wi-Fi according to the Wi-Fi parameters, rank the connection priorities according to the Wi-Fi quality index, and determine the optimal Wi-Fi based on the ranked connection priorities. The specific solution is the same as the judgment criteria of the above-mentioned target network, and will not be repeated again.
[0180] In the embodiment of the present application, the optimal Wi-Fi may be the Wi-Fi with the highest connection priority.
[0181] In this step, various solutions for the third-party application of the notebook computer 100 to determine the optimal Wi-Fi from the known Wi-Fi can be collectively referred to as the first method.
[0182] In the embodiment of the present application, in this step, the optimal Wi-Fi is the Wi-Fi with the highest connection priority determined in the first manner. The optimal Wi-Fi and other target wireless local area networks may also be referred to as first target local area networks.
[0183] Step 610: The third-party application of the notebook computer 100 controls the notebook computer 100 to connect to the optimal Wi-Fi.
[0184] For example, Fig.12 FIG. 1 shows a schematic diagram of ranking Wi-Fi connection priorities of a known Wi-Fi network. Fig.12As shown, known Wi-Fi includes Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F. If the Wi-Fi quality indicators obtained by Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F according to the quality indicator determination scheme in the third-party application are 90, 110, 105, 95 and 150 respectively, then the connection priority ranking of Wi-Fi is: the connection priority ranking of Wi-Fi-A is fifth, the connection priority ranking of Wi-Fi-B is second, the connection priority ranking of Wi-Fi-C is third, the connection priority ranking of Wi-Fi-E is fourth, and the connection priority ranking of Wi-Fi-F is first. Wi-Fi-F is the best Wi-Fi among the known Wi-Fi. The third-party application of the laptop computer 100 controls the laptop computer 100 to connect to Wi-Fi-F.
[0185] In some embodiments, if the laptop computer 100 fails to connect to the optimal Wi-Fi, it may also connect to a suboptimal Wi-Fi. For example, the suboptimal Wi-Fi may be a Wi-Fi with the second highest connection priority.
[0186] Step 611: The operating system of the notebook computer 100 determines a Wi-Fi quality indicator of the Wi-Fi that can be automatically connected to according to the Wi-Fi parameters, and determines a target Wi-Fi based on the Wi-Fi quality indicator of the Wi-Fi that can be automatically connected to.
[0187] In this step, the operating system of the laptop computer 100 determines the Wi-Fi quality indicator that can automatically connect to the Wi-Fi based on the Wi-Fi parameters, and the scheme for determining the target Wi-Fi based on the Wi-Fi quality indicator that can automatically connect to the Wi-Fi can be collectively referred to as the second method. The second method is the same as the scheme for determining the target Wi-Fi in the first method, but the network parameters in the second method are different from the network parameters in the first method. The network parameters in the first method include any combination of network signal strength parameters, network signal quality parameters, network frequency band parameters, network protocol parameters, network connection rate, or network protocol security parameters; the network parameters in the second method include network signal strength parameters.
[0188] In the embodiment of the present application, in this step, the target Wi-Fi is the Wi-Fi with the first connection priority determined in the second manner. The target Wi-Fi and other target wireless local area networks may also be referred to as second target local area networks.
[0189] For example, Fig.10 FIG. 1 shows a schematic diagram of a ranking of Wi-Fi connection priorities that can automatically connect to Wi-Fi. Fig.10As shown, known Wi-Fi includes Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F. Automatically connectable Wi-Fi includes Wi-Fi-B, Wi-Fi-C and Wi-Fi-F. The total Wi-Fi quality scores obtained by Wi-Fi-B, Wi-Fi-C and Wi-Fi-F according to the second method are 110, 105 and 150 respectively. Then the connection priority ranking of Wi-Fi is: Wi-Fi-B is ranked second, Wi-Fi-C is ranked third, and Wi-Fi-F is ranked first.
[0190] Step 612: The operating system of the notebook computer 100 controls the notebook computer 100 to connect to the target Wi-Fi.
[0191] For example, the operating system of the notebook computer 100 controls the notebook computer 100 to connect to Wi-Fi-F.
[0192] In the related art, the operating system of the laptop computer 100 stores known Wi-Fis that can automatically connect to Wi-Fi. If these known Wi-Fis that can automatically connect to Wi-Fi are not successfully connected to, and there are other known Wi-Fis that can be connected, the Wi-Fi connection is in a disconnected state, and the operating system will scan regularly at a high frequency so that it can quickly and automatically connect to these known Wi-Fis that can automatically connect to Wi-Fis when entering the range of these known Wi-Fis that can automatically connect to Wi-Fis. Frequent scanning will increase the power consumption of the wireless Wi-Fi adapter in the laptop computer 100. In the implementation of this application, the laptop computer 100 can connect to these known Wi-Fis, and the operating system will no longer trigger these scans, thereby reducing the power consumption of the laptop computer 100.
[0193] Step 613: The operating system of the notebook computer 100 determines whether the target Wi-Fi connection is successful.
[0194] The laptop computer 100 determines whether the target Wi-Fi is successfully connected. If the target Wi-Fi is successfully connected, in order to improve the user experience and allow the user to use Wi-Fi with better quality, the laptop computer 100 can also determine whether the target Wi-Fi is the best Wi-Fi among the known Wi-Fi. First, the operating system of the laptop computer 100 sends the information of successful Wi-Fi connection to the third-party application, so that the third-party application can determine the best Wi-Fi from the known Wi-Fi, that is, execute step 614. If the target Wi-Fi connection fails, the laptop computer 100 is controlled to keep the Wi-Fi disconnected state, and the information of the known Wi-Fi in the Wi-Fi scan result is sent to the third-party application, that is, execute step 606.
[0195] In some embodiments, if the laptop computer 100 fails to connect to the target Wi-Fi, it can also connect to the suboptimal Wi-Fi, for example, the suboptimal Wi-Fi can be the Wi-Fi with the second highest connection priority. In the case that the laptop computer 100 fails to connect to the suboptimal Wi-Fi, the laptop computer 100 is controlled to keep the Wi-Fi disconnected, and the information of the known Wi-Fi in the Wi-Fi scan result is sent to the third-party application; in the case that the laptop computer 100 successfully connects to the suboptimal Wi-Fi, the operating system of the laptop computer 100 sends the information of the successful Wi-Fi connection to the third-party application, so that the third-party application can determine the optimal Wi-Fi from the known Wi-Fi.
[0196] Step 614: The operating system of the notebook computer 100 sends a message indicating that the Wi-Fi connection is successful to the third-party application.
[0197] Step 615: the third-party application of the notebook computer 100 receives the Wi-Fi connection success information sent by the third-party application, and the third-party application of the notebook computer 100 determines the known Wi-Fi from the Wi-Fi scanning result.
[0198] In this step, the technical solution for determining the known Wi-Fi from the Wi-Fi scanning result is the same as the technical solution in step 608, which will not be repeated here.
[0199] It is understandable that in some embodiments, a third-party application of the laptop computer 100 can apply to the operating system to register an event monitoring callback. After the operating system agrees to register the event monitoring callback, the operating system of the laptop computer 100 can send the monitored Wi-Fi information and some trigger information to the third-party application.
[0200] For another example, when the laptop computer 100 detects that the Wi-Fi connection is successful, it will send information about the successful Wi-Fi connection to the third-party application. The information about the successful Wi-Fi connection includes a wlan_notification_acm_connection_complete event. The wlan_notification_acm_connection_complete event is used to indicate that the Wi-Fi connection is successful.
[0201] Step 616 : The third-party application of the notebook computer 100 determines the best Wi-Fi from the known Wi-Fi.
[0202] The technical solution of this step is the same as that in step 609 and will not be repeated here.
[0203] In this step, various solutions for the third-party application of the notebook computer 100 to determine the optimal Wi-Fi from the known Wi-Fi can be collectively referred to as the first method.
[0204] In the embodiment of the present application, in this step, the optimal Wi-Fi is the Wi-Fi with the highest connection priority determined in the first manner. The optimal Wi-Fi and other target wireless local area networks may also be referred to as third target local area networks.
[0205] Step 617: The third-party application of the notebook computer 100 determines whether the target Wi-Fi is the best Wi-Fi among the known Wi-Fi.
[0206] The laptop computer 100 determines whether the target Wi-Fi is the best Wi-Fi among the known Wi-Fis. If the target Wi-Fi is the best Wi-Fi among the known Wi-Fis, the process ends. If the target Wi-Fi is not the best Wi-Fi among the known Wi-Fis, the laptop computer 100 is further controlled to connect to the best Wi-Fi among the known Wi-Fis, that is, step 618 is executed.
[0207] For example, Fig.12 FIG. 1 shows a schematic diagram of ranking Wi-Fi connection priorities of a known Wi-Fi network. Fig.12 As shown, known Wi-Fi includes Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F. If the Wi-Fi quality indicators obtained by Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F according to the quality indicator determination scheme in the third-party application are 90, 110, 105, 95 and 150 respectively, then the connection priority ranking of Wi-Fi is: Wi-Fi-A is ranked fifth, Wi-Fi-B is ranked second, Wi-Fi-C is ranked third, Wi-Fi-E is ranked fourth, and Wi-Fi-F is ranked first. Wi-Fi-F is the best Wi-Fi among the known Wi-Fi. If the laptop 100 determines that Wi-Fi-F is the best Wi-Fi among the known Wi-Fi: Wi-Fi-F, then the process ends.
[0208] Another example: Fig.13 FIG. 1 shows a schematic diagram of the ranking of Wi-Fi connection priorities of a Wi-Fi that can be automatically connected. Fig.13As shown, it is known that Wi-Fi includes Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F. The Wi-Fi that can be automatically connected are Wi-Fi-B and Wi-Fi-C. The Wi-Fi quality indicators of Wi-Fi-B and Wi-Fi-C obtained according to the quality indicator determination scheme in the operating system are 110 and 105 respectively. The connection priority ranking of Wi-Fi is: Wi-Fi-B is ranked first, and Wi-Fi-C is ranked second. Wi-Fi-B is the target Wi-Fi.
[0209] The laptop computer 100 determines that Wi-Fi-B is not the best Wi-Fi among the known Wi-Fis: Wi-Fi-F, and further controls the laptop computer 100 to connect to the best Wi-Fi among the known Wi-Fis: Wi-Fi-F, that is, executes step 618 .
[0210] In some embodiments, if the laptop computer 100 fails to connect to the optimal Wi-Fi, it may also connect to a suboptimal Wi-Fi. For example, the suboptimal Wi-Fi may be a Wi-Fi with the second highest connection priority.
[0211] Step 618: The third-party application of the notebook computer 100 controls the notebook computer 100 to connect to the optimal Wi-Fi.
[0212] The embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned mobile terminal, the mobile terminal executes each function or step executed by the laptop computer 100 in the above-mentioned method embodiment.
[0213] The present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the laptop computer 100 in the above method embodiment. The computer may be the above mobile terminal (such as the laptop computer 100).
[0214] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.
[0215] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0216] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0217] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable storage media. Therefore, a machine-readable storage medium may include any mechanism for storing or disseminating information in a machine (e.g., computer) readable form, including but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROM), random access memories (RAM), erasable programmable read-only memories (EPROM), electrically erasable programmable read-only memories (EEPROM), magnetic cards or optical cards, flash memory, or a tangible machine-readable memory for disseminating information (e.g., carrier waves, infrared signal digital signals, etc.) based on the Internet in electrical, optical, acoustic, or other forms of propagation signals. Accordingly, machine-readable storage media include any type of machine-readable storage media suitable for storing or propagating electronic instructions or information in a form readable by a machine (eg, a computer).
[0218] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0219] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0220] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0221] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.
Claims
1. A network connection method, characterized in that: include: The electronic device detects that the wireless local area network is disconnected, the electronic device scans for candidate wireless local area networks, and the operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism; If the operating system fails to successfully connect to the wireless local area network according to the preset self-connection recovery mechanism, the electronic device determines a first target wireless local area network from the scanned candidate wireless local area networks; wherein the candidate wireless local area network is a wireless local area network for which the electronic device has saved connection credentials; The electronic device is connected to the first target wireless local area network.
2. The method according to claim 1, characterized in that If the electronic device detects that the wireless local area network is disconnected, the operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism, including: If the electronic device detects that the wireless LAN is abnormally disconnected, the operating system of the electronic device controls the electronic device to connect to the wireless LAN according to a preset self-recovery mechanism; wherein the abnormal disconnection of the wireless LAN includes disconnecting the wireless LAN without detecting a user disconnection instruction.
3. The method according to claim 1 or 2, characterized in that: The electronic device is provided with a third-party application, and if the electronic device detects that the wireless local area network is disconnected, the method includes: If the operating system detects that the wireless local area network is disconnected, sending wireless local area network disconnection information to the third-party application; If the operating system fails to successfully connect to the wireless local area network according to the preset self-connection recovery mechanism, the electronic device determines a first target wireless local area network from the scanned candidate wireless local area networks, including: The operating system receives the wireless local area network disconnection information sent by the third-party application, and if the operating system fails to successfully connect to the wireless local area network according to the preset self-connection recovery mechanism, and the electronic device scans a candidate wireless local area network, the operating system sends information with the candidate wireless local area network to the third-party application; In response to receiving the information having the candidate wireless local area networks, the third-party application determines a first target wireless local area network from the candidate wireless local area networks; The electronic device is connected to the first target wireless local area network, including: The third-party application controls the electronic device to connect to the first target wireless local area network.
4. The method according to any one of claims 1 to 3, characterized in that The determining of the first target wireless local area network from the scanned candidate wireless local area networks comprises: Based on the first method, according to the network parameters of the wireless local area network in the candidate wireless local area network, the wireless local area network quality index of each wireless local area network in the candidate wireless local area network is determined; wherein the network parameters include any combination of network signal strength parameters, network signal quality parameters, network frequency band parameters, network protocol parameters, network connection rate or network protocol security parameters; The first target wireless local area network is determined according to the wireless local area network quality indicators of each wireless local area network in the candidate wireless local area networks.
5. The method according to claim 4, characterized in that The candidate wireless local area network is a network capable of communicating with a wide area network.
6. The method according to claim 4, characterized in that The operating system of the electronic device controls the electronic device to connect to the wireless local area network according to a preset self-connection recovery mechanism, including: The operating system of the electronic device controls the electronic device to scan the wireless local area network to obtain a candidate wireless local area network; If the candidate wireless local area networks include a wireless local area network set to automatically connect, the operating system determines a second target wireless local area network based on a second method, and a network parameter in the second method is different from a network parameter in the first method; The operating system controls the electronic device to connect to the second target wireless local area network.
7. The method according to claim 6, characterized in that The operating system fails to successfully connect to the wireless local area network according to the preset self-connection recovery mechanism, including: The candidate wireless local area networks do not include a wireless local area network set to automatically connect; Alternatively, the electronic device fails to connect to the second target wireless local area network.
8. The method according to claim 6, characterized in that After controlling the electronic device to connect to the second target wireless local area network, the method further includes: When the electronic device is successfully connected to the second target wireless LAN, if a third target wireless LAN is determined from the candidate wireless LANs based on the first method, and the third target wireless LAN is different from the second target wireless LAN, the electronic device is controlled to connect to the third target wireless LAN.
9. The method according to any one of claims 1 to 8, characterized in that The candidate wireless local area network is a wireless local area network whose signal strength is greater than or equal to a preset signal strength threshold.
10. The method according to any one of claims 1 to 9, characterized in that The method further comprises: In response to detecting the user's instruction to disconnect the wireless local area network, the electronic device remains disconnected from the wireless local area network.
11. The method according to any one of claims 1 to 10, characterized in that The electronic device includes a laptop computer.
12. An electronic device, characterized in that: It comprises a processor and a memory; the memory is used to store code instructions; the processor is used to run the code instructions, so that the electronic device executes the method as described in any one of claims 1-11.
13. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 11.