Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention is clearer, below in conjunction with embodiment and accompanying drawing, the embodiment of the invention is described in further details.At this, illustrative examples of the present invention and explanation thereof are used for explanation the present invention, but not as a limitation of the invention.
The process flow diagram of the input current control method of a kind of terminal device that Fig. 1 provides for the embodiment of the invention please refer to Fig. 1, and this method comprises:
Step 101: initialization marking variable;
In the present embodiment, can come the controlled situation of the input current of marking terminal equipment by marking variable, when terminal device works on power, this marking variable of initialization at first, if the input current of this terminal device surpasses default thresholding, this marking variable of then resetting is no more than default thresholding up to the input current of this terminal device, again this marking variable is reverted to initial value.Therefore, if this marking variable does not change, represent that then this terminal device is working properly, its working current does not exceed default thresholding, if variation has taken place in this marking variable, for example be higher than initial value, represent that then the working current of this terminal device is higher than default thresholding, then can be controlled the input current of this terminal device by the method for present embodiment, be reverted to initial value up to this marking variable.
In one embodiment, the initial value of this marking variable can be zero.
Step 102: the input current that obtains described terminal device;
In the present embodiment, can increase the input current that current detection circuit detects this terminal device by the input end at the power circuit of terminal device.Wherein, this current detection circuit can connect the ADC converter of the baseband processing chip of this terminal device, be converted to digital value with the analogue value that current detection circuit is detected, the method for present embodiment can be obtained the input current of this terminal device from this ADC converter.
Present embodiment does not limit the input current that uses current detection circuit to detect this terminal device; for example; also can by other can sense terminals equipment the hardware of input current or the input current that software detects this terminal device, these methods can be contained within the protection domain of the embodiment of the invention.
Wherein, the input current that obtains described terminal device can obtain in real time.
Step 103: whether judge described input current greater than default thresholding, if then execution in step 104, otherwise execution in step 106;
In the present embodiment, can set in advance the threshold value of a working current, in order to compare with the input current of reality, to control this input current by the method for present embodiment.Wherein, can this threshold value be set according to the lowest high-current value that interface allows, for example the USB interface maximum can provide the electric current of 500mA, then this threshold value can be made as 500mA.Below just illustrate, present embodiment not with this as restriction.
Step 104: reduce message transmission rate or control the emissive power that described terminal device reduces radio-frequency power amplifier if described input current, is then controlled described terminal device greater than default thresholding;
In the present embodiment, control terminal reduces message transmission rate, can realize in the mode that some step-lengths descend by the message transmission rate that makes this terminal device, for example each control data transmission speed decline 1Mbps; The mode of the fixed value that also can descend by the message transmission rate that makes this terminal device realizes, must cause power consumption of terminal equipment to descend because message transmission rate descends, and therefore, can control input current by this method.Wherein, the message transmission rate of control terminal, the size of spatial cache that can be by controlling this terminal device realize, but present embodiment not with this as restriction.
In the present embodiment, control terminal reduces the emissive power of radio-frequency power amplifier, the descend mode of an amplification stage of the emissive power of radio-frequency power amplifier that can be by controlling this terminal device realizes, the emissive power of radio-frequency power amplifier that also can be by controlling this terminal device fixed value that descends realizes, so, the radio frequency part consumed current must descend, cause the input current of terminal device to descend thereupon, so also can reach the purpose of the input current of this terminal device of control.Wherein, the emissive power of the radio-frequency power amplifier of control terminal, can by control this terminal device Non-Volatile (NV item parameter) realize, but present embodiment not with this as restriction.
Step 105: described marking variable is carried out first reset.
In the present embodiment, by the message transmission rate that reduces terminal device or the emissive power that reduces the radio-frequency power amplifier of terminal device, reduce the input current of this terminal device, also will carry out first to marking variable and reset, can grasp the controlled situation to this input current like this.
In one embodiment, if the initial value of marking variable is zero, this marking variable is carried out first replacement can be for adding 1 with this marking variable.
In the present embodiment, because the message transmission rate of minimizing terminal device is to descend with predetermined step-length, the emissive power that perhaps reduces the radio-frequency power amplifier of terminal device is to make its amplification stage that descends, therefore, after carrying out the process of a step 104, the input current of this terminal device may also not drop to below the threshold value, the input current of the terminal device that obtains in real time according to step 102, continue to carry out each step, drop to below the threshold value up to the input current of this terminal device.
In the present embodiment, if reduce input current by control data transmission speed, then drop to threshold value when following when the input current that detects terminal device, message transmission rate no longer descends, and maintains this horizontal operation.
In the present embodiment, if reduce input current by the emissive power of control radio-frequency emission power amplifier, then drop to threshold value when following when the input current that detects terminal device, the radio-frequency power amplifier of this terminal device maintains corresponding amplification stage and carries out work.
According to the method for present embodiment, if input current is not more than default thresholding, then the method for present embodiment also comprises:
Step 106: judge whether marking variable is initial value, if then execution in step 102, otherwise execution in step 107;
In the present embodiment, since input current may be by above-mentioned present embodiment the method restriction (for example, reduce the input transfer rate by control terminal, from having reduced the input current of terminal device), also may input current own just below threshold value, if method by above-mentioned present embodiment limits, then marking variable is understood different, and if input current own just below threshold value, then marking variable should be initial value.So can whether be the controlled situation of the initial value input current of judging this terminal device according to marking variable.
In one embodiment, if the initial value of marking variable is zero, then this step judges whether this marking variable is zero particularly.
Step 107: controlling described terminal device increases message transmission rate or controls the emissive power that described terminal device increases radio-frequency power amplifier;
In one embodiment, when some after other the improvement of terms, the signal grow of terminal device for example, terminal device is under the message transmission rate that limits, the input current that gets access to this terminal device in real time also has bigger surplus below threshold value, for example, the input current that get access to this moment is 100mA, and threshold value is when being 500mA, by the method for present embodiment, can control data transmission speed rise with a certain step-length, up to detecting input current greater than default thresholding, method control data transmission speed again according to present embodiment descends, and input current is dropped under the threshold value.So circulation by the method for present embodiment, can make input current pace up and down near threshold value.
In another embodiment, when some after other the improvement of terms, when for example the terminal user does not carry out the mass data transmission state, the input current of the terminal device that gets access in real time may have bigger surplus below the threshold value of setting, for example, the input current that get access to this moment is 100mA, and threshold value is 500mA, according to the method for present embodiment, no longer control the power amplifier of the radio circuit of this terminal device, make it automatically according to radio frequency protocol requirement work.
Step 108: described marking variable is carried out second reset.
In one embodiment, determine that according to step 106 marking variable is non-vanishing, then this marking variable is carried out second and reset, can be for this marking variable be subtracted 1.
In the present embodiment, step 105 is to carry out first replacement by marking variable being added 1 pair of this marking variable when input current is higher than predetermined threshold value, has shown that namely input current is higher than predetermined threshold value; Be lower than predetermined threshold value and marking variable is not at 0 o'clock at input current when step 108 is, undertaken second and reset by marking variable being subtracted 1 pair of this marking variable, shown that namely input current is lower than predetermined threshold value.
Need to prove that above-described embodiment is when input current is higher than predetermined threshold value, this marking variable is carried out first reset to, marking variable is added 1; Be lower than predetermined threshold value and marking variable is not at 0 o'clock at input current, this marking variable carried out second reset to, marking variable is subtracted 1.Certainly, above-described embodiment also can for: when input current is higher than predetermined threshold value, this marking variable is carried out first resets to, marking variable is subtracted 1; Be lower than predetermined threshold value and marking variable is not at 0 o'clock at input current, this marking variable carried out second reset to, marking variable is added 1.The embodiment of the invention does not limit this.
The input current control method of the terminal device by the embodiment of the invention, can guarantee that the working current of terminal device can far surpass the requirement of specific environment at no time, and guarantee terminal device itself and computer security work, the big electric current that causes in the time of can not occurring because of terminal device two-forty, big power consumption work is with computer or terminal device damage or burn.
For the input current control method of the terminal device that makes present embodiment is clear more understandable, be elaborated below in conjunction with the workflow of the terminal device input current control method to the terminal device of present embodiment.
The process flow diagram of the input current control method of a kind of terminal device that Fig. 2 provides for the embodiment of the invention, present embodiment are to reduce input current by the message transmission rate that reduces terminal device, and wherein identical with Fig. 1 part repeats no more.Please refer to Fig. 2, this method comprises:
Step 201: initialization marking variable V
Flag=0;
Wherein, the terminal device of present embodiment can be inserted on the computer by USB interface, begins to work on power, according to the method for present embodiment, with marking variable V
FlagInitialization is set to 0.
Step 202: obtain the input current that detects described terminal device in real time;
Wherein, present embodiment can be by arranging the input current that current detection circuit detects this terminal device, and the ADC by this terminal device is converted to digital value with the analogue value of input current, in the present embodiment, magnitude of voltage that can be by reading ADC also obtains this input current with the method for its switching current value.
Step 203: whether judge described input current greater than default thresholding, if described input current greater than default thresholding, then execution in step 204, otherwise execution in step 206;
Step 204: control described terminal device and reduce message transmission rate;
Wherein, if input current surpasses default thresholding, then can pass through the mode of the message transmission rate of this terminal device of control, reduce this input current, for example, can make the message transmission rate of this terminal device reduce fixed value A, the message transmission rate of this terminal device is descended with some step-lengths.
Step 205: it is V that marking variable is set
Flag'=V
Flag+ 1;
Wherein, after control terminal reduces message transmission rate, also will be with marking variable V
FlagAdd 1, with the controlled situation of the input current that identifies this terminal device.
In the present embodiment, after the message transmission rate of terminal device descended, the input current of terminal device will inevitably descend to some extent, and according to the method for present embodiment, circulation execution in step 202-step 205 is not more than default thresholding up to input current.
Step 206: judge whether described marking variable is zero, if described marking variable is zero, then execution in step 202, otherwise execution in step 207;
Wherein, may under limited message transmission rate, work if input current, then illustrates this terminal device not above default thresholding, also may not be subjected to the restriction of message transmission rate, always in proper communication.If work under limited message transmission rate, then marking variable is not initial value; If be not subjected to the restriction of message transmission rate, then marking variable is initial value, according to the method for present embodiment, and can also be by the judgement of the value of marking variable being determined the limited situation of the message transmission rate of this terminal device.
If marking variable is non-vanishing, the message transmission rate that this terminal device then is described is restricted, also namely once controlled before the message transmission rate of this terminal device, the input current of this terminal device is descended, because input current is below threshold value at present, so can control data transmission speed progressively rise, so that input current is positioned near the default thresholding.
If marking variable is zero, illustrate that then the message transmission rate of this terminal device is not restricted, do not need to carry out respective handling, according to the method for present embodiment, continue execution in step 202.
Step 207: controlling described terminal device increases message transmission rate;
Wherein, because marking variable is non-vanishing, this moment, the message transmission rate of terminal device was restricted, and therefore, according to the method for present embodiment, control data transmission speed increases, and for example increases fixed value A accordingly, perhaps rises with aforementioned step-length accordingly.
Step 208: it is V that marking variable is set
Flag=V
Flag'-1.
Wherein, because message transmission rate increases accordingly, can subtract 1 this moment with marking variable, afterwards, according to the method for present embodiment, continues execution in step 202.
By the method for present embodiment, terminal device has formed a dynamic current detecting and input current control procedure, guarantees that the working current of terminal device can far not surpass default threshold value.
The process flow diagram of the input current control method of a kind of terminal device that Fig. 3 provides for the embodiment of the invention, present embodiment are that the emissive power by the radio-frequency power amplifier that reduces terminal device reduces input current, and wherein identical with Fig. 1 part repeats no more.Please refer to Fig. 3, this method comprises:
Step 301: initialization marking variable P
Flag=0;
Wherein, the terminal device of present embodiment can be inserted on the computer by USB interface, begins to work on power, according to the method for present embodiment, with marking variable P
FlagInitialization is set to 0.
Step 302: the input current that obtains described terminal device in real time;
Wherein, present embodiment can be by arranging the input current that current detection circuit detects this terminal device, and the ADC by this terminal device is converted to digital value with the analogue value of input current, in the present embodiment, magnitude of voltage that can be by reading ADC also obtains this input current with the method for its switching current value.
Step 303: whether judge described input current greater than default thresholding, if described input current greater than default thresholding, then execution in step 304, otherwise execution in step 306;
Step 304: control the emissive power that described terminal device reduces radio-frequency power amplifier;
Step 305: marking variable P is set
Flag'=P
Flag+ 1;
Wherein, if input current surpasses default thresholding, then can pass through the mode of the radio-frequency power amplifier of this terminal device of control, reduce this input current, for example, make the less fixed value B of emissive power of the radio-frequency power amplifier of this terminal device, perhaps make amplification stage of emissive power decline of the radio-frequency power amplifier of this terminal device.
Wherein, after the emissive power of control terminal minimizing radio-frequency power amplifier, also will be with marking variable P
FlagAdd 1, with the controlled situation of the input current that identifies this terminal device.
In the present embodiment, after the emissive power of terminal device descended, the input current of terminal device will inevitably descend to some extent, and according to the method for present embodiment, circulation execution in step 302-step 305 is not more than default thresholding up to input current.
Step 306: judge whether described marking variable is zero, if described marking variable is zero, then execution in step 302, otherwise execution in step 307;
Wherein, may under limited emissive power, work if input current, then illustrates this terminal device not above default thresholding, also may not receive the restriction of emissive power, always in proper communication.If work under limited emissive power, then marking variable is not initial value; If do not receive the restriction of message transmission rate, then marking variable is initial value, according to the method for present embodiment, and the limited situation of emissive power that can also be by the judgement of marking variable being determined this terminal device.
If marking variable is non-vanishing, the radio-frequency emission power that this terminal device then is described is restricted, also namely once control before this terminal device and reduced emissive power, and because present input current is below threshold value, progressively rise so can control radio-frequency emission power, so that input current is positioned near the default thresholding.
If marking variable is zero, illustrate that then the radio-frequency emission power of this terminal device is not restricted, do not need to carry out respective handling, according to the method for present embodiment, continue execution in step 302.
Step 307: control the emissive power that described terminal device increases radio-frequency power amplifier;
Wherein, because marking variable is non-vanishing, this moment, the radio-frequency emission power of terminal device was restricted, and therefore, according to the method for present embodiment, the control radio-frequency emission power increases, and for example increases fixed value B accordingly, and an amplification stage accordingly perhaps rises.
Step 308: marking variable P is set
Flag=P
Flag'-1.
Wherein, because emissive power increases accordingly, can subtract 1 this moment with marking variable, afterwards, according to the method for present embodiment, continues execution in step 302.
By the method for present embodiment, terminal device has formed a dynamic current detecting and input current control procedure, guarantees that the working current of terminal device can far not surpass default threshold value.
The block diagram of the control device of the input current of a kind of terminal device that Fig. 4 provides for the embodiment of the invention please refer to Fig. 4, and this device comprises:
Initialization unit 41 is used for the initialization marking variable, and described marking variable is used for the controlled situation of the input current of the described terminal device of sign;
Acquiring unit 42 is for the input current that obtains terminal device;
First judging unit 43 is used for judging that whether described input current is greater than default thresholding;
First control module 44, for the judged result at first judging unit 43 be, input current is during greater than default thresholding, control this terminal device and reduce message transmission rate or control the emissive power that this terminal device reduces radio-frequency power amplifier, then described marking variable is carried out first and reset.
In one embodiment, this device also comprises:
Second judging unit 45, being used in the judged result of first judging unit 43 is that input current is not more than when presetting thresholding, judges whether described marking variable is initial value;
Second control module 46 is used for when described marking variable is not described initial value, and controlling this terminal device increases message transmission rate or control the emissive power that this terminal device increases radio-frequency power amplifier, then described marking variable is carried out second and resets.
In one embodiment, first control module, 44 these terminal devices of control reduce message transmission rate, comprising: described message transmission rate is descended with predetermined step-length.The described terminal device of first control module, 44 controls reduces the emissive power of radio-frequency power amplifier, comprising: make amplification stage of described emissive power decline.
In one embodiment, second control module, 46 these terminal devices of control increase message transmission rate, comprising: described message transmission rate is risen with described predetermined step-length.Second control module, 46 these terminal devices of control increase the emissive power of radio-frequency power amplifier, comprising: make amplification stage of described emissive power rising.
Be understandable that, each functional unit of the control device of the input current of above-mentioned terminal device is divided according to function, certainly each functional unit also can integrate, for example first control module 44 and second control module 46 integrate, and the embodiment of the invention does not limit this.
Each ingredient of the input current control device of the terminal device of present embodiment is respectively applied to realize earlier figures 1, Fig. 2, each step embodiment illustrated in fig. 3, because in the embodiment of Fig. 1-shown in Figure 3, each step has been done detailed description, do not repeated them here.
Device by present embodiment, can guarantee that the working current of terminal device can far surpass the requirement of specific environment at no time, and guarantee terminal device itself and computer security work, the big electric current that causes in the time of can not occurring because of terminal device two-forty, big power consumption work is with computer or terminal device damage or burn.Can guarantee that terminal device is under the safe working environment.
The block diagram of a kind of terminal device that Fig. 5 provides for the embodiment of the invention, but present embodiment not with this as restriction.Please refer to Fig. 5, this terminal device also comprises except comprising its original composition and function:
Current detection circuit 51 is for detection of the input current of described terminal device;
Input current control device 52, input current for the described terminal device that obtains current detection circuit 51 detections, and at described input current during greater than default thresholding, control the emissive power of the radio-frequency power amplifier of the message transmission rate of described terminal device or described terminal device, thereby reduce described input current.
The input current control device 52 of present embodiment can be realized by the input current control device of terminal device embodiment illustrated in fig. 4, because in the embodiment shown in fig. 4, this device is had been described in detail, and does not repeat them here.
In the present embodiment, this terminal device can be wireless Internet card (data card), and the original composition of this data card comprises interface (for example this interface can be USB interface), RF transmit-receive circuit, baseband processing chip etc.
Device by present embodiment, can guarantee that the working current of terminal device (for example wireless Internet card) can far surpass the requirement of specific environment (for example USB interface is supported the electric current of 500mA) at no time, and guarantee terminal device itself and computer security work, the big electric current that causes in the time of can not occurring because of terminal device two-forty, big power consumption work is with computer or terminal device damage or burn.Can guarantee that terminal device is under the safe working environment.
In order to make terminal device embodiment illustrated in fig. 5 clear more understandable, be elaborated below in conjunction with the circuit diagram of terminal device shown in Figure 6 device to present embodiment.
Fig. 6 is the method according to present embodiment, in terminal device, increase the synoptic diagram of current detection circuit and input current control device, please refer to Fig. 6, the terminal device of present embodiment comprises: interface 61, power circuit 62, input current control device 63, ADC converter 64 and current detection circuit 65, wherein:
This interface 61 is used for connecting main frame, for example PC, notebook computer etc., and this interface can be USB interface.
Power circuit 62 links to each other with current detection circuit 65, and this power circuit 62 is used to this terminal device that required power supply is provided.
Input current control device 63 links to each other with ADC converter 64, be used for reading input current from this ADC converter 64, and at described input current during greater than default thresholding, the emissive power of the message transmission rate by controlling described terminal device or the radio-frequency power amplifier of described terminal device reduces described input current.
ADC converter 64 links to each other with current detection circuit 65, is used for the analogue value of current detection circuit 65 detected input currents is converted to digital value.
Current detection circuit 65 links to each other with interface 61, power circuit 62 and ADC converter 64, and the electric current that is used for docking port 61 inputs detects.
In the present embodiment, this
current detection circuit 65 please refer to Fig. 6 for detection of the size of input current, and input current is
Because operational amplifier has the characteristic of " empty short ", " empty disconnected ", i.e. V3=V4, I+=0, I-=0, because I-=0, so there is not pressure drop on the resistance R 3, so V2=V4, so V2=V4=V3, so
Again because V1-V3=R2 * I2, so
Because I+=0, so I2=I1.Because operational amplifier V5 under this state drives the B utmost point of triode, is the triode saturation conduction, so I1=IC=I3.So
Again because
So
Wherein R1, R2, R4 are known.Read the voltage of V5 by the
ADC converter 64 of terminal device, just can calculate the value of input current I.
The value that input current has been arranged, the input current control device 63 of present embodiment can be controlled this input current according to preceding method, for example, at described input current during greater than default thresholding, the emissive power of the message transmission rate by controlling described terminal device or the radio-frequency power amplifier of described terminal device reduces described input current.Owing in preceding method embodiment, how this terminal device is controlled input current and has been described in detail, do not repeat them here.
Device by present embodiment, can guarantee that the working current of terminal device can far surpass the requirement of specific environment at no time, and guarantee terminal device itself and computer security work, the big electric current that causes in the time of can not occurring because of terminal device two-forty, big power consumption work is with computer or terminal device damage or burn.Can guarantee that terminal device is under the safe working environment.
Need to prove that input current is controlled described terminal device and reduced message transmission rate or control the emissive power that described terminal device reduces radio-frequency power amplifier greater than default thresholding, described marking variable is carried out first reset; Be not more than default thresholding at input current, under the non-vanishing situation of marking variable, controlling described terminal device increases message transmission rate or controls the emissive power that described terminal device increases radio-frequency power amplifier, described marking variable is carried out second reset.First resets and second replacement, is in order better above-described embodiment to be set forth, and " first " in above-described embodiment and " second " can't constitute the restriction to the embodiment of the invention.
The method of describing in conjunction with embodiment disclosed herein or the step of algorithm can directly use the software module of hardware, processor execution, and perhaps the combination of the two is implemented.Software module can place the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or the technical field.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; and be not intended to limit the scope of the invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.