Network connection method, electronic device and computer-readable storage medium

By achieving automatic detection and connecting wireless local area networks in the operating system of electronic devices, the problem that the Wi-Fi is unable to automatically re-connect after the Wi-Fi abnormal disconnection is solved, and the user's Internet experience is improved.

WO2025020556A1PCT designated stage expired Publication Date: 2025-01-30HONOR DEVICE CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/083121
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-21
Filing Date
2024-03-21
Publication Date
2025-01-30

AI Technical Summary

Technical Problem

When the Wi-Fi is abnormally disconnected, the electronic device cannot automatically reconnect to the wireless LAN, resulting in a poor user experience.

Method used

Provide a network connection method. If the electronic device detects disconnecting the wireless LAN, the operating system connects the wireless LAN according to the preset self -connection recovery mechanism; And connect.

Benefits of technology

Even if the self -continuous recovery mechanism of the operating system fails, electronic equipment can still automatically connect to the wireless LAN, which improves the user's Internet experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083121_30012025_PF_FP_ABST
    Figure CN2024083121_30012025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications. Disclosed are a network connection method, an electronic device and a computer-readable storage medium. The method comprises: if an electronic device detects that a wireless local area network is disconnected, according to a preset self-connection resume mechanism, an operating system of the electronic device controlling the electronic device to connect to the wireless local area network; if the operating system is not successfully connected to the wireless local area network according to the preset self-connection resume mechanism, the electronic device determining a first target wireless local area network from among scanned candidate wireless local area networks, wherein each candidate wireless local area network is a wireless local area network, a connection credential of which has been saved by the electronic device; and the electronic device connecting to the first target wireless local area network. In this way, when an operating system of an electronic device fails to resume a wireless local area network connection according to a preset wireless local area network resume mechanism, the electronic device can also automatically connect to a wireless local area network, thereby improving the Internet-surfing experience of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Network connection method, electronic device and computer-readable storage medium

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

[0002] The embodiments of the present application relate to the field of communication technologies, 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 and experiences an abnormal disconnection due to an issue with the Wi-Fi (Wireless Fidelity) driver, wireless access point (AP), or operating system, the electronic device's operating system will perform Wi-Fi recovery operations according to the preset Wi-Fi recovery mechanism. This means that if the electronic device is disconnected from the network, it will rescan the Wi-Fi network and reconnect to any previously connected Wi-Fi network that has been set to automatically connect.

[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.

[0005] Summary of the Invention

[0006] 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.

[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0008] 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 connects to the first target wireless local area network.

[0009] In the embodiments 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-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-recovery mechanism, the electronic device can still automatically connect to the wireless LAN, thereby improving the user's Internet experience.

[0010] 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.

[0011] In a possible implementation of the first aspect, an electronic device is provided with a third-party application. 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 containing candidate wireless local area networks to the third-party application; in response to receiving the information containing candidate wireless local area networks, the third-party application determines the first target wireless local area network from the candidate wireless local area networks; and 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.

[0012] It is understood that in related technologies, when an electronic device loses connection to the network, the electronic device's operating system will perform wireless LAN recovery operations according to a preset self-recovery mechanism. A third-party application will only execute the wireless LAN recovery mechanism in the third-party application and perform wireless LAN recovery operations after receiving information from the operating system containing a candidate wireless LAN, rather than executing the self-recovery mechanism in the third-party application as soon as the electronic device initially loses connection to the wireless LAN. This avoids conflicts between the self-recovery mechanism in the third-party application and the self-recovery mechanism in the operating system.

[0013] 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 a wireless local area network quality indicator 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 a network signal strength parameter, a network signal quality parameter, a network frequency band parameter, a network protocol parameter, a network connection rate, or a network protocol security parameter; and 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.

[0014] 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.

[0015] 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.

[0016] 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, including network signal strength parameters; the operating system controls the electronic device to connect to the second target wireless local area network.

[0017] 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.

[0018] In a possible implementation of the first aspect, after controlling the electronic device to connect to the second target wireless local area network, the method further includes: if 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.

[0019] In a possible implementation manner of the first aspect, the candidate wireless local area network is a wireless local area network having a signal strength greater than or equal to a preset signal strength threshold.

[0020] In a possible implementation of the first aspect, the method further includes:

[0021] 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.

[0022] In a second aspect, an electronic device is provided, comprising a processor and a memory; the memory is used to store code instructions; and 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.

[0023] 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.

[0024] 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.

[0025] Among them, the technical effects brought about by any design method in the second, third and fourth aspects 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

[0026] FIG1 is a schematic diagram showing a scenario in which a laptop computer rescans Wi-Fi;

[0027] FIG2 is a schematic diagram showing an exemplary table of scanned Wi-Fi networks;

[0028] FIG3 shows a schematic flow chart of a Wi-Fi connection method in the related art;

[0029] FIG4 is a schematic diagram showing a method of selecting a target Wi-Fi network from scanned Wi-Fi networks based on the content in FIG2 ;

[0030] FIG5 shows a schematic structural diagram of a laptop computer provided in an embodiment of the present application;

[0031] FIG6 shows a schematic flow chart of a Wi-Fi connection method;

[0032] FIG7 shows a schematic diagram of a network and Internet user interface of an operating system of a notebook computer 100;

[0033] FIG8 shows a schematic diagram of a process for optimal Wi-Fi confirmation;

[0034] FIG9 shows a schematic diagram of a Wi-Fi quality indicator;

[0035] FIG10 shows a schematic diagram of ranking Wi-Fi connection priorities for automatically connecting to Wi-Fi;

[0036] FIG11 shows a schematic diagram of a target Wi-Fi confirmation process;

[0037] FIG12 shows a schematic diagram of ranking Wi-Fi connection priorities of a known Wi-Fi network;

[0038] FIG13 shows a schematic diagram of ranking Wi-Fi connection priorities of automatically connectable Wi-Fi networks. DETAILED DESCRIPTION

[0039] 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 embodiments described are only part of the embodiments of the present application, not all of the embodiments. The following terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features.

[0040] In the embodiments of the present application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0041] In the embodiments of this application, "and / or" is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0042] In the description of this 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.

[0043] In order to better illustrate the technical solution of this application, the following is a brief overview of the terms involved in this application.

[0044] (1) Wireless network: A wireless network is a network that connects various communication devices without wiring. Common wireless networks include Wi-Fi, Bluetooth, ZigBee, and hotspots.

[0045] Based on the coverage area of ​​the network, wireless networks can be divided into wireless wide area networks (WWAN), wireless local area networks (WLAN) and wireless metropolitan area networks (WMAN).

[0046] (2) Local Area Network (LAN): LANs generally cover an area of ​​several thousand meters. They are easy to install, cost-effective, and easily expandable, making them widely used in various offices. LANs can implement functions such as file management, application software sharing, and printer sharing.

[0047] (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 area, ranging from tens 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.

[0048] As described in the background technology above, when an electronic device is disconnected from the Internet, it will rescan Wi-Fi and connect to the previously connected Wi-Fi network that has been set to automatically connect. However, if the scanned Wi-Fi network does not contain a Wi-Fi network with automatic connection set, the electronic device cannot reconnect to the Wi-Fi network. If the electronic device fails to reconnect to the Wi-Fi network, the electronic device will remain disconnected from the Wi-Fi network, resulting in a poor user experience.

[0049] For example, Figure 1 shows a schematic diagram of a scenario in which a laptop computer rescans Wi-Fi. As shown in Figure 1, the operating system of the laptop computer 100 performs a Wi-Fi connection recovery operation. First, the laptop computer 100 rescans Wi-Fi.

[0050] There may be multiple Wi-Fis scanned by the laptop computer 100. For example, FIG2 shows an exemplary table diagram of the scanned Wi-Fis. As shown in FIG2 , the scanned Wi-Fis may include Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-D, Wi-Fi-E, Wi-Fi-F and Wi-Fi-G, wherein the previously connected Wi-Fis 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-Fis may be referred to as known Wi-Fis. The previously connected Wi-Fis may be Wi-Fis for which the laptop computer 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 computer 100 can access the Internet through a network connection password, a network account, or a network connection digital certificate.

[0051] An automatically connectable Wi-Fi network is one that the laptop computer 100 sets as an automatically connectable Wi-Fi network in response to a user operation. As shown in FIG1 , the user operation may be an operation in which the user clicks the automatic connection button. As shown in FIG2 , none of the previously connected Wi-Fi networks scanned, including Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E, and Wi-Fi-F, are set to automatically connect. In other words, none of the Wi-Fi networks scanned by the laptop computer 100 have an automatic connection set.

[0052] The following describes a Wi-Fi connection method. FIG3 shows a flow chart of a Wi-Fi connection method of related technology. As shown in FIG3, the flow includes the following steps:

[0053] Step 301: The operating system of the laptop computer 100 detects that the Wi-Fi is disconnected, controls the laptop computer 100 to scan the Wi-Fi, and obtains the Wi-Fi scan result.

[0054] Step 302: The operating system of the notebook computer 100 determines known Wi-Fi networks and automatically connectable Wi-Fi networks from the Wi-Fi scan results.

[0055] Step 303: The operating system of the notebook computer 100 determines whether there is a Wi-Fi network that can be automatically connected.

[0056] If the operating system of the laptop computer 100 determines that a Wi-Fi network is available for automatic connection, the operating system of the laptop computer 100 determines a Wi-Fi quality indicator of the Wi-Fi network available for automatic connection based on the Wi-Fi parameters, and determines a target Wi-Fi network based on the Wi-Fi quality indicator of the Wi-Fi network available for automatic connection, thereby executing step 305. If the operating system of the laptop computer 100 determines that no Wi-Fi network is available for automatic connection, the operating system of the laptop computer 100 controls the laptop computer 100 to remain in a Wi-Fi disconnected state.

[0057] Step 304: The operating system of the laptop computer 100 controls the laptop computer 100 to maintain a Wi-Fi disconnected state.

[0058] When the Wi-Fi of the laptop computer 100 is disconnected, the operating system will scan the network at a high frequency and periodically so that the laptop computer 100 can quickly and automatically connect to the corresponding automatically connectable network when it enters the range of the automatically connectable network. Frequent scanning will increase the power consumption of the wireless LAN adapter in the laptop computer 100.

[0059] Step 305: The operating system of the laptop computer 100 determines a Wi-Fi quality indicator for automatically connecting to the Wi-Fi network according to the Wi-Fi parameters, and determines a target Wi-Fi network based on the Wi-Fi quality indicator for automatically connecting to the Wi-Fi network.

[0060] Wi-Fi parameters include network signal strength parameters.

[0061] Step 306: The operating system of the laptop computer 100 controls the laptop computer 100 to connect to the target Wi-Fi.

[0062] 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 set to automatically connect among the known Wi-Fi scanned is connected. However, the previously connected Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E and Wi-Fi-F scanned 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.

[0063] To solve the aforementioned technical problems, an embodiment of the present application proposes a network connection 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 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 connects to the first target wireless local area network.

[0064] In the embodiments 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-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-recovery mechanism, the electronic device can still automatically connect to the wireless LAN, thereby improving the user's Internet experience.

[0065] The wireless local area network here can include various wireless networks such as Wi-Fi, Bluetooth, ZigBee, hotspots, etc. In this application, the wireless local area network is mainly described as Wi-Fi as an example.

[0066] In the case where the Wi-Fi network is Wi-Fi, when the electronic device detects that the Wi-Fi network is disconnected, the operating system of the electronic device controls the electronic device to connect to the Wi-Fi network according to a preset self-connection recovery mechanism; if the operating system fails to successfully connect to the Wi-Fi network according to the preset self-connection recovery mechanism, the electronic device determines a first target Wi-Fi network from the scanned candidate Wi-Fi networks; wherein the candidate Wi-Fi network is a Wi-Fi network for which the electronic device has saved connection credentials; and the electronic device connects to the first target Wi-Fi network.

[0067] It can be understood that the preset self-connection recovery mechanism can also be called a preset Wi-Fi recovery mechanism.

[0068] For example, FIG4 is based on the content in FIG2 and shows a schematic diagram of selecting a target Wi-Fi from the scanned Wi-Fi. As shown in FIG4, 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, wherein 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 laptop 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 laptop computer 100 is controlled to connect to the target Wi-Fi.

[0069] The electronic devices provided in the embodiments of the present application are various devices with the function of connecting to a wireless local area network. The electronic devices provided in the embodiments of the present application can be laptops, mobile phones, smart TVs, wearable devices, tablet computers, computers with wireless transceiver functions, virtual reality (VR) electronic devices, augmented reality (AR) electronic devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc.

[0070] The technical solution of the present application is further described in detail below by taking a laptop as an example of an electronic device.

[0071] Please refer to Figure 5, which shows a schematic diagram of the structure of a laptop provided by an embodiment of the present application. As shown in Figure 5, the laptop 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 150, an antenna, a wireless communication module 160, an audio module 170, a speaker (i.e., a speaker) 170A, a microphone 170C, a headphone jack 170B, a touchpad 180, a keyboard 190, and a camera 191, etc.

[0072] Among them, 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 all 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.

[0073] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on laptop computers. In other embodiments, the laptop computer may include more or fewer components than illustrated, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0074] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. The processor 110 can execute the network connection method provided in the embodiment of the present application.

[0075] The controller is the nerve center and command center of the laptop. It can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.

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

[0077] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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.

[0078] It is understood that the interface connection relationship between the modules illustrated in this embodiment is merely an illustrative illustration and does not constitute a structural limitation on the laptop computer. In other embodiments, the laptop computer may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0079] The charging management module 140 is configured to receive charging input from a charger (e.g., a wireless charger or a wired charger) to charge the battery 142. The power management module 141 is configured 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.

[0080] 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.

[0081] Antennas are used to transmit and receive electromagnetic wave signals. Each antenna in a laptop can cover a single or multiple communication frequency bands. Different antennas can also be reused to increase antenna utilization.

[0082] In some embodiments, the laptop's antenna is coupled to the wireless communication module 160, allowing the laptop to communicate with a wireless local area network (WLAN) and other devices via wireless communication technology. The wireless communication module 160 can provide wireless communication solutions for the laptop, including wireless local area networks (WLAN), global navigation satellite systems (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), and other wireless communication technologies. The wireless local area network can be Wi-Fi, a hotspot generated by a cellular mobile network, or Bluetooth (BT).

[0083] A laptop computer can implement display functions through a GPU, display screen 150, and an application processor. The GPU is a microprocessor for image processing that 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 that execute program instructions to generate or modify display information. The display screen 150 is used to display images, videos, and the like.

[0084] The touch panel 180 is integrated with a touch sensor. The laptop computer can receive user control commands for the laptop computer through the touch panel 180 and the keyboard 190.

[0085] The laptop computer can implement a camera function through an ISP, camera 191, a video codec, a GPU, a display 150, and an application processor. The ISP is used to process data fed back by camera 191. In some embodiments, the ISP can be installed in camera 191. Camera 191 is used to capture still images or videos. In some embodiments, the laptop computer can include one or N cameras 191, where N is a positive integer greater than 1.

[0086] 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 code, which includes 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 instructions stored in the internal memory 121, and the internal memory 121 can include a program storage area and a data storage area.

[0087] The notebook computer can implement audio functions such as music playback and recording through the audio module 170 , the speaker 170A, the microphone 170C, the headphone jack 170B, and the application processor.

[0088] 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 provided in the processor 110, or some functional modules of the audio module 170 can be provided 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", 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 terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0089] The embodiments of the present application are applied to a wireless local area network, and the following description will be made using Wi-Fi as an example.

[0090] 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.

[0091] In the embodiment of the present application, even if the operating system of the laptop computer 100 fails to reconnect to the Wi-Fi network according to the preset Wi-Fi recovery mechanism, the third-party application will select a target Wi-Fi network from the known Wi-Fi networks scanned by the laptop computer 100 and control the laptop computer 100 to connect to the target Wi-Fi network. 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 network, thereby improving the user's Internet experience.

[0092] Figure 6 shows a schematic flow chart of a Wi-Fi connection method. As shown in Figure 6, the process includes the following steps:

[0093] Step 601 : The operating system of the notebook computer 100 detects that the Wi-Fi is disconnected, and sends a Wi-Fi disconnection message to a third-party application of the notebook computer 100 .

[0094] If the laptop computer 100 detects an abnormal Wi-Fi disconnection, the operating system of the laptop computer 100 may control the laptop computer 100 to connect to the wireless LAN according to a preset self-recovery mechanism. An abnormal Wi-Fi disconnection includes disconnecting the Wi-Fi without detecting a user disconnect instruction, i.e., an abnormal Wi-Fi disconnection is triggered by a non-user disconnect operation. A normal Wi-Fi disconnection includes disconnecting the Wi-Fi after detecting a user disconnect instruction, i.e., a normal Wi-Fi disconnection is triggered by a user disconnect operation.

[0095] 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.

[0096] For example, when the laptop computer 100 detects that the Wi-Fi connection is disconnected, it sends a Wi-Fi disconnect message and a Wi-Fi disconnect reason to the third-party application. The Wi-Fi disconnect message includes a wlan_notification_acm_disconnected event, and the wlan_notification_acm_disconnected event is used to indicate that the Wi-Fi connection is disconnected.

[0097] Third-party applications on laptop computer 100 can determine whether a Wi-Fi disconnection is normal or abnormal based on the disconnection cause. A normal disconnection is a Wi-Fi disconnection triggered by laptop computer 100 in response to a user disconnection operation. An abnormal Wi-Fi disconnection is a Wi-Fi disconnection triggered by a non-user disconnection operation. The abnormal disconnection cause can be caused by the Wi-Fi driver, wireless access point, operating system, or other factors. The wlan_notification_acm_disconnected event is used to indicate a Wi-Fi disconnection.

[0098] Step 602: The third-party application of the notebook computer 100 receives a Wi-Fi disconnect message.

[0099] Step 603: The operating system of the laptop computer 100 controls the laptop computer 100 to scan Wi-Fi and obtain Wi-Fi scanning results.

[0100] When the operating system of the notebook computer 100 detects that the Wi-Fi is disconnected, it can start a Wi-Fi reconnection mechanism. First, the notebook computer 100 can scan the Wi-Fi, try to obtain a Wi-Fi that can be reconnected, and obtain a Wi-Fi scan result.

[0101] Step 604: The operating system of the notebook computer 100 determines known Wi-Fi networks and automatically connectable Wi-Fi networks from the Wi-Fi scan results.

[0102] The laptop computer 100 may or may not scan any Wi-Fi network. If the laptop computer 100 does not scan any Wi-Fi network, the number of Wi-Fi networks scanned in the Wi-Fi scan result is 0. If the laptop computer 100 scans any Wi-Fi network, the number of Wi-Fi networks scanned in the Wi-Fi scan result is at least 1. If the number of Wi-Fi networks scanned in the Wi-Fi scan result is greater than or equal to 1, the laptop computer 100 can determine known Wi-Fi networks and Wi-Fi networks that can be automatically connected from the Wi-Fi scan result.

[0103] It is understandable that the number of known Wi-Fi networks in the Wi-Fi scan result may be 0 or greater than or equal to 1, and the number of automatically connectable Wi-Fi networks may be 0 or greater than or equal to 1.

[0104] It is known that Wi-Fi can also be called a candidate wireless local area network, for the notebook computer 100 to select a network to connect to.

[0105] The operating system of the laptop computer 100 stores the known Wi-Fi networks and automatically connectable Wi-Fi networks within a period of time before the current time. In this way, the operating system of the laptop computer 100 can match the Wi-Fi networks in the Wi-Fi scan results with the known Wi-Fi networks and automatically connectable Wi-Fi networks stored in the operating system of the laptop computer 100, and determine the known Wi-Fi networks and automatically connectable Wi-Fi networks from the Wi-Fi scan results.

[0106] 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 .

[0107] For example, Figure 7 shows a schematic diagram of a network and internet user interface of the operating system of laptop computer 100. As shown in Figure 7, the network and internet user interface of the operating system of laptop computer 100 displays a Manage Known Networks entry. In response to a user opening the Manage Known Networks entry with a cursor, laptop computer 100 can display known Wi-Fi networks from a period of time before the current time.

[0108] The Wi-Fi scan results 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 of available network entries with a cursor, the laptop computer 100 can display the Wi-Fi scan results.

[0109] Step 605: The operating system of the notebook computer 100 determines whether there is a Wi-Fi network that can be automatically connected.

[0110] If the number of automatically connected Wi-Fi is 0, the laptop 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 laptop computer 100 determines that there is an automatically connected Wi-Fi.

[0111] If the laptop computer 100 determines that a Wi-Fi network is available for automatic connection, the operating system of the laptop computer 100 determines a Wi-Fi quality indicator of the Wi-Fi network available for automatic connection based on the Wi-Fi parameters, and determines a target Wi-Fi network based on the Wi-Fi quality indicator of the Wi-Fi network available for automatic connection, thus executing step 611. If the laptop computer 100 determines that no Wi-Fi network is available for automatic connection, the operating system of the laptop computer 100 controls the laptop computer 100 to remain in a Wi-Fi disconnected state and sends information about known Wi-Fi networks in the Wi-Fi scan results to the third-party application, thus executing step 606.

[0112] Step 606: The operating system of the laptop computer 100 controls the laptop computer 100 to maintain the Wi-Fi disconnected state, and sends information about known Wi-Fi in the Wi-Fi scan result to the third-party application.

[0113] The operating system of the laptop computer 100 can send information about known Wi-Fi networks in the Wi-Fi scan results to a 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 results sent by the operating system, and upon receiving the information about known Wi-Fi networks in the Wi-Fi scan results sent by the operating system, execute the Wi-Fi recovery mechanism in the third-party application and perform a Wi-Fi connection recovery operation.

[0114] It is understood that in the related art, when the laptop 100 is disconnected from the network, the operating system of the laptop 100 will execute the Wi-Fi recovery mechanism according to the preset Wi-Fi recovery mechanism to perform the Wi-Fi recovery connection operation. 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 results sent by the operating system containing information about known Wi-Fi networks, rather than executing the Wi-Fi recovery mechanism in the third-party application as soon as the laptop 100 is initially disconnected from Wi-Fi. In this way, conflicts between the Wi-Fi recovery mechanism in the third-party application and the Wi-Fi recovery mechanism in the operating system can be avoided.

[0115] When the Wi-Fi of the laptop computer 100 is disconnected and the wireless service in the operating system determines that a known Wi-Fi network exists, the operating system may send information about the known Wi-Fi network in the Wi-Fi scan result to the third-party application. The information about the known Wi-Fi network in the Wi-Fi scan result includes a wlan_notification_acm_network_available event. The wlan_notification_acm_network_available event is used to indicate that a known Wi-Fi network exists in the Wi-Fi scan result.

[0116] 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.

[0117] For example, if the laptop computer 100 determines that there is no Wi-Fi that can be automatically connected, it can send information about known Wi-Fi in the Wi-Fi scan results to the third-party application, or if the target Wi-Fi connection fails, it can send information about known Wi-Fi in the Wi-Fi scan results to the third-party application.

[0118] It is understandable that in some embodiments, after the laptop computer 100 is turned on and a third-party application of the laptop 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.

[0119] It is understood 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 results to a third-party application on 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 results sent by the operating system and, upon receiving the information about known Wi-Fi networks in the Wi-Fi scan results sent by the operating system, execute the Wi-Fi recovery mechanism in the third-party application and perform a Wi-Fi connection recovery operation.

[0120] If the number of known Wi-Fi networks is zero, the operating system of the laptop computer 100 still sends information about known Wi-Fi networks in the Wi-Fi scan results to the third-party application on the laptop computer 100. Thus, even if the third-party application receives information about known Wi-Fi networks in the Wi-Fi scan results sent by the operating system and executes the Wi-Fi recovery mechanism within the third-party application, the reconnection to Wi-Fi network will fail because the number of known Wi-Fi networks is zero, and power consumption of the operating system of the laptop computer 100 in sending the information about known Wi-Fi networks in the Wi-Fi scan results to the third-party application on the laptop computer 100 will be wasted. Therefore, the operating system of the laptop computer 100 only sends information about known Wi-Fi networks in the Wi-Fi scan results to the third-party application on the laptop computer 100 when the number of known Wi-Fi networks is greater than zero. This reduces unnecessary power consumption of the laptop computer 100 for Wi-Fi connections.

[0121] Step 607: The third-party application of the notebook computer 100 receives information about known Wi-Fi in the Wi-Fi scan result sent by the operating system.

[0122] Step 608 : The third-party application of the laptop computer 100 determines a known Wi-Fi network from the Wi-Fi scan results.

[0123] The operating system of the laptop computer 100 stores known Wi-Fi networks for a period of time before the current time. When a third-party application of the laptop computer 100 receives information about known Wi-Fi networks in the Wi-Fi scan results sent by the operating system, the third-party application can obtain the known Wi-Fi networks stored in the operating system of the laptop computer 100 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 networks in the Wi-Fi scan results with the known Wi-Fi networks obtained from the operating system of the laptop computer 100 and determine the known Wi-Fi networks from the Wi-Fi scan results.

[0124] Step 609 : The third-party application of the laptop computer 100 determines the optimal Wi-Fi network from known Wi-Fi networks.

[0125] It is understood that the quality of Wi-Fi depends, to a certain extent, on various Wi-Fi quality indicators, which can be parameter values ​​of Wi-Fi parameters. To enhance the user experience, laptop computer 100 can select a high-quality Wi-Fi network to connect to based on the Wi-Fi parameters. Specifically, in some embodiments, laptop computer 100 can determine Wi-Fi quality indicators of known Wi-Fi networks based on the Wi-Fi parameters, rank connection priorities based on the Wi-Fi quality indicators, and determine the optimal Wi-Fi network based on the ranked connection priorities.

[0126] Specifically, Figure 8 shows a schematic diagram of a process for optimal Wi-Fi confirmation. As shown in Figure 8, the process includes the following steps:

[0127] Step 801: The third-party application of the laptop computer 100 determines a Wi-Fi quality indicator of each Wi-Fi network among the known Wi-Fi networks based on Wi-Fi parameters of the Wi-Fi networks among the known Wi-Fi networks.

[0128] 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.

[0129] 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 scheme.

[0130] For example, Figure 9 shows a schematic diagram of a Wi-Fi quality indicator. As shown in Figure 9, 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. 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.

[0131] The following describes an example 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.

[0132] Table 1 shows an exemplary table of signal quality parameter scores.

[0133] Table 1

[0134] As shown in Table 1, if the signal quality parameter is between 0 and 30, the Wi-Fi signal quality parameter score is 0; if the signal quality parameter is between 30 and 50, the Wi-Fi signal quality parameter score is 20; if the signal quality parameter is between 50 and 70, the Wi-Fi signal quality parameter score is 60; if the signal quality parameter is between 70 and 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] 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.

[0138] Table 3 shows an exemplary table of Wi-Fi protocol type parameter scores.

[0139] Table 3

[0140] 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; and if the Wi-Fi protocol type parameter is be, the Wi-Fi protocol type score is 15.

[0141] Table 4 shows an exemplary table of Wi-Fi connection rate parameter scores.

[0142] Table 4

[0143] As shown in Table 4, if the Wi-Fi connection rate parameter is between 0 and 287, the Wi-Fi connection rate parameter score is 0; if the Wi-Fi connection rate parameter is between 287 and 574, the Wi-Fi connection rate parameter score is 5; if the Wi-Fi connection rate parameter is between 574 and 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.

[0144] Table 5 shows an exemplary table of Wi-Fi protocol security scores.

[0145] Table 5

[0146] 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.

[0147] In some embodiments, the known Wi-Fi may be a Wi-Fi with a signal strength greater than or equal to a preset signal strength threshold, which may be -75 dBm.

[0148] 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 of the Wi-Fi connection through some public interfaces provided by the operating system.

[0149] 1) Use the WlanQueryInterface function, a public operating system interface, and set the OpCode parameter to wlan_intf_opcode_current_connection to obtain the Wi-Fi protocol type, Wi-Fi connection rate, Wi-Fi signal quality, and Wi-Fi security parameters of the current Wi-Fi connection.

[0150] 2) Use the WlanQueryInterface function, a public operating system interface, to set the OpCode parameter to wlan_intf_opcode_channel_number. This can be used to obtain the current Wi-Fi channel, which can then be mapped to the frequency band parameters.

[0151] 3) Use the WlanQueryInterface function, a public operating system interface, to set the OpCode parameter to wlan_intf_opcode_rssi to obtain the Wi-Fi signal strength parameters of the currently connected Wi-Fi.

[0152] Step 802: The third-party application of the laptop computer 100 ranks the connection priority of each Wi-Fi network among the known Wi-Fi networks according to the Wi-Fi quality indicator of each Wi-Fi network among the known Wi-Fi networks.

[0153] Specifically, in some embodiments, the laptop computer 100 may rank the Wi-Fi quality indicators of the known Wi-Fi networks in descending order, and then the laptop computer may assign connection priorities to the Wi-Fi networks in descending order according to the ranking of the Wi-Fi quality indicators.

[0154] Step 803: The third-party application of the notebook computer 100 determines the optimal Wi-Fi network based on the ranking of the connection priorities of the known Wi-Fi networks.

[0155] 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.

[0156] For example, as shown in FIG10 , the notebook computer 100 may determine Wi-Fi-F as the optimal Wi-Fi.

[0157] Networks can be categorized into wide area networks (WANs), local area networks (LANs), and metropolitan area networks (MANs), depending on their coverage. Broadening the internet access range of electronic devices can improve the user's internet experience. In other embodiments, electronic devices may prioritize connecting to scanned Wi-Fi networks that have the ability to communicate with the WAN and have a higher connection priority. The connection priority is determined according to the aforementioned scheme.

[0158] Specifically, Figure 11 shows a schematic diagram of a process for optimal Wi-Fi confirmation. As shown in Figure 11, the process includes the following steps:

[0159] 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.

[0160] If the known Wi-Fi networks include at least one Wi-Fi network capable of communicating with a wide area network, a Wi-Fi quality indicator of the Wi-Fi network capable of communicating with a wide area network among the known Wi-Fi networks is determined based on the Wi-Fi parameters of the Wi-Fi network capable of communicating with a wide area network among the known Wi-Fi networks, that is, step 1102 is executed. If the known Wi-Fi networks do not include any Wi-Fi network capable of communicating with a wide area network, a Wi-Fi quality indicator of the Wi-Fi network without the ability to communicate with a wide area network among the known Wi-Fi networks is determined based on the Wi-Fi parameters of the Wi-Fi network without the ability to communicate with a wide area network among the known Wi-Fi networks, that is, step 1105 is executed.

[0161] In some embodiments, the laptop computer 100 can determine whether the currently connected Wi-Fi network is capable of communicating with a wide area network (WAN) by probing a public server or other means. For example, the laptop computer 100 can send an Internet Control Message Protocol (ICMP) request to a search engine's domain name system server, and upon receiving the ICMP response, determine whether the Wi-Fi network is capable of communicating with a WAN. The laptop computer 100 can also send an HTTP request to a cloud server used for connectivity testing, and upon receiving the HTTP response, determine whether the network is accessible based on the HTTP response code. If so, the Wi-Fi network is determined to be capable of communicating with a WAN.

[0162] In some embodiments, the known Wi-Fi may be a Wi-Fi with a signal strength greater than or equal to a preset signal strength threshold, which may be -75 dBm.

[0163] Step 1102 : The third-party application of the laptop computer 100 determines a Wi-Fi quality indicator of the known Wi-Fi network capable of communicating with the wide area network based on the Wi-Fi parameters of the known Wi-Fi network capable of communicating with the wide area network.

[0164] The Wi-Fi quality indicator of the Wi-Fi capable of communicating with the wide area network is determined in the same manner as the aforementioned Wi-Fi quality indicator, and is not described again herein.

[0165] Step 1103 : The third-party application of the laptop computer 100 ranks the connection priorities of the known Wi-Fi networks capable of communicating with the WAN according to the Wi-Fi quality indicators of the known Wi-Fi networks capable of communicating with the WAN.

[0166] 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.

[0167] Step 1104 : The third-party application of the notebook computer 100 determines the optimal Wi-Fi network based on the ranking of the connection priorities of all Wi-Fi networks capable of communicating with the wide area network among the known Wi-Fi networks.

[0168] The method for determining the optimal Wi-Fi among the Wi-Fi capable of communicating with the wide area network is the same as the method for determining the optimal Wi-Fi described above, and will not be repeated here.

[0169] Step 1105 : The third-party application of the laptop computer 100 determines a Wi-Fi quality indicator of the known Wi-Fi network that does not have the ability to communicate with the wide area network based on the Wi-Fi parameters of the known Wi-Fi network that does not have the ability to communicate with the wide area network.

[0170] The Wi-Fi quality indicator of the Wi-Fi that does not have the ability to communicate with the wide area network is determined in the same manner as the aforementioned Wi-Fi quality indicator, and is not described again here.

[0171] Step 1106 : The third-party application of the laptop 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.

[0172] The connection priority ranking scheme 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.

[0173] Step 1107 : The third-party application of the notebook computer 100 determines the optimal Wi-Fi network based on the ranking of the connection priorities of all Wi-Fi networks that do not have the capability of communicating with the wide area network among the known Wi-Fi networks.

[0174] The Wi-Fi quality indicator of the Wi-Fi that does not have the ability to communicate with the wide area network is determined in the same manner as the aforementioned Wi-Fi quality indicator, and is not described again here.

[0175] It is understood that the laptop 100 can also determine the Wi-Fi quality index of a known Wi-Fi network based on the Wi-Fi parameters, rank the connection priorities based on the Wi-Fi quality index, and determine the optimal Wi-Fi network based on the ranked connection priorities. The specific solution is the same as the target network judgment criteria described above and will not be further described.

[0176] In the embodiment of the present application, the optimal Wi-Fi may be the Wi-Fi with the highest connection priority.

[0177] In this step, various solutions for the third-party application of the notebook computer 100 to determine the optimal Wi-Fi from known Wi-Fi can be collectively referred to as a first approach.

[0178] In the embodiment of the present application, in this step, the optimal Wi-Fi is the Wi-Fi ranked first in connection priority determined according to the first method. The optimal Wi-Fi and other target wireless local area networks may also be referred to as first target local area networks.

[0179] Step 610: The third-party application of the laptop computer 100 controls the laptop computer 100 to connect to the optimal Wi-Fi.

[0180] For example, Figure 12 shows a schematic diagram of the ranking of Wi-Fi connection priorities for a known Wi-Fi. As shown in Figure 12, 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's connection priority is ranked fifth, Wi-Fi-B's connection priority is ranked second, Wi-Fi-C's connection priority is ranked third, Wi-Fi-E's connection priority is ranked fourth, and Wi-Fi-F's connection priority is ranked 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.

[0181] In some embodiments, if the laptop computer 100 fails to connect to the optimal Wi-Fi, it may also connect to the suboptimal Wi-Fi. For example, the suboptimal Wi-Fi may be the Wi-Fi with the second highest connection priority.

[0182] Step 611: The operating system of the laptop computer 100 determines a Wi-Fi quality indicator of the Wi-Fi that can be automatically connected to based on 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.

[0183] In this step, the operating system of laptop computer 100 determines a Wi-Fi quality indicator for automatically connecting to a Wi-Fi network based on the Wi-Fi parameters. The method for determining the target Wi-Fi network based on the Wi-Fi quality indicator for automatically connecting to a Wi-Fi network is collectively referred to as the second method. The method for determining the target Wi-Fi network in the second method is the same as that in the first method, but the network parameters in the second method are different from those 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.

[0184] In the embodiment of the present application, in this step, the target Wi-Fi is the Wi-Fi ranked first in the connection priority determined according to the second method. The target Wi-Fi and other target wireless local area networks may also be referred to as second target local area networks.

[0185] For example, Figure 10 shows a schematic diagram of the ranking of Wi-Fi connection priorities for Wi-Fi that can automatically connect. As shown in Figure 10, 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 automatically connect includes Wi-Fi-B, Wi-Fi-C, and Wi-Fi-F. The total Wi-Fi quality scores obtained by the second method for Wi-Fi-B, Wi-Fi-C, and Wi-Fi-F are 110, 105, and 150, respectively. The Wi-Fi connection priority ranking is: Wi-Fi-B's connection priority ranks second, Wi-Fi-C's connection priority ranks third, and Wi-Fi-F's connection priority ranks first.

[0186] Step 612: The operating system of the laptop computer 100 controls the laptop computer 100 to connect to the target Wi-Fi.

[0187] For example, the operating system of the notebook computer 100 controls the notebook computer 100 to connect to Wi-Fi-F.

[0188] In the related art, the operating system of the laptop computer 100 stores known Wi-Fi networks that can automatically connect to Wi-Fi. If these known Wi-Fi networks that can automatically connect to Wi-Fi are not successfully connected to, and there are other known Wi-Fi networks that can be connected to, the Wi-Fi connection is disconnected. The operating system will scan regularly at a high frequency so that it can quickly and automatically connect to these known Wi-Fi networks when it enters the range of these known Wi-Fi networks that can automatically connect to Wi-Fi. However, frequent scanning increases the power consumption of the wireless Wi-Fi adapter in the laptop computer 100. In the implementation of the present application, if the laptop computer 100 can connect to these known Wi-Fi networks, the operating system will no longer trigger these scans, thereby reducing the power consumption of the laptop computer 100.

[0189] Step 613: The operating system of the notebook computer 100 determines whether the target Wi-Fi connection is successful.

[0190] The laptop computer 100 determines whether the target Wi-Fi network is successfully connected. If so, to enhance the user experience and ensure that the user enjoys high-quality Wi-Fi, the laptop computer 100 may also determine whether the target Wi-Fi network is the best among the known Wi-Fi networks. First, the laptop computer 100's operating system sends a successful Wi-Fi connection message to the third-party application, allowing the third-party application to determine the best Wi-Fi network from the known Wi-Fi networks, thus executing step 614. If the target Wi-Fi network fails to connect, the laptop computer 100 is controlled to remain in a Wi-Fi disconnected state, and information about the known Wi-Fi networks in the Wi-Fi scan results is sent to the third-party application, thus executing step 606.

[0191] In some embodiments, if the laptop computer 100 fails to connect to the target Wi-Fi network, it can also connect to a suboptimal Wi-Fi network, for example, the suboptimal Wi-Fi network may be the Wi-Fi network ranked second in connection priority. If the laptop computer 100 fails to connect to the suboptimal Wi-Fi network, the laptop computer 100 is controlled to remain in a Wi-Fi disconnected state, and information about known Wi-Fi networks in the Wi-Fi scan results is sent to a third-party application. If the laptop computer 100 successfully connects to the suboptimal Wi-Fi network, the operating system of the laptop computer 100 sends a Wi-Fi connection success message to the third-party application, so that the third-party application can determine the optimal Wi-Fi network from the known Wi-Fi networks.

[0192] Step 614: The operating system of the notebook computer 100 sends a message indicating a successful Wi-Fi connection to the third-party application.

[0193] 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 a known Wi-Fi from the Wi-Fi scanning result.

[0194] In this step, the technical solution for determining the known Wi-Fi from the Wi-Fi scan result is the same as the technical solution in step 608 and will not be repeated here.

[0195] 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.

[0196] For another example, when the laptop computer 100 detects that the Wi-Fi connection is successful, it will send a Wi-Fi connection success message to the third-party application. The Wi-Fi connection success message 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.

[0197] Step 616 : The third-party application of the laptop computer 100 determines the optimal Wi-Fi from known Wi-Fis.

[0198] The technical solution of this step is the same as that in step 609 and will not be repeated here.

[0199] In this step, various solutions for the third-party application of the notebook computer 100 to determine the optimal Wi-Fi from known Wi-Fi can be collectively referred to as a first approach.

[0200] In the embodiment of the present application, in this step, the optimal Wi-Fi is the Wi-Fi ranked first in connection priority determined according to the first method. The optimal Wi-Fi and other target wireless local area networks may also be referred to as third target local area networks.

[0201] 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-Fis.

[0202] The laptop computer 100 determines whether the target Wi-Fi network is the best Wi-Fi network among the known Wi-Fi networks. If the target Wi-Fi network is the best Wi-Fi network among the known Wi-Fi networks, the connection ends. If the target Wi-Fi network is not the best Wi-Fi network among the known Wi-Fi networks, the laptop computer 100 is further controlled to connect to the best Wi-Fi network among the known Wi-Fi networks, that is, step 618 is executed.

[0203] For example, Figure 12 shows a schematic diagram of the Wi-Fi connection priority rankings for known Wi-Fi networks. As shown in Figure 12, known Wi-Fi networks include 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 Wi-Fi connection priority rankings are: Wi-Fi-A's connection priority ranking is fifth, Wi-Fi-B's connection priority ranking is second, Wi-Fi-C's connection priority ranking is third, Wi-Fi-E's connection priority ranking is fourth, and Wi-Fi-F's connection priority ranking is first. Wi-Fi-F is the optimal Wi-Fi network among the known Wi-Fi networks. If laptop computer 100 determines that Wi-Fi-F is the optimal Wi-Fi network among the known Wi-Fi networks: Wi-Fi-F, the connection process ends.

[0204] For example, Figure 13 shows a schematic diagram of the Wi-Fi connection priority ranking for automatically connectable Wi-Fi networks. As shown in Figure 13, Wi-Fi networks include Wi-Fi-A, Wi-Fi-B, Wi-Fi-C, Wi-Fi-E, and Wi-Fi-F. The automatically connectable Wi-Fi networks are Wi-Fi-B and Wi-Fi-C. The Wi-Fi quality indicators obtained by the quality indicator determination scheme in the operating system for Wi-Fi-B and Wi-Fi-C are 110 and 105, respectively. Therefore, the Wi-Fi connection priority ranking is: Wi-Fi-B is ranked first, and Wi-Fi-C is ranked second. Wi-Fi-B is the target Wi-Fi network.

[0205] If the laptop computer 100 determines that Wi-Fi-B is not the optimal Wi-Fi among the known Wi-Fi networks: Wi-Fi-F, the laptop computer 100 is further controlled to connect to the optimal Wi-Fi among the known Wi-Fi networks: Wi-Fi-F, that is, step 618 is executed.

[0206] In some embodiments, if the laptop computer 100 fails to connect to the optimal Wi-Fi, it may also connect to the suboptimal Wi-Fi. For example, the suboptimal Wi-Fi may be the Wi-Fi with the second highest connection priority.

[0207] Step 618: The third-party application of the laptop computer 100 controls the laptop computer 100 to connect to the optimal Wi-Fi.

[0208] An embodiment of the present application further 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 the various functions or steps executed by the laptop computer 100 in the above-mentioned method embodiment.

[0209] The present application also provides a computer program product that, when executed on a computer, enables the computer to execute the functions or steps performed by the laptop computer 100 in the above method embodiment. The computer may be the above mobile terminal (such as the laptop computer 100).

[0210] The various embodiments of the mechanisms disclosed in this 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.

[0211] Program code can be applied to input instructions to perform the functions described herein 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.

[0212] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0213] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can 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 can be read and executed by one or more processors. For example, instructions can 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 transmitting information in a machine (e.g., computer) readable form, including but not limited to floppy disks, optical disks, optical discs, 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 or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, 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 transmitting electronic instructions or information in a form readable by a machine (eg, a computer).

[0214] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, 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 a structural or method feature in a particular figure does not imply that such feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.

[0215] 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 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 raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.

[0216] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only 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 that includes 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, an element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0217] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by 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 application.

Claims

1. A network connection method, characterized in that: include: 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-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. An electronic device, characterized in that: The electronic device 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-10.

12. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Mobile device and method for automatic connectivity, data offloading and roaming between networks

    CN102857997A

  • Terminal and wireless access method and device thereof

    CN106714244A

  • Network connection control method, mobile terminal and computer readable storage medium

    CN108770075A

  • Method for reconstructing data connection, terminal equipment and storage medium

    CN112954823A

  • Network connection method and device and storage medium

    CN114286454A