Network connection method and terminal equipment
By scanning and reconnecting on the original channel after the Wi-Fi subsystem is reset and using static IP, the problem of Wi-Fi reconnection time is solved, improving user experience and network stability.
Patent Information
- Application Number
- CN202410170487.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-02-05
AI Technical Summary
The reconnection process during Wi-Fi network connection takes a long time and affects the user experience. Especially in the disconnection scenario caused by Wi-Fi subsystem reset, the existing technology cannot effectively shorten the reconnection time.
In the disconnection scenario caused by Wi-Fi subsystem reset, the terminal device instructs the Wi-Fi chip to scan on the original channel and re-establish connection with the original AP, eliminating the full channel scanning and IP allocation process, and using pre-stored static IP for Reconnect and intercept the user interface and cellular network switching modules to reduce user perception.
It shortens the Wi-Fi reconnection time, improves the user experience, reduces the adverse impact of Wi-Fi disconnection on network usage, and allows users to continue to use Wi-Fi network normally in a short period of time.
Smart Images

Figure CN119255408A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a network connection method and terminal equipment. Background Art
[0002] When mobile phones and other terminal devices connect to a wireless fidelity (Wi-Fi) network, they usually need to go through the scanning, authentication, and association stages. This Wi-Fi association process usually takes a few seconds.
[0003] In actual applications, the stability of Wi-Fi networks is usually affected by many factors, and network disconnection is prone to occur. In some cases, when the Wi-Fi network is disconnected, the terminal device will reconnect to the Wi-Fi through the Wi-Fi connection process. However, this process is time-consuming and will seriously affect the user's network experience, resulting in a poor user experience. Summary of the invention
[0004] The embodiment of the present application provides a network connection method, which solves the problem of long Wi-Fi recovery time by reconnecting to the original AP according to the original information when the Wi-Fi is disconnected due to the reset of the Wi-Fi subsystem.
[0005] The network connection method provided in the embodiment of the present application, in the scenario where Wi-Fi is disconnected due to a Wi-Fi subsystem reset (or a Wi-Fi chip problem), the terminal device will instruct the Wi-Fi chip to scan on the original channel and try to re-establish a connection with the original AP (or Wi-Fi AP) without performing a full channel scan; and / or, the terminal device will instruct the Wi-Fi chip to use the IP assigned to the terminal device by the original AP, and re-establish a connection with the original Wi-Fi access point (AP), eliminating the step of the original AP assigning an IP to the terminal device during the reconnection process. In addition, in the scenario where the Wi-Fi subsystem is reset, the terminal device can also intercept the Wi-Fi disconnection event (or Wi-Fi disconnection reason value) to the user experience (UX) interface, and / or intercept the Wi-Fi disconnection event (or Wi-Fi disconnection reason value) to the circuit switching (CS) module used to control the switching between the Wi-Fi network and the cellular network, so that the user is unaware of the current disconnection of the Wi-Fi, or the terminal device does not immediately switch to the cellular network when the Wi-Fi is disconnected, so as to ensure that the user has a good user experience of the Wi-Fi network.
[0006] Specifically, in a first aspect, a network connection method is provided, which is applied to a terminal device, and includes:
[0007] When the Wi-Fi connection with the first AP is disconnected due to a reset of the Wireless Fidelity Wi-Fi subsystem, acquiring cause indication information corresponding to the Wi-Fi disconnection, where the cause indication information is used to indicate that the cause of the Wi-Fi disconnection is the reset of the Wi-Fi subsystem;
[0008] In response to the cause indication information, reconnecting to the first AP according to pre-stored first information, where the first information includes connection information and capability information corresponding to the first AP.
[0009] In a possible implementation, the first AP may correspond to the original AP in this article, specifically, an AP with which the Wi-Fi subsystem of the terminal device performs a Wi-Fi connection with the terminal device when the Wi-Fi subsystem of the terminal device does not crash. The first AP may be a router.
[0010] In a possible implementation, resetting the Wi-Fi subsystem may also be described as restarting the Wi-Fi chip, which may specifically refer to reloading the Wi-Fi chip after it crashes.
[0011] In combination with the first aspect, in some implementations of the first aspect, the connection information includes a first channel, where the first channel is a channel on which the terminal device is connected to the first AP before the Wi-Fi subsystem is reset;
[0012] The reconnecting to the first AP according to the pre-stored first information specifically includes:
[0013] Sending a detection request message on the first channel according to the connection information, where the detection request message is used to query whether there is an AP on the first channel;
[0014] receiving a detection response message sent by the first AP through the first channel, where the detection response message is used to indicate that the first AP exists on the first channel;
[0015] According to the probe response message, associating with the first AP on the first channel.
[0016] In a possible implementation, the first channel may correspond to the original channel in this document, specifically referring to the channel on which the Wi-Fi subsystem of the terminal device is connected to the original AP through Wi-Fi when the Wi-Fi subsystem does not crash.
[0017] In a possible implementation, the process of the terminal device sending a probe request message on the first channel and receiving a probe response message through the first channel may be a scanning phase in the Wi-Fi reconnection process. In the scanning phase, the terminal device only scans on the first channel and no longer performs full channel scanning.
[0018] According to the network connection method provided by the present implementation, in the scenario where Wi-Fi disconnection is caused by resetting the Wi-Fi subsystem, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, thereby shortening the Wi-Fi reconnection time and reducing the adverse effects of Wi-Fi disconnection on the user's Internet access.
[0019] In combination with the first aspect, in some implementations of the first aspect, the connection information further includes a static IP, where the static IP is an IP used by the terminal device to access the network before the Wi-Fi subsystem is reset; and the method further includes:
[0020] Use the static IP to access the network, wherein the static IP is the IP in the first information pre-stored by the terminal device, and after the Wi-Fi subsystem is reset, the terminal device omits the process of initiating the acquisition of the static IP from the first AP.
[0021] In a possible implementation, the static IP, also known as the original IP, refers to the IP address used by the application of the terminal device for network services before the Wi-Fi connection is disconnected.
[0022] According to the network connection method provided by the present implementation, in the scenario of Wi-Fi disconnection caused by resetting the Wi-Fi subsystem, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, and omits the process of obtaining an IP, and uses the original IP to enter the network, which can shorten the time for the user to use Wi-Fi normally again and reduce the adverse impact of Wi-Fi disconnection on the user's Internet access.
[0023] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0024] The operation of sending the detection response message on other channels is omitted, and the other channels are channels other than the first channel.
[0025] In combination with the first aspect, in some implementations of the first aspect, the terminal device includes a user experience UX module, and the method further includes:
[0026] When the Wi-Fi connection with the first AP is disconnected due to the reset of the Wireless Fidelity Wi-Fi subsystem, the UX module continues to display the Wi-Fi signal indicator in the interface.
[0027] In combination with the first aspect, in some implementations of the first aspect, when the Wi-Fi connection with the first AP is disconnected due to a reset of the Wireless Fidelity Wi-Fi subsystem, continuing to display the Wi-Fi signal indicator in the interface specifically includes:
[0028] When the Wi-Fi connection with the first AP is disconnected due to a reset of the Wireless Fidelity Wi-Fi subsystem, obtaining a disconnection reason value of the Wi-Fi disconnection, where the disconnection reason value is used to indicate that a reason for the Wi-Fi disconnection is the reset of the Wi-Fi subsystem;
[0029] The disconnection reason value is intercepted so that the UX module continues to display the Wi-Fi signal indicator in the interface.
[0030] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0031] Send an IP query broadcast message, where the IP query broadcast message is used to query whether there is an IP currently used by other devices that is the static IP;
[0032] When no IP query response message sent by other devices is received, the static IP is used to access the network, and the IP query response message is used to indicate that the currently used IP is the static IP.
[0033] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0034] When receiving the IP query response message sent by the first device, an IP allocation request process is initiated, wherein the IP allocation request process is used to request the first AP to allocate a new IP to the terminal device, wherein the new IP is different from the static IP, and the first device belongs to the other device.
[0035] In combination with the first aspect, in some implementations of the first aspect, the terminal device includes a Wi-Fi chip, a Wi-Fi driver, a Wi-Fi service module, and a UX module;
[0036] When the Wi-Fi connection with the first AP is disconnected due to the reset of the wireless fidelity Wi-Fi subsystem, reconnecting to the first AP according to the pre-stored first information specifically includes:
[0037] When the Wi-Fi chip crashes, sending a Wi-Fi subsystem crash notification message to the Wi-Fi driver;
[0038] The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module, where the Wi-Fi connection disconnection indication message is used to indicate a Wi-Fi disconnection with the first AP, and the Wi-Fi connection disconnection indication message carries a reason value corresponding to the Wi-Fi disconnection;
[0039] In response to the Wi-Fi connection disconnection indication message, the Wi-Fi service module sends an original channel scan indication message to the Wi-Fi driver, where the original channel scan indication message is used to instruct the Wi-Fi chip to scan on a first channel and omit an operation of sending the detection response message on other channels, where the other channels are channels other than the first channel;
[0040] The Wi-Fi driver sends the original channel scan indication message to the Wi-Fi chip;
[0041] In response to the original channel scanning indication message, the Wi-Fi chip sends a probe request message on the first channel, and receives a probe response message sent by the first AP through the first channel, the probe request message being used to query whether an AP exists on the first channel, and the probe response message being used to indicate that the first AP exists on the first channel.
[0042] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0043] The Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver, where the scan result feedback message is used to indicate that the first AP is scanned on the first channel;
[0044] The Wi-Fi driver sends the scan result feedback message to the Wi-Fi service module.
[0045] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0046] The Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi driver, where the Wi-Fi connection request message is used to instruct reconnection to the first AP;
[0047] The Wi-Fi driver sends the Wi-Fi connection request message to the Wi-Fi chip;
[0048] In response to the Wi-Fi connection request message, the Wi-Fi chip reconnects to the first AP.
[0049] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0050] When the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP to access the network, where the static IP is the IP used by the terminal device to access the network before the Wi-Fi subsystem is reset.
[0051] In combination with the first aspect, in some implementations of the first aspect, when the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP to access a network, specifically including:
[0052] When the Wi-Fi chip successfully reconnects to the first AP for Wi-Fi, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver, where the Wi-Fi connection success message is used to indicate that the terminal device is successfully reconnected to the first AP;
[0053] The Wi-Fi driver sends the Wi-Fi connection success message to the Wi-Fi service module;
[0054] In response to the Wi-Fi connection success message, the Wi-Fi service module sends an original IP indication message to the Wi-Fi driver, where the original IP indication message is used to indicate the use of the static IP to access the network, and omits the process of the terminal device initiating the acquisition of the static IP from the first AP after the Wi-Fi subsystem is reset;
[0055] The Wi-Fi driver sends the original IP indication message to the Wi-Fi chip;
[0056] In response to the original IP indication message, the Wi-Fi chip uses the static IP to access the network.
[0057] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0058] The Wi-Fi service module intercepts the disconnection reason value so that the UX module continues to display the Wi-Fi signal indicator in the interface.
[0059] In a second aspect, a terminal device is provided, including:
[0060] processor;
[0061] Memory;
[0062] The memory stores a computer program, which includes instructions. When the instructions are executed by the processor, the terminal device executes the method described in any one of the implementations of the first aspect or the second aspect.
[0063] In a third aspect, a chip system is provided, comprising: a processing circuit, a receiving pin and a transmitting pin; wherein the receiving pin, the transmitting pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method described in any one of the implementation methods of the first aspect or the second aspect above to control the receiving pin to receive a signal and control the transmitting pin to send a signal.
[0064] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable program instructions, and when the computer-executable program instructions are executed on a computer, the computer executes a method as described in any one of the implementations of the first aspect or the second aspect.
[0065] In a fifth aspect, a computer program product is provided, the computer program product comprising a computer program code, and when the computer program code is run on a computer, the computer is caused to execute the method as described in any one of the implementations of the first aspect or the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 A schematic flowchart of a Wi-Fi reconnection provided in an embodiment of the present application.
[0067] Figure 2A A schematic flowchart of Wi-Fi reconnection in a Wi-Fi subsystem reset scenario is provided in an embodiment of the present application.
[0068] Figure 2B A schematic flowchart of a terminal device obtaining an IP address through DHCP is provided in an embodiment of the present application.
[0069] Figure 3 A schematic diagram of a system architecture applicable to a network connection method provided in an embodiment of the present application.
[0070] Figure 4 A schematic structural diagram of a terminal device 100 provided in an embodiment of the present application.
[0071] Figure 5 A software structure block diagram of a terminal device 100 provided in an embodiment of the present application.
[0072] Figure 6 A schematic flowchart of a network connection method provided in an embodiment of the present application.
[0073] Figure 7 A schematic flowchart of another network connection method provided in an embodiment of the present application.
[0074] Figure 8 A schematic flowchart of another network connection method provided in an embodiment of the present application.
[0075] Fig. 9 A schematic flowchart of another network connection method provided in an embodiment of the present application.
[0076] Fig.10 A schematic flowchart of another network connection method provided in an embodiment of the present application.
[0077] Fig.11 A schematic flowchart of another network connection method provided in an embodiment of the present application.
[0078] Fig.12 A schematic flowchart of another network connection method provided in an embodiment of the present application.
[0079] Fig.13 A schematic flowchart of another network connection method provided in an embodiment of the present application.
[0080] Fig.14 A schematic flowchart of another network connection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0081] It should be noted that the terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated obstacles, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two, "at least one" and "one or more" mean one, two or more than two.
[0082] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, it is defined that the "first" and "second" features may explicitly or implicitly include one or more of the features.
[0083] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing at different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0084] Combined with the introduction in the background technology, when current mobile phones, tablet computers and other terminal products are performing communication protocol-related scenarios, due to defects in software, hardware, etc., Wi-Fi disconnection occurs in scenarios such as calls, videos, and application experiences. The main reason for this situation is the reset of the Wi-Fi protocol subsystem. Specifically, the terminal device may include a main chip and a Wi-Fi chip. The main chip may be, for example, a system-on-chip (SOC) for processing the entire machine business; the Wi-Fi chip may be set independently of the main chip to process Wi-Fi-related services. The Wi-Fi protocol subsystem reset (or Wi-Fi subsystem reset) mentioned in the embodiments of the present application refers to reloading (or restarting) the Wi-Fi chip after it crashes.
[0085] Since the Wi-Fi chip and the main chip are two independent chips, when the Wi-Fi chip crashes, it will not affect the normal operation of the main chip, that is, the entire service of the terminal device will not be affected by the reset of the Wi-Fi subsystem, but only the Wi-Fi service will be interrupted. After the Wi-Fi chip is reset and restarted, the AP information originally stored in the Wi-Fi chip will be cleared. Therefore, if the terminal device needs to reconnect to the AP, it must re-execute the full channel scan, network selection and connection steps, resulting in a long Wi-Fi reconnection process (the Wi-Fi subsystem recovery time is about 2.5-6s at this time), which can easily make users feel a clear sense of Wi-Fi interruption and a poor network experience.
[0086] In view of this, an embodiment of the present application provides a network connection method. In a scenario where Wi-Fi is disconnected due to a reset of the Wi-Fi subsystem, when the terminal device reconnects to Wi-Fi, the Wi-Fi chip is instructing to scan on the original channel and connect to the original AP without performing a full channel scan, and / or reconnecting to the original AP with the original Internet Protocol (IP) address without obtaining an IP dynamically assigned by a server through DHCP, thereby shortening the time it takes for the terminal device to reconnect to the original AP and restoring the Wi-Fi network as soon as possible. In addition, when the terminal device obtains that the reason for the Wi-Fi disconnection is the reset of the Wi-Fi subsystem, it can intercept the Wi-Fi disconnection event (such as the reason value of the Wi-Fi disconnection) to the UX of the terminal device, and / or intercept the Wi-Fi disconnection event (such as the reason value of the Wi-Fi disconnection) to the CS module of the terminal device, so that the user does not perceive the Wi-Fi disconnection, and the terminal device is no longer connected to other types of networks such as cellular networks during the Wi-Fi reconnection period, ensuring that the user can continue to use the Wi-Fi network normally after a short time, thereby improving the user's Wi-Fi usage experience.
[0087] like Figure 1 As shown in the figure, when Wi-Fi is disconnected, if the normal (or complete) Wi-Fi connection process is used to reconnect to Wi-Fi, it usually takes about 2.5-6 seconds. From the user's perspective, the Wi-Fi signal indicator (such as Figure 1 The 01 in the figure will reappear about 2.5-6 seconds after it disappears. Since the time between the disappearance and reappearance of the Wi-Fi signal indicator is long, users can clearly perceive that the Wi-Fi network is disconnected. If the business that the user is conducting at this time has high requirements for the Wi-Fi network (such as in business scenarios such as conferences and videos), then a long Wi-Fi disconnection will affect the normal operation of the business.
[0088] For example, Figure 2A As shown, it is a schematic flowchart of a Wi-Fi reconnection in a Wi-Fi subsystem reset scenario provided by an embodiment of the present application. The process may include the interaction between various modules in the terminal device, and may specifically include the following steps:
[0089] S201, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to a Wi-Fi driver.
[0090] The Wi-Fi subsystem crash notification message may be used to indicate a Wi-Fi subsystem crash. A Wi-Fi subsystem crash may also be described as a Wi-Fi chip crash, where the Wi-Fi subsystem crash may specifically refer to a situation where the Wi-Fi subsystem can still be reset, that is, after the crash, the Wi-Fi chip may be restarted (such as automatically restarted).
[0091] In some embodiments, the Wi-Fi subsystem crash notification message may also carry information indicating the cause of the Wi-Fi subsystem crash, such as a crash cause value or a crash indicator, etc., to indicate the specific cause of the Wi-Fi subsystem crash (or crash cause). Exemplarily, there may be many causes for the Wi-Fi subsystem crash, such as software bugs, abnormal register status, or software failure to recover, etc., which are not limited in the embodiments of the present application.
[0092] S202: The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi HAL module.
[0093] In some embodiments, after receiving the Wi-Fi subsystem crash notification message, the Wi-Fi driver may send a Wi-Fi connection disconnection indication message (disconnected) to the Wi-Fi HAL module in response to the message.
[0094] It is worth noting that the Wi-Fi disconnection indication message sent by the Wi-Fi driver to the Wi-Fi HAL may not carry the reason for the Wi-Fi disconnection. For example, the Wi-Fi disconnection indication message may only indicate the Wi-Fi disconnection event to the Wi-Fi HAL module, but will not indicate that the Wi-Fi disconnection was caused by a Wi-Fi chip crash.
[0095] S203, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module (Wi-Fi service).
[0096] S204: The Wi-Fi service module sends a Wi-Fi connection disconnection indication message to the UX module.
[0097] The UX module in the embodiment of the present application can be used to control the display in the terminal device interface. When the UX module receives the Wi-Fi connection disconnection indication message, the Wi-Fi signal indicator in the terminal device interface can be controlled to disappear.
[0098] It should be noted that the UX module, Wi-Fi service module, Wi-Fi HAL module and Wi-Fi driver in the embodiment of the present application can be integrated into the main chip (SOC). When the Wi-Fi chip crashes, the main chip can maintain normal operation, so that other services of the terminal device except the Wi-Fi service can operate normally.
[0099] It should also be noted that after the Wi-Fi chip crashes (such as during the transmission of the Wi-Fi subsystem crash notification message and the Wi-Fi connection disconnection indication message), the Wi-Fi driver can execute step S205, that is, restart the Wi-Fi chip.
[0100] S206: The Wi-Fi service module sends an all-channel scan indication message to the Wi-Fi HAL module.
[0101] Among them, full channel scanning (scan) can refer to scanning the channels allowed by current regulations one by one. At present, there are 26 channels available in China, so the full channel scanning indication message can be used to instruct the Wi-Fi chip to scan these 26 channels one by one to obtain the APs in the current environment.
[0102] S207, the Wi-Fi HAL module sends a full channel scan instruction message to the Wi-Fi driver.
[0103] S208: The Wi-Fi driver sends a full channel scan instruction message to the Wi-Fi chip.
[0104] S209, the Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver.
[0105] In some embodiments, the Wi-Fi chip can execute a scanning process in response to a full channel scan indication message. Specifically, the Wi-Fi chip can send a probe frame (probe request) on each channel, and after receiving a probe response frame (probe response) fed back by the AP in a certain channel or certain channels, the received AP feedback information is packaged and sent to the Wi-Fi driver through a scan result feedback message. Among them, the probe response frame fed back by the AP may include the protocol capabilities supported by the AP, the Wi-Fi standard (such as supporting Wi-Fi 4 or Wi-Fi 6), encryption method, etc.
[0106] In some embodiments, the scan result feedback message may include the protocol capabilities supported by the AP, the Wi-Fi standard (such as whether it supports Wi-Fi 4 or Wi-Fi 6), encryption method, etc.
[0107] It should be noted that the Wi-Fi chip can obtain the channel where the AP is located, the protocol capabilities supported by the AP, the Wi-Fi standard (such as whether it supports Wi-Fi 4 or Wi-Fi 6), encryption method, etc. based on the scan feedback message.
[0108] S210, the Wi-Fi driver sends a scan result feedback message to the Wi-Fi HAL module.
[0109] S211, the Wi-Fi HAL module sends a scan result feedback message to the Wi-Fi service module.
[0110] It should be noted that the process corresponding to step S206 to step S211 may be a scanning process on the terminal device side. During the scanning process, the Wi-Fi chip scans each channel and waits for information fed back by APs on multiple channels. Therefore, the scanning process takes a long time, usually at least 1.5-2.5 seconds. This time consumption is one of the important reasons why the entire Wi-Fi reconnection process takes a long time.
[0111] S212: The Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi HAL module.
[0112] The Wi-Fi connection request message (Wi-Fi connect) is used to request to establish a Wi-Fi connection with the AP. S213, the Wi-Fi HAL module sends a Wi-Fi connection request message to the Wi-Fi driver.
[0113] S214, the Wi-Fi driver sends a connection request message to the Wi-Fi chip.
[0114] S215, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver.
[0115] The Wi-Fi connection success message (connect succ) is used to indicate that the Wi-Fi connection is successful.
[0116] In some embodiments, in response to the Wi-Fi connection request message, the Wi-Fi chip may request to connect to an AP in a certain channel. The Wi-Fi connection process may include authentication (auth), association (assoc), four-step handshake and other steps to complete the link establishment at the MAC layer. At this time, the AP that successfully establishes a Wi-Fi connection with the terminal device is different from the original AP (that is, the AP to which the terminal device was connected before the Wi-Fi chip crashed).
[0117] S216, the Wi-Fi driver sends a Wi-Fi connection success message to the Wi-Fi HAL module.
[0118] S217, the Wi-Fi HAL module sends a Wi-Fi connection success message to the Wi-Fi service module.
[0119] It should be noted that, for ease of understanding, the Wi-Fi connection process (i.e., Wi-Fi reconnection process) described in this application is only a schematic process. In actual applications, the Wi-Fi reconnection process may specifically include multiple rounds of information interaction between the terminal device and the original AP. The interaction can refer to the existing process, and the embodiments of this application will not be described in detail. The Wi-Fi reconnection process in the following embodiments is similar to Figure 2A The embodiments are similar and are also schematic processes, so no further explanation is given.
[0120] S218, executing the DHCP process.
[0121] In some embodiments, when the Wi-Fi service module receives a Wi-Fi connection success message, it can initiate a DHCP process in response to the Wi-Fi connection success message, and the DHCP process is used to reacquire an IP address to achieve normal Internet access. Exemplarily, the process may specifically include the following stages: (1) a discovery stage, i.e., a stage in which a DHCP client searches for a DHCP server; (2) a provision stage, i.e., a stage in which a DHCP server provides an IP address; (3) a selection stage, i.e., a stage in which a DHCP client selects an IP address provided by a DHCP server; (4) a confirmation stage, i.e., a stage in which a DHCP server confirms the provided IP address, etc. Among them, the DHCP client may correspond to a terminal device in an embodiment of the present application.
[0122] The DHCP process in this step can be initiated by the Wi-Fi service module, and the protocol stack, Wi-Fi driver and Wi-Fi chip can work together to complete it. Figure 2B As shown, the DHCP process may include the following steps:
[0123] S2181, the Wi-Fi service module sends an IP allocation request message to the TCP / IP protocol stack.
[0124] The transmission control protocol (TCP) / IP protocol stack may be located at the kernel layer. The IP allocation request message may be used to request a DHCP server to allocate an IP address to the terminal device.
[0125] S2182, the TCP / IP protocol stack sends an IP allocation request message to the Wi-Fi driver.
[0126] S2183, the Wi-Fi driver sends an IP allocation request message to the Wi-Fi chip.
[0127] After receiving the IP allocation request message, the Wi-Fi chip may send the IP allocation request message to the DCHP server through the AP.
[0128] S2184, the Wi-Fi chip sends an IP allocation success indication message to the Wi-Fi driver.
[0129] The providing IP succ message is used to indicate that the IP allocation for the terminal device has been completed. The providing IP succ message may carry the IP address allocated by the DHCP server to the terminal device.
[0130] S2185, the Wi-Fi driver sends an IP allocation success indication message to the TCP / IP protocol stack.
[0131] S2186, the TCP / IP protocol stack sends an IP allocation success indication message to the Wi-Fi service module.
[0132] It should be noted that the DHCP process requires multiple rounds of message interaction between the terminal device and the DHCP server, so the DHCP process is also time-consuming, generally speaking, it takes at least 0.5-3 seconds. This time consumption is also one of the important reasons why the entire Wi-Fi reconnection process takes a long time.
[0133] In some embodiments, when the Wi-Fi service module receives an IP allocation success indication message, the IP allocated to the terminal device can be obtained according to the IP allocation success indication message (relative to the IP before the Wi-Fi disconnection, the IP allocated at this time can be a new IP). Afterwards, the Wi-Fi service module can broadcast the new IP to the application (APP) of the terminal device, so that the APP of the terminal device can use the new IP to access the Internet.
[0134] S222: The Wi-Fi service module sends a Wi-Fi connection indication message to the UX module.
[0135] The Wi-Fi connection indication message is used to indicate that a Wi-Fi connection has been successfully established.
[0136] In some embodiments, the UX module may control the display screen of the terminal device to redisplay the Wi-Fi signal indicator in response to the Wi-Fi connection indication message.
[0137] Since the full channel scanning process and DHCP process take a long time, Figure 2AIn the Wi-Fi reconnection scheme in the embodiment, the user will clearly feel that the Wi-Fi is disconnected. In addition, since the Wi-Fi service module will inform the UX module of the corresponding event after the Wi-Fi is disconnected and the Wi-Fi is reconnected, the Wi-Fi signal indicator in the terminal device display disappears and reappears with the disconnection and connection of the Wi-Fi, and the user can more keenly obtain the instability of the Wi-Fi network. However, in the case of Wi-Fi disconnection caused by the reset of the Wi-Fi subsystem, the short-term disconnection of Wi-Fi often does not affect the user's normal Internet access service (for example, in the scenario of watching videos, the video is usually pre-cached for a period of time, etc.), so after the Wi-Fi is disconnected, it will be reflected in the dimension of the Wi-Fi signal indicator, which will only affect the user's experience.
[0138] Combination Figure 2A The process shown in the embodiment shows the main reasons why the Wi-Fi reconnection process takes too long and the user experience is poor. Therefore, in order to shorten the Wi-Fi reconnection time and improve the user's Wi-Fi network experience, the network connection method provided in the following embodiment of this application mainly improves the full channel scanning process and DHCP process during Wi-Fi reconnection, as well as the Wi-Fi signal indicator display.
[0139] For example, Figure 3 , which is a schematic diagram of a system architecture applicable to a network connection method in an embodiment of the present application. The system architecture 10 may include a terminal device 100 and a wireless access point (AP) 200. The wireless access point may also be described as an AP.
[0140] In some embodiments, the terminal device 100 can be various types of electronic devices, such as: smart phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) or dedicated voice call devices, etc. The embodiments of the present application do not impose any restrictions on the specific type of the terminal device 100.
[0141] In some embodiments, the AP 200 may be, for example, a router (or hotspot). The terminal device 100 and the AP 200 may be connected to a network via Wi-Fi, and the terminal device 100 may access the Internet via the AP 200.
[0142] For example, Figure 4 As shown, it is a schematic structural diagram of a terminal device 100 provided in an embodiment of the present application.
[0143] The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0144] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0145] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0146] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0147] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0148] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0149] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0150] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0151] The terminal device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The display screen 194 is used to display images, videos, etc.
[0152] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0153] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy. The video codec is used to compress or decompress digital video. The NPU is a neural network (NN) computing processor that quickly processes input information by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, and can also continuously self-learn.
[0154] Exemplarily, the software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The present application embodiment takes the Android system including a layered architecture as an example to exemplify the software structure of the terminal device 100. Figure 5 1 is a system architecture diagram of a terminal device 100 applicable to the solution of the present application provided in an embodiment of the present application. The system architecture may include a plurality of layers into which the Android system software is divided based on roles and division of labor, and these layers communicate with each other through software interfaces. In addition, the system architecture may also include a hardware abstraction layer (HAL) and a hardware layer of the terminal device 100. Among them, the hardware abstraction layer includes a Wi-Fi HAL module. The hardware layer may include a Wi-Fi chip.
[0155] In some embodiments, the Android system can be divided into four layers, from top to bottom, namely, application layer, application framework layer, Android runtime, system library, kernel layer, hardware abstraction layer (HAL), and hardware layer. In addition, the system architecture can also include a Wi-Fi chip (chepset), which can be located in the hardware layer of the terminal device 100.
[0156] The application layer can include a series of application packages. Figure 5 As shown, the application package may include applications such as camera, calendar, map, WLAN, music, short message, Bluetooth, video, social, gallery, UX module, etc. Among them, the UX module is used to control the display content in the interface of the terminal device 100. In the embodiment of the present application, UX can be specifically used to control whether to display the Wi-Fi signal indicator in the interface of the terminal device 100.
[0157] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 5 As shown, the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a notification manager, a view system, and a Wi-Fi service module, etc.
[0158] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0159] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0160] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0161] The phone manager is used to provide communication functions of the terminal device 100, such as management of call status (including connection, disconnection, etc.).
[0162] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0163] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal vibrates, the indicator light flashes, etc.
[0164] The Wi-Fi service module can also be described as middleware, which is used to transfer all messages between the kernel state and the user state during the operation of the terminal device. In some embodiments, the Wi-Fi service module can be used to manage the services of the terminal device when it is connected to Wi-Fi, such as which channel (or channels) to scan Wi-Fi on, and store information about the AP connected to the terminal device.
[0165] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0166] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0167] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as obstacle life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0168] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0169] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0170] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0171] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0172] A 2D graphics engine is a drawing engine for 2D drawings.
[0173] The HAL layer can be located between the system library and the kernel layer, including the Wi-Fi HAL module.
[0174] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera sensor driver, TCP / IP protocol stack, audio driver, sensor driver and Wi-Fi driver. Among them, the Wi-Fi driver is responsible for connecting the Wi-Fi chip with the operating system of the terminal device.
[0175] The Wi-Fi chip is located at the hardware layer of the terminal device.
[0176] For example, Figure 6As shown, it is a schematic flow chart of a network connection method provided in an embodiment of the present application. The execution subject of the process may include multiple modules in the terminal device and a Wi-Fi chip in the terminal device, and may specifically include the following steps:
[0177] S601: The Wi-Fi chip sends a Wi-Fi subsystem crash notification message to a Wi-Fi driver.
[0178] In some embodiments, the Wi-Fi subsystem crash notification message may be used to indicate a reset of the Wi-Fi subsystem or a restart of the Wi-Fi chip. Specifically, the Wi-Fi subsystem crash notification message may carry crash cause indication information, such as a crash cause value or a crash indicator. The crash cause value may be pre-set to indicate a reset of the Wi-Fi subsystem.
[0179] S602: The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi HAL module.
[0180] In some embodiments, the Wi-Fi connection disconnection indication message in the embodiments of the present application may carry Wi-Fi disconnection reason indication information, and the Wi-Fi disconnection reason indication information is used to indicate the reason for the Wi-Fi disconnection, for example, it may refer to a Wi-Fi disconnection reason value (or disconnection reason value). The disconnection reason value may be used to indicate a Wi-Fi disconnection caused by a Wi-Fi subsystem reset (or a Wi-Fi chip restart). Optionally, the disconnection reason value and the crash reason value may be the same information.
[0181] S603, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module (Wi-Fi service).
[0182] After the Wi-Fi chip crashes (such as during the transmission of the Wi-Fi subsystem crash notification message and the Wi-Fi connection disconnection indication message), the Wi-Fi driver may execute step S604, i.e., restart the Wi-Fi chip (load firmware) or reload the Wi-Fi chip.
[0183] and Figure 2A The difference between the embodiments is that the Wi-Fi service module can obtain the reason for the Wi-Fi disconnection as a Wi-Fi subsystem crash based on the Wi-Fi connection disconnection message; based on the reason for the Wi-Fi disconnection, the Wi-Fi service module can determine that the terminal device is scanning the original channel instead of performing a full channel scan.
[0184] Except for the above Figure 2AFor other detailed descriptions of steps S601 to S604 in the embodiments of the present application, please refer to Figure 2A The contents in the embodiments will not be repeated here.
[0185] S605: The Wi-Fi service module sends an original channel scanning instruction message to the Wi-Fi HAL module.
[0186] The original channel refers to the channel on which the terminal device and the AP establish a Wi-Fi connection before the Wi-Fi chip crashes.
[0187] It should be noted that when the Wi-Fi chip has not crashed, the relevant information of the terminal device and the AP for Wi-Fi connection can be stored in the Wi-Fi chip and Wi-Fi service module of the terminal device, and optionally, can also be stored in the Wi-Fi HAL module and Wi-Fi driver. When the Wi-Fi chip crashes, the relevant information of the Wi-Fi connection stored in the Wi-Fi chip is cleared, but because the main chip (SOC) is still running normally at this time, the Wi-Fi service module still stores the original Wi-Fi connection information before the Wi-Fi chip crashes, including the original channel, the SSID corresponding to the original AP, the original IP (hereinafter referred to as static IP), etc.
[0188] In some embodiments, the original channel scan indication message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information of the original channel on which the terminal device was connected to the original AP before the Wi-Fi chip crashed (such as the number or indicator corresponding to the original channel). The original channel scan information may be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0189] S606: The Wi-Fi HAL module sends original channel scanning indication information to the Wi-Fi driver.
[0190] S607: The Wi-Fi driver sends original channel scanning instruction information to the Wi-Fi chip.
[0191] It is understandable that, unlike full channel scanning, the time required for the Wi-Fi chip to scan only the original channel is much shorter than the time required to scan all channels one by one, which effectively shortens the time for Wi-Fi reconnection. In addition, since the Wi-Fi chip's functions are restored after the Wi-Fi subsystem is reset, the probability of successful scanning on the original channel is very high, and the problem of failing to find the original AP after scanning usually does not occur, which is conducive to the subsequent smooth restoration of Wi-Fi connection.
[0192] S608: The Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver.
[0193] In some embodiments, the Wi-Fi chip can execute a scanning process in response to the original channel scanning indication message. Specifically, the Wi-Fi chip can send a probe frame (probe request) on the original channel, and after receiving the probe response frame (probe response) fed back by the AP in the original channel, send it to the Wi-Fi driver through a scan result feedback message. Among them, the probe response frame fed back by the AP may include the protocol capabilities supported by the AP, the Wi-Fi standard (such as supporting Wi-Fi 4 or Wi-Fi 6), encryption method, etc. At this time, the original AP may feed back the probe response frame to the Wi-Fi chip.
[0194] In some embodiments, the scan result feedback message can be used to indicate that there is an original AP that can be connected on the original channel, and may include the protocol capabilities supported by the AP, Wi-Fi standards (such as supporting Wi-Fi 4 or Wi-Fi 6), encryption methods, etc.
[0195] It should be noted that the Wi-Fi chip can obtain the channel where the AP is located, the protocol capabilities supported by the AP, the Wi-Fi standard (such as whether it supports Wi-Fi 4 or Wi-Fi 6), encryption methods, etc. based on the scan feedback message. That is, the Wi-Fi chip obtains the information of the original AP through scanning.
[0196] It should also be noted that since the driver side of the terminal device can save the scanning results obtained when the last Wi-Fi connection to the AP was established, the Wi-Fi service module on the driver side stores the channel corresponding to the original AP (i.e., the original channel), the protocol capabilities supported by the AP, the Wi-Fi standard (such as whether it supports Wi-Fi 4 or Wi-Fi 6) and encryption method when the Wi-Fi subsystem has not crashed (such as the last time the terminal device established a Wi-Fi connection with the original AP). Therefore, in some embodiments, the Wi-Fi service module can also send this information to the Wi-Fi chip after obtaining the Wi-Fi subsystem reset, that is, the Wi-Fi chip obtains the information of the original AP from the driver side of the Wi-Fi.
[0197] The scanning result feedback message involved in the following embodiments is similar to the scanning result feedback message here. Please refer to the relevant introduction under this step and no further description will be given.
[0198] S609: The Wi-Fi driver sends a scan result feedback message to the Wi-Fi HAL module.
[0199] S610: The Wi-Fi HAL module sends a scan result feedback message to the Wi-Fi service module.
[0200] It should be noted that, in the Wi-Fi reconnection process of the embodiment of the present application, the Wi-Fi chip only scans the original channel during the scanning process, eliminating the process of full channel scanning and network selection, and specifying to reconnect to the original AP, which can usually reduce the scanning and network selection time from the original 1.5-2.5s (such as Figure 2A The time in the embodiment is shortened to 80-110 ms, which is significantly shorter than the time of full channel scanning, thereby shortening the overall time of Wi-Fi reconnection and reducing the impact of reconnection after Wi-Fi disconnection on the user's Internet access.
[0201] S611, the Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi HAL module.
[0202] The Wi-Fi connection request message (Wi-Fi connect) is used to request to establish a Wi-Fi connection with the original AP through the original channel.
[0203] In some embodiments, the Wi-Fi connection request message may carry indication information of the original channel, as well as the SSID corresponding to the original AP, the password corresponding to the original AP, and the like.
[0204] The password corresponding to the original AP may be pre-stored by the Wi-Fi service module, and the password may be provided by the user. For example, when the terminal device established a Wi-Fi connection with the AP last time, the user entered the password in the terminal device, and then the Wi-Fi service module stored it locally.
[0205] S612: The Wi-Fi HAL module sends a Wi-Fi connection request message to the Wi-Fi driver.
[0206] S613: The Wi-Fi driver sends a connection request message to the Wi-Fi chip.
[0207] S614, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver.
[0208] The Wi-Fi connection success message (connect succ) is used to indicate that the Wi-Fi connection is successful.
[0209] In some embodiments, the Wi-Fi chip can obtain the SSID, password, supported formats and other information of the original AP to be connected according to the Wi-Fi connection request message, and then connect to the original AP.
[0210] In some embodiments, in response to the Wi-Fi connection request message, the Wi-Fi chip may request to connect to the original AP in the original channel. At this time, the original AP that successfully establishes a Wi-Fi connection with the terminal device is the same as the AP to which the terminal device was connected before the Wi-Fi chip crashed.
[0211] S615, the Wi-Fi driver sends a Wi-Fi connection success message to the Wi-Fi HAL module.
[0212] S616, the Wi-Fi HAL module sends a Wi-Fi connection success message to the Wi-Fi service module.
[0213] S617, executing the DHCP process.
[0214] The specific implementation process of the DHCP process can be found above. Figure 2B The description in the embodiments will not be repeated here.
[0215] In some embodiments, when the Wi-Fi service module receives an IP allocation success indication message, the IP allocated to the terminal device can be obtained according to the IP allocation success indication message (relative to the IP before the Wi-Fi disconnection, the IP allocated at this time can be a new IP). Afterwards, the Wi-Fi service module can broadcast the new IP to the APP of the terminal device, so that the APP of the terminal device can use the new IP to access the Internet.
[0216] For other detailed descriptions of steps S615 to S620 in the present embodiment, please refer to Figure 2A The contents in the embodiments will not be repeated here.
[0217] According to the network connection method provided in the embodiment of the present application, in the scenario where Wi-Fi disconnection is caused by resetting the Wi-Fi subsystem, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, thereby shortening the Wi-Fi reconnection time and reducing the adverse effects of Wi-Fi disconnection on users' Internet access.
[0218] For example, Figure 7 As shown, it is a schematic flow chart of another network connection method provided by an embodiment of the present application. The execution subject of the process may include multiple modules in the terminal device and the Wi-Fi chip in the terminal device, and may specifically include the following steps:
[0219] S701, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to a Wi-Fi driver.
[0220] In some embodiments, the Wi-Fi subsystem crash notification message is used to indicate that the cause of the Wi-Fi subsystem crash is a crash of the Wi-Fi chip. Specifically, the Wi-Fi subsystem crash notification message may carry crash cause indication information, such as a crash cause value or a crash indicator. The crash cause value may be preset to indicate that the Wi-Fi subsystem is reset.
[0221] S702: The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi HAL module.
[0222] In some embodiments, the Wi-Fi connection disconnection indication message may carry a disconnection reason value, which is used to indicate the reason for the Wi-Fi disconnection, and specifically may be used to indicate the Wi-Fi disconnection caused by a reset of the Wi-Fi subsystem. Optionally, the disconnection reason value and the crash reason value may be considered as the same information.
[0223] S703, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module (Wi-Fi service).
[0224] After the Wi-Fi chip crashes (such as during the transmission of the Wi-Fi subsystem crash notification message and the Wi-Fi connection disconnection indication message), the Wi-Fi driver may execute step S604, i.e., restart the Wi-Fi chip (load firmware) or reload the Wi-Fi chip.
[0225] and Figure 2A The difference between the embodiments is that the Wi-Fi service module can obtain the reason for the Wi-Fi disconnection as a Wi-Fi subsystem crash based on the Wi-Fi connection disconnection message; based on the reason for the Wi-Fi disconnection, the Wi-Fi service module can determine that the terminal device is scanning the original channel instead of performing a full channel scan.
[0226] Except for the above Figure 2A For other detailed descriptions of steps S701 to S704 in the embodiments of the present application, please refer to Figure 2A The contents in the embodiments will not be repeated here.
[0227] S705: The Wi-Fi service module sends an original channel scanning instruction message to the Wi-Fi HAL module.
[0228] The original channel refers to the channel on which the terminal device and the AP establish a Wi-Fi connection before the Wi-Fi chip crashes.
[0229] It should be noted that when the Wi-Fi chip has not crashed, the relevant information of the terminal device and the AP for Wi-Fi connection can be stored in the Wi-Fi chip and Wi-Fi service module of the terminal device, and optionally, can also be stored in the Wi-Fi HAL module and Wi-Fi driver. When the Wi-Fi chip crashes, the relevant information of the Wi-Fi connection stored in the Wi-Fi chip is cleared, but because the main chip (SOC) is still running normally at this time, the Wi-Fi service module still stores the original Wi-Fi connection information before the Wi-Fi chip crashes, including the original channel, the SSID corresponding to the original AP, the original IP, etc.
[0230] In some embodiments, the original channel scan indication message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information of the original channel on which the terminal device was connected to the original AP before the Wi-Fi chip crashed (such as the number or indicator corresponding to the original channel). The original channel scan information may be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0231] S706: The Wi-Fi HAL module sends original channel scanning indication information to the Wi-Fi driver.
[0232] S707: The Wi-Fi driver sends original channel scanning instruction information to the Wi-Fi chip.
[0233] S708, the Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver.
[0234] S709, the Wi-Fi driver sends a scan result feedback message to the Wi-Fi HAL module.
[0235] S710: The Wi-Fi HAL module sends a scan result feedback message to the Wi-Fi service module.
[0236] S711, the Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi HAL module.
[0237] S712: The Wi-Fi HAL module sends a Wi-Fi connection request message to the Wi-Fi driver.
[0238] S713: The Wi-Fi driver sends a connection request message to the Wi-Fi chip.
[0239] S714, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver.
[0240] In the embodiment of the present application, steps S705 to S714 are Figure 6The corresponding steps in the embodiment are similar. For a detailed description of steps S705 to S714, please refer to Figure 6 The relevant contents in the embodiments will not be repeated here.
[0241] S715, the Wi-Fi service module sends an original IP indication message to the Wi-Fi HAL module.
[0242] In some embodiments, the Wi-Fi service module can reset the Wi-Fi subsystem according to the reason for the Wi-Fi disconnection and determine to use a static IP to access the network. The Wi-Fi service module can send a broadcast message to the APP of the terminal device, indicating that the IP currently used by the APP is a static IP. The static IP is the IP address used by the terminal device before the current Wi-Fi disconnection.
[0243] S716, the Wi-Fi HAL module sends an original IP indication message to the Wi-Fi driver.
[0244] S717, the Wi-Fi driver sends the original IP indication message to the Wi-Fi chip.
[0245] The original IP indication message is used to indicate the IP address assigned to the terminal device before the Wi-Fi chip crashes.
[0246] It should be noted that steps S715 to S717 are optional steps. In some cases, such as when the Wi-Fi chip does not need to process (such as reordering) or optimize the data packets sent by the terminal device to the APP server (or other device), steps S715 to S717 may not be performed; in other cases, such as when the Wi-Fi chip needs to process or optimize the data packets sent by the terminal device to the APP server (or other device), steps S715 to S717 may be performed.
[0247] and Figure 2A Examples and Figure 6 The embodiments are different in that Figure 7In the Wi-Fi reconnection process in the embodiment, the terminal device no longer executes the DHCP process, that is, after the terminal device establishes a Wi-Fi MAC layer link with the original AP, it no longer obtains an IP address through the DHCP process, but uses the originally assigned IP address. Among them, the originally assigned IP address specifically refers to the IP address used by the terminal device to access the Internet through the original AP before the Wi-Fi chip crashed. Because before the Wi-Fi chip crashed, the Wi-Fi service module of the terminal device had already stored the IP address assigned to it by the DHCP server, and after the Wi-Fi chip crashed, the IP address information was still stored in the Wi-Fi service module, therefore, when the terminal device establishes a link with the AP at the MAC layer, the Wi-Fi service module can instruct the Wi-Fi chip to access the Internet through the original IP address. By eliminating the process of obtaining IP through DHCP after the Wi-Fi connection, and directly using the original IP, the time used to obtain the IP can be saved, about 0.5-3s.
[0248] It should be noted that the embodiment of the present application is only introduced by taking the example of saving the process of obtaining an IP address and no longer performing a full channel scan, but scanning the original channel and reconnecting to the original AP for Wi-Fi. Figure 2A The process in the embodiment is based on the whole channel scan, that is, the whole channel scan is still performed, but the process of obtaining the IP address is no longer performed. The embodiment of the present application does not limit this.
[0249] According to the network connection method provided in the embodiment of the present application, in the scenario of Wi-Fi disconnection caused by resetting the Wi-Fi subsystem, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, and omits the process of obtaining an IP, and uses the original IP to enter the network, which can shorten the time it takes for the user to use Wi-Fi normally again and reduce the adverse effects of Wi-Fi disconnection on the user's Internet access.
[0250] It should be noted that in the above Figure 6 Examples and Figure 7 In the method of the embodiment, in the scenario where the Wi-Fi subsystem is reset and causes the Wi-Fi disconnection, after the Wi-Fi disconnection is acquired, the Wi-Fi disconnection event can be intercepted to the upper layer application (such as the UX module), such as intercepting the indication information (such as the disconnection reason value) used to indicate the Wi-Fi disconnection, so that the UX does not perceive the Wi-Fi disconnection, and the display screen of the terminal device continues to display the Wi-Fi signal indicator. Alternatively, it can also be as follows Figure 2A The method in the embodiment still notifies the upper layer application (such as the UX module) of the Wi-Fi disconnection, so that the UX module controls the Wi-Fi signal indicator to disappear on the display screen of the terminal device.
[0251] It is understandable that when the terminal device intercepts the Wi-Fi disconnection event to its upper-layer application (such as the UX module), the display status of the Wi-Fi signal indicator in the display screen will not be affected by the Wi-Fi disconnection or Wi-Fi reconnection, and will remain displayed. When the Wi-Fi signal indicator is always displayed, the user will not perceive that the Wi-Fi is disconnected. In many cases, the Wi-Fi disconnection is only short-term, especially in the case of Wi-Fi disconnection caused by the reset of the Wi-Fi subsystem, the time is shorter and the adverse effect on the user's normal use of the network is limited. Therefore, in the process of Wi-Fi disconnection and reconnection, keeping the Wi-Fi signal indicator displayed can reduce the network status changes perceived by the user and improve the user experience.
[0252] The following is a description of the process of intercepting Wi-Fi disconnection events to the upper layer application of the terminal device and keeping the Wi-Fi signal indicator displayed. It is worth noting that the upper layer application of the terminal device intercepts the Wi-Fi disconnection event, which can be Figure 2A The implementation is based on the process of the embodiment, that is, during the Wi-Fi reconnection process, all channels are scanned, and the DHCP process is still performed to obtain the IP (corresponding to the following Figure 8 Embodiment); also in Figure 6 or Figure 7 The implementation is based on the process of the embodiment, that is, during the Wi-Fi reconnection process, only the original channel scan is performed, and the DHCP process is still performed to obtain the IP (corresponding to Fig. 9 Embodiment), or in the process of Wi-Fi reconnection, the original channel scan is performed, and the DHCP process is no longer performed to obtain the IP (corresponding to Fig.10 Embodiment). Of course, intercepting the Wi-Fi disconnection event to the upper layer application of the terminal device can also be achieved by performing full channel scanning during the Wi-Fi reconnection process without obtaining the IP through DHCP, but the process in this case will not be described in detail herein.
[0253] For example, Figure 8 As shown, it is a schematic flow chart of another network connection method provided in an embodiment of the present application. The execution subject of the process may include multiple modules in the terminal device and the Wi-Fi chip in the terminal device, and may specifically include the following steps:
[0254] S801, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to a Wi-Fi driver.
[0255] The Wi-Fi subsystem crash notification message is used to indicate a reset of the Wi-Fi subsystem or a restart of the Wi-Fi chip.
[0256] S802: The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi HAL module.
[0257] In some embodiments, the Wi-Fi driver may obtain the Wi-Fi disconnection according to the received Wi-Fi subsystem crash notification message, and obtain the reason for the Wi-Fi disconnection as the Wi-Fi subsystem reset (or Wi-Fi chip restart).
[0258] The Wi-Fi connection disconnection indication message is used to indicate a Wi-Fi disconnection. The Wi-Fi disconnection indication message may carry Wi-Fi disconnection cause indication information, and the Wi-Fi disconnection cause indication information is used to indicate the cause of the Wi-Fi disconnection, for example, a Wi-Fi disconnection cause value (or disconnection cause value). Specifically, the disconnection cause value may be used to indicate a Wi-Fi disconnection caused by a reset of the Wi-Fi subsystem.
[0259] S803, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module (Wi-Fi service).
[0260] It is worth noting that after the Wi-Fi service module receives the Wi-Fi connection disconnection indication message, it no longer sends the Wi-Fi connection disconnection indication message to the UX module, that is, the step of the Wi-Fi service module indicating the Wi-Fi connection disconnection to the UX module is omitted, or the Wi-Fi service module intercepts the Wi-Fi connection disconnection indication message, so that the UX module cannot obtain the Wi-Fi connection disconnection indication message and does not perceive the Wi-Fi disconnection.
[0261] It should be noted that after the Wi-Fi chip crashes (such as during the transmission of the Wi-Fi subsystem crash notification message and the Wi-Fi connection disconnection indication message), the Wi-Fi driver can execute step S804, that is, restart the Wi-Fi chip.
[0262] S805, the Wi-Fi service module sends an all-channel scan indication message to the Wi-Fi HAL module.
[0263] S806: The Wi-Fi HAL module sends a full channel scan indication message to the Wi-Fi driver.
[0264] S807: The Wi-Fi driver sends a full channel scan instruction message to the Wi-Fi chip.
[0265] S808, the Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver.
[0266] S809, the Wi-Fi driver sends a scan result feedback message to the Wi-Fi HAL module.
[0267] S810, the Wi-Fi HAL module sends a scan result feedback message to the Wi-Fi service module.
[0268] S811, the Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi HAL module.
[0269] The Wi-Fi connection request message (Wi-Fi connect) is used to request to establish a Wi-Fi connection with an AP.
[0270] S812, the Wi-Fi HAL module sends a Wi-Fi connection request message to the Wi-Fi driver.
[0271] S813, the Wi-Fi driver sends a connection request message to the Wi-Fi chip.
[0272] S814, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver.
[0273] S815, the Wi-Fi driver sends a Wi-Fi connection success message to the Wi-Fi HAL module.
[0274] S816, the Wi-Fi HAL module sends a Wi-Fi connection success message to the Wi-Fi service module.
[0275] S817, executing the DHCP process.
[0276] The specific implementation process of the DHCP process can be found above. Figure 2B The description in the embodiments will not be repeated here.
[0277] In some embodiments, when the Wi-Fi service module receives an IP allocation success indication message, the IP allocated to the terminal device can be obtained according to the IP allocation success indication message (relative to the IP before the Wi-Fi disconnection, the IP allocated at this time can be a new IP). Afterwards, the Wi-Fi service module can broadcast the new IP to the APP of the terminal device, so that the APP of the terminal device can use the new IP for network services.
[0278] For a detailed description of steps S804 to S820 in the embodiment of the present application, please refer to the above Figure 2A The relevant contents in the embodiments will not be repeated here.
[0279] It is worth noting that after the Wi-Fi service module successfully obtains the Wi-Fi connection or has allocated an IP to the terminal device, it no longer sends the Wi-Fi connection indication message and / or the IP allocation success indication message to the UX module, that is, the step of the Wi-Fi service module indicating the Wi-Fi connection to the UX module is omitted, or the Wi-Fi service module intercepts the Wi-Fi connection indication message and / or the IP allocation success indication message, so that the UX module cannot perceive that the Wi-Fi is reconnected.
[0280] According to the network connection method provided in the embodiment of the present application, by intercepting Wi-Fi disconnection and Wi-Fi connection events to the upper-layer application of the terminal device, it is possible to avoid users from perceiving the unstable network state when the Wi-Fi network is disconnected and reconnected in a short time, thereby improving the user's usage experience.
[0281] For example, Fig. 9 As shown, it is a schematic flow chart of another network connection method provided in an embodiment of the present application. The execution subject of the process may include multiple modules in the terminal device and the Wi-Fi chip in the terminal device, and may specifically include the following steps:
[0282] S901, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to a Wi-Fi driver.
[0283] The Wi-Fi subsystem crash notification message is used to indicate a reset of the Wi-Fi subsystem or a restart of the Wi-Fi chip.
[0284] S902: The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi HAL module.
[0285] In some embodiments, the Wi-Fi driver may obtain the Wi-Fi disconnection according to the received Wi-Fi subsystem crash notification message, and obtain the reason for the Wi-Fi disconnection as the Wi-Fi subsystem reset (or Wi-Fi chip restart).
[0286] The Wi-Fi connection disconnection indication message is used to indicate a Wi-Fi disconnection. The Wi-Fi disconnection indication message may carry Wi-Fi disconnection cause indication information, and the Wi-Fi disconnection cause indication information is used to indicate the cause of the Wi-Fi disconnection, for example, a Wi-Fi disconnection cause value (or disconnection cause value). Specifically, the disconnection cause value may be used to indicate a Wi-Fi disconnection caused by a reset of the Wi-Fi subsystem.
[0287] S903, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module (Wi-Fi service).
[0288] It is worth noting that after the Wi-Fi service module receives the Wi-Fi connection disconnection indication message, it no longer sends the Wi-Fi connection disconnection indication message to the UX module, that is, the step of the Wi-Fi service module indicating the Wi-Fi connection disconnection to the UX module is omitted, or the Wi-Fi service module intercepts the Wi-Fi connection disconnection indication message, so that the UX module cannot obtain the Wi-Fi connection disconnection indication message and does not perceive the Wi-Fi disconnection.
[0289] It should be noted that after the Wi-Fi chip crashes (such as during the transmission of the Wi-Fi subsystem crash notification message and the Wi-Fi connection disconnection indication message), the Wi-Fi driver can execute step S904, that is, restart the Wi-Fi chip.
[0290] S905: The Wi-Fi service module sends an original channel scanning instruction message to the Wi-Fi HAL module.
[0291] The original channel refers to the channel on which the terminal device and the AP establish a Wi-Fi connection before the Wi-Fi chip crashes.
[0292] It should be noted that when the Wi-Fi chip has not crashed, the relevant information of the terminal device and the AP for Wi-Fi connection can be stored in the Wi-Fi chip and Wi-Fi service module of the terminal device, and optionally, can also be stored in the Wi-Fi HAL module and Wi-Fi driver. When the Wi-Fi chip crashes, the relevant information of the Wi-Fi connection stored in the Wi-Fi chip is cleared, but because the main chip (SOC) is still running normally at this time, the Wi-Fi service module still stores the original Wi-Fi connection information before the Wi-Fi chip crashes, including the original channel, the SSID corresponding to the original AP, the original IP, etc.
[0293] In some embodiments, the original channel scan indication message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information of the original channel on which the terminal device was connected to the original AP before the Wi-Fi chip crashed (such as the number or indicator corresponding to the original channel). The original channel scan information may be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0294] S906: The Wi-Fi HAL module sends an original channel scan indication message to the Wi-Fi driver.
[0295] S907: The Wi-Fi driver sends an original channel scan instruction message to the Wi-Fi chip.
[0296] S908, the Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver.
[0297] S909, the Wi-Fi driver sends a scan result feedback message to the Wi-Fi HAL module.
[0298] S910, the Wi-Fi HAL module sends a scan result feedback message to the Wi-Fi service module.
[0299] S911, the Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi HAL module.
[0300] The Wi-Fi connection request message (Wi-Fi connect) is used to request to establish a Wi-Fi connection with an AP.
[0301] S912, the Wi-Fi HAL module sends a Wi-Fi connection request message to the Wi-Fi driver.
[0302] S913: The Wi-Fi driver sends a connection request message to the Wi-Fi chip.
[0303] S914, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver.
[0304] S915, the Wi-Fi driver sends a Wi-Fi connection success message to the Wi-Fi HAL module.
[0305] S916, the Wi-Fi HAL module sends a Wi-Fi connection success message to the Wi-Fi service module.
[0306] S917, executing the DHCP process.
[0307] The specific implementation process of the DHCP process can be found above. Figure 2B The description in the embodiments will not be repeated here.
[0308] In some embodiments, when the Wi-Fi service module receives an IP allocation success indication message, the IP allocated to the terminal device can be obtained according to the IP allocation success indication message (relative to the IP before the Wi-Fi disconnection, the IP allocated at this time can be a new IP). Afterwards, the Wi-Fi service module can broadcast the new IP to the APP of the terminal device, so that the APP of the terminal device can use the new IP for network services.
[0309] For a detailed description of steps S904 to S920 in the embodiment of the present application, please refer to the above Figure 2A The relevant contents in the embodiments will not be repeated here.
[0310] It is worth noting that after the Wi-Fi service module successfully obtains the Wi-Fi connection or has allocated an IP to the terminal device, it no longer sends the Wi-Fi connection indication message and / or the IP allocation success indication message to the UX module, that is, the step of the Wi-Fi service module indicating the Wi-Fi connection to the UX module is omitted, or the Wi-Fi service module intercepts the Wi-Fi connection indication message and / or the IP allocation success indication message, so that the UX module cannot perceive that the Wi-Fi is reconnected.
[0311] According to the network connection method provided in the embodiment of the present application, in the scenario where the Wi-Fi disconnection is caused by resetting the Wi-Fi subsystem, the connection with the original AP is reestablished by scanning the original channel instead of scanning all channels, and the Wi-Fi disconnection and Wi-Fi connection events are intercepted to the upper-layer application of the terminal device. In this way, when the Wi-Fi network is disconnected and reconnected in a short time, the Wi-Fi reconnection time can be shortened, and at the same time, the user is prevented from perceiving the unstable network state, thereby improving the user's usage experience.
[0312] For example, Fig.10 As shown, it is a schematic flow chart of another network connection method provided in an embodiment of the present application. The execution subject of the process may include multiple modules in the terminal device and the Wi-Fi chip in the terminal device, and may specifically include the following steps:
[0313] S1001, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to a Wi-Fi driver.
[0314] The Wi-Fi subsystem crash notification message is used to indicate a reset of the Wi-Fi subsystem or a restart of the Wi-Fi chip.
[0315] S1002: The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi HAL module.
[0316] In some embodiments, the Wi-Fi driver may obtain the Wi-Fi disconnection according to the received Wi-Fi subsystem crash notification message, and obtain the reason for the Wi-Fi disconnection as the Wi-Fi subsystem reset (or Wi-Fi chip restart).
[0317] The Wi-Fi connection disconnection indication message is used to indicate a Wi-Fi disconnection. The Wi-Fi disconnection indication message may carry Wi-Fi disconnection cause indication information, and the Wi-Fi disconnection cause indication information is used to indicate the cause of the Wi-Fi disconnection, for example, a Wi-Fi disconnection cause value (or disconnection cause value). Specifically, the disconnection cause value may be used to indicate a Wi-Fi disconnection caused by a reset of the Wi-Fi subsystem.
[0318] S1003, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module (Wi-Fi service).
[0319] It is worth noting that after the Wi-Fi service module receives the Wi-Fi connection disconnection indication message, it no longer sends the reason value of the Wi-Fi connection disconnection to the UX module, that is, the step of the Wi-Fi service module indicating the Wi-Fi connection disconnection to the UX module is omitted, or the Wi-Fi service module intercepts the Wi-Fi connection disconnection indication message, so that the UX module cannot obtain the Wi-Fi connection disconnection indication message and does not perceive the Wi-Fi disconnection.
[0320] In some embodiments, in addition to intercepting the reason value of the Wi-Fi connection disconnection to the UX module, the Wi-Fi service module may also intercept the reason value of the Wi-Fi connection disconnection to the CS module, that is, the step of the Wi-Fi service module indicating the Wi-Fi connection disconnection to the CS module is omitted, so that the CS module no longer switches the network to the cellular network during the Wi-Fi reconnection process, so that the user can continue to use the Wi-Fi network after a short time.
[0321] It should be noted that after the Wi-Fi chip crashes (such as during the transmission of the Wi-Fi subsystem crash notification message and the Wi-Fi connection disconnection indication message), the Wi-Fi driver can execute step S1004, that is, restart the Wi-Fi chip.
[0322] S1005: The Wi-Fi service module sends an original channel scanning instruction message to the Wi-Fi HAL module.
[0323] The original channel refers to the channel on which the terminal device and the AP establish a Wi-Fi connection before the Wi-Fi chip crashes.
[0324] It should be noted that when the Wi-Fi chip has not crashed, the relevant information of the terminal device and the AP for Wi-Fi connection can be stored in the Wi-Fi chip and Wi-Fi service module of the terminal device, and optionally, can also be stored in the Wi-Fi HAL module and Wi-Fi driver. When the Wi-Fi chip crashes, the relevant information of the Wi-Fi connection stored in the Wi-Fi chip is cleared, but because the main chip (SOC) is still running normally at this time, the Wi-Fi service module still stores the original Wi-Fi connection information before the Wi-Fi chip crashes, including the original channel, the SSID corresponding to the original AP, the original IP, etc.
[0325] In some embodiments, the original channel scan indication message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information of the original channel on which the terminal device was connected to the original AP before the Wi-Fi chip crashed (such as the number or indicator corresponding to the original channel). The original channel scan information may be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0326] S1006: The Wi-Fi HAL module sends an original channel scan indication message to the Wi-Fi driver.
[0327] S1007: The Wi-Fi driver sends an original channel scan instruction message to the Wi-Fi chip.
[0328] It is understandable that, unlike full channel scanning, the time required for the Wi-Fi chip to scan only the original channel is much shorter than the time required to scan all channels one by one, which effectively shortens the time for Wi-Fi reconnection. In addition, since the Wi-Fi chip's functions are restored after the Wi-Fi subsystem is reset, the probability of successful scanning on the original channel is very high, and the problem of failing to find the original AP after scanning usually does not occur, which is conducive to the subsequent smooth restoration of Wi-Fi connection.
[0329] S1008, the Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver.
[0330] The scan result feedback message may be used to indicate that there is an original AP that can be connected on the original channel.
[0331] In some embodiments, the Wi-Fi chip may scan on a specific channel (i.e., the original channel) in response to the original channel scanning indication information. Specifically, the Wi-Fi chip may send a probe request frame on the original channel, and after receiving a probe response frame fed back by the AP on the original channel, send the information fed back by the AP to the Wi-Fi driver through a scan result feedback message.
[0332] S1009, the Wi-Fi driver sends a scan result feedback message to the Wi-Fi HAL module.
[0333] S1010, the Wi-Fi HAL module sends a scan result feedback message to the Wi-Fi service module.
[0334] It should be noted that, in the Wi-Fi reconnection process of the embodiment of the present application, the Wi-Fi chip only scans the original channel during the scanning process, eliminating the process of full channel scanning and network selection, and specifying to reconnect to the original AP, which can usually reduce the scanning and network selection time from the original 1.5-2.5s (such as Figure 2A The time in the embodiment is shortened to 80-110 ms, which is significantly shorter than the time of full channel scanning, thereby shortening the overall time of Wi-Fi reconnection and reducing the impact of reconnection after Wi-Fi disconnection on the user's Internet access.
[0335] S1011, the Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi HAL module.
[0336] The Wi-Fi connection request message (Wi-Fi connect) is used to request to establish a Wi-Fi connection with an AP.
[0337] S1012: The Wi-Fi HAL module sends a Wi-Fi connection request message to the Wi-Fi driver.
[0338] S1013: The Wi-Fi driver sends a connection request message to the Wi-Fi chip.
[0339] S1014, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver.
[0340] S1015, the Wi-Fi driver sends a Wi-Fi connection success message to the Wi-Fi HAL module.
[0341] S1016, the Wi-Fi HAL module sends a Wi-Fi connection success message to the Wi-Fi service module.
[0342] For detailed description of steps S1004 to S1016 in the embodiment of the present application, please refer to Figure 2A The description in the embodiments will not be repeated here.
[0343] It is worth noting that Fig. 9 What is different from the embodiments is that in the embodiments of the present application, after the terminal device re-establishes a Wi-Fi connection with the original AP (i.e., establishes a MAC layer link), the terminal device will no longer initiate a DHCP process to obtain an IP address, nor will the DHCP server need to feedback a successful IP allocation indication message to the terminal device. Instead, the following steps S1017 to S1019 can be directly executed.
[0344] S1017, the Wi-Fi service module sends an original IP indication message to the Wi-Fi HAL module.
[0345] In some embodiments, the Wi-Fi service module can reset the Wi-Fi subsystem according to the reason for the Wi-Fi disconnection and determine to use a static IP for network services. The Wi-Fi service module can send a broadcast message to the APP of the terminal device, indicating that the IP currently used by the APP is a static IP. The static IP is the IP address used by the terminal device before the current Wi-Fi disconnection.
[0346] The original IP indication message is used to indicate the IP address assigned to the terminal device before the Wi-Fi chip crashes.
[0347] and Fig. 9 The difference between the embodiments is that Fig.10 In the Wi-Fi reconnection process in the embodiment, the terminal device no longer executes the DHCP process, that is, after the terminal device establishes a Wi-Fi MAC layer link with the original AP, it no longer obtains an IP address through the DHCP process, but uses the originally assigned IP address. Among them, the originally assigned IP address specifically refers to the IP address used by the terminal device to access the Internet through the original AP before the Wi-Fi chip crashed. Because before the Wi-Fi chip crashed, the Wi-Fi service module of the terminal device had already stored the IP address assigned to it by the DHCP server, and after the Wi-Fi chip crashed, the IP address information was still stored in the Wi-Fi service module, therefore, when the terminal device establishes a link with the AP at the MAC layer, the Wi-Fi service module can instruct the Wi-Fi chip to access the Internet through the original IP address. By eliminating the process of obtaining IP through DHCP after the Wi-Fi connection, and directly using the original IP, the time used to obtain the IP can be saved, about 0.5-3s.
[0348] S1018, the Wi-Fi HAL module sends an original IP indication message to the Wi-Fi driver.
[0349] S1019, the Wi-Fi driver sends the original IP indication message to the Wi-Fi chip.
[0350] In some embodiments, the Wi-Fi chip can access the Internet using the original IP according to the original IP indication message.
[0351] It should be noted that steps S1017 to S1019 are optional steps. In some cases, such as when the Wi-Fi chip does not need to process (such as reordering) or optimize the data packets sent by the terminal device to the APP server (or other device), steps S1017 to S1019 may not be performed; in other cases, such as when the Wi-Fi chip needs to process or optimize the data packets sent by the terminal device to the APP server (or other device), steps S1017 to S1019 may be performed.
[0352] According to the network connection method provided in the embodiment of the present application, in the scenario of Wi-Fi disconnection caused by Wi-Fi subsystem reset, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, and omits the process of obtaining IP, and uses the original IP to enter the network, which can shorten the time for users to use Wi-Fi normally again and reduce the adverse effects of Wi-Fi disconnection on users' Internet access. In addition, when the terminal device obtains that the reason for the Wi-Fi disconnection is the reset of the Wi-Fi subsystem, it can intercept the Wi-Fi disconnection event (such as the reason value of the Wi-Fi disconnection) to the UX of the terminal device, and / or intercept the Wi-Fi disconnection event (such as the reason value of the Wi-Fi disconnection) to the CS module of the terminal device, so that the user does not perceive the Wi-Fi disconnection, and the terminal device is no longer connected to other types of networks such as cellular networks during Wi-Fi reconnection, so that the user can improve the use experience of Wi-Fi.
[0353] The network connection method provided in the embodiment of the present application can notify the UX that the Wi-Fi connection has been disconnected in some scenarios, such as Wi-Fi reconnection timeout, Wi-Fi reconnection rejection, or failure to scan the original AP, and the terminal device then re-enters the normal Wi-Fi connection process such as initiating scanning and selecting a network. For example, Fig.11 FIG. 1 is a schematic flow chart of another network connection method provided in an embodiment of the present application. The execution subject of the method may be a terminal device, and may specifically include the following steps:
[0354] S1101, Wi-Fi chip crashed.
[0355] S1102, reconnect to the original AP.
[0356] S1103, set a timeout period.
[0357] The timeout period is used to determine whether the process of reconnecting to the original AP has timed out.
[0358] S1104, determine whether the reconnection to the original AP is successful.
[0359] Among them, if the original AP reconnects successfully, that is, the judgment result of this step is "yes", then the process ends and the terminal device can access the Internet through the Wi-Fi connection between the original AP; if the original AP reconnects unsuccessfully, that is, the judgment result of this step is "no", then one or more of steps S1105, S1106 and S1107 can be executed next.
[0360] The process of the terminal device reconnecting to the original AP through Wi-Fi can be seen above. Figures 6 to 10 The processes described in the embodiments will not be described in detail here.
[0361] S1105: The original AP reconnection timed out.
[0362] In some embodiments, when the terminal device fails to successfully reconnect to the original AP via Wi-Fi, the terminal device may detect whether the current Wi-Fi reconnection process exceeds a preset timer. Specifically, when the Wi-Fi reconnection fails, the terminal device may periodically detect whether the Wi-Fi reconnection process exceeds the timer; or, when the terminal device reconnects to the original AP, a timer is started, and when the timer reaches the preset timer when the Wi-Fi reconnection fails, the terminal device is informed that the current Wi-Fi reconnection process has timed out.
[0363] S1106: Wi-Fi reconnection is rejected by the original AP.
[0364] In some embodiments, the manner in which Wi-Fi reconnection is rejected by the original AP may, for example, include: after the terminal device sends a Wi-Fi connection request message to the original AP, the original AP determines that it cannot establish a Wi-Fi connection with the terminal device based on the current network status and / or its own status (such as the current signal strength, software status, capability status, etc.); thereafter, the original AP may send a Wi-Fi connection request response message to the terminal device, instructing the original AP to refuse to establish a Wi-Fi connection with the terminal device.
[0365] S1107: The original AP is not scanned.
[0366] In some embodiments, failure to scan the original AP may specifically include: (1) the terminal device performs scanning on the original channel and fails to scan the original AP; (2) the terminal device performs scanning on all channels and fails to scan the original AP. Specifically, if the terminal device sends a probe frame (probe request) on the original channel and fails to receive a probe response frame (proberresponse) sent by the original AP, it means that the terminal device fails to scan the original AP. Alternatively, the terminal device sends probe frames one by one on all channels, and after receiving a probe response frame sent by an AP on one or some channels, if this channel is not the original channel or these channels do not include the original channel, it means that the terminal device fails to scan the original AP. Alternatively, if the terminal device obtains information that does not include the original AP based on the probe response frame after receiving the probe response frame sent by the AP, it means that the original AP is not scanned. The embodiments of the present application do not limit the specific implementation method for the terminal device to obtain the failure to scan the original AP.
[0367] It should be noted that step S1105, step S1106 and step S1107 can all be executed, such as executing steps S1105 to S1107 in sequence; or, part of steps S1105 to S1107 can also be executed, such as executing step S1105 and step S1107, or only executing step S1105 without executing step S1106 and step S1107, etc., and the embodiments of the present application are not limited to this.
[0368] S1108, notifying the UX module of the terminal device that the Wi-Fi has been disconnected.
[0369] In some embodiments, when one or more of steps S1105 to S1107 are met, the Wi-Fi service module of the terminal device may indicate to the UX module of the terminal device that the Wi-Fi connection with the original AP has been disconnected. Specifically, the Wi-Fi service module may send a Wi-Fi connection disconnection indication message to the UX module.
[0370] In some embodiments, the UX module can control the Wi-Fi signal indicator on the display screen of the terminal device to disappear according to the Wi-Fi disconnection.
[0371] It should be noted that when the terminal device fails to reconnect to the original AP, the terminal device may need to re-execute the normal Wi-Fi connection process (including scanning, network selection, connection, etc.), and the Wi-Fi connection time may take a long time. Therefore, in order to ensure the normal use of the network by the user, the Wi-Fi signal indicator can no longer be displayed on the terminal device display to make the user aware that the current Wi-Fi network has been disconnected. In other words, if the terminal device fails to reconnect to the original AP, the Wi-Fi signal indicator can no longer be displayed on the display, so that the user can perceive that the current network has been switched to other types, such as Wi-Fi networks corresponding to other APs or cellular networks.
[0372] S1109, continue to reconnect to the original AP.
[0373] In some embodiments, if the reason for the Wi-Fi reconnection failure is timeout, that is, step S1105, the terminal device can continue to reconnect to the original AP.
[0374] S1110, executing a normal Wi-Fi connection process, triggering operations such as scanning, network selection, and Wi-Fi connection.
[0375] In some embodiments, if the reason for the failure of Wi-Fi reconnection is that the Wi-Fi reconnection is rejected by the original AP and / or the original AP is not scanned, the terminal device can perform a normal Wi-Fi connection process, that is, perform a full channel scan, select a network according to the scan results, and perform Wi-Fi connection operations. The specific implementation process of the normal Wi-Fi connection can refer to the existing process and will not be described in detail here.
[0376] S1111, determine whether the Wi-Fi reconnection is successful.
[0377] In some embodiments, the Wi-Fi reconnection in this step may refer to the Wi-Fi reconnection in step S1109 , or the Wi-Fi connection in step S1110 .
[0378] Among them, if the Wi-Fi reconnection is successful, that is, the judgment result of this step is "yes", the process ends, and the terminal device can access the Internet through the Wi-Fi connection between the original AP; if the Wi-Fi reconnection is unsuccessful, that is, the judgment result of this step is "no", then step S1112 can be executed next, that is, the Wi-Fi is disconnected and switched to cellular Internet access.
[0379] According to the network connection method provided in the embodiment of the present application, in a scenario where the Wi-Fi disconnection is caused by resetting the Wi-Fi subsystem, when the terminal device fails to re-establish the Wi-Fi connection with the original AP, the terminal device will attempt to continue to connect to the original AP or execute the normal Wi-Fi connection process to establish a Wi-Fi connection with another AP, thereby ensuring the user's normal use of the Wi-Fi network.
[0380] In addition, in the case of passive scanning, the driver side of the terminal device can save the scanning results obtained from the last connection to the original AP (including the capability information of the original AP, such as the supported Wi-Fi standards; and connection information, such as SSID); when the Wi-Fi chip crashes, the terminal device can use the capabilities of the AP recorded in the last received AP Beacon frame, without initiating a scan to directly connect to the hotspot. For example, Fig.12 FIG. 1 is a schematic flow chart of a terminal device directly initiating Wi-Fi to an original AP provided in an embodiment of the present application. Specifically, the following steps are included:
[0381] S1201, the terminal device receives a beacon frame sent by the AP.
[0382] In some embodiments, the AP may send beacon frames in the form of broadcasting.
[0383] This step may occur during the last process of establishing a Wi-Fi connection with the AP. The beacon frame may include the capability information and connection information of the AP. After receiving the beacon, the terminal device stores the capability information and connection information of the AP.
[0384] S1202: The terminal device stores the capability information and connection information of the AP according to the beacon frame.
[0385] The capability information includes, for example, the protocol capability of the AP, the supported Wi-Fi standard, etc. The connection information includes, for example, the SSID and IP of the AP.
[0386] S1203, the Wi-Fi subsystem of the terminal device is reset, and the terminal device reconnects to the original AP using the stored capability information and connection information of the original AP.
[0387] The reconnection process may no longer perform the full channel scanning phase and the network selection phase, but may perform the following steps S1204 to S1213:
[0388] S1204, the terminal device sends a scan message to the AP (on the original channel).
[0389] The scanning message is, for example, a probe request.
[0390] S1205, the AP sends a scan response message to the terminal device (on the original channel).
[0391] The scan response message may be, for example, a probe response frame.
[0392] It should be noted that both step S1204 and step S1025 are performed on the original channel. Similarly, the information interaction in the following steps S1206 to S1213 can also be performed on the original channel.
[0393] S1206, the terminal device sends an authentication request message (auth req) to the AP.
[0394] S1207, the AP sends an authentication response message (auth rsp) to the terminal device.
[0395] S1208, the terminal device sends an association request message (assoc req) to the AP.
[0396] S1209, the AP sends an association response message (assoc rsp) to the terminal device.
[0397] Next, the AP may negotiate a key with the terminal device, and the key is used to encrypt the data packet. The key negotiation phase may include steps S1209 to S1212:
[0398] S1210, the AP sends an extensible authentication protocol (EAPOL) 1 to the terminal device.
[0399] S1211, the terminal device sends EAPOL2 to the AP.
[0400] S1212: The AP sends EAPOL3 to the terminal device.
[0401] S1213, the terminal device sends EAPOL4 to the AP.
[0402] When the terminal device completes the protocol negotiation with the AP and reconnects to the Wi-Fi, the terminal device can use the recorded IP used when last connecting to the AP to connect to the network, that is, use a static IP connection, and omit the process of obtaining a new IP (such as the DHCP process).
[0403] According to the network connection method provided in the embodiment of the present application, in the scenario where the Wi-Fi subsystem is reset and causes the Wi-Fi disconnection, when the terminal device re-establishes the Wi-Fi connection with the original AP, the previously stored original AP information is directly used to connect to the original AP, thereby omitting operations such as scanning, network selection, and obtaining a newly assigned IP, thereby shortening the Wi-Fi reconnection time and enabling the user to obtain a normal Wi-Fi network in a timely manner.
[0404] In some cases, when the terminal device reconnects to the original AP through Wi-Fi, the original AP may have assigned the IP address used by the terminal device last time to other devices, resulting in the problem that the terminal device cannot use the last IP address. In order to prevent Internet access failure due to the unavailability of the last IP (i.e., static IP), in the network connection method provided in the embodiment of the present application, after connecting using a static IP, an ARP probe can be initiated. If the probe result shows that other interrupted devices occupy the IP address used this time, the DHCP process is re-executed to obtain a new IP.
[0405] For example, Fig.13 FIG. 1 is a schematic flow chart of another network connection method provided in an embodiment of the present application. The execution subject of the process may be a terminal device, and may specifically include the following steps:
[0406] S1301, Wi-Fi chip crashed.
[0407] S1302: Wi-Fi reconnection with the original AP is successful.
[0408] The process of reconnecting the terminal device to the original AP through Wi-Fi can be referred to the introduction in the above embodiment and will not be described again here.
[0409] S1303: Send an ARP REQ broadcast message.
[0410] The ARP REQ broadcast message can also be described as an address resolution protocol (ARP) request broadcast message, which is used to request to obtain the IP address of other devices. Specifically, the ARP REQ broadcast message can be used to request to query whether the IP of other devices is the same as its last IP.
[0411] The terminal device can obtain whether the IP address of other devices is the same as the last IP address of the terminal device by broadcasting the ARP REQ broadcast message.
[0412] S1304: Determine whether there is any device replying to the ARP REP message.
[0413] The ARP REP message is used to indicate the IP of other devices, and specifically, can be used to indicate that the IP of other devices is the same as the last IP of the terminal device.
[0414] In some embodiments, if there is another device (represented as device 1) that is currently using the same IP address as the last IP address of the terminal device, then after device 1 receives the ARP REQ broadcast message broadcast by the terminal device, it can send an ARP REP message to the terminal device. The terminal device can obtain the IP that was last used by other devices based on the received ARP REP message.
[0415] Optionally, in other embodiments, after other devices receive the ARP REQ broadcast message sent by the terminal device, they can send an ARP REP message to the terminal device, and carry the IP indication information they are using in the ARP REP message; after the terminal device obtains the ARP REP message sent by other devices, it can determine whether other devices are using the same IP as the last time it used based on the IP indication information carried by the message.
[0416] If no device replies to the ARP REP message, that is, the judgment result of this step is "No", then step S1305 can be executed, that is, the static IP is used as the IP address of the local end. The static IP here is the IP used by the terminal device last time, and the static IP is stored in the local space of the terminal device. If a device replies to the ARP REP message, that is, the judgment result of this step is "Yes", then step S1306 can be executed:
[0417] S1306, re-execute the DHCP process to obtain a new IP.
[0418] The new IP mentioned here may be an IP different from the IP stored in the terminal device.
[0419] It should be noted that the embodiment of the present application only introduces the process of obtaining IP as the DHCP process, but with the development of the method of obtaining IP, the method of obtaining IP in the embodiment of the present application may also be other methods, and the embodiment of the present application does not limit this.
[0420] According to the network connection method provided in the embodiment of the present application, in the scenario where Wi-Fi disconnection is caused by resetting the Wi-Fi subsystem, after the terminal device completes Wi-Fi reconnection with the original AP, when using a static IP, if the static IP is already occupied by another device, the terminal device executes the process of obtaining a new IP again, thereby shortening the time to complete the Wi-Fi reconnection and ensuring that the terminal device can access the network normally.
[0421] For example, Fig.14 FIG. 1 is a schematic flow chart of another network connection method provided in an embodiment of the present application. The execution subject of the process may be a terminal device, and may specifically include the following steps:
[0422] S1401: When the Wi-Fi connection with the first AP is disconnected due to a reset of the Wi-Fi subsystem, obtain cause indication information corresponding to the Wi-Fi disconnection, where the cause indication information is used to indicate that a cause of the Wi-Fi disconnection is a reset of the Wi-Fi subsystem.
[0423] S1402: In response to the reason indication information, reconnect to the first AP according to pre-stored first information, where the first information includes connection information and capability information corresponding to the first AP.
[0424] In some embodiments, the first AP may correspond to the original AP in this article, specifically, the AP with which the Wi-Fi subsystem of the terminal device establishes a Wi-Fi connection with the terminal device when the Wi-Fi subsystem of the terminal device does not crash. The first AP may be a router.
[0425] In a possible implementation, resetting the Wi-Fi subsystem may also be described as restarting the Wi-Fi chip, which may specifically refer to reloading the Wi-Fi chip after it crashes.
[0426] In some embodiments, the connection information includes a first channel, where the first channel is the channel on which the terminal device is connected to the first AP before the Wi-Fi subsystem is reset; reconnecting to the first AP according to the pre-stored first information specifically includes: sending a probe request message on the first channel according to the connection information, where the probe request message is used to query whether there is an AP on the first channel; receiving a probe response message sent by the first AP through the first channel, where the probe response message is used to indicate that the first AP exists on the first channel; and associating with the first AP on the first channel according to the probe response message.
[0427] In a possible implementation, the first channel may correspond to the original channel in this document, specifically referring to the channel on which the Wi-Fi subsystem of the terminal device is connected to the original AP through Wi-Fi when the Wi-Fi subsystem does not crash.
[0428] In a possible implementation, the process of the terminal device sending a probe request message on the first channel and receiving a probe response message through the first channel may be a scanning phase in the Wi-Fi reconnection process. In the scanning phase, the terminal device only scans on the first channel and no longer performs full channel scanning.
[0429] According to the network connection method provided by the present implementation, in the scenario where Wi-Fi disconnection is caused by resetting the Wi-Fi subsystem, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, thereby shortening the Wi-Fi reconnection time and reducing the adverse effects of Wi-Fi disconnection on the user's Internet access.
[0430] In some embodiments, the connection information also includes a static IP, and the static IP is the IP used by the terminal device to access the network before the Wi-Fi subsystem is reset; the method also includes: using the static IP to access the network, wherein the static IP is the IP in the first information pre-stored by the terminal device, and after the Wi-Fi subsystem is reset, the terminal device omits the process of initiating a process to obtain the static IP from the first AP.
[0431] According to the network connection method provided by the present implementation, in the scenario of Wi-Fi disconnection caused by resetting the Wi-Fi subsystem, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, and omits the process of obtaining an IP, and uses the original IP to enter the network, which can shorten the time for the user to use Wi-Fi normally again and reduce the adverse impact of Wi-Fi disconnection on the user's Internet access.
[0432] In some embodiments, the method further includes: omitting the operation of sending the probe response message on other channels, where the other channels are channels other than the first channel.
[0433] In some embodiments, the terminal device includes a user experience UX module, and the method further includes: when the Wi-Fi connection with the first AP is disconnected due to a reset of the wireless fidelity Wi-Fi subsystem, the UX module continues to display the Wi-Fi signal indicator in the interface.
[0434] In some embodiments, when the Wi-Fi with the first AP is disconnected due to a reset of the Wireless Fidelity Wi-Fi subsystem, continuing to display the Wi-Fi signal indicator in the interface specifically includes: when the Wi-Fi with the first AP is disconnected due to a reset of the Wireless Fidelity Wi-Fi subsystem, acquiring a disconnection reason value of the Wi-Fi disconnection, the disconnection reason value being used to indicate that a reason for the Wi-Fi disconnection is the reset of the Wi-Fi subsystem; and intercepting the disconnection reason value so that the UX module continues to display the Wi-Fi signal indicator in the interface.
[0435] In some embodiments, the method also includes: sending an IP query broadcast message, wherein the IP query broadcast message is used to query whether there is an IP currently used by other devices as the static IP; when no IP query response message is received from other devices, using the static IP to access the network, and the IP query response message is used to indicate that the IP currently used is the static IP.
[0436] In some embodiments, the method also includes: when receiving an IP query response message sent by the first device, initiating an IP allocation request process, the IP allocation request process is used to request the first AP to allocate a new IP to the terminal device, the new IP is different from the static IP, and the first device belongs to the other device.
[0437] In some embodiments, the terminal device includes a Wi-Fi chip, a Wi-Fi driver, a Wi-Fi service module and a UX module; when the Wi-Fi connection with the first AP is disconnected due to a reset of the wireless fidelity Wi-Fi subsystem, reconnecting to the first AP according to the pre-stored first information specifically includes: when the Wi-Fi chip crashes, sending a Wi-Fi subsystem crash notification message to the Wi-Fi driver; the Wi-Fi driver sending a Wi-Fi connection disconnection indication message to the Wi-Fi service module, the Wi-Fi connection disconnection indication message is used to indicate the Wi-Fi disconnection with the first AP, and the Wi-Fi connection disconnection indication message carries a cause value corresponding to the Wi-Fi disconnection; in response to the Wi-Fi connection disconnection indication message The Wi-Fi driver sends an original channel scanning indication message to the Wi-Fi driver, where the original channel scanning indication message is used to instruct the Wi-Fi chip to scan on a first channel and omit the operation of sending the probe response message on other channels, where the other channels are channels other than the first channel; the Wi-Fi driver sends the original channel scanning indication message to the Wi-Fi chip; in response to the original channel scanning indication message, the Wi-Fi chip sends a probe request message on the first channel and receives a probe response message sent by the first AP through the first channel, where the probe request message is used to query whether there is an AP on the first channel, and the probe response message is used to indicate that the first AP exists on the first channel.
[0438] In some embodiments, the method further includes: the Wi-Fi chip sending a scan result feedback message to the Wi-Fi driver, where the scan result feedback message is used to indicate that the first AP is scanned on the first channel; and the Wi-Fi driver sending the scan result feedback message to the Wi-Fi service module.
[0439] In some embodiments, the method further includes: the Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi driver, the Wi-Fi connection request message is used to indicate reconnection to the first AP; the Wi-Fi driver sends the Wi-Fi connection request message to the Wi-Fi chip; in response to the Wi-Fi connection request message, the Wi-Fi chip reconnects to the first AP.
[0440] In some embodiments, the method further includes: when the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP to access the network, and the static IP is the IP used by the terminal device to access the network before the Wi-Fi subsystem is reset.
[0441] In some embodiments, when the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses the static IP to access the network, specifically including: when the Wi-Fi chip successfully reconnects to the first AP for Wi-Fi, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver, the Wi-Fi connection success message is used to indicate that the terminal device has successfully reconnected to the first AP; the Wi-Fi driver sends the Wi-Fi connection success message to the Wi-Fi service module; in response to the Wi-Fi connection success message, the Wi-Fi service module sends an original IP indication message to the Wi-Fi driver, the original IP indication message is used to indicate the use of the static IP to access the network, and omits the process in which the terminal device initiates the acquisition of the static IP to the first AP after the Wi-Fi subsystem is reset; the Wi-Fi driver sends the original IP indication message to the Wi-Fi chip; in response to the original IP indication message, the Wi-Fi chip uses the static IP to access the network.
[0442] In some embodiments, the method further includes: the Wi-Fi service module intercepting the disconnection reason value so that the UX module continues to display the Wi-Fi signal indicator in the interface.
[0443] According to the network connection method provided in the embodiment of the present application, in the scenario of Wi-Fi disconnection caused by Wi-Fi subsystem reset, during the Wi-Fi reconnection process, the terminal device only scans on the original channel and connects to the original AP, and no longer performs full channel scanning, and omits the process of obtaining IP, and uses the original IP to enter the network, which can shorten the time for users to use Wi-Fi normally again and reduce the adverse effects of Wi-Fi disconnection on users' Internet access. In addition, when the terminal device obtains that the reason for the Wi-Fi disconnection is the reset of the Wi-Fi subsystem, it can intercept the Wi-Fi disconnection event (such as the reason value of the Wi-Fi disconnection) to the UX of the terminal device, and / or intercept the Wi-Fi disconnection event (such as the reason value of the Wi-Fi disconnection) to the CS module of the terminal device, so that the user does not perceive the Wi-Fi disconnection, and the terminal device is no longer connected to other types of networks such as cellular networks during Wi-Fi reconnection, so that the user can improve the use experience of Wi-Fi.
[0444] Based on the same technical concept, an embodiment of the present application also provides a terminal device, including a processor; a memory; the memory stores a computer program, and the computer program includes instructions. When the instructions are executed by the processor, the terminal device executes one or more steps of any of the above methods.
[0445] Based on the same technical concept, an embodiment of the present application also provides a chip system, which includes: a processing circuit, a receiving pin and a transmitting pin; wherein the receiving pin, the transmitting pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes one or more steps of any one of the above methods to control the receiving pin to receive a signal and control the transmitting pin to send a signal.
[0446] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable program instructions. When the computer-executable program instructions are executed on a computer, the computer or processor executes one or more steps in any of the above methods.
[0447] Based on the same technical concept, an embodiment of the present application also provides a computer program product comprising instructions, wherein the computer program product includes computer program code. When the computer program code runs on a computer, the computer or processor executes one or more steps in any of the above methods.
[0448] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
[0449] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0450] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. A network connection method, characterized in that: Applied to terminal equipment, including: When the Wi-Fi connection with the first AP is disconnected due to a reset of the Wireless Fidelity Wi-Fi subsystem, acquiring cause indication information corresponding to the Wi-Fi disconnection, where the cause indication information is used to indicate that the cause of the Wi-Fi disconnection is the reset of the Wi-Fi subsystem; In response to the cause indication information, reconnecting to the first AP according to pre-stored first information, where the first information includes connection information and capability information corresponding to the first AP.
2. The method according to claim 1, characterized in that The connection information includes a first channel, where the first channel is a channel on which the terminal device is connected to the first AP before the Wi-Fi subsystem is reset; The reconnecting to the first AP according to the pre-stored first information specifically includes: Sending a detection request message on the first channel according to the connection information, where the detection request message is used to query whether there is an AP on the first channel; receiving a detection response message sent by the first AP through the first channel, where the detection response message is used to indicate that the first AP exists on the first channel; According to the probe response message, associating with the first AP on the first channel.
3. The method according to claim 1 or 2, characterized in that: The connection information also includes a static IP, where the static IP is the IP used by the terminal device to access the network before the Wi-Fi subsystem is reset; and the method further includes: Use the static IP to access the network, wherein the static IP is the IP in the first information pre-stored by the terminal device, and after the Wi-Fi subsystem is reset, the terminal device omits the process of initiating the acquisition of the static IP from the first AP.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: The operation of sending the detection response message on other channels is omitted, and the other channels are channels other than the first channel.
5. The method according to any one of claims 1 to 4, characterized in that The terminal device includes a user experience UX module, and the method further includes: When the Wi-Fi connection with the first AP is disconnected due to the reset of the Wireless Fidelity Wi-Fi subsystem, the UX module continues to display the Wi-Fi signal indicator in the interface.
6. The method according to claim 5, characterized in that When the Wi-Fi connection with the first AP is disconnected due to the reset of the wireless fidelity Wi-Fi subsystem, continuing to display the Wi-Fi signal indicator in the interface specifically includes: When the Wi-Fi connection with the first AP is disconnected due to a reset of the Wireless Fidelity Wi-Fi subsystem, obtaining a disconnection reason value of the Wi-Fi disconnection, where the disconnection reason value is used to indicate that a reason for the Wi-Fi disconnection is the reset of the Wi-Fi subsystem; The disconnection reason value is intercepted so that the UX module continues to display the Wi-Fi signal indicator in the interface.
7. The method according to claim 3, characterized in that The method further comprises: Send an IP query broadcast message, where the IP query broadcast message is used to query whether there is an IP currently used by other devices that is the static IP; When no IP query response message sent by other devices is received, the static IP is used to access the network, and the IP query response message is used to indicate that the currently used IP is the static IP.
8. The method according to claim 7, characterized in that The method further comprises: When receiving the IP query response message sent by the first device, an IP allocation request process is initiated, wherein the IP allocation request process is used to request the first AP to allocate a new IP to the terminal device, wherein the new IP is different from the static IP, and the first device belongs to the other device.
9. The method according to any one of claims 1 to 8, characterized in that The terminal device includes a Wi-Fi chip, a Wi-Fi driver, a Wi-Fi service module and a UX module, and the method further includes: When the Wi-Fi chip crashes, sending a Wi-Fi subsystem crash notification message to the Wi-Fi driver; The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module, where the Wi-Fi connection disconnection indication message is used to indicate a Wi-Fi disconnection with the first AP, and the Wi-Fi connection disconnection indication message carries a reason value corresponding to the Wi-Fi disconnection; In response to the Wi-Fi connection disconnection indication message, the Wi-Fi service module sends an original channel scan indication message to the Wi-Fi driver, where the original channel scan indication message is used to instruct the Wi-Fi chip to scan on a first channel and omit an operation of sending the detection response message on other channels, where the other channels are channels other than the first channel; The Wi-Fi driver sends the original channel scan indication message to the Wi-Fi chip; In response to the original channel scanning indication message, the Wi-Fi chip sends a probe request message on the first channel, and receives a probe response message sent by the first AP through the first channel, the probe request message being used to query whether an AP exists on the first channel, and the probe response message being used to indicate that the first AP exists on the first channel.
10. The method according to claim 9, characterized in that The method further comprises: The Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver, where the scan result feedback message is used to indicate that the first AP is scanned on the first channel; The Wi-Fi driver sends the scan result feedback message to the Wi-Fi service module.
11. The method according to claim 10, characterized in that The method further comprises: The Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi driver, where the Wi-Fi connection request message is used to instruct reconnection to the first AP; The Wi-Fi driver sends the Wi-Fi connection request message to the Wi-Fi chip; In response to the Wi-Fi connection request message, the Wi-Fi chip reconnects to the first AP.
12. The method according to claim 11, characterized in that The method further comprises: When the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP to access the network, where the static IP is the IP used by the terminal device to access the network before the Wi-Fi subsystem is reset.
13. The method according to claim 12, characterized in that When the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP to access a network, specifically including: When the Wi-Fi chip successfully reconnects to the first AP for Wi-Fi, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver, where the Wi-Fi connection success message is used to indicate that the terminal device is successfully reconnected to the first AP; The Wi-Fi driver sends the Wi-Fi connection success message to the Wi-Fi service module; In response to the Wi-Fi connection success message, the Wi-Fi service module sends an original IP indication message to the Wi-Fi driver, where the original IP indication message is used to indicate the use of the static IP to access the network, and omits the process of the terminal device initiating the acquisition of the static IP from the first AP after the Wi-Fi subsystem is reset; The Wi-Fi driver sends the original IP indication message to the Wi-Fi chip; In response to the original IP indication message, the Wi-Fi chip uses the static IP to access the network.
14. The method according to any one of claims 9 to 13, characterized in that: The method further comprises: The Wi-Fi service module intercepts the disconnection reason value so that the UX module continues to display the Wi-Fi signal indicator in the interface.
15. A terminal device, characterized in that: include: processor; Memory; The memory stores a computer program, wherein the computer program includes instructions, and when the instructions are executed by the processor, the terminal device executes the method according to any one of claims 1 to 14.
16. A chip system, characterized in that: The chip system includes a processing circuit, a receiving pin and a transmitting pin; wherein the receiving pin, the transmitting pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method described in any one of claims 1 to 14 to control the receiving pin to receive a signal and control the transmitting pin to send a signal.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable program instructions, which, when executed on a computer, enable the computer to perform the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Connection control method, connection controller and electronic equipment
CN104244374A
Access method for wireless network and mobile terminal
CN106507289A
Channel scanning method and mobile terminal
CN106792993A
Accelerated network reconnect using previous connection parameters
CN109121183A
WIFI connection method and device, storage medium and mobile terminal
CN113613310A
Cited By
Wireless network repairing method and device, storage medium and electronic equipment
CN120897212A
