TWT adjustment method, and device, system and storage medium
By turning off the TWT capability bit in the beacon frame and the detection response frame of the AP device, the problem that the terminal device cannot scan to the AP device that supports the TWT capability is solved, and a higher WLAN connection success rate is achieved.
Patent Information
- Application Number
- PCT/CN2024/086598
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-08
- Filing Date
- 2024-04-08
- Publication Date
- 2025-08-14
AI Technical Summary
In a WLAN connection, when the terminal device does not support TWT capability, it is impossible to scan to support TWT capability AP devices, resulting in a connection failure.
The AP device turns off the TWT capability bit in the beacon frame and the detection response frame, so that the terminal device that does not support the TWT capability can successfully scan to the AP device, and adjusts the signaling information to indicate that the TWT capability is not supported, thereby improving the connection success rate.
The success rate of establishing a WLAN connection between terminal devices that do not support TWT capabilities and AP devices is improved, and connection failures caused by capability conflicts are avoided.
Smart Images

Figure CN2024086598_14082025_PF_FP_ABST
Abstract
Description
TWT adjustment method, device, system and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 8, 2024, with application number 202410176288.1 and application name “TWT adjustment method, device, system and storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a TWT adjustment method, device, system and storage medium. Background Art
[0003] As people's demand for device portability increases, traditional wired networks can no longer meet the needs, and wireless local area network (WLAN) technology has emerged. In WLAN, terminal devices are kept awake for a long time, which causes unnecessary energy waste.
[0004] Related technologies have designed an energy-saving mechanism for terminal devices - target wake time (TWT). The access point (AP) device and station (STA) device of the WLAN pre-agree on the TWT wake-up time. When the wake-up time arrives, the STA device wakes up and exchanges data with the AP device, while at other times the STA device enters a sleep state, thereby reducing the energy consumption of the STA device. However, when a terminal device such as a mobile phone turns on a hotspot as an AP device, if the TWT capability bit of the AP device is turned on, other devices that do not support the TWT capability may be unable to scan the AP device, resulting in WLAN connection failure.
[0005] Summary of the Invention
[0006] The present application provides a TWT adjustment method, device, system and storage medium, which solves the technical problem that a device that does not support TWT capability cannot scan an AP device that supports TWT capability, resulting in WLAN connection failure.
[0007] To achieve the above objectives, this application adopts the following technical solutions:
[0008] In a first aspect, an embodiment of the present application provides a method for adjusting TWT. The method can be applied to a first electronic device. The method may include: the first electronic device turning on a hotspot; the first electronic device sending a first signaling, the first signaling including information that the first electronic device has turned off the TWT capability. For example, the first signaling may be a beacon frame sent periodically, or the first signaling may be a probe response frame corresponding to a probe request frame.
[0009] In the above scheme, the first electronic device supports TWT capability. When the first electronic device turns on the hotspot, although the first electronic device supports TWT capability, the first electronic device will still turn off the TWT capability of the first electronic device in the first signaling. In this way, regardless of whether the device receiving the first signaling (such as the terminal device) supports TWT capability, the first electronic device can be successfully scanned through the first signaling. For example, when the Wi-Fi firmware of the terminal device is produced earlier, so that the terminal device does not support TWT capability, if the parsed content of the detection response frame is that the first electronic device does not support TWT capability, then the bottom layer of the terminal device (such as the Wi-Fi driver) will determine that there is no TWT capability conflict between the first electronic device and the terminal device according to the default code logic, and report the parsed content normally to the upper layer of the terminal device (such as the Wi-Fi setting module), thereby scanning the first electronic device, thereby improving the success rate of establishing a WLAN connection between the first electronic device and the terminal device.
[0010] In one possible implementation, the Wi-Fi version enabled by the first electronic device may be any one of the following: seventh-generation wireless network technology Wi-Fi 7, sixth-generation wireless network technology Wi-Fi 6, fifth-generation wireless network technology Wi-Fi 5, or fourth-generation wireless network technology Wi-Fi 4. The first electronic device may set the extended capability bit of the beacon frame or the probe response frame to indicate that the first electronic device does not support TWT capability.
[0011] In one possible implementation, before the first electronic device sends the first signaling, the method may further include: the first electronic device generates first information, the first information indicating that the TWT capability of the first electronic device is turned off; and the first electronic device generates the first signaling based on the first information. Taking the first electronic device as an example, the Wi-Fi version turned on by the first electronic device is Wi-Fi 5. The first electronic device can reconfigure the 78th element of the extended capability bit of the probe response frame to "0" to indicate that "the first electronic device does not support TWT capability", so that the first electronic device can generate the first signaling based on the 78th element of the extended capability bit.
[0012] In one possible implementation, the first signaling may include a first beacon frame and a first probe response frame. Accordingly, the first electronic device turns on the hotspot and sends the first signaling, including: the first electronic device receives the first operation of the user to turn on the hotspot; the first electronic device responds to the first operation, turns on the hotspot and periodically broadcasts the first beacon frame, and the first beacon frame may include information that the first electronic device has turned off the TWT capability; the first electronic device receives the first probe request frame from the terminal device; the first electronic device sends the first probe response frame to the terminal device, and the first probe response frame may include information that the first electronic device has turned off the TWT capability.
[0013] Exemplarily, the first electronic device turns on the hotspot and periodically broadcasts the first beacon frame in response to the first operation, including: the first electronic device configures the first information in response to the first operation, and the first information indicates that the TWT capability of the first electronic device is turned off; the first electronic device turns off the TWT capability of the first electronic device based on the first information, and periodically broadcasts the first beacon frame, and the first beacon frame includes information that the TWT capability of the first electronic device has been turned off.
[0014] In the above scheme, regardless of whether the terminal device supports TWT capability, when the first electronic device turns on the hotspot, the first electronic device can directly turn off the TWT capability in the first beacon frame, so that the TWT capability configuration of the first beacon frame and the first detection response frame are consistent, avoiding the possible TWT capability conflict problem between the first electronic device and the terminal device, and increasing the probability of the terminal device scanning the first electronic device.
[0015] In one possible implementation, the first electronic device enabling the hotspot may include: the first electronic device enabling the hotspot and starting a timer. The first electronic device sending the first signaling may include: when the timer reaches a preset time (e.g., 2 minutes), if the first electronic device has not established a wireless local area network connection with another device, the first electronic device sending the first signaling.
[0016] Exemplarily, the first signaling may be a second probe response frame. The first electronic device may configure the second information in response to the user's first operation of turning on the hotspot, and the second information indicates that the TWT capability of the first electronic device is turned on. The first electronic device turns on the hotspot, turns on the TWT capability of the first electronic device based on the second information, and starts timing. The first electronic device broadcasts a second beacon frame according to a preset period, and the second beacon frame includes information that the first electronic device has turned on the TWT capability. When the timing duration reaches the preset duration, if the first electronic device has not established a wireless LAN connection with other devices, the first electronic device configures the first information and deletes the second information, and the first information indicates that the TWT capability of the first electronic device is turned off. Then, the first electronic device receives the second probe request frame from the terminal device. Afterwards, the first electronic device sends a second probe response frame to the terminal device, and the second probe response frame includes information that the first electronic device has turned off the TWT capability.
[0017] In the above scheme, when the first electronic device turns on the hotspot, the first electronic device can turn on the TWT capability. If the terminal device does not support the TWT capability, it may cause the terminal device to be unable to scan the first electronic device. To this end, when the first electronic device turns on the hotspot, the first electronic device can first turn on the TWT capability, and then after the timing reaches the preset time, if the STA device is not connected, the TWT capability of the first electronic device is turned off, so that the terminal device can scan the first electronic device, and can also establish a TWT protocol when the terminal device supports the TWT capability.
[0018] In one possible implementation, after the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method may further include: the first electronic device receives a third probe request frame from the terminal device. Accordingly, the first electronic device sends the first signaling, including: if the third probe request frame includes information that the terminal device does not support TWT capability (i.e., indicating that the terminal device does not support TWT capability), the first electronic device sends the first signaling to the terminal device. The method may further include: if the first probe request frame includes information that the terminal device supports TWT capability (i.e., indicating that the terminal device supports TWT capability), the first electronic device sends a second signaling to the terminal device, the second signaling including information that the first electronic device has turned on TWT capability.
[0019] Exemplarily, the first signaling may be a third probe response frame, and the second signaling may be a fourth probe response frame. In response to a user's first operation of turning on a hotspot, the first electronic device configures second information, the second information indicating that the first electronic device's TWT capability is enabled. The first electronic device turns on the hotspot based on the second information and periodically broadcasts a third beacon frame, the third beacon frame including information that the first electronic device has enabled TWT capability. The first electronic device receives a third probe request frame from a terminal device and parses the third probe request frame to obtain first parsed content. If the first parsed content indicates that the terminal device does not support TWT capability, the first electronic device configures the first information and deletes the second information, the first information indicating that the first electronic device's TWT capability is disabled. The first electronic device generates a third probe response frame based on the first information and sends the third probe response frame to the terminal device, the third probe response frame including information that the first electronic device has disabled TWT capability. If the first parsed content indicates that the terminal device supports TWT capability, the first electronic device retains the second information and generates a fourth probe response frame based on the second information. The first electronic device sends a fourth probe response frame to the terminal device, the fourth probe response frame including information that the first electronic device has enabled TWT capability.
[0020] In the above scheme, when the first electronic device turns on the hotspot, the TWT capability can be turned on first. If the terminal device does not support the TWT capability, the terminal device may not be able to scan the first electronic device. To this end, when the first electronic device turns on the hotspot, the first electronic device can first turn on the TWT capability, and then determine whether to turn off the TWT capability of the first electronic device based on the TWT capability of the terminal device carried in the detection request frame, so that the terminal device can scan the first electronic device, or establish a TWT protocol when the terminal device supports the TWT capability.
[0021] In one possible implementation, after the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method may further include: the first electronic device receives a first request message from the terminal device, where the first request message is used to request to turn off the TWT capability of the first electronic device. Accordingly, the first electronic device sends the first signaling, including: the first electronic device turns off the TWT capability of the first electronic device based on the first request message, and sends the first signaling to the terminal device.
[0022] Exemplarily, the first signaling is the fifth probe response frame. The first electronic device configures the second information in response to the user's first operation of turning on the hotspot, and the second information indicates that the TWT capability of the first electronic device is turned on. The first electronic device turns on the hotspot, turns on the TWT capability of the first electronic device based on the second information, and broadcasts the fourth beacon frame according to a preset period, and the fourth beacon frame includes information that the first electronic device has turned on the TWT capability. The first electronic device configures the first information based on the first request message, and deletes the second information, and the first information indicates that the TWT capability of the first electronic device is turned off. The first electronic device turns off the TWT capability of the first electronic device based on the first information, and generates a fifth probe response frame. The first electronic device sends the fifth probe response frame to the terminal device, and the fifth probe response frame includes information that the first electronic device has turned off the TWT capability.
[0023] In the above scheme, the TWT capability can be turned on when the first electronic device turns on the hotspot. If the terminal device does not support the TWT capability, the terminal device may not be able to scan the first electronic device. To this end, when the first electronic device turns on the hotspot, the first electronic device can first turn on the TWT capability. After the terminal device determines that the first electronic device supports the TWT capability based on the first signaling, the terminal device can notify the first electronic device to turn off the TWT capability, so that the terminal device can scan the first electronic device.
[0024] In one possible implementation, after the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method may further include: the first electronic device broadcasting a fifth beacon frame according to a preset period, the fifth beacon frame including information that an electronic device has turned on the TWT capability (i.e., indicating that the first electronic device supports the TWT capability). The fifth beacon frame may be the second beacon frame, the third beacon frame, or the fourth beacon frame.
[0025] In the above scheme, the terminal device may be a STA device that supports TWT capabilities, or it may be a STA device that does not support TWT capabilities. When the first electronic device turns on the hotspot, the first electronic device cannot predict whether the terminal device supports TWT capabilities. In order to avoid directly turning off the TWT capability of the first electronic device, which results in the terminal device that supports TWT capabilities and the first electronic device being unable to establish a TWT protocol, the first electronic device can first turn on the TWT capability of the beacon frame, and then in the subsequent process, further determine whether to turn off the TWT capability based on whether the timing of the first electronic device has timed out.
[0026] In one possible implementation, after the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method may also include: the first electronic device sends a third signaling and a fourth signaling, the third signaling including information that the first electronic device has turned off the TWT capability (i.e., indicating that the first electronic device does not support the TWT capability), and the fourth signaling including information that the first electronic device has turned on the TWT capability (i.e., indicating that the first electronic device supports the TWT capability); the first electronic device receives a second request message from the terminal device, the second request message is used to request to turn off the TWT capability of the first electronic device. Accordingly, the first electronic device sends the first signaling, including: the first electronic device turns off the TWT capability of the first electronic device based on the second request message, and sends the first signaling to the terminal device.
[0027] Exemplarily, the third signaling and the fourth signaling may both be beacon frames, or both be probe response frames.
[0028] Take the third signaling as the sixth beacon frame and the fourth signaling as the seventh beacon frame as an example. The first electronic device can configure the first information and the second information in response to the user's first operation of turning on the hotspot, the first information indicating to turn off the TWT capability of the first electronic device, and the second information indicating to turn on the TWT capability of the first electronic device; the first electronic device turns on the hotspot based on the first information and the second information. Then, the first electronic device generates a first beacon frame based on the first information, and generates a second beacon frame based on the second information. Then, the first electronic device broadcasts the sixth beacon frame and the seventh beacon frame according to a preset period. Afterwards, the first electronic device reconfigures the first information based on the second request message, and generates the first signaling based on the first information to turn off the TWT capability of the first electronic device, and sends the first signaling to the terminal device.
[0029] In the above scheme, since the terminal device may or may not support the TWT capability, if the TWT capability of the first electronic device is directly turned off, there may be a problem that the terminal device that supports the TWT capability and the first electronic device cannot establish a TWT protocol. When the hotspot is turned on, the first electronic device can send two beacon frames at the same time: one beacon frame indicates that the first electronic device supports the TWT capability, and the other beacon frame indicates that the first electronic device does not support the TWT capability. In this way, after receiving the two beacon frames, the terminal device can notify the first electronic device to turn off or turn on the TWT capability based on the TWT capability of the terminal device, so that the terminal device can scan the first electronic device.
[0030] In the second aspect, an embodiment of the present application provides a method for adjusting TWT. The method can be applied to a terminal device. The terminal device may not support TWT capability, or may not support TWT capability. The method may include: the terminal device starts searching for a wireless local area network; the terminal device receives a first signaling from a first electronic device. The first signaling may include information that the first electronic device has turned off the TWT capability. For example, the first signaling may be a beacon frame periodically sent by the first electronic device, and the first message may also be a probe response frame corresponding to a probe request frame sent by the terminal device.
[0031] In the above scheme, although the first electronic device supports TWT capability, the first electronic device turns off the TWT capability in the first signaling, so that the terminal device that does not support TWT capability can successfully scan the first electronic device through the detection response frame. For example, when the Wi-Fi firmware of the terminal device is produced earlier, so that the terminal device does not support TWT capability, if the parsed content of the first signaling is that the first electronic device does not support TWT capability, then the bottom layer of the terminal device (such as the Wi-Fi driver) will determine that there is no TWT capability conflict between the first electronic device and the terminal device according to the default code logic, and report the parsed content normally to the upper layer of the terminal device (such as the Wi-Fi setting module), so as to scan the first electronic device, thereby improving the success rate of establishing a WLAN connection between the first electronic device and the terminal device.
[0032] In one possible implementation, the first signaling may include a first beacon frame and a first probe response frame. The terminal device starts searching for a wireless local area network, and the terminal device receives the first signaling from the first electronic device, including: the terminal device starts searching for a wireless local area network and periodically receives the first beacon frame; the terminal device sends a first probe request frame to the first electronic device; and the terminal device receives the first probe response frame from the first electronic device. The terminal device does not support TWT capability.
[0033] In the above scheme, when the first electronic device turns on the hotspot, the first electronic device can directly turn off the TWT capability in the first beacon frame, so that the TWT capability configuration of the first beacon frame and the first detection response frame are consistent, avoiding the TWT capability conflict problem that may exist between the first electronic device and the terminal device, and increasing the probability of the terminal device scanning the first electronic device.
[0034] In one possible implementation, the first signaling is a second probe response frame. The terminal device starts searching for a wireless local area network, and the terminal device receives a first signaling from a first electronic device, including: the terminal device starts searching for a wireless local area network and starts timing; when the timing reaches a preset duration, if the terminal device has not established a wireless local area network connection with other devices, the terminal device sends a second probe request frame, and the second probe request frame includes information that the terminal device does not support TWT capabilities; based on the second probe request frame, the terminal device receives a second probe response frame from the first electronic device.
[0035] In the above scheme, after the terminal device starts searching the network, the timing starts. In the initial stage, the terminal device may not indicate to the first electronic device whether the terminal device supports TWT capability. After the timing reaches the preset time, if the AP device is not connected, the terminal device may indicate to the first electronic device that the terminal device does not support TWT capability, so that the first electronic device changes the TWT capability information of the detection response frame and the beacon frame, thereby allowing the terminal device to scan the first electronic device.
[0036] In one possible implementation, the terminal device receives a first signaling from a first electronic device, including: if the terminal device does not support TWT capability, the terminal device sends a third probe request frame to the first electronic device, and the third probe request frame includes information that the terminal device does not support TWT capability; based on the third probe request frame, the terminal device receives a third probe response frame from the first electronic device, and the first signaling is the third probe response frame.
[0037] In the above scheme, the first electronic device may have turned on the TWT capability at the initial moment. The terminal device can indicate in the detection request frame that the terminal device does not support the TWT capability, so that the first electronic device can turn off the TWT capability of the first electronic device, thereby enabling the terminal device to successfully scan the first electronic device.
[0038] In one possible implementation, after the terminal device starts searching for the wireless local area network, the method may further include: if the terminal device supports TWT capability, the terminal device sends a third probe request frame to the first electronic device, and the third probe request frame includes information that the terminal device supports TWT capability; based on the third probe request frame, the terminal device receives a second signaling from the first electronic device, and the second signaling includes information that the first electronic device has turned on the TWT capability.
[0039] In the above scheme, the first electronic device may have turned off the TWT capability at the initial moment. The terminal device can enable the first electronic device to turn on the TWT capability by indicating that the terminal device supports the TWT capability in the detection request frame, thereby enabling the terminal device to establish a TWT connection with the first electronic device.
[0040] In one possible implementation, after the terminal device starts searching for the wireless local area network and before the terminal device receives the first signaling from the first electronic device, the method may further include: the terminal device sends a fourth probe request frame to the first electronic device, and the fourth probe request frame does not include information on whether to turn off the TWT capability of the terminal device.
[0041] In the above solution, the terminal device may not indicate whether the terminal device supports TWT capability in the detection request frame, but the first electronic device may decide to turn off the TWT capability of the first electronic device based on the connection duration of the device.
[0042] In one possible implementation, after the terminal device starts searching for the wireless local area network and before the terminal device receives the first signaling from the first electronic device, the method may further include: the terminal device sends a first request message to the first electronic device, where the first request message is used to request to turn off the TWT capability of the first electronic device. Accordingly, the terminal device receives the first signaling from the first electronic device, including: based on the first request message, the terminal device receives the first signaling from the first electronic device.
[0043] In the above scheme, after the terminal device determines that the first electronic device supports TWT capability based on the message from the first electronic device, the terminal device can notify the first electronic device to turn off the TWT capability, so that the terminal device can successfully scan the first electronic device.
[0044] In one possible implementation, after the terminal device starts searching for the wireless local area network and before the terminal device receives the first signaling from the first electronic device, the method may further include: the terminal device receives a second beacon frame from the first electronic device, the second beacon frame includes second information, and the second information indicates that the TWT capability of the first electronic device is enabled.
[0045] In the above scheme, when the first electronic device turns on the hotspot, the first electronic device cannot predict whether the terminal device supports TWT capability. In order to avoid directly turning off the TWT capability of the first electronic device, which causes the terminal device that supports TWT capability to be unable to establish a TWT protocol with the first electronic device, the first electronic device can first turn on the TWT capability of the beacon frame, and then in the subsequent process, based on whether the terminal device supports TWT capability, or whether the timing of the first electronic device has timed out, or whether a request message from the terminal device to turn off the TWT capability is received.
[0046] In one possible implementation, before the terminal device receives the first signaling from the first electronic device, the method may also include: the terminal device receives a third signaling and a fourth signaling from the first electronic device, the third signaling including information that the first electronic device has turned off the TWT capability, and the fourth signaling including information that the first electronic device has turned on the TWT capability; the terminal device selects the information in the third signaling that the first electronic device has turned off the TWT capability, or selects the information in the fourth signaling that the first electronic device has turned on the TWT capability based on the TWT capability of the terminal device.
[0047] For example, the third signaling and the fourth signaling are both beacon frames. If the terminal device does not support TWT capability, the terminal device selects the third signaling and sends a second request message to the first electronic device, and the second request message is used to request to turn off the TWT capability of the first electronic device; wherein the first signaling is the sixth probe response frame, and the sixth probe response frame is obtained based on the second request message. Alternatively, if the terminal device supports TWT capability, the terminal device selects the fourth signaling and sends a third request message to the first electronic device, and the third request message is used to request to turn on the TWT capability of the first electronic device; wherein the first signaling is the seventh probe response frame, and the seventh probe response frame is obtained based on the third request message.
[0048] For another example, the third signaling and the fourth signaling are both probe response frames. If the terminal device does not support the TWT capability, the terminal device selects the probe response frame information corresponding to the third signaling, and determines to scan the first electronic device for connection. Alternatively, if the terminal device supports the TWT capability, the terminal device selects the probe response frame information corresponding to the fourth signaling, and determines to scan the first electronic device for connection.
[0049] In the above scheme, the third signaling received by the terminal device from the first electronic device includes two messages: one message indicates that the first electronic device supports the TWT capability, and the other message indicates that the first electronic device does not support the TWT capability. When the terminal device does not support the TWT capability, the first electronic device can be notified to turn off the TWT capability based on the TWT capability of the terminal device, so that the terminal device can scan the first electronic device.
[0050] In a third aspect, the present application provides an apparatus comprising units for executing the method described in the first or second aspect above. The apparatus may be configured to execute the method described in the first or second aspect above. For a description of the units in the apparatus, please refer to the description of the first or second aspect above, and for the sake of brevity, no further details will be given here.
[0051] In a fourth aspect, the present application provides an electronic device, which is a first electronic device. The first electronic device may be an AP device. The first electronic device may include one or more processors and a memory. The memory is coupled to the one or more processors, and the memory is configured to store computer program code, the computer program code including computer instructions, which are invoked by the one or more processors to cause the first electronic device to perform the method provided in the first aspect and any possible implementation thereof.
[0052] In a fifth aspect, the present application provides a terminal device. The terminal device may be a STA device. The terminal device may include: one or more processors and a memory. The memory is coupled to the one or more processors, and the memory is used to store computer program code, which includes computer instructions. The one or more processors invoke the computer instructions to cause the terminal device to perform the method provided in the second aspect and any possible implementation thereof.
[0053] In a sixth aspect, the present application provides a communication system, which may include the AP device provided in the fourth aspect and the STA device provided in the fifth aspect.
[0054] In a seventh aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions are executed on a first electronic device (i.e., an AP device), the first electronic device performs the method provided in the first aspect and any possible implementation thereof. When the computer instructions are executed on a terminal device (i.e., a STA device), the terminal device performs the method provided in the second aspect and any possible implementation thereof.
[0055] In an eighth aspect, the present application provides a computer program product. When the computer program product is executed on a first electronic device, the first electronic device performs the method provided in the first aspect and any possible implementation thereof. When the computer program product is executed on a terminal device, the terminal device performs the method provided in the second aspect and any possible implementation thereof.
[0056] In a ninth aspect, the present application provides a chip system. When the chip system is applied to a first electronic device, the chip system includes one or more processors, and the one or more processors are used to call computer instructions to cause the first electronic device to perform the method provided in the first aspect and any possible implementation thereof. When the chip system is applied to a terminal device, the chip system includes one or more processors, and the one or more processors are used to call computer instructions to cause the terminal device to perform the method provided in the second aspect and any possible implementation thereof.
[0057] It can be understood that the beneficial effects that can be achieved by the third aspect device, the fourth aspect electronic device, the fifth aspect electronic device, the sixth aspect communication system, the seventh aspect computer-readable storage medium, the eighth aspect computer program product and the ninth aspect chip system provided above can be referred to as the beneficial effects of the first and second aspects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] 1A and 1B are schematic diagrams of a WLAN system provided in an embodiment of the present application;
[0059] FIG2 is a schematic diagram of a TWT working mechanism provided in an embodiment of the present application;
[0060] FIG3 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0061] FIG4 is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of the present application;
[0062] FIG5 is a schematic diagram of a scenario of turning on the hotspot of a mobile phone 1 according to an embodiment of the present application;
[0063] FIG6 is a schematic diagram of a scenario in which mobile phone 2 fails to search for mobile phone 1 according to an embodiment of the present application;
[0064] FIG7 is a schematic diagram of a scenario in which mobile phone 2 searches for mobile phone 1 according to an embodiment of the present application;
[0065] FIG8 is a schematic diagram of the architecture of an electronic device provided in an embodiment of the present application;
[0066] FIG9 is a flowchart of a method for managing TWT capabilities provided in an embodiment of the present application;
[0067] FIG10 is a schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application;
[0068] FIG11 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application;
[0069] FIG12 is a second schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application;
[0070] FIG13 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application;
[0071] FIG14 is a third schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application;
[0072] FIG15 is a fourth schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application;
[0073] FIG16 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application;
[0074] FIG17 is a fifth schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application;
[0075] FIG18 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application;
[0076] FIG19 is a sixth schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application;
[0077] FIG20 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application;
[0078] FIG21 is a seventh schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application;
[0079] FIG22 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application;
[0080] FIG23 is a schematic diagram of establishing a WLAN connection between an AP and a STA according to an embodiment of the present application. DETAILED DESCRIPTION
[0081] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0082] In this application, the terms "first" and "second" are used to distinguish different objects or to distinguish different processing of the same object, rather than to describe a specific order of objects. For example, the terms "first operation" and "second operation" are used to distinguish different operations, rather than to describe a specific order of operations.
[0083] In the embodiments of the present application, "plurality" refers to two or more.
[0084] Some nouns or terms involved in this application are explained below.
[0085] 1. Wireless local area network (WLAN).
[0086] A WLAN (Wireless Fidelity) network is a network system that uses wireless communication technology to interconnect computer devices, enabling communication and resource sharing. WLANs are implemented in a variety of protocols. For ease of explanation, the following embodiments use the Wireless Fidelity (Wi-Fi) network protocol as an example, which does not limit the present application.
[0087] A Wi-Fi network is mainly composed of access point (AP) devices and station (STA) devices. An AP device is an electronic device that acts as an AP in a Wi-Fi network, and an STA device is an electronic device that acts as an STA in a Wi-Fi network. In a Wi-Fi network, a STA device can establish a wireless connection with an AP device through a built-in wireless network card (such as a Wi-Fi chip). The AP device provides wireless connection services for STA devices. Multiple STA devices can access the same Wi-Fi network through an AP device to connect to each other. The AP device can be connected to the Internet via a wired or wireless connection, that is, the STA device can connect to the Internet through the AP device, for example, download data from the Internet side or upload data to the Internet side, that is, the STA device can implement Wi-Fi Internet access services through the AP device, such as quality of service (QoS) services. QoS services refer to services that ensure quality according to QoS parameters during the transmission of uplink or downlink data using a Wi-Fi network, such as streaming media services.
[0088] 2. Target wake time (TWT).
[0089] TWT is a power-saving mechanism designed for end devices. The AP and STA devices pre-agreed on a TWT time period. When the agreed-upon TWT period expires, the STA device wakes up and waits for a trigger frame from the AP. The AP then exchanges data frames with the STA. After each transmission, the STA device returns to sleep, achieving energy savings.
[0090] This application provides a method for adjusting TWT. This method can be applied when a terminal device such as a mobile phone is used as an access point device to enable a hotspot. If the access point device supports TWT, the access point device will turn off the TWT capability bit in the beacon frame and the probe response frame, so that other devices that do not support TWT can also successfully scan the access point device, thereby improving the success rate of establishing a WLAN connection.
[0091] For example, FIG1A and FIG1B are schematic diagrams of a WLAN system provided in an embodiment of the present application.
[0092] A WLAN system may include one or more basic service sets (BSSs). As shown in Figures 1A and 1B, a WLAN system includes a BSS 100. BSS 100 represents a collection of devices communicating with each other within the coverage area of an access point (AP). BSS 100 may include an AP (e.g., electronic device 110) and multiple STA devices (e.g., terminal device 120, terminal device 130, and terminal device 140) connected to the AP.
[0093] The AP device is an entity that provides wireless media access to a distributed system (DS). In the embodiments of the present application, the AP device may also be referred to as a base station wireless communication terminal. The base station wireless communication terminal may be various types of wireless communication terminals that allocate communication medium resources and perform scheduling in communications with multiple wireless communication terminals. As an example, the AP device may be a terminal device such as a mobile phone, a personal computer (PC), or a tablet computer (Pad). As another example, the AP device may also be a central controller, a base station (BS), a node B, a base transceiver system (BTS), or a station controller. This application does not specifically limit the specific type of AP device, which can be determined based on actual usage requirements.
[0094] A STA device is a predefined device that includes a medium access control (MAC) and a physical layer interface for wireless media that complies with the IEEE 802.11 standard. In embodiments of the present application, a STA device may be a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in a smart city, or a wireless terminal in a smart home. As an example, an AP device and a STA device may be the same type of device, such as both an AP device and a STA device are mobile phones. As another example, an AP device and a STA device may be different types of devices, such as an AP device being a mobile phone and a STA device being a PC.
[0095] In some embodiments, the AP device supports TWT capability; the STA device may or may not support TWT capability. As shown in Figures 1A and 1B, the electronic device 110, the terminal device 120, and the terminal device 130 may support TWT capability, and the terminal device 140 may not support TWT capability.
[0096] For the electronic device 110 and the terminal device 120, although both the electronic device 110 and the terminal device 120 support TWT capabilities, since the terminal device 120 needs to continuously access the Internet through the electronic device 110, the electronic device 110 and the terminal device 120 can establish a long connection based on WLAN technology. That is, the WLAN connection between the electronic device 110 and the terminal device 120 only has an awake state and no sleep state.
[0097] For the electronic device 110 and the terminal device 130, based on the power consumption limit of the terminal device 130, the electronic device 110 and the terminal device 120 can establish a TWT connection. As shown in FIG1A , the terminal device 130 is in an awake state during certain time periods, and the electronic device 110 and the terminal device 130 can exchange data; as shown in FIG1B , the terminal device 130 is in a dormant state during other time periods, and the electronic device 110 and the terminal device 130 cannot exchange data.
[0098] For the electronic device 110 and the terminal device 140, when the electronic device 110 turns on the hotspot, since the electronic device 110 supports the TWT capability, the electronic device 110 will turn on the TWT capability bit in the beacon frame and the probe response frame. Among them, the probe response frame includes a reply message for the probe request frame sent by the terminal device 140, and the probe request frame is used to scan for available electronic devices 110. After the bottom layer of the terminal device 140 (such as the Wi-Fi firmware) receives the beacon frame or the probe response frame, the bottom layer of the terminal device 140 (such as the Wi-Fi driver) parses the beacon frame or the probe response frame. If it is found that the electronic device 110 supports TWT capability, but the terminal device 140 does not support TWT capability due to reasons such as the early production year of the Wi-Fi firmware of the terminal device 140, the Wi-Fi driver of the terminal device 140 will determine that there is a TWT capability conflict between the electronic device 110 and the terminal device 140 according to the default code logic, discard the parsed content of the electronic device 110, and will not report the parsed content of the electronic device 110 to the upper layer of the terminal device 140 (such as the Wi-Fi setting module), thereby causing the upper layer of the terminal device 140 to be unable to obtain the parsed content of the electronic device 110, causing the upper layer of the terminal device 140 to mistakenly determine that the electronic device 110 was not scanned, thereby causing the inability to establish a connection between the electronic device 110 and the terminal device 140.
[0099] In order to avoid the terminal device 140 being unable to scan the electronic device 110, the electronic device 110 can turn off the TWT capability bit in the beacon frame and the probe response frame. When the electronic device 110 turns on the hotspot as an electronic device 110, the electronic device 110 can broadcast a beacon frame at a period of 100 milliseconds, wherein the beacon frame turns off the TWT capability bit to indicate that the electronic device 110 does not support the TWT capability. The terminal device 140 can send a probe request frame, which is used to scan for available electronic devices 110 (i.e., available WLAN networks). After receiving the probe request frame, the electronic device 110 returns a probe response frame to the terminal device 140, and the probe response frame turns off the TWT capability bit to indicate that the electronic device 110 does not support the TWT capability.
[0100] After sending the probe request frame, if the terminal device 140 receives the beacon frame first, the terminal device 140 uses the beacon frame as the scan result and parses the beacon frame; if the terminal device 140 receives the probe response frame first, the terminal device 140 uses the probe response frame as the scan result and parses the probe response frame. The bottom layer of the terminal device 140 (such as the Wi-Fi driver) parses the beacon frame or the probe response frame. Although the terminal device 140 does not support the TWT capability, since the electronic device 110 turns off the TWT capability bit, the Wi-Fi driver of the terminal device 140 determines that there is no logical conflict and reports the parsed content of the electronic device 110 to the upper layer of the terminal device 140 (such as the Wi-Fi setting module) normally. The upper layer of the terminal device 140 determines that the electronic device 110 is scanned, thereby allowing a WLAN connection (i.e., a long connection) to be established between the electronic device 110 and the terminal device 140.
[0101] It should be noted that the AP device and STA device in the above embodiment can be implemented by an independent device or a functional module within a device respectively, and the embodiments of the present application do not specifically limit this. It is understandable that the above functions can be network elements in a hardware device, software functions running on dedicated hardware, virtualization functions instantiated on a platform, or chip systems. In the embodiments of the present application, the chip system can be composed of a chip, or it can include a chip and other discrete devices. In some embodiments, the AP device shown in Figures 1A and 1B can have a hardware structure as shown in Figure 3, and the STA device shown in Figures 1A and 1B can have a hardware structure as shown in Figure 4.
[0102] For example, FIG2 is a schematic diagram of a TWT working mechanism provided in an embodiment of the present application.
[0103] As shown in Figure 2, the TWT requesting station (such as a STA device in a WLAN connection) sends a TWT request frame (TWT request) to the TWT responding station (such as an AP device in a WLAN connection), requesting to set a wake-up time. After receiving the TWT request frame, the TWT responding station sends a TWT response frame (TWT response) to the TWT requesting station. After the interaction between the two parties is successful, a TWT schedule is established between the TWT requesting station and the TWT responding station. The TWT schedule consists of a TWT time period. Typically, a TWT time period includes one or more beacon frame periods. For example, a beacon frame period is 100 milliseconds, and a TWT time period is several minutes, hours, or days. When the time period negotiated by the STA device and the AP device arrives, the STA device will wake up and wait for the trigger frame (trigger) sent by the AP device, and then the two parties will exchange data frames. After each transmission is completed, the STA device returns to sleep state. In addition, the AP device can group terminal devices according to the set TWT time period and connect to multiple terminals at a time, thereby improving energy efficiency.
[0104] For example, FIG3 is a schematic diagram of the hardware structure of an AP device 200 provided in an embodiment of the present application.
[0105] AP device 200 may be an AP device. As shown in Figure 3, AP device 200 includes at least one processor 210, communication circuitry 220, at least one communication interface 230, and memory 240. Processor 210, memory 240, and communication interface 230 may be connected via communication circuitry 220. In this embodiment of the present application, "at least one" may be one, two, three, or more.
[0106] The processor 210 may be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor may also be any other device having a processing function, such as a circuit, a device, or a software module. As an example, the AP device 200 may also include Wi-Fi firmware, and the processor 210 may instruct the Wi-Fi firmware to turn off the TWT capability bit.
[0107] The communication line 220 may include a path for transmitting information between components included in the AP device 200 .
[0108] Communication interface 230 can be used to communicate with other devices or communication networks (such as STA devices, Ethernet, etc.). Communication interface 230 can be a module, circuit, transceiver, or any other device capable of communication. As an example, communication interface 230 can be used to send beacon frames and probe response frames, and to receive probe request frames from STA devices.
[0109] The memory 240 may be a read-only memory (ROM) or other type of static storage device that can store static information and / or instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and / or instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer.
[0110] As an implementable manner, the memory 240 can exist independently of the processor 210, that is, the memory 240 can be a memory external to the processor 210. In this case, the memory 240 can be connected to the processor 210 via the communication line 220 for storing instructions or program codes. When the processor 210 calls and executes the instructions or program codes stored in the memory 240, the method for adjusting the TWT capability provided in the following embodiment of the present application can be implemented. In another possible design, the memory 240 can also be integrated with the processor 210, that is, the memory 240 can be the internal memory of the processor 210. For example, the memory 240 is a cache that can be used to temporarily store some data and / or instruction information, etc.
[0111] As one implementation, processor 210 may include one or more CPUs, such as CPU0 and CPU1 in FIG3 . As another implementation, AP device 200 may include multiple processors. As yet another implementation, AP device 200 may further include an output device 250 and an input device 260. For example, input device 260 may be a keyboard, mouse, microphone, or joystick, and output device 250 may be a display screen or speaker.
[0112] It should be noted that the AP device 200 can be a general-purpose device or a dedicated device. For example, the AP device 200 can be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system, or a device with a similar structure as shown in FIG3 .
[0113] For example, FIG4 is a schematic diagram of the hardware structure of another STA device 300 provided in an embodiment of the present application.
[0114] As shown in FIG. 4 , the STA device 300 may include a processor 310 , a transceiver 320 , a user interface unit 330 , a display unit 340 , and a memory 350 .
[0115] The transceiver 320 is used to transmit and receive wireless signals, such as sending probe request frames and receiving probe response frames. As an example, the transceiver 320 may include at least one communication module that uses different frequency bands, such as a Wi-Fi module and a Bluetooth module. Depending on the performance and requirements of the STA device 300, the transceiver 320 may use only one communication module at a time or multiple communication modules simultaneously. When the STA device 300 includes multiple communication modules, each communication module may be implemented as a separate component, or multiple modules may be integrated into a single chip.
[0116] The user interface unit 330 includes various types of input / output devices provided in the STA device 300. The user interface unit 330 can receive user input by using various input devices, and the processor 310 can control the STA device 300 based on the received user input, such as searching for available hotspots in response to user input on the touch screen.
[0117] The display unit 340 is used to output images on a display screen. Based on control commands from the processor 310, the display unit 340 can output various display objects, such as displaying the identifiers of searched personal hotspots. Furthermore, the memory 350 stores control programs and various data used by the STA device 300. The control programs may include access programs required for the STA device 300 to access an AP device.
[0118] The processor 310 can execute various commands or programs and process data in the STA device 300. Furthermore, the processor 310 can control various units of the STA device 300 and control the transmission or reception of data within the units. For example, the processor 310 can execute a program stored in the memory 350 for accessing an AP device and receive messages transmitted by the AP device, such as a probe response frame. The processor 310 can also be a modem for modulating wireless signals transmitted to the transceiver 320 and demodulating wireless signals received from the transceiver 320.
[0119] As an implementation method, the various components of the STA device 300 shown in FIG4 can be designed and installed in a single chip or multiple chips as required. For example, the processor 310 and the transceiver 320 can be implemented as a single chip or as separate chips. In addition, in embodiments of the present application, certain components of the STA device 300, such as the user interface unit 330 and the display unit 340, can be selectively provided in the STA device 300.
[0120] Below, taking mobile phone 1 that supports TWT capability as an AP device and mobile phone 2 that does not support TWT capability as a STA device as an example, the application scenario of the TWT capability management method provided in this application is illustrated.
[0121] For example, FIG5 is a schematic diagram of a scenario of turning on the hotspot of the mobile phone 1 according to an embodiment of the present application.
[0122] When mobile phone 2 is in arrears or has limited mobile data, the user can enable mobile phone 1's hotspot, allowing mobile phone 2 to access the internet via mobile data or WLAN on mobile phone 1. As shown in Figure 5(a), the settings interface of mobile phone 1 may include settings options such as Bluetooth, mobile network 410, more links, homepage, and wallpaper. The user may click on mobile network 410. In response to the user's click on mobile network 410, mobile phone 1 displays the mobile network settings interface shown in Figure 5(b). The mobile network settings interface may include network settings options such as airplane mode, mobile data, SIM card management, network acceleration, personal hotspot 420, and traffic management. The user may click on personal hotspot 420, causing mobile phone 1 to display the personal hotspot settings interface shown in Figure 5(c). The personal hotspot settings interface may include a personal hotspot switch 430. As an example, by default, personal hotspot switch 430 is in the off state, as shown in Figure 5(c). The user may trigger the switch 430 to switch to the on state, as shown in Figure 5(d), by sliding the circular control on personal hotspot switch 430 to the right. As another example, the user may also trigger the personal hotspot switch 430 to switch to the off state as shown in FIG. 5( c ) by sliding the circular control of the personal hotspot switch 430 to the left as shown in FIG. 5( d ).
[0123] Additionally, users can configure the following settings for their personal hotspot based on their needs: 1. Tap Device Name to set a unique name for the personal hotspot, making it easier for other users to identify Phone 1. For example, Phone 1's device name is "HONOR Magic6." 2. Tap Password to change the password for the personal hotspot. For example, Phone 1's password is "efgweo8." 3. Tap Connected Devices to view the connected device list and blacklist. 4. Tap More Sharing Settings to set the hotspot's single-use data limit and AP frequency band.
[0124] As an implementation method, after the user completes the initial setup of the AP hotspot, the user can also turn on or off the personal hotspot through other entrances. For example, the user can pull down at the top of the screen to trigger the mobile phone 1 to display a drop-down menu, which includes a personal hotspot switch. The user can then trigger the mobile phone 1 to turn on or off the personal hotspot by operating the personal hotspot switch.
[0125] For example, FIG6 is a schematic diagram of a scenario in which mobile phone 2 fails to search for mobile phone 1 after mobile phone 1 turns on the hotspot and if mobile phone 1 turns on the TWT capability, as provided in an embodiment of the present application.
[0126] As shown in Figure 6, the user can open the WLAN interface of mobile phone 2, and mobile phone 2 starts searching for available WLAN networks nearby. For example, mobile phone 2 can broadcast a probe request frame, which is used to scan available WLAN networks. Take mobile phone 1 receiving a probe request frame as an example. Mobile phone 1 returns a probe response frame to mobile phone 2, which indicates that mobile phone 1 supports TWT capabilities. After the bottom layer of mobile phone 2 (such as Wi-Fi firmware) receives the probe response frame, the bottom layer of mobile phone 2 (such as Wi-Fi driver) parses the probe response frame. If phone 2 finds that phone 1 supports TWT capability, but phone 2 does not support TWT capability, then due to reasons such as the older Wi-Fi firmware model of phone 2, the Wi-Fi driver of phone 2 may discard the parsed content of phone 1 and will not report the parsed content of phone 1 to the upper layer of phone 2 (such as the Wi-Fi settings module), resulting in the upper layer of phone 2 being unable to obtain the parsed content of phone 1, causing the upper layer of phone 2 to mistakenly judge that phone 1 was not scanned, and the device name of phone 1, "HONOR Magic6", is not included in the scanned available WLAN list, which makes it impossible for phone 1 and phone 2 to establish a WLAN connection.
[0127] For example, FIG7 is a schematic diagram of a scenario in which mobile phone 2 searches for mobile phone 1 after mobile phone 1 turns on the hotspot and if mobile phone 1 turns off the TWT capability, as provided in an embodiment of the present application.
[0128] As shown in Figure 7, the user can open the WLAN interface of phone 2, and phone 2 begins searching for available nearby WLAN networks. For example, phone 2 can broadcast a probe request frame, which is used to scan for available WLAN networks. For example, phone 1 receives the probe request frame. Phone 1 returns a probe response frame to phone 2, indicating that phone 1 does not support TWT capabilities. After receiving the probe response frame, the lower layer of phone 2 (such as the Wi-Fi firmware) parses the probe response frame and determines that phone 1 does not support TWT capabilities. Although phone 2 does not support TWT capabilities due to factors such as the early production year of its Wi-Fi firmware (such as the Wi-Fi driver), since phone 1 has disabled the TWT capability bit, the Wi-Fi driver of phone 2 determines that there is no logical conflict and reports the parsed content of phone 1 to the upper layer of phone 2 (such as the Wi-Fi settings module) as normal. This parsed content includes the device name of phone 1 being "HONOR Magic6." The upper layer of mobile phone 2 determines that mobile phone 1 has been scanned, and thus includes the device name of mobile phone 1 as "HONOR Magic6" in the scanned available WLAN list, that is, allowing mobile phone 1 and mobile phone 2 to establish a WLAN connection. Further, the user can click the device name "HONOR Magic6" in mobile phone 2, so that mobile phone 2 and mobile phone 1 try to establish a WLAN connection.
[0129] The following example illustrates the software system of an electronic device. The electronic device can be an AP device or a STA device. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, or a microservice architecture. The embodiment of this application uses the Android system with a layered architecture as an example to illustrate the software system architecture of the electronic device.
[0130] For example, FIG8 shows a schematic diagram of the architecture of an electronic device provided in an embodiment of the present application.
[0131] As shown in Figure 8, electronic devices can adopt a layered architecture, dividing the software into several layers, each with clear roles and divisions of labor. Layers communicate with each other through software interfaces. In some embodiments, the software layers of the software structure are divided, from top to bottom, into: application (APP) layer, application framework (FWK) layer, hardware abstraction layer (HAL) layer, and kernel layer. This software architecture runs on top of the hardware layer, which can include Wi-Fi firmware, among others. Wi-Fi firmware can be understood as a set of programs stored within the Wi-Fi chip, which performs the following functions within the Wi-Fi chip: 1. Implementing interconnection with networks such as IP, TCP, UDP, and ICMP; 2. Sending and receiving data packets, performing various processing functions such as packet filtering, multiplexing, encryption, compression, and firewalling; 3. Selecting the next destination for data packets based on routing table information; 4. Exchanging topology information between external gateway protocols and other custom domains; and 5. Implementing network management and system support functions.
[0132] The application layer, also known as the application layer, can include a series of application packages. For example, the application layer can include a Wi-Fi setup module. The Wi-Fi setup module provides a user experience (UX) interface for executing corresponding Wi-Fi setup operations in response to user touch operations on the UX interface, such as turning on the hotspot, setting the hotspot device name, setting the hotspot password, viewing the connected device list and blacklist, and setting the hotspot's single data limit and AP frequency band.
[0133] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a Wi-Fi API and a Wi-Fi service module. When the Wi-Fi settings module is running, the Wi-Fi service module can be accessed through the Wi-Fi API and the corresponding Wi-Fi service can be executed. The Wi-Fi service module may include a Wi-Fi management module (WifiManager), a hotspot management module (SoftApManager), and a hotspot configuration module (SoftApConfiguration). The Wi-Fi management module (WifiManager) is a class used to manage Wi-Fi, such as scanning for networks, turning networks on and off, obtaining network status, and monitoring network signals. The hotspot management module (SoftApManager) is a class responsible for hotspot management, such as turning hotspots on and off, obtaining current hotspot status, changing hotspot names and passwords, obtaining hotspot names and passwords, registering and unregistering hotspot status monitoring, etc. SoftApConfiguration is a class used to configure network parameters.
[0134] The Hardware Abstraction Layer (HAL) has standard interfaces implemented by hardware vendors. For example, the HAL may include the hosted access point daemon (hostapd). Hostapd is a daemon that runs in user mode. It reads the configuration file from SoftApConfiguration and switches the wireless network card to master mode, simulating AP functionality. It then acts as an AP authentication server, managing STA access and authentication.
[0135] The kernel layer is the layer between hardware and software, belonging to the bottom layer of the Android system. The kernel layer can include various driver interfaces, such as Wi-Fi drivers.
[0136] It should be noted that although the embodiments of the present application are described using the Android system as an example, the basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows. In addition, the layers in the system architecture shown in Figure 8 and the components contained in each layer do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer layers than shown, and each layer may include more or fewer components, and this application does not limit this.
[0137] It is understandable that in order to implement the TWT capability management method in the embodiment of the present application, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments.
[0138] The following uses the system architecture shown in Figure 8 as an example of the system architecture of a first electronic device to specifically describe the specific interaction process between the first electronic device and the terminal device in conjunction with several embodiments. The first electronic device is an AP device, the terminal device is a STA device, and the first electronic device may include a Wi-Fi setup module, a Wi-Fi service module, hostapd, a Wi-Fi driver, and Wi-Fi firmware.
[0139] Example 1
[0140] In the first embodiment, the first electronic device is an AP device that supports TWT capability, and the terminal device is a STA device that does not support TWT capability. When the first electronic device turns on the hotspot, the first electronic device directly turns off the TWT capability.
[0141] For example, FIG9 is a flowchart of a method for managing TWT capabilities provided in an embodiment of the present application.
[0142] S01: A Wi-Fi setting module of a first electronic device receives an operation (referred to as a first operation) input by a user to enable a hotspot.
[0143] When the terminal device is in arrears or the mobile data traffic is limited, the user can turn on the hotspot of the first electronic device so that the terminal device can access the Internet through the mobile data or WLAN network of the first electronic device, and the first electronic device acts as an AP to provide network services for the terminal device.
[0144] The Wi-Fi setup module of the first electronic device provides multiple UX interfaces as entry points for activating the hotspot. For example, the first electronic device is a mobile phone 1 as shown in Figures 5 or 7. For example, a user can trigger mobile phone 1 to activate the hotspot by operating the personal hotspot switch in the personal hotspot setup interface of mobile phone 1. For another example, a user can trigger mobile phone 1 to activate the hotspot by operating the personal hotspot switch in the drop-down menu of mobile phone 1.
[0145] S02: The Wi-Fi setup module of the first electronic device notifies the Wi-Fi service module to enable the hotspot through the Wi-Fi API interface (not shown in FIG9 ). The Wi-Fi service module calls hostapd to enable the hotspot. Hostapd controls the Wi-Fi firmware to enable the hotspot through the Wi-Fi driver.
[0146] As an implementation method, as shown in Figure 8, the Wi-Fi service module may include a Wi-Fi management module (WifiManager), a hotspot management module (SoftApManager), and a hotspot configuration module (SoftApConfiguration). Specifically, the Wi-Fi management module (WifiManager) can notify the hotspot management module (SoftApManager) to turn on the hotspot. At the same time, the Wi-Fi management module (WifiManager) can notify the hotspot configuration module (SoftApConfiguration) to configure network parameters. After the hotspot configuration module (SoftApConfiguration) configures the network parameters, the hotspot configuration module (SoftApConfiguration) passes the configured network parameters to the hotspot configuration module (SoftApConfiguration). The hotspot management module (SoftApManager) notifies hostapd to turn on the hotspot and passes the configured network parameters to hostapd. Hostapd controls the Wi-Fi firmware to turn on the hotspot through the Wi-Fi driver, and passes the configured network parameters to the Wi-Fi firmware through the Wi-Fi driver. The Wi-Fi firmware stores the configured network parameters.
[0147] Exemplarily, the hotspot configuration module (SoftApConfiguration) can configure at least one of the following network parameters: frequency band, bandwidth, channel, encryption method, TWT capability parameters, beacon frame interface (beacon_port), operating channel validation (OCV), service set identifier (SSID), whether beamforming features / functions are supported, MAC address, country code, and whether it is a hidden hotspot, etc.
[0148] It should be noted that, different from the TWT capability parameter indication of "the first electronic device supports TWT capability" configured for the electronic device supporting TWT capability, in Example 1, the TWT capability parameter indication of "the first electronic device does not support TWT capability" configured for the first electronic device is equivalent to turning off the TWT capability of the first electronic device.
[0149] S03, the Wi-Fi firmware turns on the hotspot and disables the TWT capability when the hotspot is turned on.
[0150] After the Wi-Fi firmware turns on the hotspot, the first electronic device generates a beacon frame based on the configured network parameters and periodically broadcasts the beacon frame (which may be referred to as a first beacon frame) through the Wi-Fi firmware. The first beacon frame indicates that the first electronic device does not support the TWT capability, that is, the TWT capability of the first electronic device is turned off.
[0151] After turning on the hotspot, the first electronic device can generate a beacon frame based on the configured network parameters, and periodically broadcast the beacon frame through the Wi-Fi firmware according to a certain preset period (such as 0.1S), so as to tell the outside world the specific performance of the Wi-Fi network. The beacon frame consists of multiple fields, and each field is used to carry different information. For example, the information carried by the beacon frame may include: beacon frame timestamp, beacon frame period, beacon frame performance information (such as response mode, modulation mechanism, whether radio measurement is supported, whether spectrum management is supported, etc.), etc. It should be noted that, unlike the beacon frame broadcast by an electronic device that supports TWT capability, indicating that the device supports TWT capability, in Example 1, the broadcast beacon frame of the first electronic device indicates that TWT capability is not supported.
[0152] For example, the Wi-Fi version enabled by the first electronic device may be any of the following:
[0153] The seventh generation of wireless network technology, Wi-Fi7;
[0154] The sixth-generation wireless network technology, Wi-Fi 6;
[0155] Wi-Fi5, the fifth-generation wireless network technology;
[0156] The fourth generation of wireless network technology Wi-Fi4.
[0157] If the Wi-Fi version turned on by the first electronic device is Wi-Fi 7, the beacon frame broadcast by the first electronic device includes: extremely high throughput (EHT) capability bit, high efficiency (HE) capability bit, enhanced high throughput (VHT) capability bit, high throughput (HT) capability bit, and extended capability bit. Among them, the EHT capability bit, HE capability bit, VHT capability bit, and HT capability bit do not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device can set the TWT capability bit in the extended capability bit of the beacon frame to indicate that the first electronic device does not support TWT capability.
[0158] If the Wi-Fi version enabled by the first electronic device is Wi-Fi 6, the beacon frame broadcast by the first electronic device includes: HE capability bit, VHT capability bit, HT capability bit, and extended capability bit. Among them, the HE capability bit, VHT capability bit, and HT capability bit do not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device can set the TWT capability bit in the extended capability bit of the beacon frame to indicate that the first electronic device does not support TWT capability.
[0159] If the Wi-Fi version enabled by the first electronic device is Wi-Fi 5, the beacon frame broadcast by the first electronic device includes: a VHT capability bit, an HT capability bit, and an extended capability bit. The VHT capability bit and the HT capability bit do not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device can set the TWT capability bit in the extended capability bit of the beacon frame to indicate that the first electronic device does not support the TWT capability.
[0160] If the Wi-Fi version enabled by the first electronic device is Wi-Fi 4, the beacon frame broadcast by the first electronic device includes: an HT capability bit and an extended capability bit. The HT capability bit does not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device can set the TWT capability bit in the extended capability bit of the beacon frame to indicate that the first electronic device does not support the TWT capability.
[0161] Taking the Wi-Fi version enabled on the first electronic device as Wi-Fi 5 as an example, octet 10 of the extended capability bit in the beacon frame is as follows:
[0162] Extended Capabilities:0x40(octet 10)
[0163] .......0 / / Indicates that the 72nd element (element ID=72) does not have the FILS capability.
[0164] ......0. / / represents that the 73rd element (element ID=73) does not have the spread spectrum management function.
[0165] .....0.. / / Indicates that the 74th element (element ID=74) does not support future channel isolation.
[0166] ....0... / / Represents the 75th element (element ID=75) pre-association service discovery: 0x0.
[0167] ...0.... / / represents the 76th element (element ID = 76) reserved: 0x0.
[0168] ..0..... / / represents the 77th element (element ID=77) TWT initiator does not support TWT capabilities.
[0169] .0...... / / Represents the 78th element (element ID=78) The TWT responder does not support TWT capabilities.
[0170] 0....... / / Represents that the 79th element (element ID=79) does not support OBSS narrow bandwidth in OFDMA tolerance.
[0171] Combined with the description of the above embodiment, the TWT initiator is the STA device (i.e., the terminal device), and the TWT responder is the AP device (i.e., the first electronic device). By setting the 78th element of the beacon frame to 0 (which can be called the first information), it can be indicated that the first electronic device does not support the TWT capability, which is equivalent to turning off the TWT capability of the first electronic device.
[0172] S04: The terminal device receives an operation of scanning a wireless network input by a user.
[0173] Taking the mobile phone 2 as an example, the user can operate the mobile phone 2 to trigger the mobile phone to open the WLAN interface and start scanning nearby wireless networks.
[0174] S05 , the terminal device sends a probe request frame (which may be referred to as a first probe request frame) based on the user input operation of scanning wireless networks, to scan for available AP devices located near the terminal device, that is, available WLAN networks.
[0175] The terminal device's Wi-Fi firmware is older, resulting in lower capabilities and no support for TWT. For example, if the terminal device uses Wi-Fi 4 or Wi-Fi 5, the terminal device does not support TWT.
[0176] The Probe Request frame can include a specific SSID, a wildcard, or a null value. When the SSID Parameter Set field is a wildcard or null value, the terminal device requests that any nearby access point (AP) reply with a Probe Response frame for all SSIDs. When the SSID Parameter Set field is a specific SSID, the terminal device requests that nearby APs reply with a Probe Response frame only if they support that SSID.
[0177] It should be noted that the detection request frame may carry information on whether the STA supports TWT capabilities, or may not carry information on whether the STA supports TWT capabilities, and this application does not limit this.
[0178] S06, the Wi-Fi firmware of the first electronic device generates a probe response frame (which may be referred to as a first probe response frame) based on the received probe request frame and the stored network parameters, and returns the first probe response frame to the terminal device.
[0179] The probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The probe response frame indicates that the first electronic device does not support the TWT capability, that is, the TWT capability of the first electronic device is turned off.
[0180] It should be noted that, unlike the detection response frame sent by an electronic device supporting TWT capability to indicate that the device supports TWT capability, in embodiment 1, the detection response frame indicates that the first electronic device does not support TWT capability.
[0181] If the Wi-Fi version enabled by the first electronic device is Wi-Fi 7, the beacon frame broadcast by the first electronic device includes: EHT capability bit, HE capability bit, VHT capability bit, HT capability bit, and extended capability bit. Among them, the EHT capability bit, HE capability bit, VHT capability bit, and HT capability bit do not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device can set the TWT capability bit in the extended capability bit of the probe response frame to indicate that the first electronic device does not support TWT capability.
[0182] If the Wi-Fi version enabled by the first electronic device is Wi-Fi 6, the probe response frame broadcast by the first electronic device includes: HE capability bit, VHT capability bit, HT capability bit, and extended capability bit. Among them, the HE capability bit, VHT capability bit, and HT capability bit do not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device can set the TWT capability bit in the extended capability bit of the probe response frame to indicate that the first electronic device does not support TWT capability.
[0183] If the Wi-Fi version enabled by the first electronic device is Wi-Fi 5, the probe response frame broadcast by the first electronic device includes: a VHT capability bit, an HT capability bit, and an extended capability bit. Among them, the VHT capability bit and the HT capability bit do not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device can set the TWT capability bit in the extended capability bit of the probe response frame to indicate that the first electronic device does not support the TWT capability.
[0184] If the Wi-Fi version enabled by the first electronic device is Wi-Fi 4, the probe response frame broadcast by the first electronic device includes: an HT capability bit and an extended capability bit. The HT capability bit does not include the TWT capability bit, and the extended capability bit includes the TWT capability bit. The first electronic device may set the TWT capability bit in the extended capability bit of the probe response frame to indicate that the first electronic device does not support the TWT capability.
[0185] Taking the Wi-Fi version enabled on the first electronic device as Wi-Fi 5 as an example, octet 10 of the extended capability bit in the probe response frame is as follows:
[0186] Extended Capabilities:0x40(octet 10)
[0187] .......0 / / Indicates that the 72nd element (element ID=72) does not have the FILS capability.
[0188] ......0. / / represents that the 73rd element (element ID=73) does not have the spread spectrum management function.
[0189] .....0.. / / Indicates that the 74th element (element ID=74) does not support future channel isolation.
[0190] ....0... / / Represents the 75th element (element ID=75) pre-association service discovery: 0x0.
[0191] ...0.... / / represents the 76th element (element ID = 76) reserved: 0x0.
[0192] ..0..... / / represents the 77th element (element ID=77) TWT initiator does not support TWT capabilities.
[0193] .0...... / / Represents the 78th element (element ID=78) The TWT responder does not support TWT capabilities.
[0194] 0....... / / Represents that the 79th element (element ID=79) does not support OBSS narrow bandwidth in OFDMA tolerance.
[0195] In combination with the description of the above embodiment, by setting the 78th element of the detection response frame to 0 (which can be called the first information), it can be indicated that the first electronic device does not support TWT capability, which is equivalent to turning off the TWT capability of the first electronic device.
[0196] S07, the terminal device parses the received probe response frame, and determines that an AP device (ie, the first electronic device) has been scanned based on the parsed content.
[0197] For example, let's consider mobile phone 1 as the first electronic device and mobile phone 2 as the terminal device. After mobile phone 2 scans mobile phone 1, as shown in Figure 7, the available WLAN list displayed on mobile phone 2 includes the device name of mobile phone 1 as "HONOR Magic6." Mobile phones 1 and 2 can then perform operations such as authentication, association, a four-step handshake, and establishing a dynamic host configuration protocol (DHCP). For details, refer to the following embodiments and are not detailed here.
[0198] With reference to the description of the above embodiment, after the terminal device receives the detection response frame from the first electronic device, the terminal device can parse the detection response frame. If the parsed content is that the first electronic device supports TWT capability, the Wi-Fi driver of the terminal device will determine that there is a TWT capability conflict between the first electronic device and the terminal device according to the default code logic, discard the parsed content, and will not report the parsed content to the upper layer of the terminal device (such as the Wi-Fi setting module), thereby causing the upper layer of the terminal device to be unable to obtain the parsed content, causing the upper layer of the STA device to mistakenly determine that no AP device was scanned. In embodiment one, the first electronic device can change the parsed content obtained by the terminal device to that the first electronic device does not support TWT capability by turning off the TWT capability. In this way, the Wi-Fi driver of the terminal device determines that there is no logical conflict, and reports the parsed content to the upper layer of the terminal device (such as the Wi-Fi setting module) normally, thereby scanning the first electronic device.
[0199] It should be noted that the first embodiment is illustrated by taking the example of the terminal device determining that the first electronic device is scanned based on the parsed content of the detection response frame, which does not limit the present application. Referring to the description of S03 and S06 above, since the beacon frame and the detection response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support the TWT capability, the terminal device can determine that the first electronic device does not support the TWT capability based on the beacon frame, and can also determine that the first electronic device does not support the TWT capability based on the detection response frame.
[0200] As an implementable method, after S05, if the terminal device first receives a beacon frame from the first electronic device, then the terminal device can determine, based on the beacon frame, that the first electronic device does not support TWT capability; after S05, if the terminal device first receives a detection response frame from the first electronic device, then the terminal device can determine, based on the detection response frame, that the first electronic device does not support TWT capability.
[0201] For example, FIG10 is one of the schematic diagrams of the scenario of STA scanning AP provided in an embodiment of the present application.
[0202] Among them, AP supports TWT capability, but STA does not support TWT capability.
[0203] As shown in (a) in Figure 10, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame i, beacon frame i+1, beacon frame i+2... Each beacon frame indicates that the AP does not support TWT capability, that is, the TWT capability of the AP is turned off. After the AP receives the probe request frame sent by the STA, the AP first sends a probe response frame, and then sends beacon frame i+1, so that the STA receives the probe response frame first. In this case, the STA can parse the probe response frame and determine that the AP does not support TWT capability, thereby scanning the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0204] As shown in (b) of Figure 10, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame i, beacon frame i+1, beacon frame i+2... Each beacon frame indicates that the AP does not support TWT capability, that is, the TWT capability of the AP is turned off. After the AP receives the probe request frame sent by the STA, the AP first sends beacon frame i+1, and then sends a probe response frame, so that the STA receives beacon frame i+1 first. In this case, the STA can parse the beacon frame i+1 and determine that the AP does not support TWT capability, thereby scanning the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0205] In embodiment one, the beacon frame and the detection response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support TWT capability. The terminal device can determine whether the AP supports TWT capability based on the frame received first, thereby improving the speed at which the terminal device discovers the AP.
[0206] Example 2
[0207] In the second embodiment, the first electronic device is an AP device that supports TWT capabilities, and the terminal device is an STA device that does not support TWT capabilities. When the first electronic device turns on the hotspot, the first electronic device first turns on the TWT capability, and then turns off the TWT capability if the STA device is not connected after the timing reaches the preset time.
[0208] For example, FIG11 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application.
[0209] S08: The Wi-Fi setting module of the first electronic device receives an operation (referred to as a first operation) input by the user to enable a hotspot.
[0210] S09 , the Wi-Fi setting module notifies the Wi-Fi service module to turn on the hotspot through the Wi-Fi API interface (not shown in FIG11 ).
[0211] For the specific implementation of S08-S09, please refer to the description of S01-S02 in the first embodiment, which will not be repeated here.
[0212] S10: The Wi-Fi service module calls hostapd to start the hotspot and starts timing. Hostapd controls the Wi-Fi firmware to start the hotspot through the Wi-Fi driver.
[0213] On S11, the Wi-Fi firmware turns on the hotspot and enables the TWT capability when the hotspot is turned on.
[0214] Unlike the first embodiment, in which the network parameters configured by the Wi-Fi service module when opening the hotspot indicate that "the first electronic device does not support TWT capabilities," in the second embodiment, the network parameters configured by the Wi-Fi service module when opening the hotspot indicate that "the first electronic device supports TWT capabilities." That is, the network parameters configured by the Wi-Fi service module when opening the hotspot conform to the actual TWT capabilities.
[0215] After the Wi-Fi firmware turns on the hotspot, the first electronic device may generate a beacon frame (which may be referred to as a second beacon frame) based on the configured network parameters and periodically broadcast the second beacon frame through the Wi-Fi firmware. The second beacon frame indicates that the first electronic device supports the TWT capability, that is, the TWT capability of the first electronic device is turned on.
[0216] Referring to the description of S03 in the above embodiment 1, the Wi-Fi version enabled by the first electronic device may be Wi-Fi 7, Wi-Fi 6, Wi-Fi 5 or Wi-Fi 4, and the first electronic device may set the TWT capability bit in the extended capability bit of the beacon frame to indicate that the first electronic device supports TWT capability.
[0217] Taking the Wi-Fi version enabled on the first electronic device as Wi-Fi 5 as an example, octet 10 of the extended capability bit in the beacon frame broadcast by the first electronic device is as follows:
[0218] Extended Capabilities:0x40(octet 10)
[0219] .......0 / / Indicates that the 72nd element (element ID=72) does not have the FILS capability.
[0220] ......0. / / represents that the 73rd element (element ID=73) does not have the spread spectrum management function.
[0221] .....0.. / / Indicates that the 74th element (element ID=74) does not support future channel isolation.
[0222] ....0... / / Represents the 75th element (element ID=75) pre-association service discovery: 0x0.
[0223] ...0.... / / represents the 76th element (element ID = 76) reserved: 0x0.
[0224] ..0..... / / represents the 77th element (element ID=77) TWT initiator does not support TWT capabilities.
[0225] .1...... / / Represents the 78th element (element ID=78) TWT responder supports TWT capabilities.
[0226] 0....... / / Represents that the 79th element (element ID=79) does not support OBSS narrow bandwidth in OFDMA tolerance.
[0227] By setting the 78th element of the beacon frame to 1 (which can be called the second information), it can be indicated that the first electronic device supports TWT capability, which is equivalent to turning on the TWT capability of the first electronic device.
[0228] S12: The terminal device receives an operation of scanning a wireless network input by a user.
[0229] S13: The terminal device sends a probe request frame based on the user input operation of scanning wireless networks, so as to scan for available AP devices located near the terminal device, that is, available WLAN networks.
[0230] S14, the Wi-Fi firmware generates a probe response frame based on the received probe request frame and the stored network parameters, and returns the probe response frame to the terminal device.
[0231] The probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The probe response frame indicates that the first electronic device supports the TWT capability, that is, the TWT capability of the first electronic device is enabled.
[0232] Referring to the description of S06 in the above embodiment 1, the Wi-Fi version enabled by the first electronic device may be Wi-Fi 7, Wi-Fi 6, Wi-Fi 5 or Wi-Fi 4, and the first electronic device may set the TWT capability bit in the detection response frame to indicate that the first electronic device supports TWT capability.
[0233] Taking the Wi-Fi version enabled on the first electronic device as Wi-Fi 5 as an example, octet 10 of the extended capability bit in the probe response frame is as follows:
[0234] Extended Capabilities:0x40(octet 10)
[0235] .......0 / / Indicates that the 72nd element (element ID=72) does not have the FILS capability.
[0236] ......0. / / represents that the 73rd element (element ID=73) does not have the spread spectrum management function.
[0237] .....0.. / / Indicates that the 74th element (element ID=74) does not support future channel isolation.
[0238] ....0... / / Represents the 75th element (element ID=75) pre-association service discovery: 0x0.
[0239] ...0.... / / represents the 76th element (element ID = 76) reserved: 0x0.
[0240] ..0..... / / represents the 77th element (element ID=77) TWT initiator does not support TWT capabilities.
[0241] .1...... / / Represents the 78th element (element ID=78) TWT responder supports TWT capabilities.
[0242] 0....... / / Represents that the 79th element (element ID=79) does not support OBSS narrow bandwidth in OFDMA tolerance.
[0243] By setting the 78th element of the detection response frame to 1, it can be indicated that the first electronic device supports the TWT capability, which is equivalent to turning on the TWT capability of the first electronic device.
[0244] S15, the terminal device parses the received probe response frame, and determines based on the parsed content that no AP device (ie, the first electronic device) is scanned.
[0245] Referring to the description of the above embodiment, if the parsed content shows that the first electronic device supports TWT capability, the Wi-Fi driver of the terminal device will determine that there is a TWT capability conflict between the first electronic device and the terminal device according to the default code logic, and discard the parsed content, but will not report the parsed content to the upper layer of the terminal device (such as the Wi-Fi setting module), thereby causing the upper layer of the terminal device to be unable to obtain the parsed content, causing the upper layer of the STA device to mistakenly determine that no AP device was scanned. In the case that the terminal device does not scan the AP device, the terminal device will continue to send a probe request frame, and the first electronic device will continue to send a probe response frame indicating that the TWT capability is enabled, but the terminal device still will not scan the AP device... This causes the first electronic device and the terminal device to be unable to establish a WLAN connection.
[0246] S16: When the timing duration reaches a preset duration (eg, 2 minutes), the Wi-Fi service module determines whether a connection has been established with the STA device.
[0247] If the first electronic device establishes a connection with the STA device, the Wi-Fi service module does not perform any processing operations. It should be noted that the STA device here is not limited to a terminal device, but can also be other electronic devices. It should be understood that when the first electronic device establishes a connection with the STA device, it means that the STA device has successfully scanned the first electronic device, and therefore no further processing operations are required.
[0248] If the first electronic device is not connected to any STA device, it may be that other devices have not scanned the first electronic device, and the Wi-Fi service module executes the following S17.
[0249] S17, the Wi-Fi service module sends a configuration update message to the Wi-Fi firmware through hostapd and the Wi-Fi driver.
[0250] Among them, the configuration update message is used to indicate that "the first electronic device does not support TWT capability", which is equivalent to turning off the TWT capability of the first electronic device.
[0251] As an implementable manner, the hotspot configuration module (SoftApConfiguration) of the Wi-Fi service module can reconfigure all network parameters.
[0252] As another possible implementation method, the hotspot configuration module (SoftApConfiguration) of the Wi-Fi service module can only reconfigure the elements indicating whether the first electronic device supports TWT capabilities. Taking the Wi-Fi version enabled on the first electronic device as Wi-Fi 5 as an example, the hotspot configuration module (SoftApConfiguration) can reconfigure the 78th element of the extended capability bit to "0" to indicate that "the first electronic device does not support TWT capabilities."
[0253] S18, Wi-Fi firmware disables TWT capability.
[0254] After the Wi-Fi firmware turns off the TWT capability, the Wi-Fi firmware may generate a new beacon frame based on the reconfigured network parameters and periodically broadcast the new beacon frame, wherein the new beacon frame indicates that the first electronic device does not support the TWT capability, that is, the TWT capability of the first electronic device is turned off.
[0255] S19: The terminal device resends the probe request frame (which may be referred to as a second probe request frame). Accordingly, the Wi-Fi firmware generates a probe response frame (which may be referred to as a second probe response frame) based on the received second probe request frame, and returns the second probe response frame to the terminal device.
[0256] The probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The probe response frame indicates that the first electronic device does not support the TWT capability, that is, the TWT capability of the first electronic device is turned off.
[0257] It should be noted that the detection request frame may carry information on whether the STA supports TWT capabilities, or may not carry information on whether the STA supports TWT capabilities, and this application does not limit this.
[0258] S20: The terminal device parses the received probe response frame and determines that an AP device (ie, the first electronic device) has been scanned based on the parsed content.
[0259] Then, the first electronic device and the terminal device may further perform operations such as authentication, association, four-step handshake, and DHCP establishment, for which reference may be made to the description of the following embodiment and will not be repeated here.
[0260] For the specific implementation of S18-S20, please refer to the description of S05-S07 in Example 1, which will not be repeated here.
[0261] In Example 2, the terminal device as a STA device does not support TWT capability. In actual implementation, the terminal device as a STA device may also support TWT capability. When the terminal device supports TWT capability, there is no problem of being unable to scan the first electronic device due to the low capability of the terminal device. In view of this situation, when the first electronic device turns on the hotspot, the first electronic device can first turn on the TWT capability, and then turn off the TWT capability of the first electronic device if the STA device is not connected after the timing reaches the preset time, thereby avoiding the problem of directly turning off the TWT capability of the first electronic device, resulting in the terminal device that supports TWT capability and the first electronic device being unable to establish a TWT protocol.
[0262] Referring to the description of S18-S20 above, since the beacon frame and the probe response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support TWT capability, the terminal device can execute the following scheme: after S19, if the terminal device first receives the beacon frame from the first electronic device, then the terminal device can determine that the first electronic device does not support TWT capability based on the beacon frame; after S19, if the terminal device first receives the probe response frame from the first electronic device, then the terminal device can determine that the first electronic device does not support TWT capability based on the probe response frame.
[0263] For example, FIG12 is a second schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application.
[0264] Among them, AP supports TWT capability, but STA does not support TWT capability.
[0265] As shown in (a) in Figure 12, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame i, beacon frame i+1... Each beacon frame indicates that the AP supports TWT capability, that is, the TWT capability of the AP is turned on. In addition, after sending the first beacon frame, the AP starts timing. After the AP receives the probe request frame a sent by the STA, the AP returns the probe response frame a. Since the probe response frame a indicates that the AP supports TWT capability, but the STA does not support TWT capability, the STA mistakenly determines that the AP has not been scanned and continues to send probe response frame a+1... After the timing reaches 2S, the AP reconfigures the network parameters to indicate that the AP does not support TWT capability, that is, the TWT capability of the AP is turned off. After the AP receives the probe request frame b sent by the STA, the AP first sends the probe response frame b and then sends the beacon frame j+1, where both the probe response frame b and the beacon frame j+1 indicate that the AP does not support TWT capability. The STA first receives the probe response frame b and parses it to determine that the AP does not support TWT capabilities, thereby scanning the AP. The STA then sends an authentication request frame to the AP for authentication.
[0266] As shown in (b) of Figure 12, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame i, beacon frame i+1... Each beacon frame indicates that the AP supports TWT capability, that is, the TWT capability of the AP is turned on. In addition, after sending the first beacon frame, the AP starts timing. After the AP receives the probe request frame a sent by the STA, the AP returns the probe response frame a. Since the probe response frame a indicates that the AP supports TWT capability, but the STA does not support TWT capability, the STA mistakenly determines that the AP has not been scanned and continues to send probe response frame a+1... After the timing reaches 2S, the AP reconfigures the network parameters to indicate that the AP does not support TWT capability, that is, the TWT capability of the AP is turned off. After the AP receives the probe request frame b sent by the STA, the AP first sends a beacon frame j+1 and then sends a probe response frame b, where both the beacon frame j+1 and the probe response frame b indicate that the AP does not support TWT capability. The STA first receives beacon frame j+1 and parses it to determine that the AP does not support TWT capabilities, thereby scanning the AP. The STA then sends an authentication request frame to the AP for authentication.
[0267] In embodiment two, after the TWT capability of the first electronic device is turned off, the beacon frame and the detection response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support the TWT capability. The terminal device can determine whether the AP supports the TWT capability based on the frames received first, thereby improving the speed at which the terminal device discovers the AP.
[0268] Example 3
[0269] In Example 3, the first electronic device is an AP device that supports TWT capabilities, and the terminal device may be a STA device that supports TWT capabilities, or the terminal device may be a STA device that does not support TWT capabilities. When the first electronic device turns on the hotspot, the first electronic device first turns on the TWT capability, and then determines whether to turn off the TWT capability of the first electronic device based on the TWT capability of the terminal device carried in the detection request frame.
[0270] For example, FIG13 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application.
[0271] S21: The Wi-Fi setting module of the first electronic device receives an operation (referred to as a first operation) input by a user to enable a hotspot.
[0272] S22: The Wi-Fi setup module notifies the Wi-Fi service module to enable the hotspot through the Wi-Fi API (not shown in FIG13 ). The Wi-Fi service module calls hostapd to enable the hotspot. Hostapd controls the Wi-Fi firmware to enable the hotspot through the Wi-Fi driver.
[0273] S23, the Wi-Fi firmware turns on the hotspot and enables the TWT capability when the hotspot is turned on.
[0274] In the third embodiment, the network parameters (which may be referred to as the second information) configured by the Wi-Fi service module when opening the hotspot indicate that "the first electronic device supports TWT capabilities." That is, the network parameters configured by the Wi-Fi service module when opening the hotspot are consistent with the actual TWT capabilities.
[0275] After the Wi-Fi firmware turns on the hotspot, the first electronic device may generate a beacon frame (which may be referred to as a third beacon frame) based on the configured network parameters and periodically broadcast the third beacon frame through the Wi-Fi firmware. The third beacon frame indicates that the first electronic device supports the TWT capability, that is, the TWT capability of the first electronic device is turned on.
[0276] It should be noted that the implementation of S21-S23 in Example 3 is similar to that of S08-S11 in Example 2. The difference between the two is that S08-S11 has a timing mechanism, while S21-S23 does not. For the specific implementation of S21-S23, please refer to the description of S08-S11 and will not be repeated here.
[0277] S24, the terminal device receives an operation of scanning a wireless network input by the user.
[0278] S25 , the terminal device sends a probe request frame (which may be referred to as a third probe request frame) based on the user input operation of scanning wireless networks, to scan for available AP devices located near the terminal device, that is, available WLAN networks.
[0279] In one possible implementation, the terminal device may be a STA device that supports TWT capabilities.
[0280] In another possible implementation, the terminal device may also be a STA device that does not support TWT capability. For example, when the terminal device uses Wi-Fi4 or Wi-Fi5, the terminal device does not support TWT capability. Taking the case where the Wi-Fi version enabled by the terminal device is Wi-Fi5, the message of the probe request frame broadcast by the terminal device includes: VHT capability bit, HT capability bit, and extended capability bit. As an example, the VHT capability bit, HT capability bit, and extended capability bit do not include the TWT capability bit. At this moment, it is assumed that the terminal device does not support TWT capability. As another example, the VHT capability bit and HT capability bit do not include the TWT capability bit, the extended capability bit includes the TWT capability bit, and the TWT capability bit of the extended capability bit indicates that the terminal device does not support TWT capability.
[0281] S26: The Wi-Fi firmware reports the received third probe request frame to the Wi-Fi driver. The Wi-Fi driver parses the third probe request frame and transmits the parsed content (which may be referred to as the first parsed content) to the Wi-Fi service module through the Wi-Fi driver and hostapd.
[0282] S27, the Wi-Fi service module determines whether the terminal device supports TWT capabilities based on the parsed content.
[0283] If the first parsed content indicates that the terminal device supports TWT capabilities, then there is no conflict between the TWT capabilities of the first electronic device and the terminal device. The Wi-Fi service module does not perform any processing operation and maintains the second information. The Wi-Fi firmware can return a probe response frame (which can be called a fourth probe response frame) generated based on the second information to the terminal device. The fourth probe response frame indicates that the first electronic device supports TWT capabilities, that is, the TWT capability of the first electronic device is enabled. Then, the terminal device executes the following S30.
[0284] If the first parsed content indicates that the terminal device does not support TWT capabilities, then there may be a conflict between the TWT capabilities of the first electronic device and the terminal device, and the first electronic device executes the following S28-S29.
[0285] S28, the Wi-Fi service module sends a configuration update message (which may be referred to as the first information) to the Wi-Fi firmware through hostapd and the Wi-Fi driver, so that the Wi-Fi firmware turns off the TWT capability of the first electronic device.
[0286] Taking the case where the Wi-Fi version enabled on the first electronic device is Wi-Fi 5 as an example, the Wi-Fi service module can reconfigure the 78th element of the extended capability bit to "0" to indicate that "the first electronic device does not support TWT capability."
[0287] S29, after the Wi-Fi firmware turns off the TWT capability based on the configuration update message, the Wi-Fi firmware returns a probe response frame (which may be referred to as a third probe response frame) to the terminal device. The third probe response frame is a directional beacon sent to the terminal device that is scanning the wireless network. The third probe response frame indicates that the first electronic device does not support the TWT capability, that is, the TWT capability of the first electronic device is turned off.
[0288] After the Wi-Fi firmware turns off the TWT capability, the Wi-Fi firmware may also generate a new beacon frame based on the reconfigured network parameters and periodically broadcast the new beacon frame through the Wi-Fi firmware, wherein the new beacon frame indicates that the first electronic device does not support the TWT capability, that is, the TWT capability of the first electronic device is turned off.
[0289] S30: The terminal device parses the received probe response frame and determines that an AP device (ie, the first electronic device) has been scanned based on the parsed content.
[0290] Then, the first electronic device and the terminal device may further perform operations such as authentication, association, four-step handshake, and DHCP establishment, for which reference may be made to the description of the following embodiment and will not be repeated here.
[0291] It should be noted that the implementation of S28-S30 in Example 3 is similar to that of S18-S20 in Example 2. The difference between the two is that: for S18-S20, after turning off the TWT capability of the first electronic device, the first electronic device first receives the detection request frame and then returns the detection response frame; for S28-S30, after turning off the TWT capability of the first electronic device, the first electronic device directly returns the detection response frame. For the specific implementation of S28-S30, please refer to the description of S18-S20, which will not be repeated here.
[0292] In the third embodiment, the terminal device may or may not support the TWT capability. When the terminal device supports the TWT capability, there is no problem of being unable to scan the first electronic device due to low capability. After S30, the first electronic device and the terminal device can also establish a TWT connection as shown in Figure 2.
[0293] In view of this situation, when the first electronic device turns on the hotspot, the first electronic device can first turn on the TWT capability, and then determine whether to turn off the TWT capability of the first electronic device based on the TWT capability of the terminal device carried by the detection request frame, thereby avoiding the problem of directly turning off the TWT capability of the first electronic device, resulting in the terminal device that supports TWT capability and the first electronic device being unable to establish a TWT protocol.
[0294] Referring to the description of S28-S30 in the above embodiment, since the beacon frame and the probe response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support TWT capability, the terminal device can execute the following scheme: after S25, if the terminal device first receives a beacon frame from the first electronic device, then the terminal device can determine that the first electronic device does not support TWT capability based on the beacon frame; after S25, if the terminal device first receives a probe response frame from the first electronic device, then the terminal device can determine that the first electronic device does not support TWT capability based on the probe response frame.
[0295] For example, FIG14 is a third schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application.
[0296] Among them, AP supports TWT capability, but STA does not support TWT capability.
[0297] As shown in (a) of Figure 14, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame 1, beacon frame 2, beacon frame i... Each beacon frame indicates that the AP supports TWT capability, that is, the AP's TWT capability is turned on. After the AP receives the probe request frame sent by the STA, the AP parses the probe request frame. Since the probe request frame indicates that the STA does not support the TWT capability, while the AP supports the TWT capability, in order to avoid conflicts that cause the STA to be unable to scan the AP, the AP can turn off the AP's TWT capability. Then, the AP first sends a probe response frame and then sends beacon frame i+1, where both the probe response frame and beacon frame i+1 indicate that the AP does not support the TWT capability. The STA first receives the probe response frame and parses the probe response frame to determine that the AP does not support the TWT capability, thereby scanning the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0298] As shown in (b) of Figure 14, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame 1, beacon frame 2, beacon frame i... Each beacon frame indicates that the AP supports TWT capability, that is, the AP's TWT capability is turned on. After the AP receives the probe request frame sent by the STA, the AP parses the probe request frame. Since the probe request frame indicates that the STA does not support the TWT capability, while the AP supports the TWT capability, in order to avoid conflicts that cause the STA to be unable to scan the AP, the AP can turn off the AP's TWT capability. Then, the AP first sends a beacon frame i+1, and then sends a probe response frame, where both the beacon frame i+1 and the probe response frame indicate that the AP does not support the TWT capability. The STA first receives the beacon frame i+1 and parses the beacon frame i+1 to determine that the AP does not support the TWT capability, thereby scanning the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0299] For example, FIG15 is a fourth schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application.
[0300] Among them, AP supports TWT capability, and STA supports TWT capability.
[0301] As shown in (a) of Figure 15, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame 1, beacon frame 2, beacon frame i... Each beacon frame indicates that the AP supports TWT capability, that is, the TWT capability of the AP is turned on. After the AP receives the probe request frame sent by the STA, the AP parses the probe request frame. Since the probe request frame indicates that the STA indicates that it supports TWT capability, there is no conflict between the TWT capabilities of the AP and the STA, and the AP does not need to turn off the TWT capability of the AP. Then, the AP first sends a probe response frame and then sends beacon frame i+1, where the probe response frame and beacon frame i+1 both indicate that the AP supports TWT capability. The STA first receives the probe response frame and parses the probe response frame to determine that the AP supports TWT capability. Since there is no conflict between the TWT capabilities of the AP and the STA, the STA can scan the AP. Then, the STA sends an authentication request frame to the AP for authentication, and then establishes a TWT connection.
[0302] As shown in (b) of Figure 15, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S, such as beacon frame 1, beacon frame 2, beacon frame i... Each beacon frame indicates that the AP supports TWT capability, that is, the TWT capability of the AP is turned on. After the AP receives the probe request frame sent by the STA, the AP parses the probe request frame. Since the probe request frame indicates that the STA indicates that it supports TWT capability, there is no conflict between the TWT capabilities of the AP and the STA, and the AP does not need to turn off the TWT capability of the AP. Then, the AP first sends beacon frame i+1 and then sends a probe response frame. In which, beacon frame i+1 and the probe response frame both indicate that the AP supports TWT capability. The STA first receives beacon frame i+1 and parses beacon frame i+1 to determine that the AP supports TWT capability. Since there is no conflict between the TWT capabilities of the AP and the STA, the STA can scan the AP. Then, the STA sends an authentication request frame to the AP for authentication, and then establishes a TWT connection.
[0303] It should be noted that the difference between Figure 14 and Figure 15 is that: in Figure 14, the STA's probe request frame indicates that the STA does not support the TWT capability, and the AP needs to turn off the AP's TWT capability, so that the AP and STA cannot establish a TWT connection in the subsequent process; in Figure 15, the STA's probe request frame indicates that the STA supports the TWT capability, and the AP does not need to turn off the AP's TWT capability, so that the AP and STA can establish a TWT connection in the subsequent process.
[0304] In embodiment three, after parsing the probe request frame, the beacon frame and the probe response frame sent by the first electronic device both carry elements indicating whether the first electronic device supports TWT capability. The terminal device can determine whether the AP supports TWT capability based on the frame received first, thereby improving the speed at which the terminal device discovers the AP.
[0305] Example 4
[0306] In embodiment 4, the first electronic device is an AP device that supports TWT capabilities, and the terminal device may be a STA device that supports TWT capabilities, or the terminal device may be a STA device that does not support TWT capabilities. When the first electronic device turns on the hotspot, the first electronic device can send two messages at the same time: one message indicates that the first electronic device supports TWT capabilities, and the other message indicates that the first electronic device does not support TWT capabilities.
[0307] For example, FIG16 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application.
[0308] S31: The Wi-Fi setting module of the first electronic device receives an operation (referred to as a first operation) input by a user to enable a hotspot.
[0309] S32: The Wi-Fi setup module notifies the Wi-Fi service module to enable the hotspot through the Wi-Fi API interface (not shown in FIG16 ). The Wi-Fi service module calls hostapd to enable the hotspot. Hostapd controls the Wi-Fi firmware to enable the hotspot through the Wi-Fi driver.
[0310] As an implementable method, as shown in Figure 8, the Wi-Fi service module includes a Wi-Fi management module (WifiManager), a hotspot management module (SoftApManager) and a hotspot configuration module (SoftApConfiguration). Specifically, the Wi-Fi management module (WifiManager) can notify the hotspot management module (SoftApManager) to turn on the hotspot, and at the same time, the Wi-Fi management module (WifiManager) can notify the hotspot configuration module (SoftApConfiguration) to configure the network parameters. The hotspot configuration module (SoftApConfiguration) of the Wi-Fi service module configures two TWT capability parameters: the first TWT capability parameter (which can be called the second information) indicates that "the first electronic device supports TWT capability", and the second TWT capability parameter (which can be called the first information) indicates that "the first electronic device does not support TWT capability". The hotspot configuration module (SoftApConfiguration) passes the configured network parameters to the hotspot configuration module (SoftApConfiguration). The hotspot management module (SoftApManager) notifies hostapd to turn on the hotspot and passes the configured network parameters to hostapd. Hostapd controls the Wi-Fi firmware through the Wi-Fi driver to enable a hotspot and passes the configured network parameters to the Wi-Fi firmware through the Wi-Fi driver. The Wi-Fi firmware stores the configured network parameters.
[0311] S33, Wi-Fi firmware turns on hotspot.
[0312] After the Wi-Fi firmware turns on the hotspot, the Wi-Fi firmware generates beacon frame 1 (which may be called the seventh beacon frame) based on the first TWT capability parameter. Beacon frame 1 indicates that the first electronic device supports TWT capabilities. The Wi-Fi firmware generates beacon frame 2 (which may be called the sixth beacon frame) based on the second TWT capability parameter. Beacon frame 2 indicates that the first electronic device does not support TWT capabilities. The Wi-Fi firmware can broadcast a signaling every 0.1S. The signaling includes beacon frame 1 and beacon frame 2.
[0313] It should be noted that the implementation of S31-S33 of Example 4 is similar to that of S01-S03 of Example 1. The difference between the two is that: S01-S03 only configures one TWT capability parameter, and only broadcasts one beacon frame in one beacon period; S31-S33 configures the first TWT capability parameter and the second TWT capability parameter, and broadcasts two beacon frames simultaneously in one beacon period. For the specific implementation of S31-S33, please refer to the description of S01-S03, which will not be repeated here.
[0314] S34, the terminal device receives an operation of scanning a wireless network input by the user.
[0315] S35 , the terminal device sends a probe request frame based on the operation of scanning wireless networks input by the user, so as to scan for available AP devices located near the terminal device, that is, available WLAN networks.
[0316] Among them, the terminal device may support TWT capabilities or may not support TWT capabilities.
[0317] It should be noted that the detection request frame may carry information on whether the STA supports TWT capabilities, or may not carry information on whether the STA supports TWT capabilities, and this application does not limit this.
[0318] S36: The Wi-Fi firmware of the first electronic device parses the received probe request frame and returns a probe response frame 1 and a probe response frame 2 to the terminal device.
[0319] Among them, the probe response frame 1 and the probe response frame 2 are directional beacons sent to the terminal device that is scanning the wireless network. The probe response frame 1 indicates that the first electronic device supports the TWT capability, and the probe response frame 2 indicates that the first electronic device does not support the TWT capability.
[0320] S37, the terminal device receives probe response frame 1 and probe response frame 2.
[0321] S38, the terminal device selects a probe response frame (which may be called the first signaling) based on the TWT capability of the terminal device.
[0322] S39: The terminal device determines that an AP device (ie, the first electronic device) has been scanned based on the probe response frame selected in S38.
[0323] Exemplarily, after the bottom layer of the terminal device (such as the Wi-Fi firmware) receives the probe response frame 1 and the probe response frame 2, the bottom layer of the terminal device (such as the Wi-Fi driver) can parse the probe response frame 1 to obtain the parsed content 1, and the parsed content 1 is that the first electronic device supports the TWT capability; parse the probe response frame 2 to obtain the parsed content 2, and the parsed content 2 is that the first electronic device does not support the TWT capability. If the terminal device supports the TWT capability, the bottom layer of the terminal device (such as the Wi-Fi driver) can discard the parsed content 2 and report the parsed content 1 to the upper layer of the terminal device (such as the Wi-Fi setting module), thereby scanning the first electronic device. If the terminal device does not support the TWT capability, the bottom layer of the terminal device (such as the Wi-Fi driver) can discard the parsed content 1 and report the parsed content 2 to the upper layer of the terminal device (such as the Wi-Fi setting module), thereby scanning the first electronic device. Then, the first electronic device and the terminal device can also perform operations such as authentication, association, four-step handshake and establishment of DHCP. Please refer to the description of the following embodiment, which will not be repeated here.
[0324] It should be noted that the implementation of S34-S38 in Example 4 is similar to that of S04-S07 in Example 1. The difference between the two is that in S04-S07, the terminal device only receives one detection beacon frame; in S04-S07, the terminal device receives detection response frame 1 and detection response frame 2 at the same time, and decides which message to report based on the TWT capability of the terminal device. For the specific implementation of S34-S38, please refer to the description of S04-S07, which will not be repeated here.
[0325] Since the terminal device may or may not support the TWT capability, if the TWT capability of the first electronic device is directly turned off according to the method of Example 1, there may be a problem that the terminal device that supports the TWT capability and the first electronic device cannot establish a TWT protocol. In Example 4, when the hotspot is turned on, the first electronic device can send two messages at the same time: one message indicates that the first electronic device supports the TWT capability, and the other message indicates that the first electronic device does not support the TWT capability. In this way, the bottom layer of the terminal device (such as the Wi-Fi driver) can decide which message to discard and which message to report based on whether it supports the TWT capability. This allows the terminal device to scan the first electronic device and also establish the TWT protocol when the terminal device supports the TWT capability.
[0326] As an implementable method, after S35, if the terminal device first receives a beacon frame from the first electronic device, then the terminal device can determine, based on the beacon frame, that the first electronic device does not support TWT capability; after S35, if the terminal device first receives a detection response frame from the first electronic device, then the terminal device can determine, based on the detection response frame, that the first electronic device does not support TWT capability.
[0327] For example, FIG17 is a fifth schematic diagram of a scenario of a STA scanning an AP provided in an embodiment of the present application.
[0328] Among them, AP supports TWT capability, but STA does not support TWT capability.
[0329] As shown in (a) of Figure 17, after the hotspot is turned on, the AP can broadcast two beacon frames at an interval of 0.1S, one beacon frame indicating that the AP supports TWT capability, and the other beacon frame indicating that the AP does not support TWT capability. After the AP receives the probe request frame sent by the STA, the AP first sends the probe response frame 1 and the probe response frame 2, and then sends the beacon frame, so that the STA first receives the probe response frame 1 and the probe response frame 2. Among them, the probe response frame 1 indicates that the AP supports TWT capability, and the probe response frame 2 indicates that the AP does not support TWT capability. In this case, the bottom layer of the STA (such as the Wi-Fi driver) can parse the probe response frame 1 and the probe response frame 2 to obtain the parsed content 1 and the parsed content 2 respectively. If the STA supports the TWT capability, the bottom layer of the STA (such as the Wi-Fi driver) can discard the parsed content 2 and report the parsed content 1 to the upper layer of the STA (such as the Wi-Fi setting module), thereby scanning the AP. If the STA does not support TWT, the STA's lower layer (such as the Wi-Fi driver) can discard parsed content 1 and report parsed content 2 to the STA's upper layer (such as the Wi-Fi setting module) to scan the AP. The STA then sends an authentication request frame to the AP for authentication.
[0330] As shown in (b) of Figure 17, after the hotspot is turned on, the AP can broadcast two beacon frames at an interval of 0.1S, one beacon frame indicating that the AP supports TWT capability, and the other beacon frame indicating that the AP does not support TWT capability. After the AP receives the probe request frame sent by the STA, the AP first sends beacon frame 1 and beacon frame 2, and then sends a probe response frame, so that the STA first receives beacon frame 1 and beacon frame 2. Among them, beacon frame 1 indicates that the AP supports TWT capability, and beacon frame 2 indicates that the AP does not support TWT capability. In this case, the bottom layer of the STA (such as the Wi-Fi driver) can parse beacon frame 1 and beacon frame 2 to obtain parsed content 1 and parsed content 2, respectively. If the STA supports TWT capability, the bottom layer of the STA (such as the Wi-Fi driver) can discard parsed content 2 and report parsed content 1 to the upper layer of the STA (such as the Wi-Fi setting module), thereby scanning the AP. If the STA does not support TWT, the STA's lower layer (such as the Wi-Fi driver) can discard parsed content 1 and report parsed content 2 to the STA's upper layer (such as the Wi-Fi setting module) to scan the AP. The STA then sends an authentication request frame to the AP for authentication.
[0331] In embodiment four, the beacon frame and the detection response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support TWT capability. The terminal device can determine whether the AP supports TWT capability based on the frame received first, thereby improving the speed at which the terminal device discovers the AP.
[0332] Example 5
[0333] In Example 5, the first electronic device is an AP device that supports TWT capabilities, and the terminal device is a STA device that does not support TWT capabilities. When the first electronic device turns on the hotspot, the first electronic device can send two messages at the same time: one message indicates that the first electronic device supports TWT capabilities, and the other message indicates that the first electronic device does not support TWT capabilities.
[0334] For example, Figure 18 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application.
[0335] S40: The Wi-Fi setting module of the first electronic device receives an operation (referred to as a first operation) input by a user to enable a hotspot.
[0336] S41: The Wi-Fi setup module notifies the Wi-Fi service module to enable the hotspot through the Wi-Fi API (not shown in FIG18 ). The Wi-Fi service module calls hostapd to enable the hotspot. Hostapd controls the Wi-Fi firmware to enable the hotspot through the Wi-Fi driver.
[0337] S42, Wi-Fi firmware turns on hotspot.
[0338] After the Wi-Fi firmware turns on the hotspot, the Wi-Fi firmware generates beacon frame 1 based on the first TWT capability parameter (which may be referred to as the second information), and beacon frame 1 indicates that the first electronic device supports TWT capabilities; the Wi-Fi firmware generates beacon frame 2 based on the second TWT capability parameter (which may be referred to as the first information), and beacon frame 2 indicates that the first electronic device does not support TWT capabilities. The Wi-Fi firmware can broadcast a signaling every 0.1S. The signaling includes beacon frame 1 (which may be referred to as the seventh beacon frame) and beacon frame 2 (which may be referred to as the sixth beacon frame).
[0339] It should be noted that the implementation of S40-S42 in Example 5 is similar to that of S31-S33 in Example 4. For the specific implementation of S40-S42, reference may be made to the description of S31-S33, which will not be repeated here.
[0340] S43: The terminal device receives an operation of scanning a wireless network input by the user.
[0341] S44, the terminal device parses beacon frame 1 and beacon frame 2.
[0342] S45, the terminal device selects a beacon frame based on the TWT capability of the terminal device.
[0343] Referring to the description of S37-S39 of the above-mentioned embodiment 4, after the bottom layer of the terminal device (such as Wi-Fi firmware) receives beacon frame 1 and beacon frame 2, the bottom layer of the terminal device (such as Wi-Fi driver) can parse beacon frame 1 to obtain parsed content 1, and parsed content 1 is that the first electronic device supports TWT capability; parse beacon frame 2 to obtain parsed content 2, and parsed content 2 is that the first electronic device does not support TWT capability. If the terminal device does not support TWT capability, the terminal device can select beacon frame 2, and then execute the following S46 to notify the first electronic device to turn on the TWT capability. As another example, if the terminal device supports TWT capability, the terminal device can select beacon frame 1 and notify the first electronic device to turn on the TWT capability, which will not be repeated here.
[0344] S46, the terminal device sends a request message to the first electronic device, where the request message is used to request to turn off the TWT of the first electronic device.
[0345] Accordingly, the Wi-Fi driver of the first electronic device parses the received request message and passes the parsed content to the Wi-Fi service module through hostapd. The Wi-Fi service module reconfigures the network parameters based on the parsed content and sends a configuration update message to the Wi-Fi firmware through hostapd and the Wi-Fi driver to instruct the Wi-Fi firmware to disable the TWT capability of the first electronic device.
[0346] Taking the case where the Wi-Fi version enabled on the first electronic device is Wi-Fi 5 as an example, the Wi-Fi service module can reconfigure the 78th element of the extended capability bit to "0" to indicate that "the first electronic device does not support TWT capability."
[0347] S47, Wi-Fi firmware disables TWT capability.
[0348] The Wi-Fi firmware may generate a new beacon frame based on the reconfigured network parameters and periodically broadcast the new beacon frame through the Wi-Fi firmware, wherein the new beacon frame indicates that the first electronic device does not support TWT capability.
[0349] S48: The terminal device resends the probe request frame to scan for available AP devices located near the terminal device.
[0350] S49, the Wi-Fi firmware returns a probe response frame (which may be referred to as a first signaling) to the terminal device based on the probe request frame.
[0351] The probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The probe response frame indicates that the first electronic device does not support TWT capability.
[0352] S50: The terminal device parses the received probe response frame and determines that an AP device (ie, the first electronic device) has been scanned based on the parsed content.
[0353] For the specific implementation of S48-S50, please refer to the description of S18-S20, which will not be repeated here.
[0354] Since the terminal device may or may not support the TWT capability, if the TWT capability of the first electronic device is directly turned off according to the method of Example 1, there may be a problem that the terminal device that supports the TWT capability and the first electronic device cannot establish a TWT protocol. In Example 5, when the hotspot is turned on, the first electronic device can send two messages at the same time: one message indicates that the first electronic device supports the TWT capability, and the other message indicates that the first electronic device does not support the TWT capability. In this way, after receiving two beacon frames, the terminal device can notify the first electronic device to turn off or turn on the TWT capability based on the TWT capability of the terminal device, so that the terminal device can scan the first electronic device.
[0355] As an implementable method, after S59, if the terminal device first receives a beacon frame from the first electronic device, the terminal device can determine that the first electronic device does not support TWT capability based on the beacon frame; after S59, if the terminal device first receives a detection response frame from the first electronic device, the terminal device can determine that the first electronic device does not support TWT capability based on the detection response frame.
[0356] For example, FIG19 is a sixth schematic diagram of a scenario in which a STA scans an AP according to an embodiment of the present application.
[0357] Among them, AP supports TWT capability, but STA does not support TWT capability.
[0358] As shown in (a) in Figure 19, after the hotspot is turned on, the AP can broadcast two beacon frames at an interval of 0.1S, one beacon frame indicating that the AP supports TWT capability, and the other beacon frame indicating that the AP does not support TWT capability. After the STA receives the two beacon frames, the STA can send a request message to the AP to instruct the AP to turn off the TWT capability based on the fact that it does not support TWT capability. After the AP receives the request message sent by the STA, the AP turns off the TWT capability. Then, the STA sends a probe request frame to the AP. The AP first sends a probe response frame to the STA, and then sends a beacon frame, where both the probe response frame and the beacon frame indicate that the AP does not support TWT capability. The STA first receives the probe response frame, parses the probe response frame, determines that the AP does not support TWT capability, and thus scans the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0359] As shown in (b) of Figure 19, after the hotspot is turned on, the AP can broadcast two beacon frames at an interval of 0.1S, one beacon frame indicating that the AP supports TWT capability, and the other beacon frame indicating that the AP does not support TWT capability. After the STA receives the two beacon frames, the STA can send a request message to the AP to instruct the AP to turn off the TWT capability based on the fact that it does not support TWT capability. After the AP receives the request message sent by the STA, the AP turns off the TWT capability. Then, the STA sends a probe request frame to the AP. The AP first sends a beacon frame to the STA, and then sends a probe response frame, where both the beacon frame and the probe response frame indicate that the AP does not support TWT capability. The STA first receives the beacon frame and parses the beacon frame to determine that the AP does not support TWT capability, thereby scanning the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0360] In embodiment five, the beacon frame and the detection response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support TWT capability. The terminal device can determine whether the AP supports TWT capability based on the frame received first, thereby improving the speed at which the terminal device discovers the AP.
[0361] Example 6
[0362] In Example 6, the first electronic device is an AP device that supports TWT capabilities, and the terminal device is a STA device that does not support TWT capabilities. When the first electronic device turns on the hotspot, the first electronic device first turns on the TWT capability. After the terminal device determines that the first electronic device supports the TWT capability based on the message from the first electronic device, the terminal device notifies the first electronic device to turn off the TWT capability.
[0363] For example, Figure 20 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application.
[0364] S51: The Wi-Fi setting module of the first electronic device receives an operation (referred to as a first operation) input by a user to enable a hotspot.
[0365] S52: The Wi-Fi setup module notifies the Wi-Fi service module to enable the hotspot through the Wi-Fi API interface (not shown in FIG20 ). The Wi-Fi service module calls hostapd to enable the hotspot. Hostapd controls the Wi-Fi firmware to enable the hotspot through the Wi-Fi driver.
[0366] S53, the Wi-Fi firmware turns on the hotspot and enables the TWT capability when the hotspot is turned on.
[0367] In the sixth embodiment, the network parameters (which may be referred to as the second information) configured by the Wi-Fi service module when opening the hotspot indicate that "the first electronic device supports TWT capabilities." That is, the network parameters configured by the Wi-Fi service module when opening the hotspot conform to the actual TWT capabilities.
[0368] After the Wi-Fi firmware turns on the hotspot, the first electronic device can generate a beacon frame based on the configured network parameters and periodically broadcast the beacon frame through the Wi-Fi firmware. The beacon frame indicates that the first electronic device supports the TWT capability, that is, the TWT capability of the first electronic device is turned on.
[0369] For the specific implementation of S51-S53, please refer to the description of S08-S11, which will not be repeated here.
[0370] S54: The terminal device receives an operation of scanning a wireless network input by the user.
[0371] S55 : The terminal device sends a probe request frame based on the operation of scanning wireless networks input by the user, so as to scan for available AP devices located near the terminal device, that is, available WLAN networks.
[0372] Among them, the terminal device does not support TWT capabilities.
[0373] S56, the Wi-Fi firmware generates a probe response frame based on the received probe request frame and the stored network parameters, and returns the probe response frame to the terminal device.
[0374] The probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The probe response frame indicates that the first electronic device supports the TWT capability, that is, the TWT capability of the first electronic device is enabled.
[0375] S57: The terminal device parses the received probe response frame and determines based on the parsed content that no AP device (ie, the first electronic device) is scanned.
[0376] For the specific implementation of S54-S57, please refer to the description of S12-S15, which will not be repeated here.
[0377] S58, the terminal device sends a request message (which may be referred to as a first request message) to the first electronic device, where the first request message is used to request to turn off the TWT of the first electronic device.
[0378] Accordingly, the Wi-Fi driver of the first electronic device parses the received request message and passes the parsed content to the Wi-Fi service module through hostapd. The Wi-Fi service module reconfigures the network parameters based on the parsed content and sends a configuration update message to the Wi-Fi firmware through hostapd and the Wi-Fi driver to instruct the Wi-Fi firmware to disable the TWT capability of the first electronic device.
[0379] Taking the case where the Wi-Fi version enabled on the first electronic device is Wi-Fi 5 as an example, the Wi-Fi service module can reconfigure the 78th element of the extended capability bit to "0" to indicate that "the first electronic device does not support TWT capability."
[0380] S59, Wi-Fi firmware disables TWT capability.
[0381] The Wi-Fi firmware may generate a new beacon frame based on the reconfigured network parameters (which may be referred to as first information) and periodically broadcast the new beacon frame through the Wi-Fi firmware, wherein the new beacon frame indicates that the first electronic device does not support TWT capability.
[0382] S60: The terminal device resends the probe request frame to scan for available AP devices located near the terminal device.
[0383] S61, the Wi-Fi firmware returns a probe response frame (which may be referred to as a fifth probe response frame) to the terminal device based on the probe request frame.
[0384] The probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The probe response frame indicates that the first electronic device does not support TWT capability.
[0385] It should be noted that the above embodiment is illustrated by taking the case where, after the Wi-Fi firmware of the first electronic device turns off the TWT capability, the Wi-Fi firmware of the first electronic device returns a probe response frame to the terminal device based on the probe request frame from the terminal device as an example, which does not limit the present application. As another example, after the Wi-Fi firmware of the first electronic device turns off the TWT capability, the Wi-Fi firmware of the first electronic device may also directly return a probe response frame to the terminal device, that is, without executing the above S60.
[0386] S62: The terminal device parses the received probe response frame and determines that an AP device (ie, the first electronic device) has been scanned based on the parsed content.
[0387] For the specific implementation of S60-S61, please refer to the description of S18-S20, which will not be repeated here.
[0388] In Example 6, the TWT capability is turned on when the first electronic device turns on the hotspot. If the terminal device does not support the TWT capability, the terminal device may not be able to scan the first electronic device. To this end, when the first electronic device turns on the hotspot, the first electronic device first turns on the TWT capability. After the terminal device determines that the first electronic device supports the TWT capability based on the message from the first electronic device, the terminal device can notify the first electronic device to turn off the TWT capability, so that the terminal device can scan the first electronic device.
[0389] After turning off the TWT capability of the first electronic device, since the beacon frame and the probe response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support the TWT capability, the terminal device can execute the following scheme: if the terminal device first receives the beacon frame from the first electronic device, then the terminal device can determine that the first electronic device does not support the TWT capability based on the beacon frame; if the terminal device first receives the probe response frame from the first electronic device, then the terminal device can determine that the first electronic device does not support the TWT capability based on the probe response frame.
[0390] For example, FIG21 is the seventh schematic diagram of the scenario of STA scanning AP provided in an embodiment of the present application.
[0391] Among them, AP supports TWT capability, but STA does not support TWT capability.
[0392] As shown in (a) in Figure 21, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S. Each beacon frame indicates that the AP supports TWT capability, that is, the AP's TWT capability is turned on. After the AP receives the probe request frame a sent by the STA, the AP returns a probe response frame a. Since the probe response frame a indicates that the AP supports TWT capability, but the STA does not support TWT capability, the STA sends a request message to the AP to request to turn off the AP's TWT capability. Based on the request message, the AP reconfigures the network parameters to indicate that the AP does not support TWT capability, that is, turns off the AP's TWT capability. After the AP receives the probe request frame b resent by the STA, the AP first sends a probe response frame b+1 and then sends a beacon frame i+3, where both the probe response frame b+1 and the beacon frame i+3 indicate that the AP does not support TWT capability. The STA first receives the probe response frame b+1, parses the probe response frame b+1, determines that the AP does not support TWT capability, and thus scans the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0393] As shown in (b) of Figure 21, after the hotspot is turned on, the AP can broadcast beacon frames according to a beacon period of 0.1S. Each beacon frame indicates that the AP supports TWT capability, that is, the AP's TWT capability is turned on. After the AP receives the probe request frame a sent by the STA, the AP returns a probe response frame a. Since the probe response frame a indicates that the AP supports TWT capability, but the STA does not support TWT capability, the STA sends a request message to the AP to request to turn off the AP's TWT capability. Based on the request message, the AP reconfigures the network parameters to indicate that the AP does not support TWT capability, that is, turns off the AP's TWT capability. After the AP receives the probe request frame b resent by the STA, the AP first sends a beacon frame i+3 and then sends a probe response frame b+1, where both the beacon frame i+3 and the probe response frame b+1 indicate that the AP does not support TWT capability. The STA first receives the beacon frame i+3 and parses the beacon frame i+3 to determine that the AP does not support TWT capability, thereby scanning the AP. Then, the STA sends an authentication request frame to the AP for authentication.
[0394] In Example 6, after the TWT capability of the first electronic device is turned off, the beacon frame and the probe response frame sent by the first electronic device both carry elements indicating that the first electronic device does not support the TWT capability. The terminal device can determine whether the AP supports the TWT capability based on the frames received first, thereby improving the speed at which the terminal device discovers the AP.
[0395] It should be noted that the above-mentioned embodiments 1 to 6 are all described by taking the example of a user first triggering the first electronic device to turn on the hotspot and then triggering the terminal device to search for available WLANs. This does not limit the present application. In actual implementation, the user may also first trigger the terminal device to search for available WLANs and then trigger the first electronic device to turn on the hotspot. It is understood that before the first electronic device turns on the hotspot, the terminal device will not be able to search for the first electronic device.
[0396] In addition, the above embodiments 1 to 6 introduce the specific method of realizing hotspot scanning by turning off the TWT capability. After the terminal device scans the hotspot (i.e., the first electronic device), the first electronic device and the terminal device can also perform operations such as authentication, association, four-step handshake, and establishment of DHCP.
[0397] Example 7
[0398] In Example 7, the first electronic device is an AP device that supports TWT capabilities, and the terminal device is a STA device that does not support TWT capabilities. After the terminal device starts searching the network, the terminal device may not indicate to the AP device whether it supports TWT capabilities. Then, after the timing reaches a preset time, if the AP device is not connected, the TWT capability of the terminal device is disabled.
[0399] For example, Figure 22 is a flowchart of another method for managing TWT capabilities provided in an embodiment of the present application.
[0400] S63: The Wi-Fi setting module of the first electronic device receives an operation (referred to as a first operation) input by the user to enable a hotspot.
[0401] S64: The Wi-Fi setup module notifies the Wi-Fi service module to enable the hotspot through the Wi-Fi API interface (not shown in FIG22 ). The Wi-Fi service module calls hostapd to enable the hotspot. Hostapd controls the Wi-Fi firmware to enable the hotspot through the Wi-Fi driver.
[0402] S65, the Wi-Fi firmware turns on the hotspot and enables the TWT capability when the hotspot is turned on.
[0403] In the seventh embodiment, the network parameters (which may be referred to as the second information) configured by the Wi-Fi service module when opening the hotspot indicate that "the first electronic device supports TWT capabilities." That is, the network parameters configured by the Wi-Fi service module when opening the hotspot conform to the actual TWT capabilities.
[0404] After the Wi-Fi firmware turns on the hotspot, the first electronic device can generate a beacon frame based on the configured network parameters and periodically broadcast the beacon frame through the Wi-Fi firmware. The beacon frame indicates that the first electronic device supports the TWT capability, that is, the TWT capability of the first electronic device is turned on.
[0405] For the specific implementation of S63-S65, please refer to the description of S08-S11, which will not be repeated here.
[0406] S66: The terminal device receives an operation of scanning a wireless network input by the user.
[0407] Among them, the terminal device does not support TWT capabilities.
[0408] S67: The terminal device sends a probe request frame to scan for available WLAN networks nearby and starts timing.
[0409] At step S68, the Wi-Fi firmware of the first electronic device generates a probe response frame based on the received probe request frame and the stored network parameters, and returns the probe response frame to the terminal device. The terminal device parses the received probe response frame and determines based on the parsed content that no AP device (i.e., the first electronic device) has been scanned.
[0410] The probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The probe response frame indicates that the first electronic device supports the TWT capability, that is, the TWT capability of the first electronic device is enabled.
[0411] For the specific implementation of S66-S68, please refer to the description of S12-S15, which will not be repeated here.
[0412] S69: When the timing duration reaches a preset duration (eg, 2 minutes), the terminal device determines whether a connection has been established with the AP device.
[0413] If the terminal device establishes a connection with the AP device, the Wi-Fi service module does not perform any processing operations. It should be noted that the AP device here is not limited to the first electronic device, but can also be other electronic devices. It should be understood that when the terminal device establishes a connection with the AP device, it means that the terminal device has successfully scanned the first electronic device, and therefore no further processing operations are required.
[0414] If the terminal device is not connected to any AP device, it may be because the terminal device does not support TWT capabilities, so the terminal device executes the following S70-S71.
[0415] S70, the terminal device turns off the TWT capability.
[0416] S71, the terminal device resends a probe request frame (which may be referred to as a second probe request frame). The second probe request frame indicates that the terminal device does not support the TWT capability, that is, the TWT capability of the terminal device is disabled.
[0417] S72: The Wi-Fi firmware of the first electronic device generates a probe response frame (which may be referred to as a second probe response frame) based on the second probe request frame, and returns the second probe response frame to the terminal device.
[0418] The second probe response frame is a directional beacon sent to a terminal device that is scanning a wireless network. The second probe response frame indicates that the first electronic device does not support the TWT capability, that is, the TWT capability of the first electronic device is turned off.
[0419] S73, the terminal device parses the received probe response frame, and determines that an AP device (ie, the first electronic device) has been scanned based on the parsed content.
[0420] Then, the first electronic device and the terminal device may further perform operations such as authentication, association, four-step handshake, and DHCP establishment, for which reference may be made to the description of the following embodiment and will not be repeated here.
[0421] For the specific implementation of S69-S73, please refer to the description of S27-S30 in Example 2, which will not be repeated here.
[0422] In Example 7, after the terminal device starts searching the network, timing begins. In the initial stage, the terminal device may not indicate to the first electronic device whether the terminal device supports TWT capability. After the timing reaches the preset time, if the AP device is not connected, the terminal device may indicate to the first electronic device that the terminal device does not support TWT capability, so that the first electronic device changes the TWT capability information of the detection response frame and the beacon frame, thereby allowing the terminal device to scan the first electronic device.
[0423] For example, FIG23 is a schematic diagram of establishing a WLAN connection between an AP and a STA according to an embodiment of the present application.
[0424] The link between the AP and the STA is set up via five phases: scanning, authentication, association, handshake, and DHCP.
[0425] During the scanning phase, a STA sends a Probe Request message to the AP to scan for available WLAN networks near the STA. The AP returns a Probe Response message to the STA. The Probe Response frame is a directional beacon sent to the STA and indicates that the AP does not support TWT capabilities. Thus, the STA scans the AP.
[0426] During the authentication phase, the STA sends an auth request frame to the AP to request authentication. The AP returns an auth response frame to the STA to indicate that authentication is successful.
[0427] During the association phase, the STA sends an association request frame to the AP to request association. The AP returns an association response frame to the STA to indicate that the association is complete.
[0428] During the handshake phase, the AP and STA exchange Eapol frames 1, 2, 3, and 4 in sequence to complete the four-step handshake.
[0429] In the DHCP phase, the STA sends a DHCP Discover Request to the AP, and the AP returns a DHCP Offer Response to the STA. The STA then sends a DHCP Select Request to the AP, and the AP returns a DHCP Acknowledge Response to the STA.
[0430] At this point, a WLAN connection is established between the AP and the STA. The AP and the STA can exchange data based on the WLAN connection.
[0431] The present application also provides a computer-readable storage medium having computer instructions stored therein. When the computer-readable storage medium is run on an electronic device, the electronic device executes the method described in the above embodiment. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that can be integrated with one or more media. The available medium can be a magnetic medium, an optical medium, or a semiconductor medium, etc.
[0432] An embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code runs on an electronic device, the electronic device executes the methods in the above embodiments.
[0433] The present application also provides a chip coupled to a memory, configured to read and execute computer programs or instructions stored in the memory to perform the methods of the above embodiments. The chip may be a general-purpose processor or a dedicated processor.
[0434] The electronic device, computer-readable storage medium, computer program product and chip provided in the embodiments of the present application are all used to execute the methods provided in the above embodiments. Therefore, the beneficial effects that can be achieved can refer to the corresponding beneficial effects of the methods provided above, and will not be repeated here.
[0435] In the description of this application, " / " means or. For example, A / B can mean A or B. In the description of this application, "and / or" is simply a way to describe the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0436] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0437] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for adjusting a target wake-up time TWT, characterized in that: The method is applied to a first electronic device, and includes: The first electronic device turns on a hotspot; The first electronic device sends a first signaling, where the first signaling includes information that the TWT capability of the first electronic device has been turned off.
2. The method according to claim 1, characterized in that The first signaling includes a first beacon frame and a first probe response frame; The first electronic device turning on a hotspot and sending a first signaling includes: The first electronic device receives a first operation by a user to turn on a hotspot; In response to the first operation, the first electronic device turns on a hotspot and periodically broadcasts the first beacon frame; The first electronic device receives a first probe request frame from a terminal device; The first electronic device sends the first probe response frame to the terminal device.
3. The method according to claim 2, characterized in that The first electronic device, in response to the first operation, turns on a hotspot and periodically broadcasts the first beacon frame, including: In response to the first operation, the first electronic device configures first information, where the first information indicates that a TWT capability of the first electronic device is disabled; The first electronic device turns on the hotspot, turns off the TWT capability of the first electronic device based on the first information, and periodically broadcasts the first beacon frame.
4. The method according to claim 1, wherein The first electronic device enabling a hotspot includes: The first electronic device turns on the hotspot and starts timing; The first electronic device sending the first signaling includes: When the timing duration reaches a preset duration, if the first electronic device has not established a wireless local area network connection with other devices, the first electronic device sends the first signaling.
5. The method according to claim 4, characterized in that The first signaling is a second probe response frame; The first electronic device turns on the hotspot and starts timing, including: The first electronic device configures second information in response to a first operation of the user turning on the hotspot, where the second information indicates turning on the TWT capability of the first electronic device; the first electronic device turns on the hotspot, turns on the TWT capability of the first electronic device based on the second information, and starts timing; the first electronic device periodically broadcasts a second beacon frame, where the second beacon frame includes information that the first electronic device has turned on the TWT capability; When the timing duration reaches a preset duration, if the first electronic device has not established a wireless local area network connection with other devices, the first electronic device sends the first signaling, including: When the timing reaches the preset time, if the first electronic device has not established a wireless LAN connection with other devices, the first electronic device configures the first information and deletes the second information, the first information indicating that the TWT capability of the first electronic device is turned off; the first electronic device receives the second probe request frame from the terminal device; the first electronic device sends the second probe response frame to the terminal device, and the second probe response frame includes information that the TWT capability of the first electronic device has been turned off.
6. The method according to claim 1, wherein After the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method further includes: The first electronic device receives a third probe request frame from the terminal device; The first electronic device sending the first signaling includes: If the third probe request frame includes information that the terminal device does not support TWT capability, the first electronic device sends the first signaling to the terminal device.
7. The method according to claim 6, characterized in that After the first electronic device receives the third probe request frame from the terminal device, the method further includes: If the third probe request frame includes information that the terminal device supports TWT capability, the first electronic device sends a second signaling to the terminal device, where the second signaling includes information that the first electronic device has turned on the TWT capability.
8. The method according to claim 7, characterized in that The first signaling is a third probe response frame, and the second signaling is a fourth probe response frame; The first electronic device turns on the hotspot, comprising: the first electronic device configures second information in response to a first operation of the user turning on the hotspot, the second information indicating that the TWT capability of the first electronic device is turned on; the first electronic device turns on the hotspot, turns on the TWT capability of the first electronic device based on the second information, and periodically broadcasts a third beacon frame, the third beacon frame including information that the first electronic device has turned on the TWT capability; The first electronic device receives a third probe request frame from the terminal device, comprising: the first electronic device receives the third probe request frame from the terminal device, and parses the third probe request frame to obtain first parsed content; If the third probe request frame includes information that the terminal device does not support TWT capability, the first electronic device sends the first signaling to the terminal device, including: if the first parsed content indicates that the terminal device does not support TWT capability, the first electronic device configures first information and deletes the second information, the first information indicating that the TWT capability of the first electronic device is turned off; the first electronic device generates the third probe response frame based on the first information, and sends the third probe response frame to the terminal device, the third probe response frame including information that the first electronic device has turned off the TWT capability; If the third probe request frame includes information that the terminal device supports TWT capability, the first electronic device sends a second signaling to the terminal device, including: if the first parsed content indicates that the terminal device supports TWT capability, the first electronic device retains the second information and generates the fourth probe response frame based on the second information; the first electronic device sends the fourth probe response frame to the terminal device, and the fourth probe response frame includes information that the first electronic device has turned on the TWT capability.
9. The method according to claim 1, characterized in that After the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method further includes: The first electronic device receives a first request message from a terminal device, where the first request message is used to request to disable a TWT capability of the first electronic device; The first electronic device sending the first signaling includes: Based on the first request message, the first electronic device turns off the TWT capability of the first electronic device and sends the first signaling to the terminal device.
10. The method according to claim 9, characterized in that The first signaling is a fifth probe response frame; The first electronic device enabling a hotspot includes: The first electronic device configures second information in response to a first operation of a user to turn on the hotspot, where the second information indicates that the TWT capability of the first electronic device is turned on; the first electronic device turns on the hotspot based on the second information, and periodically broadcasts a fourth beacon frame, where the fourth beacon frame includes information that the first electronic device has turned on the TWT capability; The first electronic device disabling the TWT capability of the first electronic device based on the first request message and sending the first signaling to the terminal device includes: The first electronic device configures first information based on the first request message and deletes the second information, wherein the first information indicates that the TWT capability of the first electronic device is turned off; the first electronic device turns off the TWT capability of the first electronic device based on the first information and generates the fifth probe response frame; the first electronic device sends the fifth probe response frame to the terminal device, and the fifth probe response frame includes information that the TWT capability of the first electronic device has been turned off.
11. The method according to any one of claims 4, 6 and 9, characterized in that After the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method further includes: The first electronic device periodically broadcasts a fifth beacon frame, and the fifth beacon frame includes information that the first electronic device has enabled the TWT capability.
12. The method according to claim 1, characterized in that After the first electronic device turns on the hotspot and before the first electronic device sends the first signaling, the method further includes: The first electronic device sends a third signaling and a fourth signaling, where the third signaling includes information that the first electronic device has turned off the TWT capability, and the fourth signaling includes information that the first electronic device has turned on the TWT capability; The first electronic device receives a second request message from a terminal device, where the second request message is used to request to disable the TWT capability of the first electronic device; The first electronic device sending the first signaling includes: Based on the second request message, the first electronic device turns off the TWT capability of the first electronic device and sends the first signaling to the terminal device.
13. The method according to claim 12, characterized in that The third signaling is the sixth beacon frame, and the fourth signaling is the seventh beacon frame; The first electronic device enabling a hotspot includes: In response to a first operation of a user to turn on a hotspot, the first electronic device turns on the hotspot and configures first information and second information, wherein the first information indicates that the TWT capability of the first electronic device is turned off, and the second information indicates that the TWT capability of the first electronic device is turned on; The first electronic device sending the third signaling and the fourth signaling includes: The first electronic device generates a sixth beacon frame based on the first information and generates a seventh beacon frame based on the second information; the first electronic device broadcasts the sixth beacon frame and the seventh beacon frame according to a preset period; The first electronic device disabling the TWT capability of the first electronic device based on the second request message and sending the first signaling to the terminal device includes: The first electronic device reconfigures the first information based on the second request message; the first electronic device turns off the TWT capability of the first electronic device based on the first information and generates the first signaling; the first electronic device sends the first signaling to the terminal device.
14. The method according to any one of claims 1, 4, 6, 9 and 12, characterized in that The first signaling is a beacon frame or a probe response frame.
15. A method for adjusting TWT, characterized in that: The method is applied to a terminal device, and the method includes: The terminal device starts searching for a wireless local area network; The terminal device receives a first signaling from a first electronic device, where the first signaling includes information that the TWT capability of the first electronic device has been turned off.
16. The method according to claim 15, characterized in that The first signaling includes a first beacon frame and a first probe response frame; The terminal device starts searching for a wireless local area network, and the terminal device receives a first signaling from a first electronic device, including: The terminal device starts searching for a wireless local area network and periodically receives the first beacon frame from the first electronic device; The terminal device sends a first probe request frame to the first electronic device; The terminal device receives the first probe response frame from the first electronic device; Wherein, the terminal device does not support TWT capability.
17. The method according to claim 15, characterized in that The first signaling is a second probe response frame; The terminal device starts searching for a wireless local area network, and the terminal device receives a first signaling from a first electronic device, including: The terminal device starts searching for a wireless local area network and starts timing; When the timing duration reaches a preset duration, if the terminal device has not established a wireless local area network connection with other devices, the terminal device sends a second probe request frame, where the second probe request frame includes information that the terminal device does not support TWT capability; Based on the second probe request frame, the terminal device receives the second probe response frame from the first electronic device.
18. The method according to claim 15, characterized in that The terminal device receives a first signaling from a first electronic device, including: If the terminal device does not support the TWT capability, the terminal device sends a third probe request frame to the first electronic device, where the third probe request frame includes information that the terminal device does not support the TWT capability; Based on the third probe request frame, the terminal device receives a third probe response frame from the first electronic device, and the first signaling is the third probe response frame.
19. The method according to claim 15, characterized in that After the terminal device starts searching for the wireless local area network, the method further includes: If the terminal device supports the TWT capability, the terminal device sends a third probe request frame to the first electronic device, where the third probe request frame includes information that the terminal device supports the TWT capability; Based on the third probe request frame, the terminal device receives second signaling from the first electronic device, where the second signaling includes information that the first electronic device has enabled TWT capability.
20. The method according to claim 15, wherein After the terminal device starts searching for the wireless local area network and before the terminal device receives the first signaling from the first electronic device, the method further includes: The terminal device sends a fourth probe request frame to the first electronic device, and the fourth probe request frame does not include information on whether to turn off the TWT capability of the terminal device.
21. The method according to claim 15, wherein After the terminal device starts searching for the wireless local area network and before the terminal device receives the first signaling from the first electronic device, the method further includes: The terminal device sends a first request message to the first electronic device, where the first request message is used to request to disable the TWT capability of the first electronic device; The terminal device receives a first signaling from a first electronic device, including: Based on the first request message, the terminal device receives the first signaling from the first electronic device.
22. The method according to any one of claims 17 to 21, characterized in that: After the terminal device starts searching for the wireless local area network and before the terminal device receives the first signaling from the first electronic device, the method further includes: The terminal device receives a second beacon frame from the first electronic device, where the second beacon frame includes information that the first electronic device has enabled TWT capability.
23. The method according to claim 15, characterized in that After the terminal device starts searching for the wireless local area network and before the terminal device receives the first signaling from the first electronic device, the method further includes: The terminal device receives a third signaling and a fourth signaling from the first electronic device, the third signaling including information that the first electronic device has turned off the TWT capability, and the fourth signaling including information that the first electronic device has turned on the TWT capability; The terminal device selects the information in the third signaling that the first electronic device has turned off the TWT capability, or selects the information in the fourth signaling that the first electronic device has turned on the TWT capability, based on the TWT capability of the terminal device.
24. The method according to claim 23, wherein The third signaling and the fourth signaling are both beacon frames; The terminal device selects, according to the TWT capability of the terminal device, the information that the first electronic device has turned off the TWT capability in the third signaling, or selects the information that the first electronic device has turned on the TWT capability in the fourth signaling, including: If the terminal device does not support the TWT capability, the terminal device selects the third signaling and sends a second request message to the first electronic device, where the second request message is used to request to turn off the TWT capability of the first electronic device; wherein the first signaling is the sixth probe response frame, and the sixth probe response frame is obtained based on the second request message; If the terminal device supports TWT capability, the terminal device selects the fourth signaling and sends a third request message to the first electronic device, and the third request message is used to request to enable the TWT capability of the first electronic device; wherein, the first signaling is the seventh probe response frame, and the seventh probe response frame is obtained based on the third request message.
25. The method according to claim 23, characterized in that The third signaling and the fourth signaling are both probe response frames; The terminal device selects, according to the TWT capability of the terminal device, the information that the first electronic device has turned off the TWT capability in the third signaling, or selects the information that the first electronic device has turned on the TWT capability in the fourth signaling, including: If the terminal device does not support TWT capability, the terminal device selects the probe response frame information corresponding to the third signaling, and determines to scan the first electronic device for connection; If the terminal device supports TWT capability, the terminal device selects the detection response frame information corresponding to the fourth signaling, and determines to scan the first electronic device for connection.
26. The method according to any one of claims 15 to 21 and 23, characterized in that The first signaling is a beacon frame or a probe response frame.
27. An electronic device, wherein the electronic device is a first electronic device, and the first electronic device is an access point device, characterized in that: The first electronic device includes: one or more processors, and a memory; Wherein, the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the first electronic device to execute the TWT adjustment method as described in any one of claims 1 to 14.
28. A terminal device, the terminal device being a site device, characterized in that: The terminal device includes: one or more processors, and a memory; Wherein, the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the terminal device to execute the TWT adjustment method as described in any one of claims 15 to 26.
29. A communication system, characterized in that: The communication system includes the electronic device according to claim 27 and the terminal device according to claim 28.
30. A computer-readable storage medium, characterized in that The computer-readable storage medium includes instructions; When the instruction is run on a first electronic device, the first electronic device executes the TWT adjustment method as described in any one of claims 1 to 14; when the instruction is run on a terminal device, the terminal device executes the TWT adjustment method as described in any one of claims 15 to 26.
Citation Information
Patent Citations
TWT adjustment method, device, system and storage medium
CN117729570B
Control method and device for limited target wake-up service, and communication system
CN115866669A
Communication method, electronic equipment and storage medium
CN116724608A
TWT adjustment method, device and system and storage medium
CN117729570A
Indicating validity of a broadcast target wake time schedule
US20190141630A1