The content of the invention
In view of above-mentioned the deficiencies in the prior art part, controlled based on cell voltage it is an object of the invention to provide a kind of
Automatic adjustment method and its device, with when solving existing mobile terminal and developing the function related to cell voltage, it is impossible to dynamic tune
Economize on electricity cell voltage and loaded down with trivial details, complicated, the time-consuming problem of debugging process.
The technical proposal for solving the technical problem of the invention is as follows:
A kind of Automatic adjustment method controlled based on cell voltage, it includes:
Step A, when carrying out cell voltage and debugging, corresponding simulated battery electricity is input into according to commissioning requirements in voltage analog module
Pressure table;
Step B, input selecting module instruct according to first choice and simulated battery voltmeter, voltage are obtained from voltage analog module
Acquisition module exports the numerical value in simulated battery voltmeter to be debugged;
After step C, debugging terminate, input selecting module obtains cell voltage according to the second selection instruction from battery, and voltage is obtained
Delivery block exports cell voltage to power.
In the described Automatic adjustment method based on cell voltage control, in step A, in simulated battery voltmeter
The changing value of the cell voltage started from initial time is listed, form is:
[0, T0]
[X1, T1]
[X2, T2]
……
[Xn, Tn];
[0, T0] represent and start for the 0th second, cell voltage is T0, i.e. initial voltage;[X1, T1] is represented, the X1 seconds, battery
Voltage is T1;[X2, T2] represents that X2 seconds, cell voltage is T2;By that analogy, [Xn, Tn] represents that the Xn seconds open
Begin, cell voltage is Tn, i.e. final voltage.
In the described Automatic adjustment method based on cell voltage control, in step B, the input selecting module
After the step of simulated battery voltmeter is obtained from voltage analog module according to first choice instruction, also include:
Step B1, the initial voltage of current cell voltage and simulated battery voltmeter is compared, according to comparative result pair
Cell voltage carries out transition switching or keeps current being output as cell voltage.
In the described Automatic adjustment method based on cell voltage control, step B1 is specifically included:
The current cell voltage of step B11, preservation, obtains the initial voltage of simulated battery voltmeter;Judge cell voltage with it is first
Whether the absolute value of the difference of beginning voltage is more than threshold value:If then execution step B12, otherwise keeps current and is output as battery electricity
Pressure;
Step B12, variable is set and make variable be equal to current cell voltage, start timer;
Whether step B13, judgment variable are more than initial voltage:If then execution step B14, otherwise execution step B15;
Step B14, variable is deducted threshold value, and judge the variable after subtracting each other whether less than initial voltage:If then making variable etc.
In initial voltage and Off Timer, execution step B16;Return to step B13 otherwise when timing reaches;
Step B15, variable is added with threshold value, and judges the variable after being added whether more than initial voltage:If then making variable
Equal to initial voltage and Off Timer, execution step B16;Return to step B13 otherwise when timing reaches;
Step B16, make cell voltage be equal to variable.
In the described Automatic adjustment method based on cell voltage control, in step C, in input selecting module root
After the step of cell voltage is obtained from battery according to the second selection instruction, also include:
Step C1, the final voltage of simulated battery voltmeter is compared with current cell voltage, according to comparative result pair
Final voltage carries out transition switching or keeps current being output as final voltage.
In the described Automatic adjustment method based on cell voltage control, step C1 is specifically included:
Step C11, the final voltage for preserving simulated battery voltmeter, obtain current cell voltage;Judge final voltage with electricity
Whether the absolute value of the difference of cell voltage is more than threshold value:If then execution step C12, otherwise keeps current and is output as terminating electricity
Pressure;
Step C12, variable is set and make variable be equal to final voltage, start timer;
Whether step C13, judgment variable are more than cell voltage:If then execution step C14, otherwise execution step C15;
Step C14, variable is deducted threshold value, and judge the variable after subtracting each other whether less than cell voltage:If then making variable etc.
In cell voltage and Off Timer, execution step C16;Return to step C13 otherwise when timing reaches;
Step C15, variable is added with threshold value, and judges the variable after being added whether more than cell voltage:If then making variable
Equal to cell voltage and Off Timer, execution step C16;Return to step C13 otherwise when timing reaches;
Step C16, make cell voltage be equal to variable.
It is a kind of realize described in based on cell voltage control Automatic adjustment method self-checking device, it includes:
Voltage analog module, when carrying out cell voltage debugging, stores the corresponding simulated battery voltage according to commissioning requirements input
Table;
Input selecting module, according to first choice instruction simulated battery voltmeter, and debugging are obtained from voltage analog module
Cell voltage is obtained from battery according to the second selection instruction after end;
Voltage acquisition module, exports the numerical value in simulated battery voltmeter to be debugged, and exports cell voltage to power.
In described self-checking device, also including hand-off process module, on the one hand for by current cell voltage with
The initial voltage of simulated battery voltmeter is compared, and transition switching is carried out to cell voltage according to comparative result or keeps current
It is output as cell voltage;On the other hand it is used to be compared the final voltage of simulated battery voltmeter with current cell voltage
Compared with transition switching being carried out to final voltage according to comparative result or keeps current being output as final voltage.
Compared to prior art, the Automatic adjustment method controlled based on cell voltage and its device that the present invention is provided are entered
When row cell voltage is debugged, corresponding simulated battery voltmeter is input into according to commissioning requirements in voltage analog module;Input choosing
Select module and the acquisition simulated battery voltmeter from voltage analog module, the output simulation of voltage acquisition module are instructed according to first choice
Numerical value in cell voltage table is being debugged;After debugging terminates, input selecting module is according to the second selection instruction from battery
Cell voltage is obtained, voltage acquisition module exports cell voltage to power.Export described in simulated battery voltmeter during debugging
Cell voltage changing value carrys out the change of simulated battery voltage, so as to be debugged.Existing mobile terminal exploitation can so be solved
During related to cell voltage function, can't effectively dynamic regulation cell voltage, debugging process be loaded down with trivial details, complicated, time-consuming
Problem.Developer's operation is facilitated, the accuracy of development efficiency and exploitation is improve.Debugging switches back into battery confession after terminating
Electricity.The dynamic debugging function and normal power supply function of mobile terminal compatibility cell voltage have so been made, and between the two can be random
Switching, greatly facilitates the operation of developer.
Specific embodiment
The present invention provides a kind of Automatic adjustment method controlled based on cell voltage and its device, the tune based on cell voltage
Examination application.To make the objects, technical solutions and advantages of the present invention clearer, clear and definite, develop simultaneously referring to the drawings enforcement
The present invention is described in more detail for example.It should be appreciated that specific embodiment described herein is only to explain the present invention, not
For limiting the present invention.
As shown in figure 3, the Automatic adjustment method controlled based on cell voltage that the present invention is provided is included:
S100, when carrying out cell voltage and debugging, corresponding simulated battery electricity is input into according to commissioning requirements in voltage analog module
Pressure table;
S200, input selecting module instruct according to first choice and simulated battery voltmeter, voltage are obtained from voltage analog module
Acquisition module exports the numerical value in simulated battery voltmeter to be debugged.
After S300, debugging terminate, input selecting module obtains cell voltage, voltage according to the second selection instruction from battery
Acquisition module exports cell voltage to power.
In the present embodiment, by changing corresponding simulated battery voltage to the mobile terminal ambient voltage to be debugged of input
Table.During debugging, the change that the cell voltage changing value described in the simulated battery voltmeter carrys out simulated battery voltage is exported, so as to
Debugged.Debugging switches back into battery and powers after terminating.Existing mobile terminal exploitation can so be solved related to cell voltage
Function when, can't effectively loaded down with trivial details, complicated, the time-consuming problem of dynamic regulation cell voltage, debugging process.Facilitate exploitation
Human users, improve the accuracy of development efficiency and exploitation, and the normal power supply for also not interfering with mobile terminal is used.
In step S100, according to the corresponding simulated battery voltmeter that debugging enironment and commissioning requirements are input into, can
In being stored in the built-in cell voltage change file of voltage analog module.Write exactly from starting in the simulated battery voltmeter
The changing value of the cell voltage that the time starts, voltage analog module changes according to the cell voltage described in simulated battery voltmeter
Situation to voltage acquisition module provides corresponding change numerical value, so that debugging is used.Simulated battery voltmeter can be in the form of text
Description, concrete form is as follows:
[0, T0]
[X1, T1]
[X2, T2]
……
[Xn, Tn];
Wherein, per a line with [a, b] expression.A represents the time, then the first row a is necessary for 0, and the value of remaining row a need to meet and be more than
0 and rear a line value more than previous row value(I.e. 0<X1<X2<X3<……<Xn).B represents the cell voltage of simulation, Ke Yishi
Arbitrary value.The first row [0, T0] represents and starts for the 0th second that cell voltage is T0;Second row [X1, T1] is represented, the X1 seconds, electric
Cell voltage is T1;The third line [X2, T2] represents that X2 seconds, cell voltage is T2;……;By that analogy, the (n+1)th row
[Xn, Tn] represents that Xn seconds, cell voltage is Tn.N is positive integer.
Then in step S200, input selecting module selects to obtain the simulated battery voltage from voltage analog module
Table, rather than as prior art obtains actual cell voltage from battery.Voltage acquisition module exports simulated battery voltmeter
In numerical value being debugged.In the specific implementation, the numerical value in simulated battery voltmeter can arrange as follows:
[0,4.04]
[2,3.94]
[3,3.98]
[7,4.00]
The corresponding voltage waveform of simulated battery voltmeter is as shown in Figure 2.At the 0th second, cell voltage was 4.04V, by the 2nd second
When cell voltage be changed into 3.94V, be changed into 3.98V to cell voltage when the 3rd second, to when the 7th second cell voltage change 4V, afterwards
Cell voltage will be always maintained at 4V.In actual debugging process, it is difficult to the cell voltage satisfaction for repeatedly making mobile terminal is somebody's turn to do
The cell voltage situation of change that simulated battery voltage is represented.Even if encountering such case once in a while can not reappear, it is difficult to carry out
Further analysis.The present embodiment is carrying out when automatically adjusting of cell voltage control by using simulated battery voltmeter, develops
Personnel can infinitely simulate the scene of the cell voltage change, further to analyze fault-location problem.Can solve existing
The change of dynamic regulation cell voltage, loaded down with trivial details, complicated, the time-consuming defect of debugging process are unable in technology.
It is to be appreciated that must be battery-powered before cell voltage debugging is carried out, i.e., in start, input is selected
The acquiescence of module 20 selects the acquisition cell voltage from battery to be powered.Then in step s 200, it is input into selecting module and selects defeated
When going out to simulate cell voltage table, the process of the initial voltage for switching to simulated battery voltmeter has been must travel from cell voltage.
The value of cell voltage and the possible gap of the value of initial voltage are larger.In order to prevent voltage, significantly saltus step causes application program event
Barrier, be input into selecting module according to first choice instruct from voltage analog module obtain simulated battery voltmeter the step of it
Afterwards, also it is compared including step 210, by the initial voltage of current cell voltage and simulated battery voltmeter, according to comparing
As a result transition switching is carried out to cell voltage or keeps current to be output as cell voltage;It is specifically included:
The current cell voltage TB of step 211, preservation, obtains the 0th second corresponding initial voltage T0 in simulated battery voltmeter;Sentence
Whether absolute value | TB-T0 | of the difference of power-off cell voltage and initial voltage is more than threshold value TH:If then execution step 212, no
Then keep current and be output as cell voltage.
In this step, threshold value TH be preset value, such as 1V.If greater than then represent cell voltage TB and initial voltage T0 between
Difference it is larger, keep initial voltage T0 output voltage significantly saltus step occurs, execution step 212 is needed, by hand-off process
Change of the module to cell voltage is turned into transition processing, that is, the magnitude of voltage for being supplied to voltage acquisition module is changed into T0 one mistake of work from TB
Cross.In this transition period, the magnitude of voltage that voltage acquisition module gets is provided by hand-off process module.Two are represented if being less than
Person relatively, can keep current and be output as cell voltage, then can be directly subsequently simulated battery electricity from cell voltage saltus step
Initial voltage in pressure table.
Step 212, setting variable TP simultaneously make variable be equal to current cell voltage, i.e. TP=TB, start a timing
For the timer of 2 seconds;
Whether step 213, judgment variable TP are more than initial voltage T0:If then execution step 214, otherwise execution step 215;
Step 214, variable is deducted threshold value TP=TP-TH, and judge the variable TP after subtracting each other whether less than initial voltage T0:If
It is to make variable be equal to initial voltage(TP=T0)And Off Timer, execution step 216;Otherwise return when timing reaches
Return step 213.
Step 215, variable is added TP=TP+TH with threshold value, and judges the variable TP after being added whether more than initial voltage
T0:If then making variable be equal to initial voltage TP=T0 and Off Timer, execution step 216;Otherwise when timing reaches
Return to step 213.
Step 216, make cell voltage be equal to variable TP.The cell voltage is exported by hand-off process module 40 and obtained to voltage
Module 30.
By judging that cell voltage is differed with the difference of initial voltage, gap is larger, by deducting or adding upper threshold value
To shorten both gaps, cell voltage can be made when both differ less to be equal to initial voltage.So cell voltage is switched to
Would not there is the larger problem of voltage jump during initial voltage in simulated battery voltmeter.Voltage acquisition module can be directly defeated
Go out to simulate the parameter in cell voltage table to be debugged to other modules.
After debugging is finished, i.e., in step S300, it is input into selecting module and selects to obtain the electricity of reality from battery
Cell voltage can normally be powered.The dynamic debugging function and normal power supply of mobile terminal compatibility cell voltage are so made
Function, and can arbitrarily switch between the two, greatly facilitate the operation of developer.
It is to be appreciated that switching can battery power before must export be simulated battery voltmeter in parameter,
Its magnitude of voltage may be different from cell voltage.Then in step S300, before voltage acquisition module output cell voltage, must Jing
The process of the cell voltage of the numerical value switching reality crossed from simulated battery voltmeter.In order to prevent voltage, significantly saltus step is led
Application failure is caused, after being input into the step of selecting module obtains cell voltage according to the second selection instruction from battery,
Also include step 310, be compared the final voltage of simulated battery voltmeter with current cell voltage, according to comparative result
Transition switching is carried out to final voltage or keeps current to be output as final voltage;It is specifically included:
Step 311, the final voltage TX for preserving simulated battery voltmeter, obtain current cell voltage TB;Judge final voltage
With absolute value | TX-TB | of the difference of cell voltage whether more than threshold value TH:If then execution step 312, otherwise keep current
It is output as final voltage.
In this step, threshold value TH be preset value, such as 1V.If greater than then represent final voltage TX and cell voltage TB between
Difference it is larger, keep final voltage TX output voltage significantly saltus step occurs, execution step 312 is needed, by hand-off process
Change of the module to final voltage TX is turned into transition processing, that is, the magnitude of voltage for being supplied to voltage acquisition module is changed into one, TB works from TX
Transition.In this transition period, the magnitude of voltage that voltage acquisition module gets is provided by hand-off process module.Represent if being less than
Both relatively can keep current and be output as final voltage, then can be directly subsequently cell voltage from final voltage saltus step.
Step 312, setting variable TP simultaneously make variable be equal to final voltage, i.e. TP=TX, and it is 2 seconds to start a timing
Timer;
Whether step 313, judgment variable TP are more than cell voltage TB:If then execution step 314, otherwise execution step 315;
Step 314, variable is deducted threshold value TP=TP-TH, and judge the variable TP after subtracting each other whether less than cell voltage TB:If
It is to make variable be equal to cell voltage(TP=TB)And Off Timer, execution step 316;Otherwise return when timing reaches
Return step 313.
Step 315, variable is added TP=TP+TH with threshold value, and judges the variable TP after being added whether more than cell voltage
TB:If then making variable be equal to cell voltage TP=TB and Off Timer, execution step 316;Otherwise when timing reaches
Return to step 313.
Step 316, make cell voltage be equal to variable TP.The cell voltage is exported by hand-off process module 40 and obtained to voltage
Module 30.
By judging that cell voltage is differed with the difference of final voltage, gap is larger, by deducting or adding upper threshold value
To shorten both gaps, the final voltage that the currently output of voltage acquisition module can be made when both differ less is equal to battery electricity
Pressure.Would not there is the larger problem of voltage jump when so voltage acquisition module exports cell voltage.
Based on the above-mentioned Automatic adjustment method controlled based on cell voltage, the present invention also provides a kind of based on cell voltage
The self-checking device of control, sees also Fig. 4, and self-checking device is arranged in the terminal, with battery(Existing skill
Art, is that mobile terminal is powered for storage energy)Connection, it includes:
Voltage analog module 10, for storage according to the simulated battery magnitude of voltage of debugging enironment input, there is new simulated battery electricity
Pressure value(Arranged according to different debugging enironments or commissioning requirements)Legacy version before then updating during input.
Input selecting module 20, for simulated battery voltage to be obtained from voltage analog module according to first choice instruction
Value, according to the second selection instruction actual cell voltage is obtained from battery.In other words, selecting module 20 is input into according to difference
The selection instruction voltage that selects to input to voltage acquisition module be to be provided by battery, or provided by voltage analog module 10.
Voltage acquisition module 30, uses for exporting simulated battery magnitude of voltage or cell voltage to corresponding module.As adjusted
Export simulated battery magnitude of voltage during examination to be debugged to debugging module or external commissioning device.Reality is exported during normal work
Cell voltage gives corresponding module for power supply, or the supply voltage for carrying out level conversion to power module to meet disparate modules will
Ask.External which kind of module of voltage acquisition module 30 is prior art, is not repeated herein.
Hand-off process module 40, for cell voltage to be compared respectively with the voltage of simulated battery voltmeter, according to
Comparative result carries out transition switching to the voltage of cell voltage and simulated battery voltmeter or keeps current output.That is to say
Say, when being input into selecting module and switching to another kind of control source mode from a kind of control source mode a transition is made.As selected
Select the magnitude of voltage that the voltage switching obtained in voltage analog module is the acquisition from actual battery, or select actual electricity
Cell voltage switches to the magnitude of voltage of voltage analog module.So-called transition, is the rational transition of voltage change.Can be at switching
Arrange a judge module to be judged accordingly in reason module 40.
In sum, the Automatic adjustment method controlled based on cell voltage of the invention and its device, by whole to movement
End input simulated battery voltmeter.Export the cell voltage changing value described in the simulated battery voltmeter during debugging to simulate electricity
The change of cell voltage, so as to be debugged.When the existing mobile terminal of solution develops the function related to cell voltage by so,
Can't effectively loaded down with trivial details, complicated, the time-consuming problem of dynamic regulation cell voltage, debugging process.Developer's operation is facilitated,
Improve the accuracy of development efficiency and exploitation.Debugging switches back into battery and powers after terminating.Mobile terminal compatibility electricity is so made
The dynamic debugging function and normal power supply function of cell voltage, and can arbitrarily switch between the two, greatly facilitate developer's
Operation.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, and for those of ordinary skills, can
To be improved according to the above description or be converted, all these modifications and variations should all belong to the guarantor of claims of the present invention
Shield scope.