Method and storage medium for adjusting working frequency of electronic device, and electronic device

A method for adjusting a working frequency of an electronic device includes the following. First, determining a current working frequency of the electronic device, a minimum average frequency among the average frequencies of different channels, and a frequency range of one channel used for transmitting/receiving wireless signals. Second, calculating an interference frequency generated by the electronic device, and selecting another antenna to transmit/receive wireless signals when the interference frequency falls within the frequency range of the determined channel. Third, calculating a first time interval between transmitting and receiving wireless signals before switching to the other antenna, and a second time interval between transmitting and receiving wireless signals after switching to the other antenna. Fourth, determining a difference between the first and second time intervals. Fifth, adjusting the current working frequency to decrease the influence on the transmission/receipt of wireless signals when the calculated difference is greater than a predetermined threshold.

BACKGROUND

1. Technical Field

The present disclosure relates to an electronic device with a storage unit for automatically adjusting the working frequency of the electronic device, and to a method and a storage medium for automatically adjusting the working frequency of an electronic device.

2. Description of Related Art

When the running speed of a processor of a communication device (e.g. a smart phone) increases, a working frequency of the communication device correspondingly increases. When the working frequency increases, transmission and/or receipt of wireless signals of the communication device may be adversely influenced by the high working frequency.

In a typical communication device, once the working frequency of the communication device is detected to be influencing the transmission/receipt of wireless signals, the running speed of the processor is automatically decreased to correspondingly decrease the working frequency. Thereby, the influence on the transmission/receipt of wireless signals is diminished.

However, under some conditions, the influence on the transmission/receipt of wireless signals is not great, such that the wireless signals are still able to be normally transmitted and received. In such situations, even though the transmission/receipt of wireless signals is influenced, there may be no need to decrease the running speed of the processor. Thus when the running speed of the processor is automatically decreased, the operation of the communication device may be unnecessarily constrained.

Therefore, there is a need to provide a means and a method to overcome the above-described shortcomings.

DETAILED DESCRIPTION

FIG. 1is a block diagram of an electronic device1according to an exemplary embodiment. The electronic device1includes at least two antennas (not shown) for transmitting and receiving wireless signals. The antennas correspond to different channels of the electronic device1, respectively. In the embodiment described hereinafter, unless the context indicates otherwise, there are two antennas, one antenna corresponds to a portion of eleven channels of the electronic device1, and the other antenna correspond to the remaining portion of the eleven different channels of the electronic device1. The electronic device1further includes a storage unit200and a processor300. The working frequency of the electronic device1is determined by the running speeds of the storage unit200and the processor300. If the working frequency is too high, it may adversely influence the transmission and/or receipt of wireless signals in each channel. The storage unit200stores a table (see below). In the table, each channel corresponds to an average frequency and a frequency range for transmitting and receiving wireless signals. The storage unit200further stores an adjusting system100. The adjusting system100includes a variety of modules executed by the processor300to adjust the working frequency of the electronic device1. A detailed description of the variety of modules is provided below.

In the embodiment, the adjusting system100includes a determining module101, a calculating module102, an analyzing module103, and a control module104.

The determining module101determines a current working frequency of the electronic device1according to the running speeds of the storage unit200and the processor300. The determining module101then determines a minimum average frequency in the table. The determining module101further determines the channel currently used for transmitting/receiving wireless signals and the frequency range of the determined channel according to the table.

The calculating module102calculates an interference frequency generated by the electronic device1according to the current working frequency of the electronic device1, the minimum average frequency, and the frequency range of the determined channel. A detailed description of the calculation of the interference frequency is provided below.

Take the electronic device1with a current working frequency νcof 162 megahertz (MHz) as an example. In the table, the minimum average frequency νminis 2412 MHz, which is the average frequency of channel 1. The currently used channel is channel 6. The calculating module102calculates a bandwidth BW of channel 6 according to the formula: BW=(maximum frequency in the frequency range)−(minimum frequency in the frequency range). Thus BW=2448−2426=22 MHz. The calculating module102then calculates the interference frequency νiaccording to the following formula:

The analyzing module103determines whether the interference frequency falls within the frequency range of the determined channel. If so, the analyzing module103determines that the interference frequency generated by the electronic device1will adversely influence the transmission/receipt of wireless signals in the determined channel. In the above-mentioned example, since the interference frequency of 2430 MHz falls within the frequency range of 2426˜2448 MHz, the analyzing module103determines that the interference frequency generated by the electronic device1will adversely influence the transmission/receipt of wireless signals in channel 6.

The control module104selects another antenna to transmit and receive wireless signals when the analyzing module103determines that the interference frequency falls within the frequency range of the determined channel.

The calculating module102further calculates a first time interval between transmitting and receiving wireless signals before switching to the other antenna, and a second time interval between transmitting and receiving wireless signals after switching to the other antenna. The calculating module102then determines a difference between the first time interval and the second time interval to determine how much the influence is. It is known that the less the influence, the less the difference between the first and second time intervals.

The analyzing module103further compares the calculated difference with a predetermined threshold value. If the calculated difference is greater than the predetermined threshold value, the analyzing module103determines that the working frequency of the electronic device will greatly influence the transmission/receipt of wireless signals of the determined channel; otherwise, the analyzing module103determines that the interference frequency will not greatly influence the transmission/receipt of wireless signals of the determined channel.

The control module104then adjusts the current working frequency of the electronic device1to decrease the influence on the transmission/receipt of wireless signals when the calculated difference is greater than the predetermined value.

With the above-described configuration, the adjusting system100adjusts the current working frequency of the electronic device1only when the adverse influence on the transmission and receipt of wireless signals is greater than the predetermined value. Thus, when the adverse influence is less than the predetermined value, decreasing of the running speed of the processor300is avoided, and the working of the electronic device1is not affected.

FIG. 2is a flowchart of a method for adjusting the working frequency of the electronic device1, in accordance with an exemplary embodiment.

In step S21, the determining module101determines a current working frequency of the electronic device1according to the running speed of the storage unit200and the processor300, determines a minimum average frequency in the table, and further determines the channel currently used for transmitting/receiving wireless signals and the frequency range of the determined channel according to the table.

In step S22, the calculating module102calculates an interference frequency generated by the electronic device1according to the current working frequency of the electronic device1, the minimum average frequency, and the frequency range of the determined channel.

In step S23, the analyzing module103determines whether the interference frequency falls within the frequency range of the determined channel. If the determination is yes, the procedure goes to step S24; otherwise, the procedure goes back to step S21.

In step S24, the control module104selects another antenna to transmit and receive wireless signals.

In step S25, the calculating module102calculates a first time interval between transmitting and receiving wireless signals before switching to the other antenna, and a second time interval between transmitting and receiving wireless signals after switching to the other antenna, and further determines a difference between the first time interval and the second time interval to determine how much the influence is.

In step S26, the analyzing module103compares the calculated difference with a predetermined threshold value and determines whether the difference is greater than the predetermined threshold value. If the determination is yes, the procedure goes to step S27; otherwise, the procedure returns to step S21.

In step S27, the control module104adjusts the current working frequency of the electronic device1to decrease the influence on the transmission/receipt of wireless signals. After executing step S27, the procedure returns to step S21.