A kind of mobile terminal unused time length detecting method
Technical field
The application is related to smart mobile phone technical field, more particularly to a kind of mobile terminal unused time length detecting method.
Background technology
As science and technology is maked rapid progress, miscellaneous portable electronic devices are applied among life, for example Smartphone
And tablet personal computer etc..These portable electronic devices are different due to specification and model, its Electronic Performance, the reaction time and
Unused time also differs.Even if in the portable electronic devices of same specification and model, due to the otherness of its processing procedure, respectively
Item electrical performance index also will not be just the same.However, when portable electronic devices dispatch from the factory, it is necessary to pass through many testing processes
So that the Electronic Performance after dispatching from the factory meets its specification, and efficiency quality reaches unanimously as far as possible.
During these detections, the length of unused time needed for portable electronic devices is a critically important efficiency
Index.In general, the length of unused time needed for portable electronic devices is defined as performing pass by portable electronic devices
After machine instruction, to the time being completely loaded needed for shutdown programm.Intuitively, the unused time needed for measuring portable electronic devices is long
The method of degree is the display time using portable electronic devices, with unification timer or code table, observes its execution shutdown and refers to
Make the time being completely loaded needed for shutdown programm.However, this mode measured manually, which there is, measures inaccurate wind
Danger.If, can be because of performing shutdown in addition, completely in accordance with the display measuring time value unused time length of portable electronic devices
In a period of time after instruction, time-program(me) is not yet completely loaded and causes the display time of portable electronic devices to be forbidden
Really, ultimately result in measured unused time length and have very big error.
The A of document CN 104298530 propose a kind of data processing system and measure the portable electronic devices available machine time
The method of length, using the start deadline point and the time difference at data line time point for being recorded in portable electronic devices,
At the anti-corresponding time point pushed away on computer, portable electronic devices available machine time length is further estimated exactly.When it is utilized
Between poor concept estimation portable electronic devices available machine time length, therefore when portable electronic devices time and computer when
Between when having the error of offset, when calculating its time difference, this offset can be eliminated because subtracting each other.This method has certain
Accuracy.
However, although the above method is with certain accuracy, however it remains many defects, such as, first, electronic installation
It must maintain to be connected with test equipment that the test of available machine time length could be realized, flexibility is poor;Secondly, it is to utilize the time
The concept estimation electronic device startup time span of difference, the method for the estimation still suffers from the problem of accuracy is poor;Again, this method
Due to the timing node negligible amounts of acquisition, it is impossible to the parameters in the accurate start process for obtaining electronic installation, Jin Jinshi
Less accurate available machine time measurement is showed, it is impossible to provide detailed open state information, and then changing after test can not be provided
Enter suggestion.Finally, this method simply show the method for testing of available machine time length, and when also relating to shutdown in practical application
Between length test, also there are many limitations in the above method.In summary analyze, one kind is not suggested that among prior art
Accurately and efficiently electronic installation unused time method of testing.
The content of the invention
A kind of mobile terminal unused time length detecting method, methods described comprises the following steps:
S1, test script is loaded into the mobile terminal;
S2, closes the mobile terminal, and record the shutdown triggered time point of the mobile terminal;
S3, records kernel dereferenced stop time point, the kernel dereferenced closing end time point of the mobile terminal;
S4, records the kernel associated program shut-in time point of the mobile terminal, kernel association and closes end time point;
S5, records electric time point under the kernel of the mobile terminal, kernel shut-in time point, kernel close end time point;
S6, the end time is closed according to the shutdown triggered time point, kernel dereferenced stop time point, kernel dereferenced
Point, kernel associated program shut-in time point, kernel associated program are closed end time point, kernel shut-in time point, kernel and closed
Electric time point calculates the unused time length of the mobile terminal under end time point, kernel.
As a preferred embodiment, the step S1 is specifically included:By the mobile terminal under open state
Test equipment is connected to, test script is loaded into from the test equipment;If test pattern is primary test pattern, described
Test script disconnects the connection of the test equipment and the mobile terminal after the completion of being loaded into;If test pattern is advanced test
Pattern, then keep the connection of the test equipment and the mobile terminal after the completion of test script loading.
As a preferred embodiment, under advanced test mode, the test equipment obtains the movement in real time
The off-mode information of terminal, and be compared with standard unused time information, and then the mobile terminal is analyzed whole
The performance parameter in the stage of each in shutdown process, provides unused time length performance analysis report and parameter adjustment suggestion.
As a preferred embodiment, the step S4 also includes:For the shutdown triggered time point, the non-pass of kernel
Join stop time point, kernel dereferenced closing end time point, kernel associated program shut-in time point, kernel associated program
When closing end time point, kernel shut-in time point, kernel close each shutdown where electric time point under end time point, kernel
Between the stage weighted value is set, and unused time length is calculated according to each stage unused time and its weighted value.
As a preferred embodiment, the step S4 also includes:The unused time length includes conventional shut down
Time span and effective unused time length;The computational methods of the conventional shutdown are the upper kernel dereferenced stop knot
Beam time point subtracts the difference of the shutdown triggered time point;The computational methods of effective unused time length are the kernel
Close the difference of end time point and the kernel shut-in time point, kernel associated program closing end time point with it is described
The difference of kernel associated program shut-in time point and the kernel close the difference of end time point and the kernel shut-in time point
The sum of value.
The present invention proposes a kind of accurately and efficiently electronic installation unused time method of testing, by detecting mobile terminal
In the Each point in time and the parameter of time phase of shutdown, detailed, accurate off-mode information is got, and when combining each
Between the stage to shut down performance influence, provide different unused time calculation formula, improve the mobile terminal unused time test
Accuracy and diversity.In addition, there is provided different test patterns, meets different testing requirements, also reducing to test
The degree of dependence of equipment, flexibility is greatly improved.Finally, to mobile terminal in the Each point in time of shutdown and the ginseng of time phase
Several measurements, not only increases computational accuracy, moreover it is possible to the parameter adjustment suggestion in shutdown process is provided according to these parameters, to move
Improvement of the dynamic terminal in exploitation, test process, which is improved, provides facility, so as to shorten the R&D cycle of mobile terminal.
Brief description of the drawings
Fig. 1 is a kind of length detection mobile terminal unused time, schematic diagram time point of the present invention.
Embodiment
Embodiments of the invention are further illustrated below in conjunction with accompanying drawing.
Embodiment one:
A kind of mobile terminal unused time length detecting method, methods described comprises the following steps:
S1, test script is loaded into the mobile terminal;
S2, closes the mobile terminal, and record the shutdown triggered time point of the mobile terminal;
S3, records kernel dereferenced stop time point, the kernel dereferenced closing end time point of the mobile terminal;
S4, records the kernel associated program shut-in time point of the mobile terminal, kernel association and closes end time point;
S5, records electric time point under the kernel of the mobile terminal, kernel shut-in time point, kernel close end time point;
S6, the end time is closed according to the shutdown triggered time point, kernel dereferenced stop time point, kernel dereferenced
Point, kernel associated program shut-in time point, kernel associated program are closed end time point, kernel shut-in time point, kernel and closed
Electric time point calculates the unused time length of the mobile terminal under end time point, kernel.
As a preferred embodiment, the step S1 is specifically included:By the mobile terminal under open state
Test equipment is connected to, test script is loaded into from the test equipment;If test pattern is primary test pattern, described
Test script disconnects the connection of the test equipment and the mobile terminal after the completion of being loaded into;If test pattern is advanced test
Pattern, then keep the connection of the test equipment and the mobile terminal after the completion of test script loading.By setting
Different test patterns, not only meets basic shutdown testing requirement, can also meet senior, complicated test request, tool
There is certain flexibility.In addition, above-mentioned primary test pattern and advanced test mode are intended only as one kind preferred embodiment,
During actual test, more test patterns can be set, to meet the testing requirement of different complexities, do not limited herein
System.
As a preferred embodiment, under advanced test mode, the test equipment obtains the movement in real time
The off-mode information of terminal, and be compared with standard unused time information, and then the mobile terminal is analyzed whole
The performance parameter in the stage of each in shutdown process, provides unused time length performance analysis report and parameter adjustment suggestion.It is senior
Test pattern, can also be according to survey as a preferred embodiment, it not only meets basic unused time length testing
Test result, which is made, to be analyzed and provides suggestion, so that test object optimizes and revises matching somebody with somebody for the software and hardware being related in shutdown process
Parameter is put, so that constantly adjustment, the shutdown relevant parameter of optimal inspection object before dispatching from the factory, so that right in the test process simplified
Caused by the analysis and test equipment of test result is inconsistent the problem of complex procedures, inefficiency.
As a preferred embodiment, the step S4 also includes:It is non-for shutdown triggered time point t1, kernel
Associated program shut-in time point t2, kernel dereferenced close end time point t3, kernel associated program shut-in time point t4, kernel
Associated program closes electric time point under end time point t5, kernel shut-in time point t6, kernel closing end time point t7, kernel
Each stage unused time where t8 sets weighted value, and when calculating shutdown according to each stage unused time and its weighted value
Between length.For example, the important ratio due to kernel dwell period in whole shutdown process is larger, therefore closed to the kernel
Kernel dwell period distribution weighted value 0.5 where time point t6 closes end time point t7 with kernel;Kernel associated program is closed
The importance in stage is taken second place, then associates and close where end time point t5 with kernel for kernel associated program shut-in time point t4
Kernel associated program dwell period distributes weighted value 0.3;Finally, it is kernel dereferenced stop time point t2 and the non-pass of kernel
The kernel dereferenced stop stage where connection closes end time point t3 distributes weighted value 0.2. and according to above-mentioned weighted value
And its place dwell period calculates comprehensive unused time length.
That is, TZ=(t7-t6)*0.5+(t5-t4)*0.3+(t3-t2)*0.2.
It is emphasized that above-mentioned weighted value is as just a kind of embodiment, above-mentioned weighted value can also be according to reality
Testing requirement is adjusted, and weighted value and remain 1.Due to the accurate test of above-mentioned timing node, it is ensured that calculate and close
The accuracy of machine time span, an any of the above-described timing node all provides guarantee for the accurate test.
As a preferred embodiment, the step S4 also includes:The unused time length includes conventional shut down
Time span and effective unused time length;The computational methods of the conventional shutdown subtract institute for electric time point under the upper kernel
State the difference of shutdown triggered time point, i.e. TA=t8-t1;The computational methods of effective unused time length are closed for the kernel
Close end time point associated with difference t7-t6, the kernel of the kernel shut-in time point closing end time point with it is described
The difference t5-t4 of kernel associated program shut-in time point and the kernel dereferenced close end time point and the non-pass of the kernel
Join the difference t3-t2 at stop time point sum, i.e. TB=(t7-t6)+(t5-t4)+(t3-t2).
Further, since the method for testing has been presented for the value of each material time point, it therefore, it can be based on the time point
Other computational methods are taken, so as to draw different result of calculations.Do not limit herein.Because the species of test object is present
Difference, the mode of unused time length is calculated there is also difference by above-mentioned timing node, therefore, and above-mentioned formula is as just one kind
During preferred scheme, actual test, above-mentioned timing node can be done to other any rational plus-minus combinations, to meet reality
Testing requirement;The plus-minus combination of this timing node is all within the scope of the present invention.
The present invention proposes a kind of accurately and efficiently electronic installation unused time method of testing, by detecting mobile terminal
In the Each point in time and the parameter of time phase of shutdown, detailed, accurate off-mode information is got, and when combining each
Between the stage to shut down performance influence, provide different unused time calculation formula, improve the mobile terminal unused time test
Accuracy and diversity.In addition, there is provided different test patterns, meets different testing requirements, also reducing to test
The degree of dependence of equipment, flexibility is greatly improved.Finally, to mobile terminal in the Each point in time of shutdown and the ginseng of time phase
Several measurements, not only increases computational accuracy, moreover it is possible to the parameter adjustment suggestion in shutdown process is provided according to these parameters, to move
Improvement of the dynamic terminal in exploitation, test process, which is improved, provides facility, so as to shorten the R&D cycle of mobile terminal.
Embodiments of the invention are the foregoing is only, are not intended to limit the scope of the invention, it is every to utilize this hair
Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.