Network connection methods and terminal equipment
By enabling terminal devices to scan and reconnect on the original channel during Wi-Fi subsystem reset scenarios, the need for full channel scanning and IP reallocation is eliminated, thus solving the problem of excessively long Wi-Fi disconnection time and improving user experience.
Patent Information
- Application Number
- CN202410170487.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-02-05
AI Technical Summary
When Wi-Fi connection drops due to a Wi-Fi subsystem reset, existing technologies require full-channel scanning and IP reallocation, resulting in excessively long reconnection times and impacting user experience.
When a Wi-Fi disconnection occurs due to a Wi-Fi subsystem reset, the terminal device instructs the Wi-Fi chip to scan the original channel and attempt to reconnect to the original AP, eliminating the need for full channel scanning and IP reallocation. At the same time, it intercepts the Wi-Fi disconnection event, maintaining a stable user interface.
It shortens Wi-Fi reconnection time, reduces users' perception of Wi-Fi disconnection, and improves the network user experience.
Smart Images

Figure CN119255408B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method and terminal device for network connection. Background Technology
[0002] When mobile devices and other terminal devices connect to a wireless fidelity (Wi-Fi) network, they typically need to go through a scanning, authentication, and association process, which usually takes several seconds.
[0003] In practical applications, the stability of Wi-Fi networks is often affected by various factors, making them prone to disconnection. In some cases, when the Wi-Fi network is disconnected, the terminal device will reconnect through the Wi-Fi re-establishment process. However, this process is time-consuming, which can severely impact the user's network experience and lead to a poor user experience. Summary of the Invention
[0004] This application provides a network connection method that, in the event of a Wi-Fi disconnection caused by a Wi-Fi subsystem reset, reconnects to the original access point (AP) according to the original information, thereby solving the problem of excessively long Wi-Fi recovery time.
[0005] The network connection method provided in this application embodiment, in the scenario of Wi-Fi disconnection caused by Wi-Fi subsystem reset (or Wi-Fi chip problem), the terminal device will instruct the Wi-Fi chip to scan on the original channel and attempt to re-establish a connection with the original AP (or Wi-Fi AP), instead of performing a full channel scan; and / or, the terminal device will instruct the Wi-Fi chip to use the IP address 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 address to the terminal device during the reconnection process. In addition, in the scenario of the Wi-Fi subsystem being reset, the terminal device can also intercept Wi-Fi disconnection events (or Wi-Fi disconnection reason values) to the user experience (UX) interface, and / or intercept Wi-Fi disconnection events (or Wi-Fi disconnection reason values) to the circuit-switch (CS) module used to control the switching between Wi-Fi and cellular networks. This allows the user to be unaware of the current Wi-Fi disconnection, or prevents the terminal device from immediately switching to the cellular network when Wi-Fi is disconnected, thus ensuring that the user has a better experience with the Wi-Fi network.
[0006] Specifically, in a first aspect, a network connectivity method is provided, applied to a terminal device, comprising:
[0007] When the Wi-Fi connection with the first AP is lost due to a reset of the Wi-Fi subsystem, the cause indication information corresponding to the Wi-Fi disconnection is obtained. 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, the first AP is reconnected according to the pre-stored first information, which includes the connection information and capability information corresponding to the first AP.
[0009] In one possible implementation, the first AP can correspond to the original AP in this document, specifically referring to the AP that establishes a Wi-Fi connection with the terminal device when the terminal device's Wi-Fi subsystem is not crashing. This first AP can be a router.
[0010] In one possible implementation, a Wi-Fi subsystem reset can also be described as a Wi-Fi chip reboot, specifically referring to a reload after a Wi-Fi chip crash.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the connection information includes a first channel, which is the channel on which the terminal device connects to the first AP before the Wi-Fi subsystem is reset;
[0012] The step of reconnecting to the first AP based on the pre-stored first information specifically includes:
[0013] Based on the connection information, a probe request message is sent on the first channel, the probe request message being used to query whether an AP exists on the first channel;
[0014] Receive a probe response message sent by the first AP through the first channel, the probe response message being used to indicate the presence of the first AP on the first channel;
[0015] Based on the probe response message, associate with the first AP on the first channel.
[0016] In one possible implementation, the first channel can correspond to the original channel in this paper, specifically the channel on which the terminal device's Wi-Fi subsystem connects to the original AP when it is not in a crash.
[0017] In one 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 can be considered a scanning phase in the Wi-Fi reconnection process. During this scanning phase, the terminal device only scans on the first channel and does not perform a full-channel scan.
[0018] According to the network connection method provided in this implementation, 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 with the original AP, instead of performing a full channel scan, thereby shortening the Wi-Fi reconnection time and reducing the adverse impact of Wi-Fi disconnection on users' Internet access.
[0019] In conjunction with the first aspect, in some implementations of the first aspect, the connection information further includes a static IP address, which is the IP address used by the terminal device to access the network before the Wi-Fi subsystem is reset; the method further includes:
[0020] The terminal device accesses the network using the static IP address, where the static IP address is the IP address pre-stored in the first information. After the Wi-Fi subsystem is reset, the terminal device skips the process of obtaining the static IP address from the first access point.
[0021] In one possible implementation, a static IP, also known as the original IP, refers to the IP address used by the terminal device for network services before the Wi-Fi connection was lost.
[0022] According to the network connection method provided in this implementation, 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 with the original AP, instead of performing a full channel scan, and skips the process of obtaining an IP address, using the original IP address to enter the network. This 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.
[0023] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes:
[0024] The operation of sending the probe response message on other channels is omitted, where other channels are channels other than the first channel.
[0025] In conjunction 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 lost due to a reset of the Wi-Fi subsystem, the UX module continues to display the Wi-Fi signal indicator on the interface.
[0027] In conjunction with the first aspect, in certain implementations of the first aspect, the step of continuing to display the Wi-Fi signal indicator on the interface when the Wi-Fi connection with the first AP is lost due to a reset of the Wi-Fi subsystem specifically includes:
[0028] When the Wi-Fi connection with the first AP is disconnected due to a reset of the Wi-Fi subsystem, the disconnection cause value is obtained. The disconnection cause value is used to indicate that the reason for the Wi-Fi disconnection is the reset of the Wi-Fi subsystem.
[0029] The disconnection reason value is intercepted, allowing the UX module to continue displaying the Wi-Fi signal indicator on the interface.
[0030] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes:
[0031] Send an IP query broadcast message, the IP query broadcast message being used to query whether there are other devices currently using the static IP;
[0032] When no IP query response message is received from other devices, the static IP is used to access the network. The IP query response message is used to indicate that the currently used IP is the static IP.
[0033] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes:
[0034] When an IP query response message is received from the first device, an IP allocation request process is initiated. 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 devices.
[0035] In conjunction 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 lost due to a reset of the Wi-Fi subsystem, the reconnection to the first AP is based on pre-stored first information, specifically including:
[0037] When the Wi-Fi chip crashes, a Wi-Fi subsystem crash notification message is sent to the Wi-Fi driver;
[0038] The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module. The Wi-Fi connection disconnection indication message is used to indicate that the Wi-Fi connection with the first AP has been disconnected, and the Wi-Fi connection disconnection indication message carries the 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. The original channel scan indication message is used to instruct the Wi-Fi chip to scan on the first channel, and eliminates the operation of sending the probe response message on other channels, which 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 scan 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 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.
[0042] In conjunction 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, the scan result feedback message indicating that the first AP was detected on the first channel;
[0044] The Wi-Fi driver sends the scan result feedback message to the Wi-Fi service module.
[0045] In conjunction 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, and 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 conjunction 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 address to access the network. The static IP address is the IP address used by the terminal device to access the network before the Wi-Fi subsystem is reset.
[0051] In conjunction with the first aspect, in certain implementations of the first aspect, when the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP address to access the network, specifically including:
[0052] When the Wi-Fi chip successfully reconnects to the first AP and establishes 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.
[0053] The Wi-Fi driver sends a 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. The original IP indication message is used to indicate that the static IP is used to access the network, and eliminates the need for the terminal device to initiate the process of obtaining 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 a static IP to access the network.
[0057] In conjunction 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, allowing the UX module to continue displaying the Wi-Fi signal indicator on the interface.
[0059] Secondly, a terminal device is provided, including:
[0060] processor;
[0061] Memory;
[0062] The memory stores a computer program, which includes instructions that, when executed by the processor, cause the terminal device to perform the method as described in any of the first or second aspects above.
[0063] Thirdly, a chip system is provided, the chip system 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 first or second aspects above to control the receiving pin to receive signals and control the transmitting pin to transmit signals.
[0064] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable program instructions, which, when executed on a computer, cause the computer to perform the method as described in any one of the first or second aspects above.
[0065] Fifthly, a computer program product is provided, the computer program product including computer program code, which, when run on a computer, causes the computer to perform the method as described in any one of the first or second aspects above. Attached Figure Description
[0066] Figure 1 This is a schematic flowchart illustrating a Wi-Fi reconnection method provided in an embodiment of this application.
[0067] Figure 2A This is a schematic flowchart illustrating a Wi-Fi reconnection scenario in a Wi-Fi subsystem reset scenario, provided as an embodiment of this application.
[0068] Figure 2B This is a schematic flowchart illustrating how a terminal device obtains an IP address via DHCP, as provided in an embodiment of this application.
[0069] Figure 3 This is a schematic diagram of the system architecture applicable to a network connection method provided in an embodiment of this application.
[0070] Figure 4 This is a schematic structural diagram of a terminal device 100 provided in an embodiment of this application.
[0071] Figure 5 This is a software structure block diagram of a terminal device 100 provided in an embodiment of this application.
[0072] Figure 6 This is a schematic flowchart illustrating a network connection method provided in an embodiment of this application.
[0073] Figure 7 A schematic flowchart illustrating another network connection method provided in an embodiment of this application.
[0074] Figure 8 This is a schematic flowchart illustrating another network connection method provided in an embodiment of this application.
[0075] Figure 9 This is a schematic flowchart illustrating another network connection method provided in an embodiment of this application.
[0076] Figure 10 This is a schematic flowchart illustrating another network connection method provided in an embodiment of this application.
[0077] Figure 11 This is a schematic flowchart illustrating another network connection method provided in an embodiment of this application.
[0078] Figure 12 This is a schematic flowchart illustrating another network connection method provided in an embodiment of this application.
[0079] Figure 13 This is a schematic flowchart illustrating another network connection method provided in an embodiment of this application.
[0080] Figure 14 This is a schematic flowchart illustrating another network connection method provided in an embodiment of this application. Detailed Implementation
[0081] It should be noted that the terminology used in the implementation section of the embodiments of this application is only used to explain the specific embodiments of this application and is not intended to limit this application. In the description of the embodiments of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document is merely a description of the association relationship of related obstacles, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. In addition, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, "at least one" or "one or more" means one, two or more.
[0082] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0083] References to "one embodiment" or "some embodiments" as used in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0084] As described in the background section, current mobile phones, tablets, and other terminal products experience Wi-Fi disconnections during communication protocol-related services due to inherent software and hardware defects, particularly in scenarios involving calls, video calls, and application experiences. The primary cause of this is a Wi-Fi protocol subsystem reset. Specifically, a terminal device may include a main chip and a Wi-Fi chip. The main chip, for example, can be a system-on-a-chip (SoC) used to handle overall device operations; the Wi-Fi chip can be independent of the main chip and is used to handle Wi-Fi-related services. In this embodiment, a Wi-Fi protocol subsystem reset (or Wi-Fi subsystem reset) refers to a Wi-Fi chip crashing and then being reloaded (or restarted).
[0085] Since the Wi-Fi chip and the main chip are two independent chips, a Wi-Fi chip failure will not affect the normal operation of the main chip. This means the terminal device's overall service will not be affected by the Wi-Fi subsystem reset; only the Wi-Fi service will be interrupted. After the Wi-Fi chip resets and restarts, the AP information stored in that 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 approximately 2.5-6 seconds). This can easily give users a noticeable Wi-Fi interruption experience, leading to a poor network usage experience.
[0086] In view of this, embodiments of this application provide a network connection method. In the scenario where a Wi-Fi subsystem reset causes a Wi-Fi disconnection, when the terminal device reconnects to Wi-Fi, the Wi-Fi chip is instructed to scan on the original channel and connect to the original AP, instead of performing a full channel scan and / or reconnecting to the original AP using the original Internet Protocol (IP) address, without needing to obtain a dynamically assigned IP address from the server via DHCP. This shortens the time for the terminal device to reconnect to the original AP and restores the Wi-Fi network as quickly as possible. Furthermore, when a terminal device detects that the Wi-Fi disconnection is due to a Wi-Fi subsystem reset, it can intercept the Wi-Fi disconnection event (such as the cause value) from the terminal device's UX and / or from the terminal device's CS module. This ensures that the user is unaware of the Wi-Fi disconnection and prevents the terminal device from connecting to other types of networks, such as cellular networks, during the Wi-Fi reconnection period. This guarantees that the user can continue to use the Wi-Fi network normally after a short period of time, thus improving the user's Wi-Fi experience.
[0087] like Figure 1 As shown, when a Wi-Fi connection is lost, reconnecting via the normal (or complete) Wi-Fi connection process typically takes about 2.5-6 seconds. From the user's perspective, the Wi-Fi signal indicator (such as...) in the terminal device's (taking a mobile phone as an example) UX interface... Figure 1 The 01 in the Wi-Fi indicator will reappear approximately 2.5-6 seconds after disappearing. Because of this relatively long time between the disappearance and reappearance of the Wi-Fi signal indicator, users can clearly perceive the Wi-Fi network disconnection. If the user's activity at this time has high Wi-Fi network requirements (such as in conferencing or video conferencing scenarios), then a prolonged Wi-Fi disconnection will affect the normal operation of that activity.
[0088] For example, such as Figure 2A The diagram shown is a schematic flowchart illustrating a Wi-Fi reconnection scenario in a Wi-Fi subsystem reset scenario, according to an embodiment of this application. The process may include interactions between various modules within the terminal device, and specifically may include the following steps:
[0089] S201, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to the Wi-Fi driver.
[0090] The Wi-Fi subsystem crash notification message can be used to indicate a Wi-Fi subsystem crash. A Wi-Fi subsystem crash can also be described as a Wi-Fi chip crash. Specifically, a Wi-Fi subsystem crash can refer to a situation where the Wi-Fi subsystem can still be reset, that is, after the crash, the Wi-Fi chip can restart (such as automatically restarting).
[0091] In some embodiments, the Wi-Fi subsystem crash notification message may also carry indication information of the cause of the Wi-Fi subsystem crash, such as a crash cause value or a crash indicator, to indicate the specific cause (or crash reason) of the Wi-Fi subsystem crash. For example, there may be a variety of reasons that cause the Wi-Fi subsystem to crash, such as: software bug, abnormal register state, or software unrecoverable, etc., and this application embodiment does not limit this.
[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 a Wi-Fi subsystem crash notification message, the Wi-Fi driver may send a Wi-Fi connection disconnected indication message to the Wi-Fi HAL module in response to the message.
[0094] It is worth noting that the Wi-Fi connection 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 connection disconnection indication message may only indicate the Wi-Fi connection disconnection event to the Wi-Fi HAL module, but will not indicate that the Wi-Fi disconnection was caused by a Wi-Fi chip failure.
[0095] S203, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module.
[0096] S204, the Wi-Fi service module sends a Wi-Fi connection disconnection indication message to the UX module.
[0097] In this embodiment, the UX module can be used to control the display on the terminal device interface. When the UX module receives a Wi-Fi connection disconnection indication message, it can control the Wi-Fi signal indicator on the terminal device interface 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 embodiments of this application can be integrated into the main chip (SOC). When the Wi-Fi chip fails, the main chip can continue to operate normally, so that other services of the terminal device other than Wi-Fi service can operate normally.
[0099] It should also be noted that when the Wi-Fi chip crashes (such as during the transmission of Wi-Fi subsystem crash notification messages and Wi-Fi connection disconnection indication messages), the Wi-Fi driver can execute step S205, that is, restart the Wi-Fi chip.
[0100] S206, the Wi-Fi service module sends a full-channel scan instruction message to the Wi-Fi HAL module.
[0101] Full channel scanning refers to scanning each channel permitted by current regulations. Currently, there are 26 channels available in China, so the full channel scan instruction message can be used to instruct the Wi-Fi chip to scan each of these 26 channels to obtain the access points (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 perform a scanning process in response to a full-channel scan instruction message. Specifically, the Wi-Fi chip can send probe requests on each channel, and after receiving probe response frames from APs on one or more channels, it packages the received AP feedback information and sends it to the Wi-Fi driver via a scan result feedback message. The AP probe response frames may include the protocol capabilities supported by the AP, the Wi-Fi standard (e.g., whether it supports Wi-Fi 4 or Wi-Fi 6), encryption methods, 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), the 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), and the encryption method 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 steps S206 to S211 correspond to a scanning process on the terminal device side. Because the Wi-Fi chip scans each channel and waits for feedback from multiple access points (APs) on various channels during this scanning process, it is relatively time-consuming, typically taking at least 1.5-2.5 seconds. This time consumption is one of the main reasons for the long overall Wi-Fi reconnection process.
[0111] S212, the Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi HAL module.
[0112] The Wi-Fi connect request message is used to request the establishment of a Wi-Fi connection with the AP. In step S213, the Wi-Fi HAL module sends the Wi-Fi connect 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) indicates that the Wi-Fi connection has been successfully established.
[0116] In some embodiments, in response to a Wi-Fi connection request message, the Wi-Fi chip can request to connect to an Access Point (AP) on a specific channel. The Wi-Fi connection process may include authentication (auth), association (assoc), and a four-way handshake to establish a link at the MAC layer. In this case, the AP that successfully establishes a Wi-Fi connection with the terminal device is different from the original AP (i.e., the AP the terminal device was connected to 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 an illustrative process. In practical applications, the Wi-Fi reconnection process may specifically include multiple rounds of information exchange between the terminal device and the original access point (AP). This exchange can be found in existing processes, and will not be detailed in the embodiments of this application. The Wi-Fi reconnection process in the following embodiments is similar to... Figure 2A The implementation examples are similar and are also illustrative processes, so no further special explanation will be given.
[0120] S218, execute the DHCP procedure.
[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 message. This DHCP process is used to reacquire an IP address to enable normal internet access. For example, the process may specifically include the following stages: (1) a discovery stage, i.e., the stage where the DHCP client searches for a DHCP server; (2) a provision stage, i.e., the stage where the DHCP server provides an IP address; (3) a selection stage, i.e., the stage where the DHCP client selects an IP address provided by a DHCP server; and (4) a confirmation stage, i.e., the stage where the DHCP server confirms the provided IP address, etc. The DHCP client may correspond to the terminal device in the embodiments of this application.
[0122] The DHCP process in this step can be initiated by the Wi-Fi service module, and completed collaboratively by the protocol stack, Wi-Fi driver, and Wi-Fi chip. For example, such as... 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 can reside in the kernel layer. This IP address allocation request message can be used to request a DHCP server to assign 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] Once the Wi-Fi chip receives the IP allocation request message, it can 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 indicates that the IP address allocation for this terminal device has been completed. This message may carry the IP address assigned to the terminal device by the DHCP server.
[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 exchange between the terminal device and the DHCP server, therefore the DHCP process is relatively time-consuming, typically taking at least 0.5-3 seconds. This time consumption is 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, it can obtain the IP address assigned to the terminal device based on the message (the IP address relative to the IP address before the Wi-Fi disconnection; the assigned IP address may be a new IP address). Then, the Wi-Fi service module can broadcast the new IP address to the terminal device's application (APP), enabling the APP to access the internet using this new IP address.
[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 indicates that a Wi-Fi connection has been successfully established.
[0136] In some embodiments, the UX module may, in response to the Wi-Fi connection indication message, control the display screen of the terminal device to redisplay the Wi-Fi signal indicator.
[0137] Because the full-channel scanning process and DHCP procedure are time-consuming, therefore, Figure 2AIn the Wi-Fi reconnection scheme described in this embodiment, the user will clearly perceive the Wi-Fi disconnection. Furthermore, since the Wi-Fi service module notifies the UX module of the corresponding events after Wi-Fi disconnection and reconnection, the Wi-Fi signal indicator on the terminal device's display disappears and reappears with each disconnection and reconnection, allowing the user to more readily perceive Wi-Fi network instability. However, in cases where Wi-Fi disconnection is caused by a Wi-Fi subsystem reset, the short-term disconnection often does not affect the user's normal internet access (e.g., in scenarios like watching videos, where videos are typically pre-buffered). Therefore, the disconnection is always reflected in the Wi-Fi signal indicator, only impacting the user experience.
[0138] Combination Figure 2A The process illustrated in the embodiments reveals the main reasons for the excessively long Wi-Fi reconnection time and poor user experience. 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 embodiments below of this application mainly improves the full-channel scanning process and DHCP process during Wi-Fi reconnection, as well as the display of the Wi-Fi signal indicator.
[0139] For example, such as Figure 3 The diagram shown illustrates a system architecture applicable to a network connection method according to an embodiment of this application. This 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 may be various types of electronic devices, such as: smartphones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), or dedicated voice calling devices, etc. This application embodiment does not impose any restrictions on the specific type of the terminal device 100.
[0141] In some embodiments, AP 200 may be, for example, a router (or hotspot). Terminal device 100 and AP 200 can connect via Wi-Fi, and terminal device 100 can access the Internet through AP 200.
[0142] For example, such as Figure 4 The diagram shown is a schematic structural diagram of a terminal device 100 provided in an embodiment of this application.
[0143] 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, a headphone jack 170D, a sensor module 180, buttons 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, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0144] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components 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 antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0146] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0147] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0148] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates 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 processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0149] The wireless communication module 160 can provide solutions for wireless communication applications on the terminal device 100, 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), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0150] In some embodiments, antenna 1 of terminal device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling terminal device 100 to communicate with networks and other devices via 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0151] The terminal device 100 implements display functions through a GPU, a display screen 194, and an application processor. The display screen 194 is used to display images, videos, etc.
[0152] Terminal device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0153] A digital signal processor (DSP) is used to process digital signals, including digital image signals and other digital signals. For example, when terminal device 100 selects a frequency, the DSP performs Fourier transforms on the frequency energy. A video codec is used to compress or decompress digital video. An NPU (Neural Processing Unit) is a neural network (NN) computing processor that, by borrowing from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, rapidly processes input information and can continuously learn on its own.
[0154] For example, the software system of terminal device 100 may adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the Android system, which includes a layered architecture, as an example to illustrate the software structure of terminal device 100. Figure 5 This is a system architecture diagram of a terminal device 100 applicable to the solution of this application, provided by an embodiment of this application. The system architecture may include several layers of Android system software divided based on roles and division of labor, and these layers communicate with each other through software interfaces. Furthermore, the system architecture may also include a hardware abstraction layer (HAL) and a hardware layer for the terminal device 100. 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: application layer, application framework layer, Android runtime, system libraries, kernel layer, hardware abstraction layer (HAL), and hardware layer. Furthermore, this system architecture may also include a Wi-Fi chip (chepset), which may reside in the hardware layer of the terminal device 100.
[0156] The application layer can include a series of application packages. For example... Figure 5 As shown, the application package may include applications such as camera, calendar, map, WLAN, music, SMS, Bluetooth, video, social networking, gallery, and UX module. The UX module controls the content displayed on the interface of the terminal device 100. In this embodiment, the UX can specifically control whether to display a Wi-Fi signal indicator on the interface of the terminal device 100.
[0157] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications within the application layer. The application framework layer includes some predefined functions. For example... Figure 5 As shown, the application framework layer may include a window manager, content provider, phone manager, resource manager, notification manager, view system, and Wi-Fi service module, etc.
[0158] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0159] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0160] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0161] The phone manager is used to provide communication functions for terminal device 100. For example, it manages call status (including connection, hang-up, etc.).
[0162] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0163] The notification manager allows applications to display notifications in the status bar. These can be used to convey informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, or flashing indicator lights.
[0164] The Wi-Fi service module can also be described as middleware, used to relay all messages between kernel mode and user mode during terminal device operation. In some embodiments, the Wi-Fi service module can be used to manage the services of the terminal device when making Wi-Fi connections, such as which (or which) channels to scan for Wi-Fi, and storing information about the APs connected to the terminal device.
[0165] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0166] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0167] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as obstacle lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0168] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0169] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0170] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[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 graphics engine for 2D drawing.
[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. It includes at least the display driver, camera sensor driver, TCP / IP protocol stack, audio driver, sensor driver, and Wi-Fi driver. The Wi-Fi driver is responsible for interfacing the Wi-Fi chip with the terminal device's operating system.
[0175] Wi-Fi chips are located in the hardware layer of terminal devices.
[0176] For example, such as Figure 6The diagram shown is a schematic flowchart illustrating a network connection method provided in an embodiment of this application. The execution entity of this process may include multiple modules in a terminal device and a Wi-Fi chip in the terminal device, and specifically may include the following steps:
[0177] S601, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to the Wi-Fi driver.
[0178] In some embodiments, the Wi-Fi subsystem crash notification message can be used to instruct the Wi-Fi subsystem to reset or the Wi-Fi chip to restart. Specifically, the Wi-Fi subsystem crash notification message can carry crash cause indication information, such as a crash cause value or a crash indicator. The crash cause value can be preset to instruct the Wi-Fi subsystem to reset.
[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 this application may carry Wi-Fi disconnection reason indication information, which indicates the reason for the Wi-Fi disconnection, such as a Wi-Fi disconnection reason value (or disconnection reason value). This disconnection reason value may, for example, indicate a Wi-Fi disconnection caused by a Wi-Fi subsystem reset (or Wi-Fi chip restart). Optionally, this 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.
[0182] When the Wi-Fi chip crashes (such as during the transmission of Wi-Fi subsystem crash notification messages and Wi-Fi connection disconnection indication messages), the Wi-Fi driver can execute step S604, which is to restart the Wi-Fi chip (load firmware) or reload the Wi-Fi chip.
[0183] and Figure 2A The difference in the implementation 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 on the original channel and no longer performs a full channel scan.
[0184] Apart from the above-mentioned and Figure 2AFor differences between the embodiments and other specific descriptions of steps S601 to S604 in the embodiments of this application, please refer to... Figure 2A The details in the examples will not be repeated here.
[0185] S605, the Wi-Fi service module sends a source channel scan instruction message to the Wi-Fi HAL module.
[0186] The original channel refers to the channel on which the terminal device established a Wi-Fi connection with the access point before the Wi-Fi chip failed.
[0187] It should be noted that when the Wi-Fi chip is still functioning, the information related to the Wi-Fi connection between the terminal device and the access point (AP) can be stored in the terminal device's Wi-Fi chip and Wi-Fi service module. Optionally, it can also be stored in the Wi-Fi HAL module and the Wi-Fi driver. When the Wi-Fi chip fails, the Wi-Fi connection information stored in the chip is cleared. However, since the main chip (SOC) is still operating normally, the Wi-Fi service module still stores the original Wi-Fi connection information before the chip failed, including the original channel, the original AP's SSID, the original IP address (hereinafter referred to as static IP), etc.
[0188] In some embodiments, the original channel scan instruction message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information (such as the original channel number or indicator) of the original channel on which the terminal device and the original AP were connected before the Wi-Fi chip failed. This original channel scan information can be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0189] S606, the Wi-Fi HAL module sends the original channel scanning instruction information to the Wi-Fi driver.
[0190] S607, the Wi-Fi driver sends the original channel scanning instruction information to the Wi-Fi chip.
[0191] Understandably, unlike full-channel scanning, the time required for a Wi-Fi chip to scan only the original channel is significantly less than the time required to scan all channels one by one. This effectively shortens the Wi-Fi reconnection time. Furthermore, since the Wi-Fi chip's functionality is restored after the Wi-Fi subsystem resets, the probability of a successful scan on the original channel is very high. The problem of not finding the original access point after scanning is usually avoided, which facilitates a smooth restoration of the 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 perform a scanning process in response to a native channel scan instruction message. Specifically, the Wi-Fi chip can send a probe request frame on the native channel, and after receiving a probe response frame from the access point (AP) on the native channel, it sends a scan result feedback message to the Wi-Fi driver. The AP's probe response frame may include the protocol capabilities supported by the AP, the Wi-Fi standard (e.g., whether it supports Wi-Fi 4 or Wi-Fi 6), the encryption method, etc. In this case, the AP itself can be the one sending 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 a connectable original AP on the original channel, and 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), the encryption method, 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), the encryption method, etc., based on the scan feedback message. In other words, the Wi-Fi chip obtains the original AP's information by scanning.
[0196] It should also be noted that, since the terminal device's driver side can save the scan results obtained when it last connected to the AP via Wi-Fi, such as the Wi-Fi service module on the driver side storing information such as the original AP's channel (i.e., the original channel), the AP's supported protocol capabilities, Wi-Fi standard (e.g., whether it supports Wi-Fi 4 or Wi-Fi 6), and encryption method when the Wi-Fi subsystem has not crashed (e.g., when the terminal device last established a Wi-Fi connection with the original AP), in some embodiments, the Wi-Fi service module can also send this information to the Wi-Fi chip after the Wi-Fi subsystem is reset, that is, the Wi-Fi chip obtains the original AP's information from the Wi-Fi driver side.
[0197] The scan result feedback messages involved in the following embodiments are similar to the scan result feedback messages here. Please refer to the relevant descriptions in this step, and they will not be repeated here.
[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 this application embodiment, the Wi-Fi chip only scans the original channel during the scanning process, eliminating the need for full-channel scanning and network selection. It then specifies the original AP for reconnection, typically reducing the scanning and network selection time from the original 1.5-2.5 seconds. Figure 2A In the embodiment, the time is shortened to 80-110ms, which is significantly shorter than the time for full channel scanning. This helps to shorten the overall time for Wi-Fi reconnection and reduce the impact of Wi-Fi reconnection on users' 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 connect request message is used to request the establishment of a Wi-Fi connection with the original AP through the original channel.
[0203] In some embodiments, the Wi-Fi connection request message may carry information indicating the original channel, as well as the SSID and password of the original AP.
[0204] The password corresponding to the original access point (AP) can be pre-stored by the Wi-Fi service module, and this password can be provided by the user. For example, when the terminal device last established a Wi-Fi connection with this AP, the user entered the password on 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) indicates that the Wi-Fi connection has been successfully established.
[0209] In some embodiments, the Wi-Fi chip can obtain information such as the SSID, password, and supported standards of the original AP to be connected based on the Wi-Fi connection request message, and then connect to the original AP.
[0210] In some embodiments, in response to a Wi-Fi connection request message, the Wi-Fi chip can request to connect to the original access point (AP) on the original channel. In this case, the original AP with which the terminal device successfully establishes a Wi-Fi connection is the same AP that the terminal device was connected to 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 executes the DHCP process.
[0214] The specific implementation process of this DHCP procedure can be found in the above text. Figure 2B The descriptions 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, it can obtain the IP address assigned to the terminal device based on the message (the assigned IP address can be a new IP address relative to the IP address used during the Wi-Fi disconnection). The Wi-Fi service module can then broadcast this new IP address to the terminal device's app, enabling the app to access the internet using this new IP address.
[0216] For further details regarding steps S615 to S620 in this embodiment, please refer to [link / reference]. Figure 2A The details in the examples will not be repeated here.
[0217] According to the network connection method provided in the embodiments of this 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 with the original AP, instead of performing a full channel scan, thereby shortening the Wi-Fi reconnection time and reducing the adverse impact of Wi-Fi disconnection on users' Internet access.
[0218] For example, such as Figure 7 The diagram shown is a schematic flowchart illustrating another network connection method provided in this application embodiment. The execution entity of this process may include multiple modules in the terminal device and a Wi-Fi chip in the terminal device, and specifically may include the following steps:
[0219] S701, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to the Wi-Fi driver.
[0220] In some embodiments, the Wi-Fi subsystem crash notification message indicates that the Wi-Fi subsystem crashed because the Wi-Fi chip crashed. 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 instruct the Wi-Fi subsystem to 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 indicates the reason for the Wi-Fi disconnection, specifically indicating a Wi-Fi disconnection caused by a Wi-Fi subsystem reset. Optionally, this disconnection reason value can be considered the same as a crash reason value.
[0223] S703, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module.
[0224] When the Wi-Fi chip crashes (such as during the transmission of Wi-Fi subsystem crash notification messages and Wi-Fi connection disconnection indication messages), the Wi-Fi driver can execute step S604, which is to restart the Wi-Fi chip (load firmware) or reload the Wi-Fi chip.
[0225] and Figure 2A The difference in the implementation 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 on the original channel and no longer performs a full channel scan.
[0226] Apart from the above-mentioned and Figure 2A For differences between the embodiments and other specific descriptions of steps S701 to S704 in the embodiments of this application, please refer to... Figure 2A The details in the examples will not be repeated here.
[0227] S705, the Wi-Fi service module sends a source channel scan instruction message to the Wi-Fi HAL module.
[0228] The original channel refers to the channel on which the terminal device established a Wi-Fi connection with the access point before the Wi-Fi chip failed.
[0229] It should be noted that when the Wi-Fi chip is still functioning, the information related to the Wi-Fi connection between the terminal device and the access point (AP) can be stored in the terminal device's Wi-Fi chip and Wi-Fi service module. Optionally, it can also be stored in the Wi-Fi HAL module and the Wi-Fi driver. When the Wi-Fi chip fails, the Wi-Fi connection information stored in the chip is cleared. However, since the main chip (SOC) is still operating normally, the Wi-Fi service module still stores the original Wi-Fi connection information before the chip failed, including the original channel, the original AP's SSID, the original IP address, etc.
[0230] In some embodiments, the original channel scan instruction message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information (such as the original channel number or indicator) of the original channel on which the terminal device and the original AP were connected before the Wi-Fi chip failed. This original channel scan information can be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0231] S706, the Wi-Fi HAL module sends the original channel scanning instruction information to the Wi-Fi driver.
[0232] S707, the Wi-Fi driver sends the original channel scan 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 embodiments of this application, steps S705 to S714 and Figure 6The corresponding steps in the embodiment are similar. For a detailed description of steps S705 to S714, please refer to [link / reference needed]. Figure 6 The relevant content in the embodiments will not be repeated here.
[0241] S715, the Wi-Fi service module sends the source IP indication message to the Wi-Fi HAL module.
[0242] In some embodiments, the Wi-Fi service module can reset the Wi-Fi subsystem based on the reason for the Wi-Fi disconnection and determine to access the network using a static IP address. The Wi-Fi service module can send a broadcast message to the terminal device's app, indicating that the app is currently using a static IP address. This static IP address is the IP address used by the terminal device before the Wi-Fi disconnection.
[0243] S716, the Wi-Fi HAL module sends the source IP indication message to the Wi-Fi driver.
[0244] S717, the Wi-Fi driver sends the source IP instruction 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 failed.
[0246] It should be noted that steps S715 to S717 are optional. In some cases, such as when the Wi-Fi chip does not need to process (e.g., reorder) or optimize the data packets sent by the terminal device to the APP server (or other devices), steps S715 to S717 can be omitted; 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 devices), steps S715 to S717 can be executed.
[0247] and Figure 2A Examples and Figure 6 The embodiments are all different in that, Figure 7In the Wi-Fi reconnection process described in this embodiment, the terminal device no longer executes the DHCP process. That is, after establishing a Wi-Fi MAC layer link with the original access point (AP), the terminal device no longer obtains an IP address through DHCP, but instead uses the previously assigned IP address. Specifically, the previously assigned IP address refers to the IP address used by the terminal device when accessing the internet through the original AP before the Wi-Fi chip failed. Since the terminal device's Wi-Fi service module already stored the IP address assigned by the DHCP server before the Wi-Fi chip failed, and this IP address information is still stored in the Wi-Fi service module after the Wi-Fi chip failure, the Wi-Fi service module can instruct the Wi-Fi chip to access the internet using the original IP address after the terminal device establishes a MAC layer link with the AP. By skipping the DHCP IP acquisition process after the Wi-Fi connection and directly using the original IP address, the time spent acquiring the IP address can be saved by approximately 0.5-3 seconds.
[0248] It should be noted that the embodiments in this application are only described as examples of saving the IP address acquisition process and eliminating the need for full-channel scanning, instead scanning only on the original channel and reconnecting to the original AP via Wi-Fi. In practical applications, the improvements of this application can also be described as follows: Figure 2A The process described in this embodiment is based on the existing full-channel scanning, but the process of obtaining an IP address is no longer performed. This application does not limit this aspect.
[0249] According to the network connection method provided in the embodiments of this 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 with the original AP, instead of performing a full channel scan, and the process of obtaining an IP is omitted. Instead, the original IP is used 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.
[0250] It should be noted that, in the above Figure 6 Examples and Figure 7 In the method of the embodiment, in a scenario where a Wi-Fi subsystem reset causes Wi-Fi disconnection, upon receiving information about the Wi-Fi disconnection, the upper-layer application (such as the UX module) can intercept the Wi-Fi disconnection event. This includes intercepting indication information (such as a disconnection reason value) used to indicate the Wi-Fi disconnection, so that the UX does not perceive the Wi-Fi disconnection, and the terminal device's display continues to show the Wi-Fi signal indicator. Alternatively, it can be done as follows: Figure 2A The method in this 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 from the display screen of the terminal device.
[0251] Understandably, when a terminal device intercepts a Wi-Fi disconnection event from its upper-layer application (such as a UX module), the display status of the Wi-Fi signal indicator on the screen remains unaffected by the Wi-Fi disconnection or reconnection. The user will not perceive a disconnection while the indicator remains displayed. Since Wi-Fi disconnections are often short-lived, especially those caused by a Wi-Fi subsystem reset, the impact on normal network usage is limited. Therefore, keeping the Wi-Fi signal indicator constantly displayed during the disconnection and reconnection process reduces the user's perception of network status changes and improves the user experience.
[0252] The following, with reference to the accompanying diagram, describes the process of intercepting Wi-Fi disconnection events at the upper-layer application on the terminal device and keeping the Wi-Fi signal indicator continuously displayed. It is worth noting that intercepting Wi-Fi disconnection events at the upper-layer application on the terminal device can... Figure 2A This implementation is based on the previous example process, specifically, it performs a full-channel scan during Wi-Fi reconnection while still using the DHCP process to obtain an IP address (corresponding to the following text). Figure 8 (Example); or in Figure 6 or Figure 7 This implementation is based on the previous example process, specifically, during Wi-Fi reconnection, it only performs the original channel scan and still uses the DHCP process to obtain an IP address (corresponding to...). Figure 9 (Example), or during Wi-Fi reconnection, performing the original channel scan without going through the DHCP process to obtain an IP address (corresponding to) Figure 10 (Example). Of course, intercepting Wi-Fi disconnection events by upper-layer applications on terminal devices can also be achieved during the Wi-Fi reconnection process by performing a full-channel scan without obtaining an IP address via DHCP, but the process in this case will not be described in detail here.
[0253] For example, such as Figure 8 The diagram shown is a schematic flowchart illustrating another network connection method provided in this application embodiment. The execution entity of this process may include multiple modules in the terminal device and a Wi-Fi chip in the terminal device, and specifically may include the following steps:
[0254] S801, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to the Wi-Fi driver.
[0255] The Wi-Fi subsystem crash notification message is used to instruct the Wi-Fi subsystem to reset or the Wi-Fi chip to restart.
[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 can obtain Wi-Fi disconnection based on the received Wi-Fi subsystem crash notification message, and obtain the reason for Wi-Fi disconnection as Wi-Fi subsystem reset (or Wi-Fi chip restart).
[0258] The Wi-Fi connection disconnection indication message is used to indicate that Wi-Fi has been disconnected. This message may carry Wi-Fi disconnection reason indication information, which indicates the cause of the disconnection, such as a Wi-Fi disconnection reason value (or disconnection reason value). Specifically, this reason value can indicate a Wi-Fi disconnection caused by a Wi-Fi subsystem reset.
[0259] S803, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module.
[0260] It is worth noting that when 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, it skips the step of the Wi-Fi service module instructing the UX module to indicate that the Wi-Fi connection is disconnected, 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 is unaware of the Wi-Fi disconnection.
[0261] It should be noted that when the Wi-Fi chip crashes (such as during the transmission of Wi-Fi subsystem crash notification messages and Wi-Fi connection disconnection indication messages), the Wi-Fi driver can execute step S804, that is, restart the Wi-Fi chip.
[0262] S805, the Wi-Fi service module sends a full-channel scan instruction message to the Wi-Fi HAL module.
[0263] S806, the Wi-Fi HAL module sends a full-channel scan instruction 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 connect request message is used to request the establishment of a Wi-Fi connection with the access point (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 executes the DHCP process.
[0276] The specific implementation process of this DHCP procedure can be found in the above text. Figure 2B The descriptions 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, it can obtain the IP address assigned to the terminal device based on the message (the assigned IP address can be a new IP address relative to the IP address before the Wi-Fi disconnection). The Wi-Fi service module can then broadcast the new IP address to the terminal device's application, enabling the application to use this new IP address for network services.
[0278] For a detailed description of steps S804 to S820 in the embodiments of this application, please refer to the above text. Figure 2A The relevant content in the embodiments will not be repeated here.
[0279] It is worth noting that after the Wi-Fi service module obtains a successful Wi-Fi connection or has assigned an IP address to the terminal device, it no longer sends the Wi-Fi connection indication message and / or IP assignment success indication message to the UX module. In other words, the step of the Wi-Fi service module informing the UX module of the Wi-Fi connection is omitted, or the Wi-Fi service module intercepts the Wi-Fi connection indication message and / or IP assignment success indication message, so that the UX module cannot detect that the Wi-Fi has been reconnected.
[0280] The network connection method provided in the embodiments of this application intercepts Wi-Fi disconnection and Wi-Fi connection events at the upper layer application of the terminal device, thereby preventing users from perceiving the unstable network status when the Wi-Fi network disconnects and reconnects in a short period of time, and improving the user experience.
[0281] For example, such as Figure 9 The diagram shown is a schematic flowchart illustrating another network connection method provided in this application embodiment. The execution entity of this process may include multiple modules in the terminal device and a Wi-Fi chip in the terminal device, and specifically may include the following steps:
[0282] S901, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to the Wi-Fi driver.
[0283] The Wi-Fi subsystem crash notification message is used to instruct the Wi-Fi subsystem to reset or the Wi-Fi chip to restart.
[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 can obtain Wi-Fi disconnection based on the received Wi-Fi subsystem crash notification message, and obtain the reason for Wi-Fi disconnection as Wi-Fi subsystem reset (or Wi-Fi chip restart).
[0286] The Wi-Fi connection disconnection indication message is used to indicate that Wi-Fi has been disconnected. This message may carry Wi-Fi disconnection reason indication information, which indicates the cause of the disconnection, such as a Wi-Fi disconnection reason value (or disconnection reason value). Specifically, this reason value can indicate a Wi-Fi disconnection caused by a Wi-Fi subsystem reset.
[0287] S903, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module.
[0288] It is worth noting that when 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, it skips the step of the Wi-Fi service module instructing the UX module to indicate that the Wi-Fi connection is disconnected, 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 is unaware of the Wi-Fi disconnection.
[0289] It should be noted that when the Wi-Fi chip crashes (such as during the transmission of Wi-Fi subsystem crash notification messages and Wi-Fi connection disconnection indication messages), the Wi-Fi driver can execute step S904, that is, restart the Wi-Fi chip.
[0290] S905, the Wi-Fi service module sends a source channel scan instruction message to the Wi-Fi HAL module.
[0291] The original channel refers to the channel on which the terminal device established a Wi-Fi connection with the access point before the Wi-Fi chip failed.
[0292] It should be noted that when the Wi-Fi chip is still functioning, the information related to the Wi-Fi connection between the terminal device and the access point (AP) can be stored in the terminal device's Wi-Fi chip and Wi-Fi service module. Optionally, it can also be stored in the Wi-Fi HAL module and the Wi-Fi driver. When the Wi-Fi chip fails, the Wi-Fi connection information stored in the chip is cleared. However, since the main chip (SOC) is still operating normally, the Wi-Fi service module still stores the original Wi-Fi connection information before the chip failed, including the original channel, the original AP's SSID, the original IP address, etc.
[0293] In some embodiments, the original channel scan instruction message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information (such as the original channel number or indicator) of the original channel on which the terminal device and the original AP were connected before the Wi-Fi chip failed. This original channel scan information can be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0294] S906, the Wi-Fi HAL module sends a native channel scan instruction message to the Wi-Fi driver.
[0295] S907, the Wi-Fi driver sends a native 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 connect request message is used to request the establishment of a Wi-Fi connection with the access point (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 executes the DHCP process.
[0307] The specific implementation process of this DHCP procedure can be found in the above text. Figure 2B The descriptions 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, it can obtain the IP address assigned to the terminal device based on the message (the assigned IP address can be a new IP address relative to the IP address before the Wi-Fi disconnection). The Wi-Fi service module can then broadcast the new IP address to the terminal device's application, enabling the application to use this new IP address for network services.
[0309] For a detailed description of steps S904 to S920 in the embodiments of this application, please refer to the above text. Figure 2A The relevant content in the embodiments will not be repeated here.
[0310] It is worth noting that after the Wi-Fi service module obtains a successful Wi-Fi connection or has assigned an IP address to the terminal device, it no longer sends the Wi-Fi connection indication message and / or IP assignment success indication message to the UX module. In other words, the step of the Wi-Fi service module informing the UX module of the Wi-Fi connection is omitted, or the Wi-Fi service module intercepts the Wi-Fi connection indication message and / or IP assignment success indication message, so that the UX module cannot detect that the Wi-Fi has been reconnected.
[0311] The network connection method provided in the embodiments of this application shortens the Wi-Fi reconnection time in the case of Wi-Fi network disconnection and reconnection caused by Wi-Fi subsystem reset, by scanning the original channel instead of full channel scanning, and by intercepting Wi-Fi disconnection and Wi-Fi connection events in the upper layer application of the terminal device, while avoiding user perception of the unstable network status and improving user experience.
[0312] For example, such as Figure 10 The diagram shown is a schematic flowchart illustrating another network connection method provided in this application embodiment. The execution entity of this process may include multiple modules in the terminal device and a Wi-Fi chip in the terminal device, and specifically may include the following steps:
[0313] S1001, the Wi-Fi chip sends a Wi-Fi subsystem crash notification message to the Wi-Fi driver.
[0314] The Wi-Fi subsystem crash notification message is used to instruct the Wi-Fi subsystem to reset or the Wi-Fi chip to restart.
[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 can obtain Wi-Fi disconnection based on the received Wi-Fi subsystem crash notification message, and obtain the reason for Wi-Fi disconnection as Wi-Fi subsystem reset (or Wi-Fi chip restart).
[0317] The Wi-Fi connection disconnection indication message is used to indicate that Wi-Fi has been disconnected. This message may carry Wi-Fi disconnection reason indication information, which indicates the cause of the disconnection, such as a Wi-Fi disconnection reason value (or disconnection reason value). Specifically, this reason value can indicate a Wi-Fi disconnection caused by a Wi-Fi subsystem reset.
[0318] S1003, the Wi-Fi HAL module sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module.
[0319] It is worth noting that when the Wi-Fi service module receives the Wi-Fi connection disconnection indication message, it no longer sends the reason value for the Wi-Fi connection disconnection to the UX module. That is, it skips the step of the Wi-Fi service module instructing the UX module to indicate that the Wi-Fi connection is disconnected, 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 is unaware of the Wi-Fi disconnection.
[0320] In some embodiments, in addition to intercepting the reason value for the Wi-Fi connection disconnection from the UX module, the Wi-Fi service module can also intercept the reason value for the Wi-Fi connection disconnection from the CS module. This eliminates the step of the Wi-Fi service module instructing the CS module that the Wi-Fi connection has been disconnected, so that the CS module will not switch the network to the cellular network during the Wi-Fi reconnection process, allowing the user to continue using the Wi-Fi network after a short period of time.
[0321] It should be noted that when the Wi-Fi chip crashes (such as during the transmission of Wi-Fi subsystem crash notification messages and Wi-Fi connection disconnection indication messages), the Wi-Fi driver can execute step S1004, that is, restart the Wi-Fi chip.
[0322] S1005, the Wi-Fi service module sends a source channel scan instruction message to the Wi-Fi HAL module.
[0323] The original channel refers to the channel on which the terminal device established a Wi-Fi connection with the access point before the Wi-Fi chip failed.
[0324] It should be noted that when the Wi-Fi chip is still functioning, the information related to the Wi-Fi connection between the terminal device and the access point (AP) can be stored in the terminal device's Wi-Fi chip and Wi-Fi service module. Optionally, it can also be stored in the Wi-Fi HAL module and the Wi-Fi driver. When the Wi-Fi chip fails, the Wi-Fi connection information stored in the chip is cleared. However, since the main chip (SOC) is still operating normally, the Wi-Fi service module still stores the original Wi-Fi connection information before the chip failed, including the original channel, the original AP's SSID, the original IP address, etc.
[0325] In some embodiments, the original channel scan instruction message sent by the Wi-Fi service module to the Wi-Fi HAL may carry indication information (such as the original channel number or indicator) of the original channel on which the terminal device and the original AP were connected before the Wi-Fi chip failed. This original channel scan information can be used to instruct the Wi-Fi chip to scan the AP on the original channel.
[0326] S1006, the Wi-Fi HAL module sends a native channel scan instruction message to the Wi-Fi driver.
[0327] S1007, the Wi-Fi driver sends a native channel scan instruction message to the Wi-Fi chip.
[0328] Understandably, unlike full-channel scanning, the time required for a Wi-Fi chip to scan only the original channel is significantly less than the time required to scan all channels one by one. This effectively shortens the Wi-Fi reconnection time. Furthermore, since the Wi-Fi chip's functionality is restored after the Wi-Fi subsystem resets, the probability of a successful scan on the original channel is very high. The problem of not finding the original access point after scanning is usually avoided, which facilitates a smooth restoration of the 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 can be used to indicate that there is a connectable original AP on the original channel.
[0331] In some embodiments, the Wi-Fi chip can scan on a specific channel (i.e., the original channel) in response to the original channel scan instruction information. Specifically, the Wi-Fi chip can send a probe request on the original channel, and after receiving a probe response frame from the AP on the original channel, it can 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 this application embodiment, the Wi-Fi chip only scans the original channel during the scanning process, eliminating the need for full-channel scanning and network selection. It then specifies the original AP for reconnection, typically reducing the scanning and network selection time from the original 1.5-2.5 seconds. Figure 2A In the embodiment, the time is shortened to 80-110ms, which is significantly shorter than the time for full channel scanning. This helps to shorten the overall time for Wi-Fi reconnection and reduce the impact of Wi-Fi reconnection on users' 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 connect request message is used to request the establishment of a Wi-Fi connection with the access point (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 a detailed description of steps S1004 to S1016 in the embodiments of this application, please refer to [link to relevant documentation]. Figure 2A The descriptions in the embodiments will not be repeated here.
[0343] It is worth noting that, with Figure 9 Unlike the previous embodiment, in this embodiment, 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 it require the DHCP server to send a message indicating that the terminal device's IP allocation was successful. Instead, it can directly execute the following steps S1017 to S1019.
[0344] S1017, the Wi-Fi service module sends the 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 based on 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 terminal device's APP, indicating that the APP is currently using a static IP. This static IP is the IP address used by the terminal device before the 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 failed.
[0347] and Figure 9 The difference in the embodiments is that, Figure 10 In the Wi-Fi reconnection process described in this embodiment, the terminal device no longer executes the DHCP process. That is, after establishing a Wi-Fi MAC layer link with the original access point (AP), the terminal device no longer obtains an IP address through DHCP, but instead uses the previously assigned IP address. Specifically, the previously assigned IP address refers to the IP address used by the terminal device when accessing the internet through the original AP before the Wi-Fi chip failed. Since the terminal device's Wi-Fi service module already stored the IP address assigned by the DHCP server before the Wi-Fi chip failed, and this IP address information is still stored in the Wi-Fi service module after the Wi-Fi chip failure, the Wi-Fi service module can instruct the Wi-Fi chip to access the internet using the original IP address after the terminal device establishes a MAC layer link with the AP. By skipping the DHCP IP acquisition process after the Wi-Fi connection and directly using the original IP address, the time spent acquiring the IP address can be saved by approximately 0.5-3 seconds.
[0348] S1018, the Wi-Fi HAL module sends the 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 address based on the original IP instruction message.
[0351] It should be noted that steps S1017 to S1019 are optional. In some cases, such as when the Wi-Fi chip does not need to process (e.g., reorder) or optimize the data packets sent by the terminal device to the APP server (or other devices), steps S1017 to S1019 can be omitted; 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 devices), steps S1017 to S1019 can be executed.
[0352] According to the network connection method provided in the embodiments of this 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, instead of performing a full channel scan. Furthermore, the process of obtaining an IP address is eliminated, and the original IP address is used to access the network. This shortens the time for users to regain normal Wi-Fi access and reduces the adverse impact of Wi-Fi disconnection on internet browsing. In addition, when the terminal device detects that the cause of the Wi-Fi disconnection is a Wi-Fi subsystem reset, it can intercept the Wi-Fi disconnection event (such as the cause value) at the terminal device's UX and / or at the terminal device's CS module. This ensures that the user is unaware of the Wi-Fi disconnection and prevents the terminal device from connecting to other types of networks such as cellular networks during Wi-Fi reconnection, thereby improving the user's Wi-Fi experience.
[0353] The network connection method provided in this application, in some scenarios such as Wi-Fi reconnection timeout, Wi-Fi reconnection rejection, or failure to scan the original AP, can notify the UX that the Wi-Fi connection has been lost, and the terminal device can then re-enter the normal Wi-Fi connection process, such as initiating scanning and network selection. For example, Figure 11 The diagram shown is a schematic flowchart illustrating another network connection method provided in this application. The method can be executed by a terminal device, and specifically may include the following steps:
[0354] S1101, Wi-Fi chip crashed.
[0355] S1102, reconnect to the original AP.
[0356] S1103, set the 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 original AP reconnection was successful.
[0359] If the original AP reconnects successfully, that is, the result of this step is "yes", then the process ends and the terminal device can access the Internet through the Wi-Fi connection with the original AP; if the original AP reconnects unsuccessfully, that is, the 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 via Wi-Fi can be found above. Figures 6 to 10 The process described in the examples will not be repeated here.
[0361] S1105, original AP reconnection timed out.
[0362] In some embodiments, when a terminal device fails to successfully reconnect to the original AP via Wi-Fi, the terminal device can detect whether the current Wi-Fi reconnection process has exceeded a preset timeout. Specifically, in the case of unsuccessful Wi-Fi reconnection, the terminal device can periodically detect whether the Wi-Fi reconnection process has exceeded the timeout; or, when the terminal device reconnects to the original AP, a timer is started, and in the case of unsuccessful Wi-Fi reconnection, when the timer reaches the preset timeout, the terminal device is informed that the current Wi-Fi reconnection process has timed out.
[0363] S1106, Wi-Fi reconnection was rejected by the original access point.
[0364] In some embodiments, the way in which a Wi-Fi reconnection is rejected by the original AP may include, for example, the following: after the terminal device sends a Wi-Fi connection request message to the original AP, the original AP determines, based on the current network status and / or its own status (such as the current signal strength, software status, capability status, etc.), that it cannot establish a Wi-Fi connection with the terminal device; 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, original AP not detected.
[0366] In some embodiments, not detecting the original AP may specifically include: (1) the terminal device scans on the original channel and fails to detect the original AP; (2) the terminal device scans on all channels and fails to detect the original AP. Specifically, if the terminal device sends a probe request on the original channel and does not receive a probe response frame from the original AP, it means that the terminal device has not detected the original AP. Alternatively, if the terminal device sends probe requests one by one on all channels and receives a probe response frame from an AP on one or more channels, and if this channel is not the original channel or these channels do not include the original channel, it means that the terminal device has not detected the original AP. Alternatively, if the terminal device receives a probe response frame from an AP and obtains information that does not include the original AP based on the probe response frame, it means that the original AP has not been detected. The embodiments of this application do not limit the specific implementation method of the terminal device obtaining information that the original AP has not been detected.
[0367] It should be noted that steps S1105, S1106, and S1107 can all be executed, such as executing steps S1105 to S1107 sequentially; or, some steps from S1105 to S1107 can be executed, such as executing steps S1105 and S1107, or executing only step S1105 without executing steps S1106 and S1107, etc. The embodiments of this application do not limit this.
[0368] S1108, Notify the terminal device that the UX module 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 can 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 can 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 terminal device display to disappear when Wi-Fi is disconnected.
[0371] It should be noted that when a terminal device fails to reconnect to the original access point (AP), it may need to re-execute the normal Wi-Fi connection process (including scanning, network selection, and connection steps). This Wi-Fi connection process can take a considerable amount of time. Therefore, to ensure normal network access for users, the Wi-Fi signal indicator can be removed from the terminal device's display to inform the user that the 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 will not be displayed, allowing the user to perceive that the network has switched to another type, such as a Wi-Fi network or cellular network associated with another AP.
[0372] S1109, continue reconnecting to the original AP.
[0373] In some embodiments, if the reason for the Wi-Fi reconnection failure is a timeout, i.e. step S1105, then the terminal device can continue to reconnect to the original AP.
[0374] S1110 executes the normal Wi-Fi connection process, triggering operations such as scanning, network selection, and Wi-Fi connection.
[0375] In some embodiments, if the Wi-Fi reconnection fails because the original access point (AP) rejects the reconnection and / or the original AP is not detected, the terminal device can perform the normal Wi-Fi connection process, which includes performing a full-channel scan, selecting a network based on the scan results, and establishing a Wi-Fi connection. The specific implementation process for a normal Wi-Fi connection can be found in existing procedures and will not be detailed here.
[0376] S1111, determine whether the Wi-Fi reconnection was 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] If the Wi-Fi reconnection is successful, that is, the result of this step is "yes", then the process ends and the terminal device can access the Internet through the Wi-Fi connection with the original AP; if the Wi-Fi reconnection is unsuccessful, that is, the 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 embodiments of this application, in the scenario where the Wi-Fi subsystem is reset and the Wi-Fi connection is lost, when the terminal device fails to re-establish the Wi-Fi connection with the original AP, the terminal device will try to continue to connect to the original AP or perform the normal Wi-Fi connection process to connect with other APs, which can ensure the normal use of the Wi-Fi network by the user.
[0380] Furthermore, in passive scanning scenarios, the terminal device's driver can save the scan results obtained from the previous connection to the original access point (including the original access point's capability information, such as 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 access point recorded in the previously received access point beacon frame to directly connect to the hotspot without initiating a scan. For example, as shown... Figure 12 The diagram shown is a schematic flowchart illustrating how a terminal device directly initiates a Wi-Fi connection to the original access point (AP) according to an embodiment of this application. Specifically, it includes the following steps:
[0381] S1201, the terminal device receives the beacon frame sent by the AP.
[0382] In some embodiments, the AP can send beacon frames via broadcast.
[0383] This step can occur during the previous Wi-Fi connection establishment process with the AP. The beacon frame can include the AP's capability information and connection information. After receiving the beacon, the terminal device stores the AP's capability information and connection information.
[0384] S1202, the terminal device stores the AP's capability information and connection information based on the beacon frame.
[0385] Capability information includes, for example, the AP's protocol capabilities and supported Wi-Fi standards. Connectivity information includes, for example, the AP's SSID and IP address.
[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 and connection information of the original AP.
[0387] The reconnection process can skip the full-channel scanning and network selection phases and instead proceed to steps S1204 to S1213:
[0388] S1204, The terminal device sends a scan message to the AP (on the original channel).
[0389] The scan 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 can be, for example, a probe response frame.
[0392] It should be noted that steps S1204 and S1025 are both performed on the original channel. Similarly, the information exchange in steps S1206 to S1213 below 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 can negotiate a key with the terminal device, which is used to encrypt data packets. This key negotiation phase may, for example, include steps S1209 to S1212:
[0398] S1210, the AP sends the 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] After the terminal device completes protocol negotiation with the AP and reconnects to Wi-Fi, the terminal device can use the IP address recorded when it last connected to the AP to connect to the network, that is, use a static IP address to connect, thus avoiding the process of obtaining a new IP address (such as the DHCP process).
[0403] According to the network connection method provided in the embodiments of this application, in the scenario where the Wi-Fi subsystem is reset and the Wi-Fi connection is lost, when the terminal device re-establishes the Wi-Fi connection with the original AP, it directly uses the previously stored information of the original AP to connect with the original AP, thus eliminating the need for scanning, network selection, and obtaining a newly assigned IP address. This can shorten the Wi-Fi reconnection time and enable users to obtain a normal Wi-Fi network in a timely manner.
[0404] In some situations, when a terminal device reconnects to the original access point (AP) via Wi-Fi, the AP may have already assigned the IP address previously used by the terminal device to another device, resulting in the terminal device being unable to use the previous IP address. To prevent internet access failures due to the unusable previous IP address (i.e., a static IP), the network connection method provided in this application embodiment allows for ARP probing after connecting with a static IP. If the probing results indicate that another interrupted device is using the currently used IP address, the DHCP process is re-executed to obtain a new IP address.
[0405] For example, such as Figure 13 The diagram shown is a schematic flowchart illustrating another network connection method provided in this application embodiment. The execution entity of this process can be a terminal device, and specifically may include the following steps:
[0406] S1301, Wi-Fi chip crashed.
[0407] S1302 successfully reconnected to the original AP's Wi-Fi network.
[0408] The process of the terminal device reconnecting to the original AP via Wi-Fi can be found in the above embodiment, and will not be repeated here.
[0409] S1303, send an ARP REQ broadcast message.
[0410] The ARP REQ broadcast message can be described as an Address Resolution Protocol (ARP) request broadcast message, used to request the IP address of other devices. Specifically, this ARP REQ broadcast message can be used to query whether there is another device with the same IP address as its previous IP address.
[0411] Terminal devices can obtain information about whether the IP addresses of other devices are the same as the IP address of the terminal device in the previous test by broadcasting this ARP REQ broadcast message.
[0412] S1304, determine if any device has replied with an ARP REP message.
[0413] The ARP REP message is used to indicate the IP address of other devices. Specifically, it can be used to indicate that the IP address of other devices is the same as the IP address of the terminal device in the previous step.
[0414] In some embodiments, if another device (referred to as device 1) is currently using the same IP address as the terminal device last time, then when 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 information about other devices currently using the IP address it previously used based on the received ARP REP message.
[0415] Optionally, in other embodiments, after receiving the ARP REQ broadcast message sent by the terminal device, other devices may send an ARP REP message to the terminal device, and carry the IP indication information that 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 there are other devices using the same IP as the IP it used last time based on the IP indication information it carries.
[0416] If no device replies with an ARP REP message, meaning the result of this step is "No," then step S1305 can be executed, which involves using a static IP address as the local IP address. This static IP address is the IP address previously used on the terminal device and is stored locally on the terminal device. If a device replies with an ARP REP message, meaning the result of this step is "Yes," then step S1306 can be executed.
[0417] S1306, Re-execute the DHCP process to obtain a new IP address.
[0418] Here, the new IP address can be a different IP address than the one stored in the terminal device.
[0419] It should be noted that this application embodiment only introduces the process of obtaining IP using the DHCP process as an example. However, with the development of IP acquisition methods, the IP acquisition method in this application embodiment can also be other methods, and this application embodiment does not limit this.
[0420] According to the network connection method provided in the embodiments of this application, in the scenario of Wi-Fi disconnection caused by Wi-Fi subsystem reset, after the terminal device completes Wi-Fi reconnection with the original AP, if another device has already occupied the static IP when using a static IP, the terminal device will execute the process of obtaining a new IP again. This can shorten the time to complete Wi-Fi reconnection while ensuring that the terminal device can access the network normally.
[0421] For example, such as Figure 14 The diagram shown is a schematic flowchart illustrating another network connection method provided in this application embodiment. The execution entity of this process can be a terminal device, and specifically may include the following steps:
[0422] S1401, when the Wi-Fi connection with the first AP is disconnected due to a Wi-Fi subsystem reset, obtain the cause indication information corresponding to the Wi-Fi disconnection. The cause indication information is used to indicate that the cause of the Wi-Fi disconnection is a Wi-Fi subsystem reset.
[0423] S1402, in response to the cause indication information, reconnect to the first AP according to the pre-stored first information, the first information including the 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 document, specifically referring to the AP that enables the terminal device's Wi-Fi subsystem to establish a Wi-Fi connection with the terminal device when it is not inoperable. The first AP may be a router.
[0425] In one possible implementation, a Wi-Fi subsystem reset can also be described as a Wi-Fi chip reboot, specifically referring to a reload after a Wi-Fi chip crash.
[0426] In some embodiments, the connection information includes a first channel, which is the channel on which the terminal device was connected to the first AP before the Wi-Fi subsystem was reset; the step of reconnecting to the first AP according to pre-stored first information specifically includes: sending a probe request message on the first channel according to the connection information, the probe request message being used to query whether an AP exists on the first channel; receiving a probe response message sent by the first AP through the first channel, the probe response message being 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 one possible implementation, the first channel can correspond to the original channel in this paper, specifically the channel on which the terminal device's Wi-Fi subsystem connects to the original AP when it is not in a crash.
[0428] In one 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 can be considered a scanning phase in the Wi-Fi reconnection process. During this scanning phase, the terminal device only scans on the first channel and does not perform a full-channel scan.
[0429] According to the network connection method provided in this implementation, 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 with the original AP, instead of performing a full channel scan, thereby shortening the Wi-Fi reconnection time and reducing the adverse impact of Wi-Fi disconnection on users' Internet access.
[0430] In some embodiments, the connection information further includes a static IP address, which is the IP address used by the terminal device to access the network before the Wi-Fi subsystem is reset; the method further includes: accessing the network using the static IP address, wherein the static IP address is the IP address pre-stored in the first information by the terminal device, and after the Wi-Fi subsystem is reset, the terminal device omits the process of initiating the process of obtaining the static IP address from the first AP.
[0431] According to the network connection method provided in this implementation, 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 with the original AP, instead of performing a full channel scan, and skips the process of obtaining an IP address, using the original IP address to enter the network. This 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.
[0432] In some embodiments, the method further includes: omitting the operation of sending the probe response message on other channels, wherein 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 lost due to a reset of the Wi-Fi subsystem, the UX module continues to display a Wi-Fi signal indicator in the interface.
[0434] In some embodiments, the step of continuing to display the Wi-Fi signal indicator on the interface when the Wi-Fi connection with the first AP is disconnected due to a Wi-Fi subsystem reset specifically includes: when the Wi-Fi connection with the first AP is disconnected due to a Wi-Fi subsystem reset, obtaining the disconnection reason value, which indicates that the reason for the Wi-Fi disconnection is the Wi-Fi subsystem reset; and intercepting the disconnection reason value so that the UX module continues to display the Wi-Fi signal indicator on the interface.
[0435] In some embodiments, the method further includes: sending an IP query broadcast message, the IP query broadcast message being used to query whether there is an IP currently used by another device that is the static IP; when no IP query response message is received from another device, using the static IP to access the network, the IP query response message being used to indicate that the currently used IP is the static IP.
[0436] In some embodiments, the method further includes: when receiving an IP query response message sent by a first device, initiating an IP allocation request process, 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.
[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; the step of reconnecting to the first AP according to pre-stored first information when the Wi-Fi connection with the first AP is disconnected due to a Wi-Fi Fidelity subsystem reset 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 indicating a Wi-Fi disconnection with the first AP, and the Wi-Fi connection disconnection indication message carrying a cause value corresponding to the Wi-Fi disconnection; responding to the Wi-Fi connection disconnection indication message... The Wi-Fi service module sends a native channel scan indication message to the Wi-Fi driver. This native channel scan indication message instructs the Wi-Fi chip to scan on the first channel, omitting the operation of sending the probe response message on other channels (channels other than the first channel). The Wi-Fi driver then sends the native channel scan indication message to the Wi-Fi chip. In response to the native channel scan 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 is used to query whether an AP exists on the first channel, and the probe response message indicates 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, the scan result feedback message indicating that the first AP was detected 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 sending a Wi-Fi connection request message to the Wi-Fi driver, the Wi-Fi connection request message being used to indicate reconnection to the first AP; the Wi-Fi driver sending the Wi-Fi connection request message to the Wi-Fi chip; and in response to the Wi-Fi connection request message, the Wi-Fi chip reconnecting 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, wherein 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 step of the Wi-Fi chip using a static IP address to access the network specifically includes: when the Wi-Fi chip successfully reconnects to the first AP and establishes Wi-Fi connectivity, the Wi-Fi chip sends a Wi-Fi connection success message to the Wi-Fi driver, the Wi-Fi connection success message indicating 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 address indication message to the Wi-Fi driver, the original IP address indication message indicating that the static IP address is used to access the network, thus eliminating the need for the terminal device to initiate the process of obtaining the static IP address from the first AP after the Wi-Fi subsystem is reset; the Wi-Fi driver sends the original IP address indication message to the Wi-Fi chip; and in response to the original IP address indication message, the Wi-Fi chip uses a static IP address 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 embodiments of this 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, instead of performing a full channel scan. Furthermore, the process of obtaining an IP address is eliminated, and the original IP address is used to access the network. This shortens the time for users to regain normal Wi-Fi access and reduces the adverse impact of Wi-Fi disconnection on internet browsing. In addition, when the terminal device detects that the cause of the Wi-Fi disconnection is a Wi-Fi subsystem reset, it can intercept the Wi-Fi disconnection event (such as the cause value) at the terminal device's UX and / or at the terminal device's CS module. This ensures that the user is unaware of the Wi-Fi disconnection and prevents the terminal device from connecting to other types of networks such as cellular networks during Wi-Fi reconnection, thereby improving the user's Wi-Fi experience.
[0444] Based on the same technical concept, embodiments of this application also provide a terminal device, including a processor; a memory; the memory stores a computer program, the computer program including instructions, which, when executed by the processor, cause the terminal device to perform one or more steps of any of the above methods.
[0445] Based on the same technical concept, this application embodiment also provides a chip system, the chip system including: 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 of the above methods to control the receiving pin to receive signals and control the transmitting pin to transmit signals.
[0446] Based on the same technical concept, embodiments of this application also provide a computer-readable storage medium storing computer-executable program instructions, which, when executed on a computer, cause the computer or processor to perform one or more steps of any of the above methods.
[0447] Based on the same technical concept, embodiments of this application also provide a computer program product containing instructions, the computer program product including computer program code, which, when run on a computer, causes the computer or processor to perform one or more steps of any of the above methods.
[0448] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0449] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0450] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.
Claims
1. A method for network connection, characterized in that, Applied to terminal devices, the terminal devices include a Wi-Fi chip and a main chip SOC, including: When the Wi-Fi connection with the first AP is lost due to the Wi-Fi chip crashing and then reloading, the cause indication information corresponding to the Wi-Fi disconnection is obtained. The cause indication information is used to indicate that the cause of the Wi-Fi disconnection is the Wi-Fi chip crashing and then reloading. After the Wi-Fi chip crashes and then reloads, the AP information originally stored in the Wi-Fi chip is cleared. In response to the cause indication information, the first AP is reconnected according to the first information pre-stored in the SOC. The first information includes connection information and capability information corresponding to the first AP. The connection information includes a first channel, which is the channel on which the terminal device connects to the first AP before the Wi-Fi chip crashes and is reloaded. The step of reconnecting to the first AP based on the first information pre-stored in the SOC specifically includes: Send a probe request message on the first channel, and omit the operation of sending the probe request message on other channels, where the other channels are channels other than the first channel. The probe request message is used to query whether there is an AP on the first channel. Receive a probe response message sent by the first AP through the first channel, the probe response message being used to indicate the presence of the first AP on the first channel; Using the password pre-stored in the SOC corresponding to the first AP, the first AP is associated with the first AP on the first channel; When the Wi-Fi connection with the first AP is lost due to the reloading after the Wi-Fi chip crashes, the UX module in the terminal device continues to display the Wi-Fi signal indicator on the interface, so that the display status of the Wi-Fi signal indicator is not affected by the Wi-Fi disconnection or reconnection.
2. The method according to claim 1, characterized in that, The connection information also includes a static IP address, which is the IP address used by the terminal device to access the network before the Wi-Fi chip is reloaded after a crash; the method further includes: The terminal device accesses the network using the static IP address, where the static IP address is the IP address pre-stored in the first information. After the Wi-Fi chip restarts, the terminal device skips the process of obtaining the static IP address from the first access point.
3. The method according to claim 1, characterized in that, The cause indication information refers to the disconnection cause value; when the Wi-Fi connection with the first AP is lost due to the Wi-Fi chip crashing and then reloading, the Wi-Fi signal indicator continues to be displayed on the interface, specifically including: When the Wi-Fi connection with the first AP is lost due to the Wi-Fi chip crashing and then reloading, the disconnection reason value is obtained; The disconnection reason value is intercepted, allowing the UX module to continue displaying the Wi-Fi signal indicator on the interface.
4. The method according to claim 2, characterized in that, The method further includes: Send an IP query broadcast message, the IP query broadcast message being used to query whether there are other devices currently using the static IP; When no IP query response message is received from other devices, the static IP is used to access the network. The IP query response message is used to indicate that the currently used IP is the static IP.
5. The method according to claim 4, characterized in that, The method further includes: When an IP query response message is received from the first device, an IP allocation request process is initiated. 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 devices.
6. The method according to any one of claims 3-5, characterized in that, The terminal device further includes a Wi-Fi driver, a Wi-Fi service module, and a UX module, and the method further includes: When the Wi-Fi chip crashes, a Wi-Fi subsystem crash notification message is sent to the Wi-Fi driver; The Wi-Fi driver sends a Wi-Fi connection disconnection indication message to the Wi-Fi service module. The Wi-Fi connection disconnection indication message is used to indicate that the Wi-Fi connection with the first AP is disconnected, and the Wi-Fi connection disconnection indication message carries the disconnection 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. The original channel scan indication message is used to instruct the Wi-Fi chip to scan on the first channel, and eliminates the operation of sending the probe response message on other channels, which 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 scan 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 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.
7. The method according to claim 6, characterized in that, The method further includes: The Wi-Fi chip sends a scan result feedback message to the Wi-Fi driver, the scan result feedback message indicating that the first AP was detected on the first channel; The Wi-Fi driver sends the scan result feedback message to the Wi-Fi service module.
8. The method according to claim 7, characterized in that, The method further includes: The Wi-Fi service module sends a Wi-Fi connection request message to the Wi-Fi driver, and 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.
9. The method according to claim 8, characterized in that, The method further includes: When the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP address to access the network. The static IP address is the IP address used by the terminal device to access the network before the Wi-Fi subsystem is reset.
10. The method according to claim 9, characterized in that, When the Wi-Fi chip successfully reconnects to the first AP, the Wi-Fi chip uses a static IP address to access the network, specifically including: When the Wi-Fi chip successfully reconnects to the first AP and establishes 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 a 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 that the static IP is used to access the network, and eliminates the need for the terminal device to initiate the process of obtaining 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 a static IP to access the network.
11. The method according to any one of claims 7-10, characterized in that, The method further includes: The Wi-Fi service module intercepts the disconnection reason value, allowing the UX module to continue displaying the Wi-Fi signal indicator on the interface.
12. A terminal device, characterized in that, include: processor; Memory; The memory stores a computer program, the computer program including instructions that, when executed by the processor, cause the terminal device to perform the method as described in any one of claims 1 to 11.
13. 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 as described in any one of claims 1 to 11 to control the receiving pin to receive signals and control the transmitting pin to transmit signals.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable program instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Connection control method, connection controller and electronic equipment
CN104244374A
Access method for wireless network and mobile terminal
CN106507289A
Accelerated network reconnect using previous connection parameters
CN109121183A