The present invention is related to wireless communications, and more particularly, to a method for controlling an electronic device to enter a sleep mode through wireless communications.
Current wireless earphones mostly utilize BlueTooth for transmitting audio data. Since a BlueTooth earphone only requires a small current when receiving and playing audio data, usage time of a battery can be increased. A disadvantage of the BlueTooth earphone is that its throughput is too low, so that the BlueTooth earphone cannot be utilized for transmission of high-quality music with minimum distortion.
In comparison with BlueTooth, Wireless Fidelity (Wi-Fi) communications can reach a high throughput (e.g. in the 802.11g specification, the highest throughput can reach 54 megabits per seconds (Mbps)), and is therefore suitable for transmitting high-quality and non-distortion music. The application of Wi-Fi communications to wireless earphones is limited, however, since power consumption of Wi-Fi communications is much greater than BlueTooth. Additionally, the 802.11 specification states that turning off Wi-Fi communication mechanism and entering a power-saving/sleep mode is determined according to a current data amount. Since entering the power-saving/sleep mode only depends on the data amount in conventional Wi-Fi power-saving mechanisms, the start time point and the end time point of data transmission are unpredictable. Power-saving effect is therefore not good in practice, and the throughput might be affected.
Thus, an objective of the present invention is to provide a method for controlling an electronic device to enter a sleep mode through wireless communications, wherein the method can precisely control a wireless communication module within a wireless earphone to operate in a normal mode or sleep mode in order to save power, and the throughput and normal operations of the earphone will not be affected.
In an embodiment of the present invention, a control circuit for an electronic device is disclosed. The electronic device comprises a wireless communication module configured to perform wireless communication with another electronic device; and the control circuit performs burst transmission using the wireless communication module to transmit data to the other electronic device during a partial time of a time period only, and the data is configured for being continuously played by the other electronic device during the time period.
In another embodiment of the present invention, a control circuit for an electronic device is disclosed. The electronic device comprises a wireless communication module configured to perform wireless communication with another electronic device, and a playing component. The control circuit is configured to use the wireless communication module to receive data from the other electronic device, wherein the playing component continuously plays the data during a time period, the control circuit receives the data during a partial time of the time period only, and the control circuit controls the wireless communication module to operate in a sleep mode or a normal mode according to the partial time.
In another embodiment of the present invention, a method for controlling an audio device is disclosed. The method comprises the following steps: controlling an electronic device to use a first wireless communication module to communicate with the audio device; controlling the electronic device to perform burst transmission to transmit audio data to the audio device during a partial time of a time period only; controlling the audio device to continuously play the audio data during the time period; and when the audio device finishes receiving the audio data, controlling a second wireless communication module of the audio device to enter a sleep mode.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
In an embodiment, the host device 110 may be a smart phone, a tablet, a notebook computer, or any electronic device that is able to transmit data to the audio device 120, and the audio device 120 maybe a wireless earphone, a wireless sound box, or any audio playing device having a loudspeaker.
Refer to
As mentioned in the flowchart shown in
In an embodiment, since a lost packet may occur during wireless transmission, the audio device 120 may utilize information of the timer 128 to determine whether the burst transmission end message from the host device is lost. For example, according to a time message provided by the timer 128, and assuming that the audio device 120 does not receive any burst transmission end message for a period of time (e.g. 7 ms) after the audio device 120 starts receiving the audio data, the control circuit 122 may determine that the burst transmission end message is lost, and will thereby turn off the Wi-Fi module 124 or set the Wi-Fi module 124 to be in sleep mode in order to save power. In addition, the host device 110 may utilize information of the timer 118 to determine whether a burst transmission start message from the audio device 120 is lost. For example, according to a time message provided by the timer 118, and assuming that the host device 110 does not receive any burst transmission start message for a period of time (e.g. 18 ms) after the host device 110 starts transmitting the audio data, the control circuit 112 may determine that the burst transmission start message is lost, and thereby directly starts to transmit the next audio data.
It should be noted that the aforementioned transmission of the 20 ms audio data within 5 ms, as well as other related numbers and parameters, are for illustrative purposes only and are not a limitation of the present invention. In other embodiments, if the speed of Wi-Fi transmission is faster or the audio data utilizes a lower sampling rate, the host device can use a shorter time to transmit the audio data, so that a power-saving duration of the Wi-Fi module 124 within the audio device 120 can be longer.
Refer to
In Step S404, the host device 110 caches audio data in a memory of the host device 110 for being played during a time period. This embodiment assumes that the host device 110 caches 20 milliseconds (ms) of audio data. In Step S406, the control circuit 112 within the host device 110 performs burst transmission (e.g. uses a burst transmission method) using the Wi-Fi module 114 for immediately transmitting the 20 ms audio data to the audio device 120 within a shorter time. This embodiment assumes that the host device 110 transmits the 20 ms audio data to the audio device 120 within 5 ms, wherein when the audio device 120 starts receiving the audio data, the audio device 120 plays contents of the received audio data through the playing component 126. In this embodiment, the burst transmission transmits multiple packets to the audio device 120 at once, and in an example, each packet within the multiple packets may comprise the following four parameters: a burst transmission start time (BurstStartTsf), playing time of burst transmission of the audio data (BurstPeriod), a number of the multiple packets of burst transmission (BurstPacketNum), and a packet serial number (DataSeq).
In Step S408, the audio device 120 may determine whether burst transmission of the host device 110 ends according to parameters within each packet. For example, assuming that the burst transmission transmits five packets (BurstPacketNum=5) having respective packet serial numbers 0 to 4, when the audio device 120 receives a packet having the packet serial number DataSeq=4, the audio device 120 may determine that the burst transmission ends in order to turn off the Wi-Fi module 124 or control the Wi-Fi module 124 to enter the sleep mode. Regarding a time for turning off the Wi-Fi module 124 or controlling the Wi-Fi module to enter the sleep mode, the following equation can be utilized:
OffTime=BurstPeriod−(DeviceTsf−BurstStartTsf)−Delta;
where DeviceTsf is the time of the audio device 120, Delta is a deviation value to guarantee that the Wi-Fi module 124 will be in the normal mode or turned on before the host device 110 transmits next information data.
Additionally, after the host device 110 finishes transmitting the last packet, the host device 110 may stop transmitting audio data for a period of time, where the period of time that transmission of audio data is stopped can be calculated utilizing the following equation:
IdelTime=BurstPeriod−(HostTsf−BurstStartTsf);
where HostTsf is the time of the host device 110; concurrently, the host device may turn off the Wi-Fi module 114 or set the Wi-Fi module 114 to be in the sleep mode in order to save power, and start to cache the next 20 ms audio data.
In Step S410, when the Wi-Fi module 124 has entered the sleep mode for a period of time, and the period of time has reached the previously calculated off-time, the control circuit 122 may turn on the Wi-Fi module 124 or set the Wi-Fi module 124 to be in the normal mode to start receiving the next audio data from the host device 110 (the flow returns to Step S408).
As mentioned in the flowchart shown in
It should be noted that, although embodiments of
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
201910064746.1 | Jan 2019 | CN | national |