Sleep scheduling method and related apparatus

By introducing a sleep scheduling strategy in Wi-Fi systems, sleep and monitor states alternately, the problem of excessive Wi-Fi power consumption is solved, and the balance between power consumption optimization and real-time service is achieved.

WO2025140192A1PCT designated stage expired Publication Date: 2025-07-03HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/141846
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-26
Filing Date
2024-12-24
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

With the increase in the transmission rate of Wi-Fi protocol, the power consumption of terminal devices remains high, affecting the user experience, especially in the monitoring state, the power consumption accounts for too high.

Method used

By introducing a sleep scheduling strategy into the wireless communication system of the terminal device, the sleep and monitoring state are alternately performed, the length of the sleep and monitoring time slices are adjusted according to business needs, the power consumption of the monitoring state is reduced, and the real-time performance of the service is ensured.

Benefits of technology

It effectively reduces the power consumption of Wi-Fi system, reduces the power consumption and loss in the monitoring state, ensures the service delay requirements, and does not affect the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024141846_03072025_PF_FP_ABST
    Figure CN2024141846_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a sleep scheduling method and a related apparatus. The method is applied to a terminal device. The method comprises: after first service data is transmitted by means of a wireless communication system (e.g., a wireless fidelity (Wi-Fi) system) and a network device, the wireless communication system sleeping and waking up according to a first sleep scheduling policy, wherein the first sleep scheduling policy comprises a first duration (comprising at least one first time slice and at least one second time slice), the first time slice and the second time slice in the first duration alternate, and the wireless communication system is in a sleep state in the first time slice and is in an operating state (comprising a monitoring state) in the second time slice. For example, the length of the first time slice and / or the length of the second time slice are / is determined on the basis of the latency of a service requirement corresponding to the first service data. Therefore, the system can sleep and perform monitoring periodically on the basis of a latency requirement of the current service instead of always staying in the monitoring state, thereby ensuring the real-time experience of services, and also reducing the power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Sleep scheduling method and related device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on December 26, 2023, with application number 202311818404.7, and priority to the Chinese patent application entitled “Sleep Scheduling Method and Related Devices”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a sleep scheduling method and related devices. Background Art

[0003] With the continuous evolution of wireless fidelity (Wi-Fi) protocols, Wi-Fi transmission rates have increased dramatically, but power consumption on terminal devices remains high, impacting user experience. However, the Wi-Fi system on terminal devices can be put into a sleep state, which consumes very little power. Therefore, optimizing sleep mode is an important research topic for Wi-Fi power consumption optimization. Summary of the Invention

[0004] The present application discloses a sleep scheduling method and related devices, which can keep the Wireless Fidelity Wi-Fi system of a terminal device in a sleep state as much as possible without affecting the real-time experience of the service, thereby reducing the power consumption of the Wi-Fi system.

[0005] In a first aspect, the present application provides a sleep scheduling method, which is applied to a terminal device, wherein the state of a wireless communication system (such as a wireless fidelity Wi-Fi system) of the terminal device includes a sleep state and a working state (including a listening state). The method includes: the terminal device transmits first service data through the wireless communication system and a network device, and ends the transmission of the first service data at a first moment; after the first moment, the wireless communication system can sleep and wake up according to a first sleep scheduling strategy (also referred to as sleep scheduling), wherein the first sleep scheduling strategy includes a first duration, the first duration includes one or more first time slices and one or more second time slices, and the first sleep strategy also includes: the terminal device can use the first duration to replace the waiting time of the power saving mode PSM, in the first duration, the wireless communication system enters the sleep state at the start time of the first time slice, and remains in the sleep state within the first time slice, and the wireless communication system enters the listening state at the start time of the second time slice, and remains in the working state within the second time slice; when the wireless communication system has no uplink service and downlink service within the first time slice, the wireless communication system enters the sleep state, and sends a first message to the network device through the wireless communication system, the first message instructing the terminal device to enter the sleep state.

[0006] The time slices in the first duration during which the wireless communication system is in a dormant state are collectively referred to as first time slices, and the time slices in which the wireless communication system is in an active state are collectively referred to as second time slices. The first time slice of the first duration is the first time slice (for example, the start time of the first duration is the start time of the first time slice) or the second time slice (for example, the start time of the first duration is the start time of the second time slice). The first time slices and the second time slices in the first duration are alternated, for example, the start time of a second time slice is the end time of an adjacent first time slice, and the end time of the second time slice is the start time of another adjacent first time slice, for example, the start time of a first time slice is the end time of an adjacent second time slice, and the end time of the first time slice is the start time of another adjacent second time slice. The first duration and the second duration are related, for example, the length of the first duration is determined based on the length of the second duration, for example, the length of the first duration is equal to the length of the second duration. The total duration of the above-mentioned one or more first time slices and the above-mentioned one or more second time slices may be equal to the first duration, that is, the first duration is composed of the above-mentioned one or more first time slices and the above-mentioned one or more second time slices, or they may be unequal, for example, the first duration is composed of the above-mentioned one or more first time slices, the above-mentioned one or more second time slices and other time periods.

[0007] Among them, when the terminal device is dormant and awakened based on PSM, after the above-mentioned first moment, the wireless communication system of the terminal device will enter the listening state, and it has entered the waiting time of PSM. When there is no uplink business and downlink business within the second time period after the wireless communication system enters the listening state (that is, within the waiting time), the terminal device will send a second message to the network device through the wireless communication system, and the second message instructs the terminal device to enter the dormant state.

[0008] In the above method, the terminal device can use the first time length to replace the waiting time of PSM. During the waiting time of PSM, the wireless communication system will always be in the listening state, but during the first time length, the wireless communication system will switch between the listening state and the sleep state at regular intervals, that is, the proportion of the listening time in the waiting time is 1, and the proportion of the listening time in the first time length is less than 1, for example, less than or equal to 0.5. It can be understood that the wireless communication system is in the sleep state as much as possible during the original waiting time, effectively reducing the power consumption loss in the listening state, thereby reducing the power consumption of the wireless communication system.

[0009] In one possible implementation, before the wireless communication system goes into sleep and wakes up according to the first sleep scheduling strategy, the method further includes: obtaining a first delay required by a first service currently running on the terminal device (for example, the maximum delay that the first service can withstand), and the lengths of the first time slice and the second time slice can be determined based on the first delay, for example, the length of the first time slice is greater than or equal to the first delay, and the length of the second time slice is equal to the first delay.

[0010] In the above method, the length of the first time slice in the dormant state in the first duration is determined based on the maximum delay that the currently running service can withstand, for example, equal to the delay, thereby effectively ensuring the delay requirements of the service and reducing power consumption without affecting the user experience.

[0011] In one possible implementation, the number of first time slices and the number of second time slices in the first time length are the same, for example, including A pairs of first time slices, or the number of first time slices and the number of second time slices in the first time length are different, for example, including B pairs of first time slices and second time slices, and including 1 first time slice or second time slice.

[0012] In one possible implementation, the length of each first time slice in the first duration is equal, or the lengths of at least two first time slices in the first duration are unequal. For example, when the wireless communication system has no uplink or downlink services within a second time slice, the length of the previous time slice of the second time slice (belonging to the first time slice, the end time of the first time slice is the start time of the second time slice) is less than the length of the next time slice of the second time slice (belonging to the first time slice, the start time of the first time slice is the end time of the second time slice), that is, the length of the first time slice can be gradually increased. The length of each second time slice in the first duration is equal, or the lengths of at least two second time slices in the first duration are unequal.

[0013] In the above method, the length of the first time slice can be gradually increased. If the length of the second time slice is fixed, the proportion of sleep time in the first time slice is approximately greater than 0.5, that is, the proportion of listening state is approximately less than 0.5. Compared with the proportion of listening time in waiting time being 1, this situation can reduce the power consumption of the listening state by more than 50%, achieving better results.

[0014] In one possible implementation, the length of the first time slice and the length of the second time slice in the first time length may be equal or different. For example, the length of each first time slice in the first time length is equal, and the length of each second time slice is equal, then the length of each first time slice and the length of each second time slice are equal or different. For example, the length of each first time slice in the first time length is equal, and the lengths of at least two second time slices are different. There may be a second time slice in the first time length that is equal to the length of the first time slice, or there may be a second time slice that is different from the length of the first time slice. For example, the length of each second time slice in the first time length is equal, and the lengths of at least two first time slices are different. There may be a first time slice in the first time length that is equal to the length of the second time slice, or there may be a first time slice that is different from the length of the first time slice.

[0015] In the above method, the first time slice and the second time slice in the first duration can be set in various ways, and the application scenarios are more extensive.

[0016] In one possible implementation, the terminal device and the network device can use PSM to negotiate a first sleep scheduling strategy, and the above-mentioned wireless communication system sleeps and wakes up according to the first sleep scheduling strategy, including: in the first time length, the terminal device can send a third message to the network device through the wireless communication system before the start time of each first time slice, the third message instructing the terminal device to enter the sleep state, that is, before the terminal device enters the sleep state each time (it can also be understood as before the terminal device enters the first time slice from the second time slice each time, at this time it is in the second time slice), it will send the third message to the network device within the current second time slice to notify the network device that the terminal device is about to enter the sleep state; and the terminal device can send a fourth message to the network device after the start time of each second time slice through the wireless communication system, the fourth message indicating that the terminal device is in the working state, that is, after the terminal device enters the working state from the sleep state each time (it can also be understood as after the terminal device enters the second time slice from the first time slice each time, at this time it is in the second time slice), it will send the fourth message to the network device within the current second time slice to notify the network device that the terminal device has been awakened. For example, the third message may be obtained by setting the Power Management Bit in the Null-Data frame to 1, and the fourth message may be obtained by setting the Power Management Bit in the Null-Data frame to 0.

[0017] In the above method, since most devices support the PSM protocol, the first sleep scheduling strategy negotiated based on PSM has good universality.

[0018] In one possible implementation, the terminal device and the network device can use the timed wake-up mechanism TWT to negotiate a first sleep scheduling strategy, and the above-mentioned wireless communication system sleeps and wakes up according to the first sleep scheduling strategy, including: before the start time of the first time length, sending a fifth message to the network device through the wireless communication system, the fifth message is a TWT setting frame in the TWT, and the TWT setting frame is used to negotiate a TWT plan (which can correspond to the above-mentioned first time length), and the TWT plan can include a time slice of the sleep Doze state (which can correspond to the above-mentioned first time slice) and a time slice of the TWT service period SP state (which can correspond to the above-mentioned second time slice).

[0019] In one possible implementation, the terminal device and the network device can use a private negotiation mechanism to negotiate a first sleep scheduling strategy, and the above-mentioned wireless communication system sleeps and wakes up according to the first sleep scheduling strategy, including: before the start time of the first time period, sending a sixth message to the network device through the wireless communication system, the sixth message is a custom behavior Action frame negotiated between the terminal device and the network device, and the terminal device and the network device negotiate to use such an Action frame to transmit control information between the terminal device and the network device.

[0020] In the above method, the terminal device and the network device can use existing protocols / mechanisms to negotiate the first sleep scheduling strategy, or use customized, private protocols / mechanisms to negotiate the first sleep scheduling strategy, which has a wider range of applicable devices and a wider range of application scenarios.

[0021] In one possible implementation, the above-mentioned working state may include a sending state, and the terminal device may send uplink data in the second time slice. The above-mentioned method also includes: when the wireless communication system is in a sleep state in the first time slice, if the terminal device detects the second service data to be sent to the network device, the second service data may be cached in a preset first queue; the wireless communication system may enter a listening state at the end time of the first time slice, and then enter the next time slice of the first time slice (i.e., the second time slice). The wireless communication system may enter a sending state in the second time slice (for example, enter when the channel is idle), and send the second service data in the first queue to the network device in the sending state.

[0022] In one possible implementation, the above-mentioned working state may include a receiving state, and the terminal device may receive downlink data in the second time slice. The above-mentioned method also includes: when the wireless communication system is in a dormant state within the first time slice, if the network device has business data to be sent to the terminal device, the business data may be cached; the wireless communication system may enter a listening state at the end time of the first time slice, and then enter the next time slice of the first time slice (i.e., the second time slice), and the wireless communication system may enter a receiving state within the second time slice (for example, entering when it detects that downlink data is about to arrive); the wireless communication system may directly receive the third business data sent by the network device in the receiving state, or the wireless communication system may first receive the seventh message sent by the network device in the receiving state (indicating that the network device has business data to be sent to the terminal device), and then the wireless communication system enters a sending state and sends an eighth message to the network device (for requesting the network device to send business data), and then the wireless communication system enters a receiving state and receives the fourth business data (for example, the above-mentioned third business data) sent by the network device.

[0023] In one possible implementation, before the above-mentioned wireless communication system goes into sleep and wakes up according to the first sleep scheduling strategy, the traffic pattern of the first service run by the terminal device is: there are continuous messages for a period of time, then there are few or no messages within a period of time, and then there are continuous messages for a period of time. The first service is, for example: the online playback service of short video applications, the online playback service of video applications, the online reading service or online audio-book service of reading applications, or the online web page service of browser applications.

[0024] In one possible implementation, the terminal device is a station STA, and the network device is a wireless access point AP. The network device is used to enable the terminal device to communicate with the Internet through a wireless communication system. The network device can use a hotspot mode to provide Internet access functions for the terminal device. For example, the network device and the terminal device are both user devices, or the network device can also serve as a gateway to provide Internet access functions for the terminal device. For example, the network device is a gateway device such as a router, and the terminal device is a user device.

[0025] In a second aspect, the present application provides a sleep scheduling method, which is applied to a terminal device, wherein the state of the wireless communication system (e.g., a Wireless Fidelity Wi-Fi system) of the terminal device includes a sleep state and a working state (including a listening state). The method includes: when a first condition is met, the terminal device can actively negotiate a first sleep scheduling strategy with the network device, and the wireless communication system of the terminal device can sleep and wake up according to the first sleep scheduling strategy (also referred to as sleep scheduling). The first condition is that the ratio of the capacity of the current wireless communication channel and the first value (i.e., the average traffic of the first service currently running on the terminal device) is greater than or equal to a preset threshold. For example, when the first condition is met, it indicates that the current channel capacity is much greater than the bandwidth of the current service. The first sleep scheduling strategy includes a first cycle, and the first cycle includes a first time slice and a second time slice. The first sleep scheduling strategy also includes: the terminal device can perform multiple first cycles, and in each first cycle, the wireless communication system enters the sleep state at the start time of the first time slice and is in the sleep state within the first time slice. The wireless communication system enters the listening state at the start time of the second time slice and is in the working state within the second time slice.

[0026] The time slice in the first cycle during which the wireless communication system is in a dormant state is called a first time slice, and the time slice in which the wireless communication system is in an active state is called a second time slice. The first time slice in the first cycle is either the first time slice (e.g., the start time of the first cycle is the start time of the first time slice) or the second time slice (e.g., the start time of the first cycle is the start time of the second time slice). The first time slice and the second time slice in the first cycle do not overlap. The first time slice in the first cycle can precede the second time slice (in which case the end time of the first time slice is the start time of the second time slice), or the first time slice in the first cycle can also precede the second time slice (in which case the start time of the first time slice is the end time of the second time slice). The total duration of the first time slice and the second time slice can be equal to the duration of the first cycle, i.e., the first cycle is composed of the first time slice and the second time slice, or they can be different, for example, the first cycle is composed of the first time slice, the second time slice, and other time periods.

[0027] Among them, when the above-mentioned first condition is not met, the terminal device will sleep and wake up based on PSM. After the terminal device transmits the first service data through the wireless communication system and the network device, the wireless communication system will enter the listening state. At this time, it has entered the waiting time of PSM. For example, if the traffic pattern of the current service of the terminal device is that there are continuous messages, then there is a high probability of uplink service and / or downlink service within the first period of time after the wireless communication system enters the listening state (that is, within the waiting time slice). The terminal device can directly end the current waiting time and perform the service data transmission process through the wireless communication system and the network device. It is difficult to meet the condition that there is no uplink service and downlink service within the waiting time slice, so it cannot enter the sleep state.

[0028] In the above method, the terminal device will actively negotiate with the network device for the first sleep scheduling strategy when the first condition is met, and sleep and wake up according to the first sleep scheduling strategy. For example, the traffic pattern of the current business of the terminal device is that there are continuous messages. In this application, the terminal device can periodically switch between the listening state and the sleep state based on the first cycle, which solves the problem that the original sleep mechanism (such as PSM) cannot enter the sleep state, that is, allows the terminal device to enter the sleep state as much as possible, thereby reducing the power consumption of the wireless communication system. In this application, the network device does not instruct the terminal device to sleep and wake up periodically, but the terminal device determines the first cycle by itself and actively negotiates the first sleep scheduling strategy with the network device. Therefore, the first cycle is more in line with the actual business situation of the terminal device.

[0029] In one possible implementation, before the wireless communication system goes to sleep and wakes up according to the first sleep scheduling strategy, the method further includes: obtaining a first delay required by a first service currently running on the terminal device (e.g., a maximum delay that the first service can tolerate), and the lengths of the first time slice and the second time slice can be determined based on the first delay, for example, the length of the first time slice and the length of the second time slice are both equal to the first delay. The lengths of the first time slice and the second time slice can be equal or different.

[0030] In the above method, the length of the first time slice in the dormant state in the first duration is determined based on the maximum delay that the currently running service can withstand, for example, equal to the delay, thereby effectively ensuring the delay requirements of the service and reducing power consumption without affecting the user experience.

[0031] In one possible implementation, the first sleep scheduling strategy includes multiple first cycles; the length of each first cycle in the multiple first cycles is equal, or the length of at least two first cycles in the multiple first cycles is unequal; the length of the first time slice in each first cycle in the multiple first cycles is equal, or the first time slices in at least two first cycles are unequal; the length of the second time slice in each first cycle in the multiple first cycles is equal, or the second time slices in at least two first cycles are unequal. For example, the length of each first cycle in the multiple first cycles is equal, and each first cycle includes one first time slice of length N and one second time slice of length N, where N may also be the above-mentioned first delay.

[0032] In the above method, the multiple first periods, the first time slices in the first period, and the second time slices can be set in various ways, and the application scenarios are more extensive.

[0033] In one possible implementation, the terminal device and the network device can use PSM to negotiate a first sleep scheduling strategy, and the above-mentioned wireless communication system sleeps and wakes up according to the first sleep scheduling strategy, including: in the first sleep scheduling strategy, the terminal device can send a first message to the network device through the wireless communication system before the start time of each first time slice, the first message instructing the terminal device to enter the sleep state, that is, before the terminal device enters the sleep state each time (it can also be understood that before the terminal device enters the first time slice from the second time slice each time, it is in the second time slice at this time), it will send the first message to the network device within the current second time slice to notify the network device that the terminal device is about to enter the sleep state; and the terminal device can send a second message to the network device at the start time of each second time slice through the wireless communication system, the second message indicating that the terminal device is in the working state, that is, after the terminal device enters the working state from the sleep state each time (it can also be understood that after the terminal device enters the second time slice from the first time slice each time, it is in the second time slice at this time), it will send the second message to the network device within the current second time slice to notify the network device that the terminal device has been awakened. For example, the first message may be obtained by setting the Power Management Bit in the Null-Data frame to 1, and the second message may be obtained by setting the Power Management Bit in the Null-Data frame to 0.

[0034] In the above method, since most devices support the PSM protocol, the first sleep scheduling strategy negotiated based on PSM has good universality.

[0035] In one possible implementation, the terminal device and the network device can use the timed wake-up mechanism TWT to negotiate a first sleep scheduling strategy, and the above-mentioned wireless communication system sleeps and wakes up according to the first sleep scheduling strategy, including: before the start time of the first cycle, sending a third message to the network device through the wireless communication system, the third message is a TWT setting frame in the TWT, and the TWT setting frame is used to negotiate a TWT plan (which can correspond to the above-mentioned first cycle), and the TWT plan can include a time slice of the sleep Doze state (which can correspond to the above-mentioned first time slice) and a time slice of the TWT service cycle SP state (which can correspond to the above-mentioned second time slice).

[0036] In one possible implementation, the terminal device and the network device can use a private negotiation mechanism to negotiate a first sleep scheduling strategy, and the above-mentioned wireless communication system sleeps and wakes up according to the first sleep scheduling strategy, including: before the start time of the first cycle, sending a fourth message to the network device through the wireless communication system, the fourth message is a custom behavior Action frame negotiated between the terminal device and the network device, and the terminal device and the network device negotiate to use such an Action frame to transmit control information between the terminal device and the network device.

[0037] In the above method, the terminal device and the network device can use existing protocols / mechanisms to negotiate the first sleep scheduling strategy, or use customized, private protocols / mechanisms to negotiate the first sleep scheduling strategy, which has a wider range of applicable devices and a wider range of application scenarios.

[0038] In one possible implementation, the above-mentioned working state may include a sending state, and the terminal device may send uplink data in the second time slice. The above-mentioned method also includes: the wireless communication system enters a sleep state at the start time of the first time slice; within the first time slice, if the terminal device detects the second service data to be sent to the network device, the second service data may be cached in a preset first queue; the wireless communication system enters a listening state at the end time of the first time slice, and at this time enters the next time slice of the first time slice (i.e., the second time slice), and the wireless communication system may enter a sending state within the second time slice (for example, enter when the channel is idle), and send the service data in the first queue to the network device in the sending state; the wireless communication system enters a sleep state at the end time of the second time slice, and at this time enters the next time slice of the second time slice (i.e., the first time slice).

[0039] In one possible implementation, the above-mentioned working state may include a receiving state, and the terminal device may receive downlink data in the second time slice. The above-mentioned method further includes: the wireless communication system enters a dormant state at the start time of the first time slice; within the first time slice, if the network device has service data to be sent to the terminal device, the service data may be cached; the wireless communication system may enter a listening state at the end time of the first time slice, and then enter the next time slice of the first time slice (i.e., the second time slice), and the wireless communication system may enter a receiving state within the second time slice (for example, when it detects that downlink data is about to arrive); the wireless communication system may directly receive the third service data sent by the network device in the receiving state, or the wireless communication system may first receive a notification message sent by the network device in the receiving state (indicating that the network device has service data to be sent to the terminal device), and then the wireless communication system enters a sending state and sends a request message to the network device (for requesting the network device to send service data), and then the wireless communication system enters a receiving state and receives the fourth service data (for example, the above-mentioned third service data) sent by the network device.

[0040] In one possible implementation, before the wireless communication system goes to sleep and wakes up according to the first sleep scheduling strategy, the method further includes: obtaining first traffic information of the first service currently running on the terminal device, the first traffic information may include at least one of the following: the delay required by the first service, the traffic type of the first service, and the average traffic of the first service; determining the first period based on the first traffic information; the method further includes: when the wireless communication system goes to sleep and wakes up according to the first sleep scheduling strategy, if the second condition is met, obtaining the second traffic information of the second service currently running on the terminal device again to redetermine the sleep scheduling strategy, the second condition being that the amount of service data cached in the first queue is greater than or equal to the queue threshold, and the first queue is used by the wireless communication system to cache the detected service data to be sent within the first time slice; and, if the second condition is met, the wireless communication system of the terminal device will enter a sending state to send the service data in the first queue to the network device, and the above-mentioned first period will no longer be performed.

[0041] In the above method, when the wireless communication system is in sleep and wake-up according to the first sleep scheduling strategy, if the second condition is met, it indicates that too many messages are accumulated to be sent, and it can be considered that the first traffic information previously obtained may not be in line with the current situation. Therefore, the terminal device can wake up immediately and send the accumulated messages in the first queue, and can re-trigger the decision of the sleep scheduling strategy (including re-obtaining the traffic information of the currently running business) to ensure that the sleep scheduling strategy used by the terminal device is in line with the actual business situation, while reducing the power consumption of the wireless communication system and ensuring the user experience.

[0042] In one possible implementation, before the above-mentioned wireless communication system goes into sleep and wakes up according to the first sleep scheduling strategy, the traffic pattern of the first service run by the terminal device is: there are continuous messages, and the number is relatively balanced, and there will be no period of time without messages or with fewer messages. The first service is, for example: the online live broadcast service of the live broadcast application, the online call service of the network call application, and the online game service of the game application.

[0043] In one possible implementation, the terminal device is a station STA, and the network device is a wireless access point AP. The network device is used to enable the terminal device to communicate with the Internet through a wireless communication system. The network device can use a hotspot mode to provide Internet access functions for the terminal device. For example, the network device and the terminal device are both user devices, or the network device can also serve as a gateway to provide Internet access functions for the terminal device. For example, the network device is a gateway device such as a router, and the terminal device is a user device.

[0044] In the third aspect, the present application provides a sleep scheduling method, which is applied to a terminal device, and the method includes: the terminal device obtains the traffic type of the currently running first service, and determines whether the traffic type of the first service is the first type or the second type; when the terminal device determines that the traffic type of the first service is the first type, for example, the traffic pattern of the first service is: there are continuous messages within a period of time, and then there are few or no messages within a period of time, and then there are continuous messages within a period of time, the terminal device can execute the sleep scheduling method provided by the first aspect and any one of the implementation methods of the first aspect; when the terminal device determines that the traffic type of the first service is the second type, for example, the traffic pattern of the first service is: there are continuous messages, and the number is relatively balanced, and there will be no no messages or few messages for a period of time, the terminal device can execute the sleep scheduling method provided by the second aspect and any one of the implementation methods of the second aspect.

[0045] In a fourth aspect, the present application provides a terminal device comprising a transceiver, a processor and a memory; the memory is used to store a computer program, and the processor calls the computer program, so that the terminal device executes the sleep scheduling method provided in the first aspect, the second aspect, the third aspect and any one of the embodiments of the first aspect, the second aspect and the third aspect.

[0046] In the fifth aspect, the present application provides a computer storage medium, which stores a computer program. When the computer program is executed by a processor, it is used to execute the sleep scheduling method provided by the first aspect, the second aspect, the third aspect, and any one of the embodiments of the first aspect, the second aspect, and the third aspect.

[0047] In a sixth aspect, the present application provides a computer program product, which, when running on a device, enables the device to execute the sleep scheduling method provided in the first aspect, the second aspect, the third aspect, and any one of the implementations of the first aspect, the second aspect, and the third aspect.

[0048] In a seventh aspect, the present application provides an electronic device, the electronic device including a method or apparatus for executing any aspect or embodiment of the present application. The electronic device is, for example, a chip.

[0049] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single implementation. On the contrary, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution or beneficial effect is included in at least one implementation. Therefore, the description of a technical feature, technical solution or beneficial effect in this application does not necessarily refer to the same implementation. Furthermore, the technical features, technical solutions and beneficial effects described in this application can also be combined in any appropriate manner. Those skilled in the art will understand that this application can be implemented without one or more specific technical features, technical solutions or beneficial effects of a specific implementation. In other implementations, additional technical features and beneficial effects can also be identified in specific implementations that do not embody all implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The following is an introduction to the drawings used in this application.

[0051] FIG1A is a schematic diagram of the architecture of a communication system provided by the present application;

[0052] FIG1B is a schematic diagram of the architecture of another communication system provided by the present application;

[0053] FIG2 is a schematic diagram of the hardware structure of a terminal device provided by the present application;

[0054] FIG3 is a schematic diagram of a software architecture of a terminal device provided by the present application;

[0055] 4A and 4B are schematic diagrams of some traffic models provided in this application;

[0056] 5A and 5B are schematic diagrams of some sleep / work processes provided by the present application;

[0057] 6A-6C are schematic diagrams of some sleep scheduling strategies provided by this application;

[0058] 7A-7C are schematic diagrams of some further sleep / work processes provided by the present application;

[0059] FIG8 is a schematic diagram of another traffic model provided by the present application;

[0060] 9A and 9B are schematic diagrams of some further sleep / work processes provided by the present application;

[0061] FIG10 is a flowchart of a sleep scheduling method provided by the present application;

[0062] FIG11 is a flowchart of another sleep scheduling method provided by the present application;

[0063] FIG12 is a flow chart of another sleep scheduling method provided by the present application;

[0064] FIG13 is a schematic diagram of the hardware structure of another terminal device provided in this application. DETAILED DESCRIPTION

[0065] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings. The terms used in the implementation methods of the embodiments of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.

[0066] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0067] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0068] With the continuous evolution of the wireless fidelity (Wi-Fi) protocol, the transmission rate of the Wi-Fi protocol has been rapidly improved, but the power consumption on the terminal devices remains high, affecting the user experience.

[0069] In an embodiment of the present application, the states of the wireless communication system of the terminal device may include but are not limited to the following four: a transmit (transport, TX) state, a receive (receive, RX) state, a listen (listen) state, and a sleep (sleep) state. In the transmit state, the terminal device can transmit data frames, in the receive state, the terminal device can receive data frames, in the sleep state, the wireless communication system is powered off (not working), and in the listen state, the wireless communication system is not powered off, does not receive or transmit data frames, but continuously monitors the energy on the wireless communication channel. Other states other than the sleep state (such as the above-mentioned transmit state, receive state, and listen state) can be collectively referred to as working states.

[0070] In the embodiment of the present application, the wireless communication system of the terminal device (which may also be the wireless communication chip of the terminal device) may adopt wireless communication technology to implement relevant functions. The wireless communication technology may be a technology for transmitting information between the communicating parties through radio waves, and may include but is not limited to: Wi-Fi technology, Bluetooth technology, Near Field Communication (NFC) technology, Wi-Fi Aware technology, general wireless communication technology, SparkLink Alliance-standard wireless communication technology (for example, SparkLink low energy (SLE), SparkLink basic (SLB)), etc. The wireless communication system may also be named according to the wireless communication technology it supports. For example, a wireless communication system that supports Wi-Fi communication technology may be called a Wi-Fi system, and a wireless communication system that supports SparkLink Alliance-standard wireless communication technology may be called a SparkLink system. Wireless communication can be widely used in various aspects such as file transfer, call audio transmission, media audio transmission, remote control, screen projection, and perception of surrounding devices (such as smart vehicles, smart terminal devices, smart home devices, and smart manufacturing equipment).

[0071] For the convenience of description, the following embodiments are described by taking the wireless communication system of the terminal device as a Wi-Fi system supporting Wi-Fi technology as an example.

[0072] For example, by testing and analyzing Wi-Fi power consumption for commonly used applications on terminal devices (e.g., the top 20 applications), we can determine the percentage of time the Wi-Fi system spends in the four states described above: 0.8% in the sending state, 9.2% in the receiving state, 41% in the listening state, and 49% in the sleeping state. Furthermore, the power consumption contribution of these four states is: 8% in the sending state, 24% in the receiving state, 64% in the listening state, and 4% in the sleeping state. Understandably, although the current of the Wi-Fi system is high in the sending and receiving states, the time spent in these states is very short, so the power consumption contribution of the sending and receiving states is not high. The current of the Wi-Fi system in the sleeping state is very low, so the power consumption contribution of the sleeping state is also low. However, the listening state, as an "inactive state," has a high power consumption contribution. Therefore, optimizing the power consumption of the listening state is very meaningful for Wi-Fi power optimization.

[0073] 1A and 1B exemplarily illustrate an architecture diagram of a communication system 10. The communication system 10 may include a terminal device 100 and a network device 200. The terminal device 100 may be connected to the network device 200 via a wired and / or wireless method. Wired methods include, but are not limited to, high-definition multimedia interface (HDMI), universal serial bus (USB), coaxial cable, optical fiber, etc., and wireless methods include, but are not limited to, Bluetooth, Wi-Fi, sidelink, NFC, ultra wide band (UWB), infrared, etc.

[0074] In the embodiment of the present application, the terminal device 100 can be, but is not limited to, a mobile phone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), as well as smart home devices such as smart TVs, smart cameras, and smart speakers, wearable devices such as smart bracelets, smart watches, and smart glasses, extended reality (XR) devices such as augmented reality (AR), virtual reality (VR), and mixed reality (MR), in-vehicle devices, or smart city devices. The embodiment of the present application does not impose any special restrictions on the specific type of electronic device.

[0075] In an embodiment of the present application, the network device 200 can be a router, a transmission and receiver point (TRP), a relay device or other access network device, or the network device 200 can also be a terminal device. For specific type examples, please refer to the description of the terminal device 100 in the above example.

[0076] In the communication system 10, the terminal device 100 can communicate with the Internet through the network device 200, for example, by performing Wi-Fi communication. This can also be referred to as the network device 200 providing Internet access functionality for the terminal device 100. The terminal device 100 can send uplink data packets to the network device 200, and the network device 200 can also send downlink data packets to the terminal device 100. In one embodiment, when the terminal device 100 performs Wi-Fi communication with the Internet through the network device 200, the Wi-Fi system of the terminal device 100 can be put into sleep and awakened according to the sleep scheduling method provided in the embodiments of the present application, and the network device 200 does not need to be put into sleep.

[0077] In the embodiments of the present application, the terminal device 100 can be referred to as a station (STA), and the network device 200 can be referred to as a wireless access point (AP). When the network device 200 is a terminal device, it can use hotspot mode to provide Internet access for the terminal device 100. In this case, the network device 200 can also be referred to as a software wireless access point (SoftAP). The network device 200 can be a physical AP or a virtual wireless access point (VAP), where the VAP is, for example, a driver network card.

[0078] Exemplarily, as shown in FIG1A , the terminal device 100 is a mobile phone, the network device 200 is a router, and the network device 200 can serve as an AP to provide Internet access, such as Wi-Fi Internet access, to the terminal device 100 serving as a STA.

[0079] Exemplarily, as shown in FIG1B , the terminal device 100 is a mobile phone, the network device 200 is a tablet computer, and the network device 200 can serve as a SoftAP to provide Internet access, such as Wi-Fi Internet access, to the terminal device 100 serving as a STA.

[0080] It can be understood that the form and quantity of the terminal device 100 and the network device 200 shown in Figures 1A and 1B are only for example purposes and are not limited to the embodiments of the present application.

[0081] Next, the terminal device 100 in the embodiment of the present application is exemplarily introduced.

[0082] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0083] FIG2 is a schematic diagram of the hardware structure of a terminal device 100 provided in an embodiment of the present application.

[0084] As shown in Figure 2, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0085] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0086] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

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

[0088] In one embodiment, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0089] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging implementations, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging implementations, the charging management module 140 can receive wireless charging input via the wireless charging coil of the terminal device 100. While charging the battery 142, the charging management module 140 can also provide power to the terminal device 100 via the power management module 141.

[0090] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In another embodiment, the power management module 141 can also be set in the processor 110. In another embodiment, the power management module 141 and the charging management module 140 can also be set in the same device.

[0091] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0092] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In another embodiment, the antenna can be used in conjunction with a tuning switch.

[0093] The mobile communication module 150 can provide wireless communication solutions for the terminal device 100, including second generation (2G), third generation (3G), fourth generation (4G), fifth generation (5G), and sixth generation (6G). The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1. In one embodiment, at least some of the functional modules of the mobile communication module 150 can be located in the processor 110. In another embodiment, at least some of the functional modules of the mobile communication module 150 and at least some of the modules of the processor 110 can be located in the same device.

[0094] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In one embodiment, the modem processor may be an independent device. In another embodiment, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0095] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency modulate them, amplify them, and convert them into electromagnetic waves for radiation through the antenna 2. In one embodiment, at least some functional modules of the wireless communication module 160 can be set in the processor 110. In one embodiment, at least some functional modules of the wireless communication module 160 can be set in the same device as at least some modules of the processor 110.

[0096] In the embodiment of the present application, the wireless communication module 160 may include a Wi-Fi communication module, a Star Flash communication module, etc. The wireless communication module 160 or any one of the wireless communication modules 160 (such as the Wi-Fi communication module) may include the above-mentioned sending state, receiving state, monitoring state and sleep state. It can be understood that the wireless communication module 160 or any one of the wireless communication modules 160 (such as the Wi-Fi communication module) can independently enter the sleep state without affecting the operation of other modules in the terminal device 100.

[0097] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In one embodiment, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0098] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0099] Video codecs are used to compress or decompress digital video. Terminal device 100 may support one or more video codecs. This allows terminal device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0100] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in the terminal device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0101] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0102] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0103] The terminal device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor. The terminal device 100 can also implement audio functions such as music playback and recording through a connected Bluetooth device.

[0104] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In one embodiment, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0105] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0106] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the user can hear the voice by placing the receiver 170B close to the ear.

[0107] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In another embodiment, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In another embodiment, the terminal device 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and can also identify the sound source to realize directional recording function, etc.

[0108] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In one embodiment, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Terminal device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, terminal device 100 detects the touch operation intensity based on pressure sensor 180A. Terminal device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In one embodiment, touch operations applied to the same touch location but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0109] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a Hall sensor. The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). The distance sensor 180F is used to measure the distance. The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The ambient light sensor 180L is used to sense the brightness of the ambient light. The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc. The temperature sensor 180J is used to detect temperature. The bone conduction sensor 180M can obtain vibration signals.

[0110] The touch sensor 180K is also called a "touch control device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In another embodiment, the touch sensor 180K can also be disposed on the surface of the terminal device 100, in a location different from that of the display screen 194.

[0111] Keys 190 include a power button, volume button, and other buttons. Keys 190 can be mechanical or touch-sensitive. Terminal device 100 can receive key inputs and generate key signal inputs related to user settings and function control of terminal device 100. Motor 191 can generate vibration prompts. Indicator 192 can be an indicator light that can be used to indicate charging status, battery level changes, messages, missed calls, notifications, and the like.

[0112] The software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. For example, the software system with a layered architecture can be an Android system, a Harmony operating system (OS), or other software systems. The embodiment of the present application uses a layered architecture as an example to illustrate the software structure of the terminal device 100.

[0113] FIG3 is a schematic diagram of a software architecture of a terminal device 100 provided in an embodiment of the present application.

[0114] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In one embodiment, the software system of terminal device 100 is divided into five layers: application layer, application framework layer, system library layer, kernel layer, and wireless communication system layer, from top to bottom.

[0115] The application layer can include a series of application packages.

[0116] As shown in Figure 3, the application package may include applications such as camera, video, Wi-Fi, short video, network call (such as voice call or video call in chat application), reading, live broadcast, game, browser, etc. The application in the embodiment of the present application can also be replaced by other software such as mini-programs and atomic services.

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

[0118] As shown in FIG3 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0119] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0120] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0121] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0122] The phone manager is used to provide communication functions of the terminal device 100, such as management of call status (including answering, hanging up, etc.).

[0123] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0124] The notification manager enables applications to display notification information in the status bar. This can be used to convey notification-type messages, and can disappear automatically after a short period of time without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be used to display notifications in the form of icons or scrolling text in the top status bar of the system, such as notifications from applications running in the background, or notifications that appear on the screen in the form of dialog windows. For example, a text message can be displayed in the status bar, a notification sound can be emitted, the terminal device 100 can vibrate, an indicator light can flash, etc.

[0125] As shown in Figure 3, the system library may include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (e.g., OpenGL ES), and a 2D graphics engine (e.g., SGL).

[0126] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0127] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0128] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0129] A 2D graphics engine is a drawing engine for 2D drawings.

[0130] The kernel layer is the layer between hardware and software. As shown in Figure 3, the kernel layer may include but is not limited to at least one of the following: display driver, camera driver, audio driver, or sensor driver.

[0131] The wireless communication system can be used to perform wireless communication processes. As shown in Figure 3, the wireless communication system may include but is not limited to a Wi-Fi system, a Star Flash system (not shown), etc. The Wi-Fi system is used to perform wireless communication using Wi-Fi technology, and the Star Flash system is used to perform wireless communication using SLE or SLB technology. For example, the real-time service of application 1 in the application layer can be implemented through the Wi-Fi system. The data packet of application 1 can be processed by the application framework layer, system library, and kernel layer and then sent to the Wi-Fi system, which then sends it to network device 200. The Wi-Fi system can also receive data packets sent by network device 200, and after processing by the kernel layer, system library, and application framework layer, send it to application 1.

[0132] In the embodiment of the present application, the wireless communication system / any one of the wireless communication systems (e.g., a Wi-Fi system) may include the aforementioned sending state, receiving state, listening state, and sleep state. It is understandable that the wireless communication system / any one of the wireless communication systems (e.g., a Wi-Fi system) may independently enter the sleep state without affecting the operation of other modules in the terminal device 100.

[0133] It is understandable that the terminal device 100 shown in FIG2 and the terminal device 100 shown in FIG3 may correspond to each other. For example, the application layer, application framework layer, system layer library, and kernel layer shown in FIG3 belong to the application processor shown in FIG2 , and the wireless communication system shown in FIG3 corresponds to the wireless communication module 160 shown in FIG2 . Without limitation, other software architectures of the terminal device 100 may also correspond to the hardware structure shown in FIG2 . Other hardware structures of the terminal device 100 may also correspond to the software architecture shown in FIG3 . For example, the terminal device 100 may include a system on chip (SoC) and a Wi-Fi communication chip. The application layer, application framework layer, system layer library, and kernel layer shown in FIG3 belong to the SoC. The wireless communication system shown in FIG3 corresponds to the Wi-Fi communication chip. The Wi-Fi communication chip may be integrated with the SoC or exist independently. For example, the terminal device 100 may also include a processor and a transceiver (including a Wi-Fi transceiver). The application layer, application framework layer, system layer library, and kernel layer shown in FIG3 belong to the processor. The wireless communication system shown in FIG3 corresponds to the transceiver.

[0134] The following describes the workflow of the software and hardware of the terminal device 100 by way of example in conjunction with a video playback scenario implemented by a video application based on a Wi-Fi network.

[0135] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch single-click operation, and the control corresponding to the single-click operation as an example, the video application calls the interface of the application framework layer, and then calls the Wi-Fi system in the wireless communication system to send a request message to the network device 200, and the request message is used to request the video data to be played. In addition, the Wi-Fi system can receive the video data sent by the network device 200 and send it to the video application in the application layer so that the video application plays the video data.

[0136] The Wi-Fi protocol defines a power save mode (PSM) sleep mechanism. The basic principles are as follows:

[0137] 1) The AP can send beacon frames to STAs at a specific period, which is called the target beacon transmission time (TBTT). TBTT is, for example, 100 milliseconds. For example, after the STA and AP are powered on, the AP can send Beacon frames to the STA at a period of TBTT.

[0138] 2) During network access negotiation, the STA and AP will negotiate a Listen Interval. After the STA enters sleep mode, it wakes up every Listen Interval TBTT and listens for Beacon frames. Furthermore, the AP assigns different identity documents (IDs), called association IDs (AIDs), to different STAs. The Listen Interval is a positive integer; for example, the default value is 1.

[0139] 3) When the STA has no service data to send, it can send Data Packet 1 to the AP. The AP can then enter the sleep state based on Data Packet 1. Data Packet 1 can also be called a sleep frame. For example, Data Packet 1 can be obtained by the STA setting the power management bit in the media access control (MAC) frame header of any data packet to 1. For example, Data Packet 1 can be a Null-Data frame.

[0140] 4) When the AP has service data to send to the target STA, it will first cache it and send a Beacon frame in state 1 to the target STA. The target STA can obtain the data that the AP has to send to the target STA based on the Beacon frame in state 1. For example, the Beacon frame in state 1 can be obtained by setting the bit corresponding to the target STA's AID in the bitmap of the traffic indication map (TIM) to 1.

[0141] 5) The STA can wake up and listen for Beacon frames according to the negotiated Listen Interval. When it receives a Beacon frame in State 1, it can obtain downlink data to be received. At this time, the STA can send Data Packet 2 to the AP to request data. Data Packet 2 can also be called a request frame. For example, Data Packet 2 is a power saving poll (PS-Poll) frame.

[0142] 6) The AP can obtain the corresponding buffered data according to the AID in the PS-Poll frame and send it to the STA corresponding to the AID.

[0143] Based on the PSM sleep mechanism described above, the current low-power sleep strategy for terminal devices when transmitting Wi-Fi data frames is as follows:

[0144] 1) For uplink services (i.e., STAs sending service data to the AP), when Application 2 has a message to transmit via the Wi-Fi system, the message can be sent to the Wi-Fi system. If the Wi-Fi system receives the message while it is not in sleep mode, it can send the message to the AP in the sending state. If the Wi-Fi system receives the message while in sleep mode, it can wake up and send the message to the AP in the sending state.

[0145] 2) For downlink services (i.e., AP sends service data to STA), since STA cannot predict when AP will send downlink data, it can set a waiting time T wait When the STA and AP complete data transmission (for example, after the STA sends uplink service data to the AP), the STA can wait for T wait (T wait The Wi-Fi system is in monitoring state), if T wait If the AP has no downlink data to send to the STA, the STA can send a sleep frame to the AP and enter the sleep state. After entering the sleep state, the STA can wake up and listen for Beacon frames according to the negotiated Listen Interval. When the AP has downlink data to send to the STA, it can send a Beacon frame in State 1 to the STA. The STA can then send a request frame to the AP based on the Beacon frame in State 1, instructing the AP to send downlink service data to the STA based on the request frame.

[0146] The traffic model in different business scenarios may be different. The following examples illustrate two common traffic models. The traffic model below uses the downlink traffic of the business as an example. The uplink traffic is similar and will not be described in detail.

[0147] Figure 4A illustrates a schematic diagram of a pulsed traffic model for Business Scenario 1. For example, online business scenarios in short video applications, video applications, reading applications, and browser applications are Business Scenario 1. The horizontal axis in Figure 4A represents time in seconds, and the vertical axis represents the amount of downlink data in bytes.

[0148] As shown in Figure 4A, the pattern of downlink traffic in service scenario 1 is: there are continuous packets for a period of time, followed by a period of time with few or no packets, then a period of time with continuous packets, then a period of time with few or no packets, and so on. For example, in Figure 4A, there are many packets between about 2820s and 2860s, and the data volume is mainly concentrated in the interval (0,8×10 5 ]bytes, then there is no message between about 2860s and 2880s, and then there are more messages between about 2880s and 2885s. The data size is mainly concentrated in the interval (0,12×10 5 ]bytes, then there is no message between about 2885s and 2905s, and then there are more messages between about 2905s and 2925s. The data size is mainly concentrated in the interval (0,7×10 5 ]bytes, then there are fewer messages between 2925s and 2955s, and then there are more messages between about 2955s and 3000s. The size of the data is mainly concentrated in the interval (0,12×10 5 ] bytes, and then there is no message between approximately 3000s and 3030s.

[0149] Figure 4B illustrates a schematic diagram of a continuous traffic model for Service Scenario 2. For example, online service scenarios in live streaming applications, Internet calling applications, and gaming applications are Service Scenario 2. The horizontal axis in Figure 4B represents time in seconds, and the vertical axis represents downlink data volume in bytes.

[0150] As shown in Figure 4B, the pattern of downlink traffic in scenario 1 is: there are continuous packets, and the data volume is relatively balanced, without a period of no packets or a small number of packets. For example, in Figure 4B, there are continuous packets between 100s and 400s, and the data volume is concentrated in the interval (0, 2×10 4 ]bytes.

[0151] Next, based on the above low-power sleep strategy, the sleep / working process of the Wi-Fi system in the above two service scenarios is described as an example. The following embodiment is described as an example using Listen Interval = 1, that is, STA listens to Beacon frames every 1 TBTT.

[0152] FIG5A exemplarily shows a sleep / work process of a Wi-Fi system in service scenario 1. ...

[0153] As shown in Figure 5A, during the time period from t1 to t2, the STA's Wi-Fi system sends the last service data 1 to the AP in the sending state, and then enters the listening state from the sending state. The STA can wait for T wait , in T wait The STA may receive the Beacon frame sent by the AP, or it may not receive the Beacon frame. wait The AP has no downlink service data to send to the STA. For example, the STA is in T wait If the Beacon frame of state 1 is not received or the downlink service data is not received, then at time t3 (i.e. after T2 wait At time t4 after sending the sleep frame, the STA can switch from the sending state to the sleep state.

[0154] It can be understood that after the STA and AP are powered on, the AP can send Beacon frames to the STA at a period of TBTT. After time t4, assuming that the arrival time of the next Beacon frame is time t5, the STA can enter the receiving state from the sleep state at time t5 and receive the Beacon frame sent by the AP in the receiving state. Assuming that the Beacon frame received between time t5 and t6 is not a Beacon frame in state 1, the STA obtains from the Beacon frame that the AP does not have any business data to send to itself. Therefore, at time t6, the STA enters the sleep state from the receiving state. At time t7 after time t6 and after TBTT, the STA can enter the receiving state from the sleep state and receive the Beacon frame sent by the AP in the receiving state. Assuming that the currently received Beacon frame is a Beacon frame in state 1, the STA obtains from the Beacon frame that the AP has business data to send to itself. Therefore, the STA no longer enters the sleep state, but enters the listening state, and when the Wi-Fi channel is idle (assuming that it is currently idle), it enters the sending state from the listening state. When entering the sending state (i.e. time t8), the STA can send a request frame to the AP to request downlink data. After sending the request frame, the STA can enter the listening state and enter the receiving state when downlink data is about to arrive.

[0155] Assume that the downlink data to be sent by the AP to the STA includes service data 2 and service data 3. At time t9, the STA enters the receiving state. 10 , STA receives service data 2 and service data 3 sent by AP in sequence. At time t 10After that, the STA can enter the listening state. Assuming that the STA has an uplink data packet to be sent to the AP, the STA can enter the sending state from the listening state and send data at time t 11 to t 12 4. Assume that service data 4 is the last service data sent by STA. Therefore, STA can send service data 4 to AP at time t. 12 Enter the listening state. STA can continue to wait for T wait The subsequent process is similar and will not be described in detail.

[0156] As can be seen from Figure 5A, if T wait If the AP has no downlink service data to send to the STA, the STA will wait for the time T wait The monitoring state will not bring any "benefits", T wait It will cause power consumption waste. Understandably, most STAs currently use T wait Set to hundreds of milliseconds (ms), and, in business scenario 1, T wait The probability that the AP has no downlink service data to send to the STA is high, so each T wait It will cause a lot of power consumption waste. However, if there is no waiting time T wait That is, after the STA sends the last service data to the AP, it directly sends a sleep frame to the AP and enters the sleep state. This method has the following problems: if the AP has downlink data to send to the STA, the STA cannot receive the Beacon frame in state 1 until the next TBTT (actually Listen Interval TBTTs) after entering the sleep state. The average delay is tens to hundreds of milliseconds, which affects the real-time experience of some delay-sensitive services.

[0157] FIG5B exemplarily shows a sleep / work process of a Wi-Fi system in service scenario 2. FIG.

[0158] As shown in FIG5B , at time t 13 to t 14 In the transmit state, the STA's Wi-Fi system sends the last service data 5 to the AP, and then enters the listening state from the transmit state. The STA can wait for T wait , when T wait When the AP has downlink service data to send to the STA, the AP can send it directly. When the service data 6 sent by the AP is about to arrive, the STA can enter the receiving state from the listening state. The STA can 15 to t 16Receive the service data 6 sent by AP and enter the monitoring state when the reception is completed. The time t 15 and time t 14 The interval is less than T wait STA can continue to wait for T in the listening state. wait , when T wait When the downlink service data sent by the AP is about to arrive, the STA can enter the receiving state from the listening state. The STA can 17 to t 18 The service data 7 and service data 8 sent by AP are received in sequence, wherein the time t 17 and time t 16 The interval is less than T wait At time t 18 After that, the STA can enter the listening state. Then, when the STA has an uplink data packet to be sent to the AP, it can enter the sending state from the listening state and 19 to t 20 t sends service data 9 to AP. Assuming that service data 9 is the last service data sent by STA, STA can send service data 9 to AP at time t. 20 Enter the listening state. STA can continue to wait for T wait The subsequent process is similar and will not be described in detail.

[0159] As can be seen from Figure 5B, in business scenario 2, T wait The probability that the AP has downlink service data to send to the STA is very high. Therefore, the STA can hardly achieve T waiT If there is no downlink message, it will enter the sleep state, resulting in a large amount of power consumption in the monitoring state.

[0160] The embodiment of the present application provides a sleep scheduling method, which is applied to the communication system 10. When the preset conditions are met, the terminal device 100 (i.e., STA) in the communication system 10 can negotiate a sleep scheduling policy with the network device 200 (i.e., AP), and the terminal device 100 can sleep and wake up according to the sleep scheduling policy. At the same time, the waiting time T wait The sleep scheduling strategy may include at least one sleep time slice (collectively referred to as sleep time) and at least one listening time slice (collectively referred to as listening time). For example, the proportion of sleep time is equal to the proportion of listening time, or the proportion of sleep time is greater than the proportion of listening time. waitThe proportion of listening time in the sleep scheduling strategy of the embodiment of the present application is 1, and the proportion of listening time in the sleep scheduling strategy of the embodiment of the present application is small (for example, less than or equal to 0.5), which effectively reduces the power consumption loss in the listening state. In addition, the length of the time slice in the sleep scheduling strategy of the embodiment of the present application is determined based on the maximum delay that the service currently running on the terminal device 100 can withstand, so no large delay is introduced. In other words, the embodiment of the present application can greatly optimize the power consumption of the listening state without affecting the real-time experience of the service, so that the Wi-Fi system of the terminal device 100 is in a dormant state as much as possible, thereby greatly reducing the power consumption of the Wi-Fi system.

[0161] The following is an exemplary introduction to the sleep scheduling strategy involved in the embodiments of the present application.

[0162] FIG6A exemplarily shows a schematic diagram of a sleep scheduling strategy.

[0163] In the sleep scheduling strategy shown in Figure 6A, the length of each sleep state time slice is equal (take N as an example for illustration), the length of each listening state time slice is equal (take N as an example for illustration), the length of 1 sleep state time slice and the length of 1 listening state time slice are equal (take N as an example for illustration), where N is a positive number and N is the maximum delay that the service running the STA can withstand.

[0164] In the sleep scheduling strategy shown in FIG6A, the time slices of the listening state and the time slices of the sleep state are alternated. The Wi-Fi system of the STA can periodically switch between the listening state and the sleep state, and switch once every N ms. For example, as shown in FIG6A, the end time of the listening state time slice 1 (Nms) is the start time of the sleep state time slice 2 (Nms), the end time of the sleep state time slice 2 is the start time of the listening state time slice 3 (Nms), the end time of the listening state time slice 3 is the start time of the sleep state time slice 4 (Nms), and so on. Among them, time slice 3 and time slice 1 are both time slices of the listening state. Time slice 3 can be understood as another time slice 1, and time slice 1 can also be understood as another time slice 3. Time slice 2 and time slice 4 are both time slices of the sleep state. Time slice 4 can be understood as another time slice 2, and time slice 2 can also be understood as another time slice 4. The description of the time slices of the listening state and the time slices of the sleep state in the subsequent embodiments of this application is similar.

[0165] In one embodiment, in the total duration of the sleep scheduling strategy shown in FIG6A , the number of sleep state time slices and the number of listening state time slices are equal. For example, FIG6A shows 6 sleep state time slices and 6 listening state time slices. Therefore, the proportion of sleep time and the proportion of listening time are equal, both being 0.5. Without limitation to this, in another embodiment, the number of sleep state time slices and the number of listening state time slices may also be different.

[0166] For example, the total duration of the sleep scheduling strategy shown in FIG6A is the same as the T wait are of equal length.

[0167] It can be understood that compared with the above T wait The proportion of listening time in the sleep scheduling strategy is 1, and the proportion of listening time in the sleep scheduling strategy shown in FIG6A is approximately 0.5, so the power consumption of the listening state can be reduced by about 50%. Moreover, even if there is uplink / downlink business in any sleep state time slice, since the length N of any sleep state time slice is the maximum delay that the business running the STA can bear, the communication process without uplink / downlink business during the sleep time will not introduce a delay exceeding the tolerable range, so the delay requirement of the business can be effectively guaranteed.

[0168] FIG6B exemplarily shows a schematic diagram of yet another sleep scheduling strategy.

[0169] In the sleep scheduling strategy shown in Figure 6B, the length of each listening state time slice is equal (take N as an example for illustration), and the lengths of at least two sleep state time slices may be different. For example, the length of time slice 6 is N, and the length of time slice 8 is N1, N1>N, and the length of at least one sleep state time slice is equal to the length of one listening state time slice. For example, the length of time slice 5 of the listening state and the length of time slice 6 of the sleep state are both N. The length of at least one sleep state time slice is different from the length of one listening state time slice. For example, the length of time slice 5 of the listening state is N, and the length of time slice 8 of the sleep state is N1. The length of any sleep state time slice is greater than or equal to the length of one listening state time slice.

[0170] In the sleep scheduling strategy shown in Figure 6B, the time slices of the listening state and the sleep state are alternated. The STA's Wi-Fi system can periodically switch between the listening state and the sleep state, and switch from the listening state to the sleep state every Nms. For example, as shown in Figure 6B, the end time of the listening state time slice 5 (Nms) is the start time of the sleep state time slice 6 (Nms), the end time of the sleep state time slice 6 is the start time of the listening state time slice 7 (Nms), the end time of the listening state time slice 7 is the start time of the sleep state time slice 8 (N1ms), and so on.

[0171] Figure 6B illustrates an example where the length of the sleep state time slice can gradually increase. For example, as shown in Figure 6B , when there is no uplink data / downlink data to be transmitted in the second listening state time slice 7, the length N of the first sleep state time slice 6 is less than the length N1 of the second sleep state time slice 8. When there is no uplink data / downlink data to be transmitted in the third listening state time slice 9, the length N1 of the second sleep state time slice 8 is less than the length N2 of the third sleep state time slice 10.

[0172] It is understandable that although the length of the time slice of the sleep state can be gradually increased, the total duration of the sleep scheduling strategy may be a preset fixed length, such as the same as the above T wait In this case, if the last time slice in the sleep scheduling strategy is the time slice of the sleep state, even if there is no uplink data / downlink data to be transmitted in the penultimate time slice (i.e., the time slice of the listening state), the length of the last time slice may not be the value obtained according to the above rule. For example, the length N3 of the last sleep state time slice shown in Figure 6B is less than the length N2 of the previous sleep state time slice 10.

[0173] FIG6C exemplarily shows a schematic diagram of yet another sleep scheduling strategy.

[0174] In the sleep scheduling strategy shown in Figure 6C, the length of each sleep state time slice is equal (take N as an example for illustration), the length of each listening state time slice is equal (take N4 as an example for illustration), and the length of a sleep state time slice is greater than the length of a listening state time slice, that is, N>N4.

[0175] In the sleep scheduling strategy shown in FIG6C , the time slices of the listening state and the sleep state are alternated. The STA's Wi-Fi system can periodically switch between the listening state and the sleep state, switching from the sleep state to the listening state every Nms and from the listening state to the sleep state every N4ms. For example, as shown in FIG6C , the end time of the listening state time slice 11 (N4ms) is the start time of the sleep state time slice 12 (Nms), the end time of the sleep state time slice 12 is the start time of the listening state time slice 13 (N4ms), the end time of the listening state time slice 13 is the start time of the sleep state time slice 14 (Nms), and so on.

[0176] In one embodiment, in the total duration of the sleep scheduling strategy shown in Figures 6B and 6C, the number of time slices in the sleep state is equal to the number of time slices in the listening state. For example, Figure 6B shows 4 time slices in the sleep state and 4 time slices in the listening state, and the length of each time slice in the sleep state is greater than or equal to the length of the time slice in the listening state. For another example, Figure 6C shows 5 time slices in the sleep state and 5 time slices in the listening state, and the length of each time slice in the sleep state is greater than the length of the time slice in the listening state. Therefore, the proportion of the listening time is less than the proportion of the sleep time, and the proportion of the listening time is approximately less than 0.5. Not limited to this, in another embodiment, the number of time slices in the sleep state and the number of time slices in the listening state may also be different.

[0177] For example, the total duration of the sleep scheduling strategy shown in FIG6B / FIG6C is the same as the T wait are of equal length.

[0178] It can be understood that compared with the above T wait The proportion of listening time in the sleep scheduling strategy shown in Figure 6B / Figure 6C is 1, and the proportion of listening time in the sleep scheduling strategy is approximately less than 0.5, so the power consumption of the listening state can be reduced by more than 50%. In addition, the length of the time slice of the sleep state is determined according to whether there is uplink business / downlink business in each listening state. The length of the time slice of the sleep state can be gradually increased, so the delay requirement of the business can also be effectively guaranteed.

[0179] Figures 6A and 6C illustrate the example that the length of the time slice of each listening state is equal and the time slice of each sleeping state is equal, and Figure 6B illustrates the example that the length of the time slice of each listening state is equal and the time slices of at least two sleeping states are unequal. In a specific implementation, the time slices of at least two listening states may be unequal and the time slice of each sleeping state may be equal, or the time slices of at least two listening states may be unequal and the time slices of at least two sleeping states may be unequal. The embodiments of the present application do not limit this.

[0180] Figures 6A-6C illustrate the example of the first time slice being a time slice in the listening state. In a specific implementation, the first time slice may also be a time slice in the sleeping state. The embodiment of the present application does not limit the types of the first time slice and the last time slice.

[0181] Next, the sleep / work process implemented by the Wi-Fi system based on the sleep scheduling method provided in the embodiment of the present application is exemplarily described.

[0182] In the above business scenario 1, after the STA and the AP complete the data transmission (for example, after the STA completes sending the uplink business data to the AP), the STA can negotiate the sleep scheduling information (including the first duration) with the AP and use the first duration to replace the original waiting time T wait , examples of the sleep / work process can be seen in Figures 7A-7C below.

[0183] Fig. 7A exemplarily shows a sleep / work process of another Wi-Fi system in service scenario 1. Fig. 7A is illustrated by taking the existence of uplink service in the terminal device 100 as an example.

[0184] As shown in FIG7A , at time t 21 to t 22 During the period, the STA's Wi-Fi system sends the last service data 10 to the AP in the sending state, and then at time t 22 to t 23 Within , the STA sends a negotiation frame to the AP, which is used to negotiate sleep scheduling information 1 with the AP. The sleep scheduling information 1 may include a first duration, which may include at least one first time slice (i.e., a time slice in the sleep state) and at least one second time slice (i.e., a time slice in the listening state). FIG7A takes the first duration as set according to the sleep scheduling policy shown in FIG6A , where the first duration T0 includes 6 first time slices and 6 second time slices, the length of each first time slice is N, and the length of each second time slice is N, i.e., T0 = 12×N as an example for explanation. After the sleep scheduling information 1 is successfully negotiated, the STA can use the first duration to replace the original T wait , and sleep and wake up according to the first time slice and the second time slice within the first time slice, and the AP can send downlink data according to the first time slice and the second time slice within the first time slice.

[0185] As shown in FIG7A , from time t 23 The first duration starts from the beginning. Assuming that the starting time of the first duration is the starting time of the time slice of the monitoring state, then at time t 23, STA can enter the listening state and enter the sleep state after N ms in the listening state (i.e. the first time slice, which is also the time slice of the listening state), that is, enter the sleep state at the end of the first time slice (i.e. the start time of the second time slice), and then enter the listening state after N ms in the sleep state (i.e. the second time slice, which is also the time slice of the sleep state), that is, enter the listening state at the end of the second time slice (i.e. the start time of the third time slice, which is the time slice of the listening state), and so on. It can be understood that within the first time length, the STA switches the listening state / sleep state every N ms. Assume that in the fourth time slice (i.e. the time slice of the sleep state), for example, time t 24 , when the STA detects the uplink data to be sent (i.e., service data 11) in the sleep state, it caches it (for example, caches it in a preset sending queue), and when the time slice of the next listening state arrives, that is, at time t 25 (i.e. the end time of the 4th time slice)(t 25 and t 23 The interval between them is 4N ms), the STA can enter the listening state from the sleep state, and enter the sending state from the listening state when the Wi-Fi channel is idle (assuming it is currently idle). 25 to t 26 In the sending state, STA can send service data 11 to AP. It can be understood that the first duration ends at the end of the fourth time slice (i.e., time t 25 ) ended early.

[0186] As shown in FIG7A , after the STA sends the service data 11 to the AP, at time t 26 to t 27 During the transmission period, the STA can send a negotiation frame to the AP in the transmission state. The negotiation frame is used to negotiate the sleep schedule information 1 with the AP. 27 A new first duration can start from the beginning, and the STA can enter the monitoring state, and enter the sleep state after N ms in the monitoring state (i.e., the first time slice, also the time slice of the monitoring state), and enter the monitoring state after N ms in the sleep state (i.e., the second time slice, also the time slice of the sleep state), and so on, until the current first duration T0 = 12 × N ends (the end time is t 28 ). Since the first duration (i.e. time t 27 to t 28 ) has no uplink or downlink traffic, so at the end of the first duration, i.e. at time t 28When the STA enters the transmit state and sends a sleep frame to the AP to notify the AP that it will enter the sleep state, the STA then enters the sleep state after sending the sleep frame. Optionally, after entering the sleep state, the STA can wake up and listen for Beacon frames every Listen Interval TBTT according to the PSM sleep mechanism, such as the process after time t4 shown in Figure 5A.

[0187] In FIG7A , when the STA detects that there is uplink data to be sent during the time slice of the sleep state in the first time length, the STA will remain in the sleep state and cache the uplink data. After the next time slice of the sleep state time slice (i.e., the time slice of the listening state) arrives, the STA enters the sending state and sends the uplink data to the AP. This can be understood as the first time length being ended in advance after the sleep state time slice in which the uplink data to be sent is detected ends. Not limited to this, in other examples, when the STA detects that there is uplink data to be sent during the time slice of the sleep state in the first time length, the STA may not cache the uplink data and enter the sending state from the sleep state to send the uplink data to the AP. This can be understood as the time slice in which the STA detects that there is uplink data to be sent, such as the time t shown in FIG7A . 24 In other examples, the STA may detect the presence of uplink data to be sent during a listening state time slice within the first time slice. In this case, the STA may not cache the uplink data and transition from the listening state to the transmitting state to send the uplink data to the AP. This means that the first time slice is terminated in advance within the listening state time slice upon detecting the presence of uplink data to be sent.

[0188] Fig. 7B exemplarily shows a sleep / work process of another Wi-Fi system in service scenario 1. Fig. 7B is illustrated by taking the case where the terminal device 100 has downlink service as an example.

[0189] As shown in FIG7B , at time t 29 to t 30 During the period, the STA's Wi-Fi system sends the last service data 12 to the AP in the sending state, and then at time t 30 to t 31 In the present embodiment, the STA sends a negotiation frame to the AP, where the negotiation frame is used to negotiate sleep scheduling information 1 with the AP. For an explanation of the sleep scheduling information 1, please refer to the explanation of the sleep scheduling information 1 in FIG. 7A .

[0190] As shown in FIG7B , from time t 31The first duration begins from the beginning. During the first duration, the STA can switch between the listening state and the sleeping state every N ms. Assuming that in the fourth time slot (i.e., the sleeping state time slot), the STA is in the sleeping state and the AP has downlink data to be sent, it will cache it. After the next listening state time slot arrives (i.e., after the current sleeping state time slot ends), it will send data packet 3 to notify the STA that there is downlink data to be sent. At the end time of the fourth time slot, t 32 (t 32 and t 31 The interval between them is 4N ms), the STA can enter the listening state from the sleep state. When the STA detects that a downlink data packet is about to arrive in the listening state, the STA can enter the receiving state from the listening state and receive data packet 3 sent by the AP in the receiving state. Based on data packet 3, the STA obtains that the AP has service data to be sent to itself. Therefore, the STA enters the listening state and enters the sending state from the listening state when the Wi-Fi channel is idle (assuming it is currently idle). When entering the sending state (i.e. time t 33 ), the STA can send a request frame to the AP to request downlink data. After sending the request frame, the STA can enter the listening state and enter the receiving state when the downlink data is about to arrive. Assume that the downlink data to be sent by the AP to the STA includes service data 13 and service data 14. At time t 34 , STA enters the receiving state, at time t 34 To time t 35 , STA receives service data 13 and service data 14 sent by AP in sequence. It can be understood that the first duration ends at the end time of the fourth time slice (i.e., time t 32 ) ended early.

[0191] As shown in FIG7B , after the STA receives the service data 13 and service data 14 sent by the AP, that is, at time t 35 After that, the STA can enter the listening state and then switch to the sending state to send a negotiation frame to the AP. The negotiation frame is used to negotiate the sleep scheduling information 1 with the AP. 36 A new first duration can be started, and the STA can switch between the sleep state and the listening state every N ms until the current first duration T0 = 12 × N ends (the end time is time t 37 ). Since the first duration (i.e. time t 36 to t 37 ) has no uplink or downlink traffic, so at the end of the first duration, i.e. at time t 37 When the STA enters the sending state and sends a sleep frame to the AP to notify the AP that it will enter the sleep state, and enters the sleep state after sending the sleep frame.

[0192] Data packet 3 is used to notify the STA that the AP has downlink data to send to the STA. In some examples, when the STA and AP negotiate via a target wake time (TWT) mechanism or a private negotiation mechanism (i.e., negotiation via custom action frames), Data packet 3 may be a trigger frame. Without limitation, in other examples, when the STA and AP negotiate via PSM (e.g., using PSM Null-Data frames), Data packet 3 may be a Beacon frame in state 1.

[0193] Not limited to the example shown in FIG7B , in other examples, the AP may not send data packet 3 but directly send downlink service data, such as when the STA and the AP negotiate through TWT or a private negotiation mechanism. For specific examples, see FIG7C .

[0194] FIG7C exemplarily shows another sleep / work process of a Wi-Fi system in service scenario 1. FIG7C is similar to FIG7B , except that the end time of the fourth time slice is t 32 After that, the AP may not send data packet 3, but directly send service data 13 and service data 14 to the STA. At time t 32 , the STA can enter the listening state from the sleep state, and then enter the receiving state when the downlink data is about to arrive. The STA can receive service data 13 and service data 14 in the receiving state. Then, at time t 38 , STA can enter the listening state, then switch from the listening state to the sending state and send a negotiation frame to the AP, which negotiates the sleep schedule information 1 with the AP. 39 A new first duration begins, and during the first duration, the STA can switch between the sleep state and the listening state every N ms until the current first duration T0 = 12 × N ends (the end time is t 40 ). Since the first duration (i.e. time t 39 to t 40 ) has no uplink or downlink traffic, so at the end of the first duration (i.e., time t 40 ), the STA can enter the sending state and send a sleep frame to the AP and enter the sleep state.

[0195] In Figures 7B and 7C, if the AP detects that there is downlink data to be sent during the sleep state time slice of the first duration, the AP will cache the downlink data and send the downlink data after the next time slice of the sleep state time slice (i.e., the listening state time slice) arrives. This can be understood as the first duration being terminated in advance after the sleep state time slice in which the downlink data to be sent is detected to have ended. Without limitation, in other examples, the AP may also detect that there is downlink data to be sent during the listening state time slice of the first duration, and the AP may not cache the downlink data, but may directly send data packet 3 and the downlink data (similar to Figure 7B), or directly send the downlink data (similar to Figure 7C). This can be understood as the first duration being terminated in advance during the listening state time slice in which the downlink data to be sent is detected.

[0196] Figures 7A-7C are used as an example to illustrate that the first time duration is set according to the sleep scheduling strategy shown in Figure 6A. In a specific implementation, the first time duration can also be set according to Figure 6B, Figure 6C or other sleep scheduling strategies. The embodiment of the present application does not limit the specific setting method of the first time slice and the second time slice in the first time duration, but the first time slice and the second time slice are always alternated within the first time duration.

[0197] In one embodiment, in the above-mentioned service scenario 1, when the maximum delay N that the service running the STA can withstand is less than the first duration, after the STA and the AP complete the data transmission, the STA can negotiate the first duration with the AP. However, when the maximum delay N that the service running the STA can withstand is greater than or equal to the first duration, after the STA and the AP complete the data transmission, the STA can also directly send a sleep frame and enter the sleep state, that is, directly cancel the waiting time. In this case, although the Beacon frame can only be received after the next TBTT after the STA enters the sleep state, because N is large, for example, the first duration is 100ms, and N is greater than 100ms, it will not affect the real-time experience of the current service, and the power consumption waste in the listening state during the waiting time is completely avoided.

[0198] As can be seen from Figure 4B and Figure 5B above, the traffic model under business scenario 2 is that there are continuous messages and the data volume is relatively balanced. Therefore, STA can hardly achieve T wait The embodiment of the present application provides a traffic shaping mode, which can integrate the continuous traffic model under the service scenario 2 into a pulse traffic model. The example of the integrated traffic model can be seen in FIG8 .

[0199] FIG8 exemplifies a schematic diagram of a pulsed traffic model under business scenario 2. The pattern of the downlink traffic in this traffic model is: there are more messages concentrated in a short period of time, and then there are no messages for a period of time, and then there are more messages concentrated in a short period of time, and then there are no messages for a period of time, and so on. In other words, this traffic model has downlink traffic at regular intervals, and no downlink traffic at other times. For example, in FIG8 , there is about 650 bytes of downlink traffic in a short period of time after 0ms, more than 900 bytes of downlink traffic at about 10ms, about 800 bytes of downlink traffic at about 20ms, and so on. It can be understood that there is a higher downlink traffic every 10ms, and no downlink traffic at other times.

[0200] In the above-mentioned business scenario 2, if the current channel capacity is much larger than the bandwidth of the current business (in this case, a large amount of data can be transmitted in a shorter time), the STA can determine to enter the traffic shaping mode, otherwise it will not enter the traffic shaping mode. When it is determined to enter the traffic shaping mode, the STA can negotiate the sleep scheduling information (including the first period) with the AP. In the traffic shaping mode, the STA can periodically switch between the listening state and the sleep state based on the first period, and both the STA and the AP can cache the data packets to be sent and periodically send the cached data packets based on the first period. For examples of the sleep / working process, please refer to Figures 9A and 9B below.

[0201] Fig. 9A exemplarily shows a sleep / work process of another Wi-Fi system in service scenario 2. Fig. 9A is illustrated by taking the existence of uplink service in the terminal device 100 as an example.

[0202] As shown in FIG9A , at time t 41 , STA determines to enter traffic shaping mode, so at time t 41 to t 42 During the sleep schedule, the STA's Wi-Fi system sends a negotiation frame to the AP in the transmitting state. The negotiation frame is used to negotiate sleep schedule information 2 with the AP. Sleep schedule information 2 may include a first cycle. One first cycle may include one first time slice (i.e., a time slice in the sleep state) and one second time slice (i.e., a time slice in the listening state). FIG9A illustrates an example in which the first cycle is set according to the sleep scheduling policy shown in FIG6A, and the lengths of the first time slice and the second time slice in the first cycle are both N, i.e., the first cycle is 2N. After the sleep schedule 2 is successfully negotiated, multiple first cycles may be performed. The STA may sleep and wake up according to the first time slice and the second time slice in the first cycle. Moreover, in the second time slice of the first cycle, the STA may send uplink data and / or the AP may send downlink data.

[0203] As shown in FIG9A , from time t 42 Assuming that the start time of the first cycle is the start time of the time slice of the monitoring state, at the start time t 42 STA can enter the listening state and enter the sleep state after N ms (i.e. the time slice of the listening state), i.e. at the end time t of the time slice of the listening state 43 (i.e. the start time of the sleep state time slice) enters the sleep state, and then stays in the sleep state for N ms (i.e. the sleep state time slice), and the end time of the sleep state time slice is t 44 This is the end time of the first cycle, and a new first cycle can be carried out later, for example, at time t 44 To time t 46 is the second first cycle, and so on. Therefore, the STA can switch between the listening state and the sleeping state every N ms.

[0204] As shown in FIG9A , the STA can send uplink data in the time slice of the listening state in the first cycle. Assume that in the time slice of the listening state in the first cycle, that is, time t 42 to t 43 During the period, the STA does not detect uplink data and downlink data in the monitoring state. Assume that during the time slice of the first cycle of the sleep state, that is, time t 43 to t 44 During the sleep state, the STA detects uplink data to be sent and caches it (for example, caches it in a preset transmission queue). When the time slice of the second first cycle of the listening state arrives (that is, the time slice of the first first cycle of the sleep state ends), that is, at time t 44 , STA can enter the listening state from the sleep state, and enter the sending state from the listening state when the Wi-Fi channel is idle (assuming it is currently idle), and within the time slice of the current listening state, that is, time t 44 To time t 45 , the STA can send the uplink data (i.e., service data 15) cached in the above-mentioned sending queue to the AP in the sending state. The subsequent description is similar. When the STA detects uplink data to be sent in the time slice of the sleep state, it can cache it in the preset sending queue and enter the sending state when the next listening state time slice of the sleep state time slice arrives, so as to send the data in the sending queue to the AP in the sending state. For example, in the sleep state time slice of the second first cycle (i.e., time t 45 to t 46 ) If the STA has uplink data to be sent, it will be cached. In the time slice of the monitoring state of the first cycle of the third period (i.e., time t 46 to t47 ) The STA in the STA sends the cached data to the AP, and so on, and no further examples are given.

[0205] In Figure 9A, if the STA detects that there is uplink data to be sent during a sleep state time slice in the first cycle, the STA will remain in the sleep state and cache the uplink data. After the next listening state time slice after the sleep state time slice arrives, the STA enters the sending state and sends the uplink data to the AP. Without limitation, in other examples, the STA may also detect that there is uplink data to be sent during a listening state time slice in the first cycle. In this case, the STA may send the currently detected uplink data in the sending state before the end of the current listening state time slice.

[0206] Fig. 9B exemplarily shows another sleep / work process of a Wi-Fi system in service scenario 2. Fig. 9B is illustrated by taking the case where the terminal device 100 has downlink service as an example.

[0207] As shown in FIG9B , at time t 48 , STA determines to enter traffic shaping mode, so at time t 48 to t 49 In the transmitting state, the Wi-Fi system of the STA sends a negotiation frame to the AP. The negotiation frame is used to negotiate the sleep scheduling information 2 with the AP. For the description of the sleep scheduling information 2, please refer to the description of the sleep scheduling information 2 in FIG. 9A .

[0208] As shown in FIG9B , from time t 49 Start multiple first cycles, time t 49 To time t 51 For the first cycle, time t 51 To time t 53 is the second first cycle, and so on. The description of how the STA switches between the listening state and the sleeping state in each first cycle can be found in the first first cycle (time t 42 to t 44 ) is not repeated here.

[0209] As shown in FIG9B , the AP can send downlink data in the time slice of the listening state in the first cycle. Assume that in the time slice of the listening state in the first cycle, that is, time t 49 to t 50 During the period, the STA does not detect uplink data and downlink data in the monitoring state. Assume that during the time slice of the first cycle of the sleep state, that is, time t 50 to t 51During the period, STA is in sleep state, and AP has downlink data to be sent, so it is cached and the downlink data is sent after the time slice of the second first cycle of monitoring state arrives (that is, after the time slice of the first first cycle of sleep state ends). 51 , STA can enter the listening state from the sleep state. When STA detects that the downlink data packet is about to arrive in the listening state, STA can enter the receiving state from the listening state, and, within the time slice of the current listening state, that is, time t 51 To time t 52 , the STA can receive the downlink data (i.e., service data 17) sent by the AP in the receiving state. The subsequent description is similar. When the AP detects the downlink data to be sent in the time slice of the sleep state, it can cache it and send the downlink data to the STA in the next listening state time slice of the sleep state time slice, for example, in the sleep state time slice of the second first cycle (i.e., time t 52 to t 53 ), the STA is in sleep state, and the AP has downlink data to be sent and caches it. In the time slice of the monitoring state of the first cycle of the third period (i.e., time t 53 to t 54 ) The STA in the receiving state receives the downlink data (ie, service data 18) sent by the AP, and so on, which will not be given one by one.

[0210] FIG9B illustrates an example in which the AP does not send data packet 3 but directly sends downlink service data. In other examples, the AP may also first send data packet 3 to notify the STA that the current AP has downlink data to be sent to the STA. The AP then sends the downlink service data after receiving the request frame sent by the STA. For a specific example, see time t in FIG7B. 32 to t 35 Description.

[0211] Exemplarily, when N=10 ms, the traffic model of the sleep / work process shown in FIG. 9A / FIG. 9B may be the traffic model shown in FIG. 8 .

[0212] In FIG9B , the AP detects that there is downlink data to be sent during the sleep state time slice of the first cycle, and the AP will buffer the downlink data and send the downlink data after the next listening state time slice of the sleep state time slice arrives. Without limitation, in other examples, the AP may also detect that there is downlink data to be sent during the listening state time slice of the first cycle, and the AP may not buffer the downlink data, but directly send data packet 3 and the downlink data before the end of the current listening state time slice (similar to FIG7B ), or directly send the downlink data (similar to FIG7C ).

[0213] In one embodiment, in traffic shaping mode, if specific conditions are met (for example, the amount of data in the above-mentioned preset sending queue exceeds the preset queue threshold), the STA can exit the traffic shaping mode, and the first cycle will no longer be performed. For example, at this time, it can work according to the sleep mechanism of the above-mentioned PSM.

[0214] Figures 9A and 9B illustrate the example of the first cycle being set according to the sleep scheduling policy shown in Figure 6A. In a specific implementation, the first cycle can also be set according to other sleep scheduling policies. In some examples, the first cycle is set according to the sleep scheduling policy shown in Figure 6B, then the first first cycle includes time slices 5 and 6, the second first cycle includes time slices 7 and 8, the third first cycle includes time slices 9 and 10, and so on. In other examples, the first cycle is set according to the sleep scheduling policy shown in Figure 6C, then the first first cycle includes time slices 11 and 12, the second first cycle includes time slices 13 and 14, and so on. The embodiments of the present application do not limit the specific setting method of the first time slice and the second time slice in the first cycle.

[0215] Figures 9A and 9B illustrate the transmission of uplink data or downlink data within a time slice in a listening state as an example. In a specific implementation, uplink data and downlink data can be transmitted within a time slice in a listening state. For example, uplink data is transmitted first and then downlink data is transmitted, and so on. The transmission process may be different in different business scenarios and at different times. The embodiment of the present application does not limit the specific transmission process within the time slice in the listening state.

[0216] Understandably, before each uplink data transmission, the STA will first compete for a channel and only send the uplink data after a successful competition. Similarly, before each downlink data transmission, the AP will first compete for a channel and only send the downlink data after a successful competition. In some examples, if the STA wants to send uplink data and the AP also wants to send downlink data, the STA and AP can compete for a channel, and only the device that successfully competes can send data.

[0217] It can be understood that after the STA sends uplink service data to the AP, the STA sends a negotiation frame to the AP, or after the STA receives downlink service data sent by the AP, the STA sends a negotiation frame to the AP. This embodiment of the present application does not limit this.

[0218] Next, a flowchart of a sleep scheduling method provided by an embodiment of the present application is described. This method can be applied to the terminal device 100 shown in Figure 1A. This method can be applied to the terminal device 100 shown in Figure 1B. This method can be applied to the terminal device 100 shown in Figure 2. This method can be applied to the terminal device 100 shown in Figure 3.

[0219] Please refer to Figure 10, which is a flowchart of a sleep scheduling method provided by an embodiment of the present application. The method may include but is not limited to the following steps:

[0220] S101: The terminal device 100 obtains the traffic type and delay-sensitive information of the currently running first service.

[0221] In one embodiment, the terminal device 100 can identify the traffic type of the currently running first service, and the traffic models of the first services of different traffic types are different. The traffic type of the first service can be, but is not limited to, the first type or the second type. An example of the traffic model of the first service of the first type can be a pulsed traffic model under service scenario 1 shown in FIG4A , and an example of the traffic model of the second service of the first type can be a continuous traffic model under service scenario 2 shown in FIG4B .

[0222] In one embodiment, the delay-sensitive information may be the maximum delay that the first service can tolerate, i.e., the aforementioned N ms. The terminal device 100 may identify whether the currently running first service includes a delay-sensitive service. If so, the terminal device 100 may obtain the maximum delay that the delay-sensitive service can tolerate (i.e., the delay-sensitive information). If not, the terminal device 100 may determine the preset delay as the maximum delay that the first service can tolerate (i.e., the delay-sensitive information).

[0223] S102: The terminal device 100 determines whether the traffic type of the first service is the first type or the second type.

[0224] In the process shown in Figure 10, the terminal device 100 can use different sleep scheduling strategies for first services of different traffic types. When the traffic type of the first service obtained in S101 is the first type, the terminal device 100 can execute the following S103-S104. When the traffic type of the first service obtained in S101 is the second type, the terminal device 100 can execute the following S105-S107.

[0225] S103: The terminal device 100 obtains the sleep scheduling strategy 1 (including the first duration) according to the first type and delay-sensitive information.

[0226] In one embodiment, the terminal device 100 can determine, based on the first type and delay-sensitive information: it is currently in business scenario 1 (the traffic presents a pulse-like pattern similar to that shown in FIG4A ), and the maximum delay N that the currently running first business can withstand. When currently in business scenario 1, the terminal device 100 can determine the length of the first time slice and the length of the second time slice based on N, and determine the first duration (including at least one first time slice and at least one second time slice), the first time slice being the time slice when the terminal device 100 is in a sleep state (i.e., the time slice in the above-mentioned sleep state), and the second time slice being the time slice when the terminal device 100 is in a listening state (i.e., the time slice in the above-mentioned listening state). An example of the first duration in sleep scheduling strategy 1 can be found in the total duration shown in FIG6A-FIG6C .

[0227] In one embodiment, the sleep scheduling strategy 1 may include: the terminal device 100 uses the first duration to replace the original waiting time T wait , for example, the length of the first duration and the waiting time T waiT are of equal length.

[0228] In one embodiment, the sleep scheduling strategy 1 may include: after the terminal device 100 and the network device 200 complete data transmission, the terminal device 100 can sleep and wake up according to the first time slice and the second time slice in the first time length. If there is no uplink service and downlink service within the first time length, the terminal device 100 can enter a sleep state.

[0229] S104: The terminal device 100 negotiates with the network device 200 about the sleep scheduling strategy 1, and performs sleep and wake-up according to the sleep scheduling strategy 1.

[0230] In one embodiment, after the terminal device 100 and the network device 200 complete the current data transmission, for example, after the terminal device 100 sends the current uplink data to the network device 200, or after the terminal device 100 receives the downlink data currently sent by the network device 200, the terminal device 100 can actively negotiate the sleep scheduling strategy 1 with the network device 200.

[0231] In one embodiment, the terminal device 100 may first send a negotiation frame to the network device 200 to negotiate a sleep scheduling policy 1 with the network device 200. After the negotiation is successful (e.g., after the negotiation frame is successfully sent), the terminal device 100 then starts the first duration and sleeps and wakes up according to the first time slice and the second time slice in the first duration, that is, sends the negotiation frame before the start time of the first duration. The negotiation frame may include at least one of the following: information about the first duration (e.g., length), information about the first time slice, or information about the second time slice. The information about the first time slice / second time slice may include, but is not limited to, length, whether the lengths of the multiple time slices are equal if there are multiple time slices, the relationship between the lengths of the multiple time slices if there are multiple time slices, the proportion of the first time slice in the first duration, or the number of the second time slices in the first duration. For example, the negotiation frame includes the length of the first time slice, the length of the second time slice, the number of the first time slices in the first duration, and the number of the second time slices in the first duration. For another example, the negotiation frame includes the length of the first duration and the proportion of the first time slice or the second time slice in the first duration. For specific implementation examples, please refer to the following implementation methods 2 and 3 of negotiating sleep scheduling policy 1.

[0232] In another embodiment, the terminal device 100 may also negotiate the sleep scheduling strategy 1 with the network device 200 during the first time period. For a specific implementation example, please refer to the following implementation method 1 of negotiating the sleep scheduling strategy 1.

[0233] In the embodiment of the present application, the terminal device 100 and the network device 200 may negotiate the sleep scheduling strategy 1 in the following three ways, but are not limited to:

[0234] Method 1, negotiate a sleep scheduling strategy 1 based on PSM. In the first time period, the terminal device 100 can send a sleep frame to the network device 200 before entering the sleep state each time, and the network device 200 can determine that the terminal device 100 is about to / has entered the sleep state based on the sleep frame, and the terminal device 100 can send a wake-up frame to the network device 200 after each wake-up (for example, when entering the listening state), and the network device 200 can determine that the terminal device 100 is currently awakened (that is, in the working state) based on the wake-up frame. In one embodiment, when the first time slice in the first time period is a time slice in the listening state, the negotiation frame can be a wake-up frame, and when the first time slice in the first time period is a time slice in the sleep state, the negotiation frame can be a sleep frame. In one embodiment, the sleep scheduling strategy can be negotiated based on the Null-Data frame of PSM. The Null-Data frame is a short frame that transmits data in about tens of microseconds. For example, the above-mentioned sleep frame can be obtained by setting the Power Managemet Bit in the Null-Data frame to 1, and the above-mentioned wake-up frame can be obtained by setting the Power Managemet Bit in the Null-Data frame to 0. Understandably, currently all Wi-Fi-supported devices basically support the PSM protocol, so the PSM-based negotiated sleep scheduling strategy has good universality.

[0235] Method 2, based on TWT negotiated sleep scheduling strategy 1, wherein TWT is a mechanism for STA and AP to negotiate sleep and wake-up, and STA can negotiate a TWT plan (TWT Schedule) with AP through TWT Setup Frame. The TWT Schedule can divide the time axis into alternating sleep (Doze) state time slices and TWT service period (SP) state time slices. A continuous Doze state time slice and a TWT SP state time slice can be called a TWT cycle. The above-mentioned negotiation frame can be a TWT Setup Frame, the above-mentioned Doze state can correspond to the sleep state in the embodiment of the present application, and the above-mentioned TWT SP state can correspond to the working state (such as the listening state) in the embodiment of the present application. In one embodiment, the TWT Schedule may include but is not limited to at least one of the following information: the duration of a TWT cycle, the duration in the TWT SP state within a TWT cycle, the proportion of the TWT SP state within a TWT cycle, the starting point and / or end point of an event, the number of TWT cycles, or management frames (such as management frames for how to interact in the TWT SP state), and the management frame is, for example, the above-mentioned data packet 3 (used to notify the STA that the current AP has downlink data to be sent to the STA) (which can be a Trigger frame). It can be understood that the TWT negotiated sleep scheduling strategy requires that both the terminal device 100 and the network device 200 support the TWT protocol (an optional feature of Wi-Fi 6).

[0236] Mode 3: Negotiate the sleep scheduling policy 1 based on a private negotiation mechanism. The terminal device 100 and the network device 200 can customize the Action frame and negotiate the sleep scheduling policy 1 by transmitting the Action frame. The above negotiation frame is a customized Action frame.

[0237] In one embodiment, the terminal device 100 can configure the sleep parameters according to the obtained sleep scheduling strategy 1, so that when it subsequently sleeps and wakes up according to the configured sleep parameters in the first time period, it can correspond to the first time slice and the second time slice. Wherein, the sleep parameters include, but are not limited to, at least one of the following: the first time period (for example, the length of the above-mentioned waiting time), the length of time in the listening state, the length of time in the sleeping state, or the time point of switching between the listening state and the sleeping state, etc. In some examples, the sleep parameters can be configured after the terminal device 100 and the network device 200 successfully negotiate the sleep scheduling strategy 1, for example, after the terminal device 100 successfully sends a negotiation frame to the network device 200, such as the case of negotiating the sleep scheduling strategy 1 based on the above-mentioned method 2 and method 3. In other examples, the sleep parameters can be configured before the terminal device 100 and the network device 200 negotiate the sleep scheduling strategy 1, for example, the sleep parameters are configured after the sleep scheduling strategy 1 is obtained.

[0238] In one embodiment, the terminal device 100 can configure a sending queue based on the obtained sleep scheduling strategy 1. The sending queue can be used to cache the uplink data to the sending queue when the terminal device 100 detects uplink data to be sent within the time slice of the sleep state. In some examples, the sleep parameters can be configured after the terminal device 100 and the network device 200 successfully negotiate the sleep scheduling strategy 1, for example, after the terminal device 100 successfully sends a negotiation frame to the network device 200, such as the case of negotiating the sleep scheduling strategy 1 based on the above-mentioned method 2 and method 3. In other examples, the sleep parameters can be configured before the terminal device 100 and the network device 200 negotiate the sleep scheduling strategy 1, for example, the sleep parameters are configured after the sleep scheduling strategy 1 is obtained.

[0239] In one embodiment, after the terminal device 100 and the network device 200 complete the current data transmission, the terminal device 100 can sleep and wake up in the first time period according to the sleep scheduling strategy 1, which includes: entering the sleep state at the starting moment of the first time slice in the first time period and being in the sleep state in the first time slice, and entering the listening state at the starting moment of the second time slice in the first time period and being in the working state in the second time slice. When the terminal device 100 sleeps and wakes up according to the sleep scheduling strategy 1, the network device 200 can send data frames to the terminal device 100 based on the first time slice and the second time slice in the first time period, which includes: the network device 200 will not send data frames to the terminal device 100 in the first time slice (i.e., the time slice in the sleep state) (at this time, there are data frames to be sent that can be cached), and the network device 200 will send data frames to the terminal device 100 in the second time slice (i.e., the time slice in the listening state).

[0240] In one embodiment, based on the configured sleep parameters, the terminal device 100 can be in a sleep state in the first time slice of the first time length and in a working state in the second time slice of the first time length. For specific examples, see Figures 6A-6C.

[0241] In one embodiment, if the terminal device 100 has no uplink or downlink traffic within the first time period, the terminal device 100 may enter a dormant state after the first time period ends. For example, as shown in FIG7A , at time t 26 to t 27 Within t, the terminal device 100 can send a negotiation frame to the network device 200, starting from time t 27 Start the first duration at time t 27 to t 28 Within the first time period, the terminal device 100 has no uplink or downlink services. Therefore, at the end time t 28 , the terminal device 100 can send a sleep frame to the network device 200 and then enter the sleep state.

[0242] In one embodiment, if the terminal device 100 detects uplink data to be sent within a time slice of a certain sleep state in the first time period, the uplink data can be cached in a sending queue, and when the time slice of the next listening state of the time slice of the sleep state arrives, the terminal device 100 enters the listening state, and then enters the sending state from the listening state, and sends the uplink data cached in the above-mentioned sending queue to the network device 200 in the sending state, at which time the current first time period is terminated in advance. If the terminal device 100 detects uplink data to be sent within a time slice of a certain listening state in the first time period, the terminal device 100 may not cache the uplink data, but enter the sending state, and send the uplink data to the network device 200 in the sending state, at which time the current first time period is terminated in advance. For a specific implementation example, please refer to the sleep / working process shown in Figure 7A. It can be understood that caching data in the sending queue is to push the data into the sending queue, and sending the data in the sending queue is to push the data out of the sending queue and send it, so the sent data will not be stored in the sending queue, reducing the storage pressure of the device.

[0243] In some examples, during the first time period, when the application of the terminal device 100 has business data to be sent, the terminal device 100 can detect the status of the Wi-Fi system. If the Wi-Fi system is in a working state such as a listening state, the application can send the business data to the Wi-Fi system, so that the Wi-Fi system sends the business data to the network device 200 in the sending state. If the Wi-Fi system is in a dormant state, the terminal device 100 can cache the business data in a sending queue, and instruct the Wi-Fi system to wake up when the next listening state time slice arrives, and send the business data cached in the above sending queue to the Wi-Fi system, so that the Wi-Fi system sends the business data to the network device 200 in the sending state.

[0244] In one embodiment, if the network device 200 detects downlink data to be sent during a time slice of a sleep state in the first duration, the downlink data may be cached, and the network device 200 may send the downlink data to the terminal device 100 after the time slice of the next listening state arrives. The terminal device 100 enters the listening state when the time slice of the next listening state arrives, and enters the receiving state when the downlink data is about to arrive, so as to receive the downlink data in the receiving state, and at this time, the current first duration is ended in advance. If the network device 200 detects downlink data to be sent during a time slice of a listening state in the first duration, the downlink data may not be cached, but may be sent to the terminal device 100. When the downlink data is about to arrive, the terminal device 100 may enter the receiving state and receive the downlink data, and at this time, the current first duration is ended in advance. For a specific implementation example, please refer to the sleep / working process shown in Figures 7B and 7C.

[0245] In some examples, when the terminal device 100 and the network device 200 negotiate based on TWT or a private negotiation mechanism, the network device 200 may send a Trigger frame before sending the downlink data to notify the terminal device 100 that the network device 200 currently has downlink data to be sent to the terminal device 100. The network device 200 will send the downlink data only after receiving the request frame sent by the terminal device 100. For a specific example, see Figure 7B. Without limitation, in other examples, when the terminal device 100 and the network device 200 negotiate based on TWT or a private negotiation mechanism, the network device 200 may also directly send the downlink data without sending a Trigger frame. For a specific example, see Figure 7C.

[0246] In some examples, when the terminal device 100 and the network device 200 negotiate based on PSM, the network device 200 may send a Beacon frame in state 1 before sending downlink data to notify the terminal device 100 that the current network device 200 has downlink data to be sent to the terminal device 100. The network device 200 will only send the downlink data after receiving the request frame sent by the terminal device 100. For a specific example, see Figure 7B.

[0247] S105: The terminal device 100 obtains the average traffic of the first service, and the terminal device 100 obtains the current channel capacity.

[0248] In one embodiment, when the traffic type of the first service is the second type, the terminal device 100 can obtain the average traffic of the first service, which can be represented as X megabits per second (Mbps). In some examples, the terminal device 100 can obtain the current average traffic of the first service by counting and predicting the traffic of the first service over a period of time. In other examples, the terminal device 100 can also obtain the average traffic of the first service from the network device 200, for example, through a private negotiation mechanism.

[0249] In one embodiment, when the traffic type of the first service is the second type, the terminal device 100 can estimate the current channel capacity according to the current channel condition and link information, which can be represented as Y Mbps.

[0250] S106: The terminal device 100 obtains the sleep scheduling strategy 2 (including the first period) according to the second type, delay-sensitive information, average traffic and channel capacity.

[0251] In one embodiment, the terminal device 100 can determine, based on the second type and delay-sensitive information, that it is currently in service scenario 2 (the traffic presents a continuous pattern similar to that shown in FIG4B ), and the maximum delay N that the currently running first service can withstand. When currently in service scenario 2, the terminal device 100 can determine whether to use the traffic shaping mode based on the average traffic X of the first service and the current channel capacity Y. If the current channel capacity is much larger than the bandwidth of the current service (for example, whether Y / X is greater than or equal to a preset threshold, the preset threshold is, for example, 10), the terminal device 100 can determine to use the traffic shaping mode to integrate the second type of traffic into a pulsed traffic similar to that shown in FIG8 . At this time, the sleep scheduling strategy 2 is implemented based on the traffic shaping mode. Otherwise, the traffic shaping mode is not used. For example, the sleep mechanism of the PSM mentioned above can be used at this time, and S107 is not executed.

[0252] In one embodiment, when it is determined to use the traffic shaping mode, the terminal device 100 can determine the length of the first time slice and the length of the second time slice according to N, and determine the first cycle (including the first time slice and the second time slice), the first time slice is the time slice when the terminal device 100 is in the sleep state (i.e., the time slice of the above-mentioned sleep state), and the second time slice is the time slice when the terminal device 100 is in the listening state (i.e., the time slice of the above-mentioned listening state). An example of the first cycle in the sleep scheduling strategy 2 can be seen in Figures 6A-6C. In Figures 6A-6C, any period consisting of a continuous time slice of a listening state and a time slice of a sleep state can be a first cycle. For example, as shown in Figure 6A, the first first cycle includes time slice 1 and time slice 2, the second first cycle includes time slice 3 and time slice 4, and so on. For example, as shown in Figure 6B, the first first cycle includes time slice 5 and time slice 6, the second first cycle includes time slice 7 and time slice 8, the third first cycle includes time slice 9 and time slice 10, and so on. For example, as shown in FIG6C , the first first cycle includes time slots 11 and 12 , the second first cycle includes time slots 13 and 14 , and so on.

[0253] In one embodiment, the sleep scheduling strategy 2 may include: when it is determined to use the traffic shaping mode, the terminal device 100 may perform one or more first cycles, and the terminal device 100 and the network device 200 may both cache the data packets to be sent and periodically send the cached data packets based on the first cycle, wherein the terminal device 100 / network device 200 may cache the data packets to be sent within the first time slice in the first cycle (i.e., the time slice in the sleep state), and send the cached data packets in the second time slice in the first cycle (i.e., the time slice in the listening state).

[0254] In one embodiment, the sleep scheduling strategy 2 may include: when it is determined to use the traffic shaping mode, the terminal device 100 may perform one or more first cycles, when a specific condition is not met (for example, the amount of data cached in the sending queue is greater than or equal to the queue threshold), maintain the traffic shaping mode, and continue with the subsequent first cycle, when a specific condition is met, exit the traffic shaping mode and no longer perform the first cycle, at which time the terminal device 100 can re-trigger the decision of the sleep scheduling strategy, for example, re-execute the process of Figure 10.

[0255] S107: The terminal device 100 negotiates with the network device 200 about the sleep scheduling strategy 2, and performs sleep and wake-up according to the sleep scheduling strategy 2.

[0256] In one embodiment, when it is determined to use the traffic shaping mode, the terminal device 100 can actively negotiate with the network device 200 for sleep scheduling strategy 2. The implementation method of negotiating sleep scheduling strategy 2 is similar to the implementation method of negotiating sleep scheduling strategy 1 in S104, except that the first duration needs to be replaced by the first period. For details, please refer to the description of S104.

[0257] In one embodiment, the terminal device 100 may first send a negotiation frame to the network device 200 to negotiate sleep scheduling policy 2 with the network device 200. After the negotiation is successful (for example, after the negotiation frame is successfully sent), the terminal device 100 restarts the first cycle and sleeps and wakes up according to the first time slice and the second time slice in the first cycle, that is, sends the negotiation frame before the start time of the first first cycle. The negotiation frame may include at least one of the following: information about the first cycle, information about the first time slice, or information about the second time slice. The information about the first cycle may include, but is not limited to, at least one of the following: length, whether the lengths of multiple first cycles are equal, or a correlation between the lengths of multiple first cycles. The information about the first time slice / second time slice may include, but is not limited to, at least one of the following: length, whether the lengths of the first time slice / second time slice in multiple first cycles are equal, a correlation between the lengths of the first time slice / second time slice in multiple first cycles, or a proportion in the first cycle, etc. For example, the negotiation frame includes the length of the first time slice and the length of the second time slice. For another example, the negotiation frame includes the length of the first cycle and the proportion of the first time slice or the second time slice in the first cycle. For specific implementation examples, please refer to the second and third implementation methods of negotiating the sleep scheduling strategy 1 in S104 (in this case, the sleep scheduling strategy 1 needs to be replaced with the sleep scheduling strategy 2).

[0258] In another embodiment, the terminal device 100 can also negotiate the sleep scheduling strategy 2 with the network device 200 in the first cycle. For a specific implementation example, please refer to the following implementation method 1 for negotiating the sleep scheduling strategy 1 (at this time, the sleep scheduling strategy 1 needs to be replaced with the sleep scheduling strategy 2).

[0259] In one embodiment, the terminal device 100 can configure the sleep parameters according to the obtained sleep scheduling strategy 2, so that when it subsequently sleeps and wakes up according to the configured sleep parameters in the first cycle, it can correspond to the first time slice and the second time slice. The specific instructions are similar to the instructions for configuring the sleep parameters in S104 and will not be repeated here.

[0260] In one embodiment, the terminal device 100 can configure the sending queue according to the obtained sleep scheduling strategy 2. The specific instructions are similar to the instructions for configuring the sending queue in S104 and will not be repeated here. In one embodiment, the terminal device 100 can also configure the threshold of the sending queue (which may be simply referred to as the queue threshold) according to the obtained sleep scheduling strategy 2. When the amount of data cached in the sending queue is greater than or equal to the queue threshold, it indicates that too many messages are piled up to be sent, and the traffic type and average traffic previously obtained can be considered invalid. In this case, the terminal device 100 can immediately wake up and enter the sending state to send the accumulated messages to the network device 200, and the terminal device 100 can re-trigger the decision of the sleep scheduling strategy, such as re-executing the process of Figure 10.

[0261] In one embodiment, after determining to use the traffic shaping mode, the terminal device 100 can sleep and wake up in one or more first cycles according to the sleep scheduling strategy 2, including: entering the sleep state at the start time of the first time slice in each first cycle and being in the sleep state in the first time slice, and entering the listening state at the start time of the second time slice in each first cycle and being in the working state in the second time slice. In addition, the terminal device 100 can send data frames to the network device 200 based on the first time slice and the second time slice in the first cycle, including: in the first time slice (i.e., the time slice in the sleep state), the terminal device 100 will not send data frames to the network device 200 (at this time, there are data frames to be sent that can be cached), and in the second time slice (i.e., the time slice in the listening state), the terminal device 100 will send data frames to the network device 200.

[0262] In one embodiment, when the terminal device 100 is in sleep and wake-up according to the sleep scheduling strategy 2, the network device 200 can send data frames to the terminal device 100 based on the first time slice and the second time slice in the first cycle, including: within the first time slice (i.e., the time slice in the sleep state), the network device 200 will not send data frames to the terminal device 100 (at this time, there are data frames to be sent that can be cached), and within the second time slice (i.e., the time slice in the listening state), the network device 200 will send data frames to the terminal device 100.

[0263] In one embodiment, based on the configured sleep parameters, the terminal device 100 can perform one or more first cycles, and be in a sleep state in the first time slice of each first cycle, and be in a working state in the second time slice of the first cycle. For specific examples, see Figures 6A-6C.

[0264] In one embodiment, if the terminal device 100 detects uplink data to be sent during a sleep state time slice in the first cycle, the uplink data may be cached in a transmit queue. When the next listen state time slice of the sleep state time slice arrives, the terminal device 100 enters a listen state, then enters a transmit state from the listen state, and sends the uplink data cached in the transmit queue to the network device 200 in the transmit state. The terminal device 100 enters a sleep state when the next sleep state time slice of the listen state time slice arrives. If the terminal device 100 detects uplink data to be sent during a listen state time slice in the first cycle, the terminal device 100 may not cache the uplink data, but instead enter a transmit state and send the uplink data to the network device 200 in the transmit state. The terminal device 100 enters a sleep state when the next sleep state time slice of the listen state time slice arrives. For a specific implementation example, see the sleep / work process shown in FIG9A. For an example of the interaction between the application and the Wi-Fi system in sleep scheduling strategy 2, see the example of the interaction between the application and the Wi-Fi system shown in S104, which will not be repeated here.

[0265] In one embodiment, if the network device 200 detects downlink data to be sent during a sleep state time slice in the first cycle, the downlink data may be cached. The network device 200 may send the downlink data to the terminal device 100 after the next listening state time slice of the sleep state time slice arrives. When the next listening state time slice arrives, the terminal device 100 enters the listening state, and when the downlink data is about to arrive, enters the receiving state to receive the downlink data in the receiving state. The terminal device 100 enters the sleep state when the next sleep state time slice of the listening state time slice arrives. If the network device 200 detects downlink data to be sent during a listen state time slice in the first cycle, the network device 200 may not cache the downlink data, but instead send the downlink data to the terminal device 100. When the downlink data is about to arrive, the terminal device 100 may enter the receiving state and receive the downlink data. The terminal device 100 enters the sleep state when the next sleep state time slice of the listening state time slice arrives. For a specific implementation example, see the sleep / operation process shown in Figure 9B. Before the network device 200 sends downlink data to the terminal device 100, it may first notify the terminal device 100 that the current network device 200 has downlink data to be sent to the terminal device 100, or it may directly send the downlink data without notifying. For specific examples, please refer to the description of the S104 example, which will not be repeated here.

[0266] In the method shown in FIG10 , for the first service of the first type (ie, the first service of pulsed traffic), the first duration can be used to replace the waiting time T in the original PSM sleep mechanism. WAiT(The listening state is maintained during this period), the listening method used in the first time period is more flexible, and the proportion of the listening time in the first time period can be less than or equal to 50%, thereby reducing the power consumption overhead in the listening state by at least 50%, and the length of the time slice of the sleep state in the first time period is determined according to the maximum delay N that the currently running business can withstand, thereby ensuring the delay requirements of the business.

[0267] As for the first service of the second type (i.e., the first service of continuous traffic), the traffic of the first service can be shaped into pulse traffic (as shown in Figure 8) through traffic cache control and the first period. The terminal device 100 can sleep periodically and perform data transmission periodically, which solves the problem of being unable to enter the sleep state under the original sleep mechanism, that is, allowing the terminal device 100 to enter the sleep state as much as possible, effectively reducing the power consumption of the device, and the length of the sleep state time slice in the first period is determined according to the maximum delay N that the currently running service can withstand, thereby ensuring the delay requirements of the service.

[0268] Not limited to the embodiment shown in FIG10 , in other embodiments, when the traffic type of the first service is the first type (i.e., pulsed traffic), if the delay-sensitive information N obtained in S101 is greater than or equal to the preset first duration (e.g., the waiting time T WAit ), the terminal device 100 can also directly enter the sleep state after completing the data transmission with the network device 200, that is, directly cancel the waiting time T wait , completely avoiding the power consumption waste of the listening state during the waiting time, and since N is large, it will not affect the real-time experience of the current business.

[0269] Please refer to Figure 11, which is a flowchart of another sleep scheduling method provided by an embodiment of the present application. The method may include but is not limited to the following steps:

[0270] S201: At a first moment, the wireless communication system of the terminal device and the network device end the transmission of the first service data.

[0271] For an example of a wireless communication system, see the example of a wireless communication module in FIG2 .

[0272] S202: After the first moment, the wireless communication system of the terminal device goes into sleep and wakes up according to the first sleep scheduling strategy (including the first duration).

[0273] In one embodiment, the first sleep scheduling strategy includes a first duration, which includes one or more first time slices and one or more second time slices. Furthermore, the first sleep scheduling strategy includes: the terminal device can use the first duration to replace the waiting time of the power saving mode (PSM), and in the first duration, the wireless communication system enters the sleep state at the start time of the first time slice and remains in the sleep state within the first time slice, and the wireless communication system enters the listening state at the start time of the second time slice and remains in the working state within the second time slice.

[0274] In one embodiment, the state of the wireless communication system of the terminal device includes a sleep state and a working state. The working state includes a listening state, a sending state, and a receiving state. For specific examples, please refer to the description of the state of the Wi-Fi system above.

[0275] In one embodiment, in the first time length, the time slices in which the terminal device is in the sleep state are collectively referred to as first time slices, and the time slices in which the terminal device is in the working state are collectively referred to as second time slices. The starting moment of the first time length is the starting moment of the first time slice or the starting moment of the second time slice, that is, the first time slice of the first time length can be the first time slice or the second time slice. The first time slice and the second time slice in the first time length are alternated. In one case, one second time slice can have two adjacent first time slices, wherein the end moment of one first time slice is the start moment of the second time slice, and the end moment of the second time slice is the start moment of another first time slice. Similarly, one first time slice can also have two adjacent second time slices. For example, in Figure 6A, time slice 3 in the listening state has two adjacent time slices in the sleep state: time slice 2 and time slice 4, and time slice 2 in the sleep state has two adjacent time slices: time slice 1 and time slice 3. It can be understood that the first time slice and the last time slice of the first time length have only one adjacent time slice. For example, the first time slice of the first time length is the first time slice, the starting time of the first time slice is the starting time of the first time length, and the end time of the first time slice is the starting time of the adjacent second time slice. The last time slice of the first time length is the second time slice, the starting time of the second time slice is the end time of the adjacent first time slice, and the end time of the second time slice is the end time of the first time length.

[0276] In one embodiment, the first duration is related to the preset waiting time, for example, the first duration is equal to the preset waiting time.

[0277] In one embodiment, before S202, the terminal device can obtain the first delay required by the currently running first service. For example, the first service data corresponds to the first service, and the first delay can be the above-mentioned N. The length of the first time slice and the second time slice in the first duration can be determined based on the first delay. For example, the length of the first time slice is greater than or equal to the first delay, and the length of the second time slice is equal to the first delay.

[0278] In one embodiment, the number of first time slices and the number of second time slices in the first duration may be the same, such as illustrated in FIG. 6A to FIG. 6C (where the time slice in the listening state is the second time slice), or may be different.

[0279] In one embodiment, the length of each first time slice in the first duration can be equal, such as the time slices in the sleep state in Figures 6A and 6C, or the length of at least two first time slices in the first duration can be different, such as the time slices in the sleep state in Figure 6B. The length of each second time slice in the first duration can be equal, such as the time slices in the listening state in Figures 6A-6C, or the length of at least two second time slices in the first duration can be different.

[0280] In one embodiment, the length of the first time slice and the length of the second time slice in the first duration may be equal, such as the description of Figure 6A (wherein the time slice in the listening state is the second time slice), or they may be unequal, such as the description of Figures 6B and 6C (wherein the time slice in the listening state is the second time slice).

[0281] In one embodiment, when the wireless communication system of the terminal device has no uplink service and downlink service within the second time slice in the first time length, the length of the first time slice whose end time is the start time of the second time slice is less than the length of the first time slice whose start time is the end time of the second time slice. For example, in Figure 6B, when there is no uplink service and downlink service within time slice 7 (i.e., the second time slice) in the listening state, the length of time slice 8 is greater than the length of time slice 6.

[0282] S203: When the wireless communication system of the terminal device has no uplink service and downlink service within the first time period, the wireless communication system enters a sleep state, and the terminal device sends a sleep message to the network device through the wireless communication system.

[0283] S203 is an optional step.

[0284] Not limited to the process shown in Figure 11, in other embodiments, the terminal device performs sleep and wake-up based on PSM. After the first moment, the terminal device does not execute S202 and S203, but enters the listening state (that is, enters the waiting time). If there is no uplink business and downlink business during the waiting time after entering the listening state, the terminal device sends a sleep message to the network device through the wireless communication system, and the wireless communication system enters the sleep state. The sleep message instructs the terminal device to enter the sleep state. The sleep message is the above-mentioned sleep frame. A specific example can be seen in Figure 5A.

[0285] The method shown in FIG11 may correspond to the case where the traffic type of the first service in FIG10 is the first type, and S202 may correspond to S104 in FIG10. In one embodiment, before S202, the terminal device may further execute S101, S102 (the judgment result is the first type), and S103 in FIG10.

[0286] Please refer to Figure 12, which is a flowchart of another sleep scheduling method provided by an embodiment of the present application. The method may include but is not limited to the following steps:

[0287] S301: When the first condition is met, the wireless communication system of the terminal device performs sleep and wake-up according to the second sleep scheduling strategy (including the first period).

[0288] In one embodiment, the first condition includes that the ratio (i.e., Y / X) of the capacity of the current wireless communication channel (i.e., Y mentioned above) and the first value (i.e., X mentioned above) is greater than or equal to a preset threshold (e.g., 10), and the first value is the average of the traffic of the first service currently running on the terminal device. Optionally, when the first condition is met, it can be characterized that the current channel capacity is much larger than the bandwidth of the current service.

[0289] In one embodiment, the second sleep scheduling strategy includes a first cycle, the first cycle including a first time slice and a second time slice. Furthermore, the second sleep scheduling strategy includes: the terminal device can perform one or more first cycles, in each first cycle, the wireless communication system enters a sleep state at the start time of the first time slice and remains in the sleep state during the first time slice, and the wireless communication system enters a listening state at the start time of the second time slice and remains in an active state during the second time slice.

[0290] In one embodiment, the state of the wireless communication system of the terminal device includes a sleep state and a working state. The working state includes a listening state, a sending state, and a receiving state. For specific examples, please refer to the description of the state of the Wi-Fi system above.

[0291] In one embodiment, in the first cycle, the time slice in which the terminal device is in a dormant state is referred to as the first time slice, and the time slice in which the terminal device is in an active state is referred to as the second time slice. The start time of the first cycle is the start time of the first time slice or the start time of the second time slice, i.e., the first time slice in the first cycle can be either the first time slice or the second time slice. In the first cycle, the end time of the first time slice is the start time of the second time slice, i.e., the first time slice is before the second time slice, or the start time of the first time slice is the end time of the second time slice, i.e., the second time slice is before the first time slice.

[0292] In one embodiment, before S301, the terminal device can obtain the first delay required by the currently running first service. For example, the first service data corresponds to the first service, the first delay can be the above-mentioned N, and the length of the first time slice and the second time slice in the first cycle can be determined based on the first delay.

[0293] In one embodiment, the second sleep scheduling strategy includes multiple first cycles. The length of each first cycle in these multiple first cycles can be equal, for example, in Figure 6A, each first cycle includes 1 N ms first time slice and 1 N ms second time slice, and for example, in Figure 6C, each first cycle includes 1 N ms first time slice and 1 N4 ms second time slice. They can also be unequal, for example, in Figure 6B, the first first cycle includes N ms time slice 5 (i.e., the second time slice) and N ms time slice 6 (i.e., the first time slice), and the second first cycle includes N ms time slice 7 (i.e., the second time slice) and N1 ms time slice 8 (i.e., the first time slice). In these multiple first cycles, the length of the first time slice in each first cycle is equal, such as the sleep state time slices in Figures 6A and 6C, or they can be unequal, such as the sleep state time slice in Figure 6B. The length of the second time slice in each first cycle in these multiple first cycles is equal, such as the listening state time slices in Figures 6A-6C, or they can be unequal.

[0294] In one embodiment, before S301, the terminal device can obtain the first flow information of the currently running first service (including the delay required by the first service), and specifically refer to the description of S101 and S105 in Figure 10, wherein the first flow information may include at least the following: flow type, delay-sensitive information, and average flow. The terminal device can then determine the first cycle based on the first flow information, and specifically refer to the description of S106 in Figure 10. In S301, when the terminal device performs the first cycle, if a specific condition is met, the second flow information of the currently running second service is re-obtained, for example, the process shown in Figure 10 is re-executed, and the specific condition is that the amount of service data cached in the first queue is greater than or equal to the queue threshold. The first queue is used for the wireless communication system to cache the service data to be sent detected within the first time slice, and the first queue is the above-mentioned sending queue.

[0295] Not limited to the process shown in Figure 12, in other embodiments, when the first condition is not met, S301 may not be executed, and the terminal device performs sleep and wake-up based on PSM. After the terminal device transmits the first service data through the wireless communication system and the network device, the wireless communication system of the terminal device enters a listening state (that is, enters a waiting time). Since the traffic type of the terminal device is the second type (a specific example can be seen in the traffic model shown in Figure 4B), the terminal device will have uplink and / or downlink services during the above-mentioned waiting time. Therefore, the terminal device will end the current waiting time and perform the service data transmission process with the network device. A specific example can be seen in Figure 5B.

[0296] The method shown in FIG12 may be the case where the traffic type of the first service in FIG10 is the second type, and S301 may correspond to S107 in FIG10. In one embodiment, before S301, the terminal device may further execute S101, S102 (the judgment result is the second type), S105, and S106 in FIG10.

[0297] Please refer to Figure 13, which is a schematic diagram of the hardware structure of another terminal device 100 provided in an embodiment of the present application.

[0298] As shown in FIG13 , the terminal device 100 may include a processor 101 , a memory 102 , and a transceiver 103 . In one embodiment, the processor 101 , the memory 102 , and the transceiver 103 may be interconnected via a bus.

[0299] The processor 101 may be one or more central processing units (CPUs). When the processor 101 is a CPU, the CPU may be a single-core CPU or a multi-core CPU. The memory 102 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable read-only memory (CD-ROM), and the memory 102 is used for related computer programs and data. The transceiver 103 is used to receive and send data. In one embodiment, the transceiver 103 may include a Wi-Fi communication module, which can be used to implement the transmission process of Wi-Fi frames between the network device 200.

[0300] The processor 101 can be used to read the computer program or instructions stored in the memory 102 and execute the steps performed by the terminal device 100 / STA in the embodiments of the present application, such as the sleep / work process shown in Figures 7A-7C, the sleep / work process shown in Figures 9A-9B, and the sleep scheduling method shown in Figures 10-12.

[0301] The above embodiments are described using Wi-Fi technology as an example. The embodiments of the present application may also be applicable to other wireless communication technologies, such as Bluetooth, NFC, IR, GNSS, SLE, SLB, etc., and the embodiments of the present application are not limited to this.

[0302] The methods provided in the various embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, they may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital video disc (DWD), or a semiconductor medium (e.g., a solid state drive (SSD)). As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the same. Although the present application has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments may be modified, or some of the technical features thereof may be replaced by equivalents. However, such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A hibernation scheduling method, characterized in that, Applied to a terminal device, the states of the wireless communication system of the terminal device include a sleep state and a working state, and the working state includes a listening state. The method includes: At a first moment, the wireless communication system and a network device finish transmitting first service data; After the first moment, the wireless communication system sleeps and wakes up according to a first sleep scheduling policy. The first sleep scheduling policy includes a first duration, and the first duration includes one or more first time slices and one or more second time slices. The end moment of the first time slice is the start moment of the second time slice, and the end moment of the second time slice is the start moment of the first time slice. The wireless communication system is in the sleep state within the first time slice, and the wireless communication system is in the working state within the second time slice; When there is no uplink service and downlink service within the first duration of the wireless communication system, the wireless communication system enters the sleep state, and sends a first message to the network device through the wireless communication system. The first message indicates that the terminal device enters the sleep state.

2. The method according to claim 1, characterized in that, The method further includes: After the first moment, the wireless communication system enters the listening state; When there is no uplink service and downlink service within a second duration after the wireless communication system enters the listening state, a second message is sent to the network device through the wireless communication system. The second message indicates that the terminal device enters the sleep state, and the second duration is a preset waiting time of the terminal device; The wireless communication system enters the sleep state.

3. The method according to claim 2, characterized in that, The first duration and the second duration are related, and the start moment of the first duration is the start moment of the first time slice or the start moment of the second time slice.

4. The method according to any one of claims 1 to 3, characterized in that Before the wireless communication system sleeps and wakes up according to the first sleep scheduling policy, the method further includes: Obtaining a first delay required by a first service currently running on the terminal device. The lengths of the first time slice and the second time slice are determined according to the first delay.

5. The method according to any one of claims 1 to 4, characterized in that, The number of the one or more first time slices is the same as or different from the number of the one or more second time slices; The lengths of each of the one or more first time slices are equal, or at least two of the one or more first time slices have unequal lengths; The lengths of each of the one or more second time slices are equal, or at least two of the one or more second time slices have unequal lengths; The length of the first time slice is equal to or unequal to the length of the second time slice.

6. The method according to any one of claims 1-5, characterized in that, When there is no uplink service and downlink service within the second time slice of the wireless communication system, the length of the first time slice with the end moment being the start moment of the second time slice is less than the length of the first time slice with the start moment being the end moment of the second time slice.

7. The method according to any one of claims 1 to 6, characterized in that, The wireless communication system performs sleep scheduling according to the first sleep scheduling policy, including: Before the start time of the first time slice, send a third message to the network device through the wireless communication system, where the third message indicates that the terminal device enters the sleep state; After the start time of the second time slice, send a fourth message to the network device through the wireless communication system, where the fourth message indicates that the terminal device is in the working state, and both the third message and the fourth message are related to the Power Saving Mode (PSM).

8. The method according to any one of claims 1 to 6, characterized in that, The wireless communication system performs sleep scheduling according to a first sleep scheduling policy, including: Before the start time of the first duration, send a fifth message to the network device through the wireless communication system, where the fifth message is a TWT setup frame in the Timing Wake-up Mechanism (TWT). The TWT setup frame is used to negotiate the TWT schedule, and the TWT schedule corresponds to the first duration. The TWT schedule includes time slices in the Doze state and time slices in the TWT Service Period (SP) state. The time slice in the Doze state corresponds to the first time slice, and the time slice in the TWT SP state corresponds to the second time slice.

9. The method according to any one of claims 1 to 6, characterized in that, The wireless communication system performs sleep scheduling according to a first sleep scheduling policy, including: Before the start time of the first duration, send a sixth message to the network device through the wireless communication system, where the sixth message is an Action frame negotiated between the terminal device and the network device for transmitting control information between the terminal device and the network device.

10. The method according to any one of claims 1-9, characterized in that, The working state includes a transmission state, and the method further includes: When the wireless communication system is in the sleep state within the first time slice, the terminal device detects second service data to be sent to the network device and caches the second service data into a preset first queue; After the end time of the first time slice, the wireless communication system enters the transmission state; Send the second service data in the first queue to the network device through the wireless communication system.

11. The method according to any one of claims 1-9, characterized in that, The working state includes a reception state, and the method further includes: When there is service data to be sent by the network device to the terminal device, after the end time of the first time slice, the wireless communication system enters the reception state; receive the third service data sent by the network device through the wireless communication system; or, When there is service data to be sent by the network device to the terminal device, after the end time of the first time slice, the wireless communication system enters the reception state; receive the seventh message sent by the network device through the wireless communication system, where the seventh message indicates that there is service data to be sent by the network device to the terminal device; send the eighth message to the network device through the wireless communication system, where the eighth message is used to request the network device to send service data; receive the fourth service data sent by the network device through the wireless communication system.

12. The method according to any one of claims 1-11, characterized in that, Before the wireless communication system goes into sleep and wakes up according to the first sleep scheduling policy, the first services running on the terminal device include at least one of the following: online playback service of a short video application, online playback service of a video application, online reading service of a reading application or online audiobook service, or online web page service of a browser application.

13. The method according to any one of claims 1-12, characterized in that, The terminal device is a station STA, and the network device is a wireless access point AP. The network device is used to enable the terminal device to communicate through the wireless communication system and the Internet.

14. The method according to any one of claims 1 to 13, characterized in that, The wireless communication system is a Wi-Fi system.

15. A sleep scheduling method, characterized in that, Applied to a terminal device, the states of the wireless communication system of the terminal device include a sleep state and a working state. The working state includes a listening state. The method includes: When a first condition is met, the wireless communication system goes into sleep and wakes up according to the first sleep scheduling policy. The first condition is that the ratio of the capacity of the current wireless communication channel to a first value is greater than or equal to a preset threshold. The first value is the average value of the traffic of the first service currently running on the terminal device. The first sleep scheduling policy includes a first period. The first period includes a first time slice and a second time slice. The end time of the first time slice is the start time of the second time slice, or the start time of the first time slice is the end time of the second time slice. The wireless communication system is in the sleep state during the first time slice and in the working state during the second time slice.

16. The method according to claim 15, characterized in that, The method further includes: When the first condition is not met, after transmitting the first service data through the wireless communication system and the network device, the wireless communication system enters the listening state; When there is an uplink service or a downlink service within a first duration after the wireless communication system enters the listening state, a process of transmitting service data is performed through the wireless communication system and the network device. The first duration is the preset waiting time of the terminal device.

17. The method according to claim 15 or 16, characterized in that, Before the wireless communication system goes into sleep and wakes up according to the first sleep scheduling policy, the method further includes: Obtaining a first delay required by the first service currently running on the terminal device. The lengths of the first time slice and the second time slice are determined according to the first delay. The lengths of the first time slice and the second time slice are equal or unequal.

18. The method according to any one of claims 15-17, characterized in that, The first sleep scheduling policy includes multiple first periods; The lengths of each of the multiple first periods are equal, or at least two of the multiple first periods have unequal lengths; Among the multiple first periods, the lengths of the first time slices in each first period are equal, or the first time slices in at least two first periods are unequal; Among the multiple first periods, the lengths of the second time slices in each first period are equal, or the second time slices in at least two first periods are unequal.

19. The method according to any one of claims 15-18, characterized in that, The wireless communication system goes into sleep and wakes up according to the first sleep scheduling policy, including: Before the start time of the first time slice, send a first message to the network device through the wireless communication system, where the first message indicates that the terminal device enters the sleep state; After the start time of the second time slice, send a second message to the network device through the wireless communication system, where the second message indicates that the terminal device is in the working state, and both the first message and the second message are related to the Power Saving Mode (PSM).

20. The method according to any one of claims 15-18, characterized in that, The wireless communication system performs sleep and wake-up according to a first sleep scheduling strategy, including: Before the start time of the first cycle, send a third message to the network device through the wireless communication system, where the third message is a TWT setup frame in the Timing Wake-up Mechanism (TWT), and the TWT setup frame is used to negotiate a TWT schedule corresponding to the first cycle. The TWT schedule includes time slices in the Doze state and time slices in the TWT Service Period (SP) state. The time slice in the Doze state corresponds to the first time slice, and the time slice in the TWT SP state corresponds to the second time slice.

21. The method according to any one of claims 15 - 18, characterized in that, The wireless communication system performs sleep and wake-up according to a first sleep scheduling strategy, including: Before the start time of the first cycle, send a fourth message to the network device through the wireless communication system, where the fourth message is an Action frame negotiated between the terminal device and the network device for transmitting control information between the terminal device and the network device.

22. The method according to any one of claims 15-21, characterized in that The working state includes a transmission state, and the method further includes: The wireless communication system enters the sleep state at the start time of the first time slice; Within the first time slice, if the terminal device detects second service data to be sent to the network device, cache the second service data into a preset first queue; The wireless communication system enters the transmission state after the start time of the second time slice; Within the second time slice, send the service data in the first queue to the network device through the wireless communication system; The wireless communication system enters the sleep state at the end time of the second time slice.

23. The method according to any one of claims 15-21, characterized in that, The working state includes a reception state, and the method further includes: The wireless communication system enters the sleep state at the start time of the first time slice; When the network device has service data to be sent to the terminal device, the wireless communication system enters the reception state after the start time of the second time slice; Within the second time slice, receive third service data sent by the network device through the wireless communication system; The wireless communication system enters the sleep state at the end time of the second time slice.

24. The method according to any one of claims 15-23, characterized in that, Before the wireless communication system performs sleep and wake-up according to the first sleep scheduling strategy, the method further includes: Obtain first traffic information of a first service currently running on the terminal device, where the first traffic information includes the latency required by the first service; Determine the first cycle according to the first traffic information; The method further includes: When the wireless communication system goes to sleep and wakes up according to the first sleep scheduling policy, if a second condition is met, the second traffic information of the second service currently running on the terminal device is obtained again. The second condition is that the data volume of the service data cached in the first queue is greater than or equal to the queue threshold, and the first queue is used for the wireless communication system to cache the detected service data to be sent within the first time slice.

25. The method according to any one of claims 15 - 24, characterized in that, Before the wireless communication system goes to sleep and wakes up according to the first sleep scheduling policy, the first service running on the terminal device includes at least one of the following: the online live broadcast service of a live broadcast application, the online call service of a network call application, or the online game service of a game application.

26. The method according to any one of claims 15-25, characterized in that, The terminal device is a station STA, and the network device is a wireless access point AP. The network device is used to enable the terminal device to communicate with the Internet through the wireless communication system.

27. The method according to any one of claims 15 - 26, characterized in that, The wireless communication system is a wireless fidelity Wi-Fi system.

28. The method according to any one of claims 15 - 27, characterized in that, The starting moment of the first period is the starting moment of the first time slice or the starting moment of the second time slice.

29. A terminal device, characterized in that, It includes a transceiver, a processor, and a memory. The memory is used to store a computer program, and the processor calls the computer program to execute the method according to any one of claims 1-28.

30. A computer storage medium, characterized in that, The computer storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1-28 is implemented.

Citation Information

Patent Citations

  • Sleep scheduling method and related device

    CN120224344A

  • Method for receiving energy-saving signal by terminal and terminal

    CN111586812A

  • Sleep scheduling method and device

    CN115278831A

  • Equipment dormancy method, equipment dormancy device and computer readable storage medium

    CN116684946A

  • Coreset and search space set dormancy indication via downlink control information

    US20220053542A1

Cited By

  • Operation method, device, equipment, medium and program of wireless communication module

    CN120897189A