Summary of the invention
The technical problem to be solved in the present invention is, above-mentioned defect for prior art, a kind of method and system thereof based on test condition dynamic memory log is provided, the invention solves in prior art mobile terminal in long-time test process, because adopting without deletion mode, store test log, when storage space completely cannot hold effective log information and cause the defect of test invalidation.
The technical scheme that technical solution problem of the present invention adopts is as follows:
A method based on test condition dynamic memory log, wherein, described method comprises:
A, mobile terminal receive tester's operational order, and the trigger condition of a control log storage, the spatial cache size of log buffer zone and the memory capacity of log memory block are set;
B, when described trigger condition is not triggered, log information is sent to described log buffer zone and stores;
C, when described trigger condition is triggered, the log information of described log buffer stores is sent to described log memory block and stores, and the log information of output after described trigger condition is triggered is sent to described log memory block and stores.
The described method based on test condition dynamic memory log, wherein, described trigger condition is that battery electric quantity is lower than default power threshold, subscriber dialing, video playback or music.
The described method based on test condition dynamic memory log, wherein, described step B specifically comprises:
B1, when described trigger condition is not triggered and the remaining cache space of described log buffer zone is greater than the byte number of current log information, current log information is sent to described log buffer zone and stores;
B2, be not triggered and the remaining cache space of described log buffer zone is less than the byte number of current log information when described trigger condition, to storage time in described log buffer area, log information was the earliest deleted processing, and current log information is sent to described log buffer zone stores.
The described method based on test condition dynamic memory log, wherein, after the spatial cache size that the memory capacity of described log memory block is greater than described log buffer zone is triggered with described trigger condition, the log information of output is occupied storage space sum.
The described method based on test condition dynamic memory log, wherein, described step C specifically comprises:
C1, when described trigger condition is triggered, by the log information of described log buffer stores by storage time sequencing be sent to successively described log memory block and store, and discharge described log buffer zone;
C2, described trigger condition is triggered after the log information of output by log information generation time sequencing, be sent to successively described log memory block and store.
The described method based on test condition dynamic memory log, wherein, also comprises after described step C:
D, when described log memory block is during without residual memory space, close log and finish test by a pop-up box prompting tester.
A system based on test condition dynamic memory log, wherein, comprising:
Module is set, for mobile terminal, receives tester's operational order, the trigger condition of a control log storage, the spatial cache size of log buffer zone and the memory capacity of log memory block are set;
The first control module, for when described trigger condition is not triggered, is sent to log information described log buffer zone and stores;
The second control module, for when described trigger condition is triggered, the log information of described log buffer stores is sent to described log memory block and stores, and the log information of output after described trigger condition is triggered is sent to described log memory block and stores.
The described system based on test condition dynamic memory log, wherein, described the first control module specifically comprises:
The first control module, for not being triggered when described trigger condition and the remaining cache space of described log buffer zone is greater than the byte number of current log information, being sent to described log buffer zone by current log information and storing;
The second control module, for not being triggered when described trigger condition and the remaining cache space of described log buffer zone is less than the byte number of current log information, to storage time in described log buffer area, log information was the earliest deleted processing, and current log information is sent to described log buffer zone stores.
The described system based on test condition dynamic memory log, wherein, described the second control module specifically comprises:
The 3rd control module, for when described trigger condition is triggered, by the log information of described log buffer stores by storage time sequencing be sent to successively described log memory block and store, and discharge described log buffer zone;
The 4th control module, is sent to successively described log memory block for the log information of output after trigger condition is triggered by log information generation time sequencing and stores.
The described system based on test condition dynamic memory log, wherein, also comprises:
Close and reminding module, for when described log memory block is during without residual memory space, close log and finish test by a pop-up box prompting tester.
The invention discloses a kind of method and system thereof based on test condition dynamic memory log, method comprises: mobile terminal receives tester's operational order, and the trigger condition of a control log storage, the spatial cache size of log buffer zone and the memory capacity of log memory block are set; When described trigger condition is not triggered, log information is sent to described log buffer zone and stores; When described trigger condition is triggered, the log information of described log buffer stores is sent to described log memory block and stores, and the log information of output after trigger condition is triggered is sent to described log memory block and stores.The invention enables in the process of the mobile test reception tester, when reproduction problem, can cannot not preserve effective log information because of the finite capacity of log buffer zone, greatly promote test validity.
Embodiment
For making object of the present invention, technical scheme and advantage clearer, clear and definite, referring to accompanying drawing, developing simultaneously, the present invention is described in more detail for embodiment.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Refer to Fig. 1, Fig. 1 is the process flow diagram of the method preferred embodiment based on test condition dynamic memory log of the present invention.As shown in Figure 1, the described method based on test condition dynamic memory log, comprises the following steps:
Step S100, mobile terminal receive tester's operational order, and the trigger condition of a control log storage, the spatial cache size of log buffer zone and the memory capacity of log memory block are set.
In the embodiment of the present invention, need tester to set in advance the spatial cache size of trigger condition, log buffer zone and the memory capacity of log memory block.Wherein, described log buffer zone is arranged in power down volatile storage and (is arranged in RAM storer); Described log memory block is arranged in power down nonvolatile memory and (is arranged in FLASH storer); Described trigger condition is that tester sets in advance, and when mobile terminal detects when precondition meets trigger condition in the process of test, after trigger condition being met, the log information of output is saved to log memory block, and the satisfied log information that is kept at log buffer zone before of trigger condition is also saved to log memory block.
Step S200, when described trigger condition is not triggered, log information is sent to described log buffer zone and stores.
Obviously, when mobile terminal is in the process of test, if trigger condition detected, be not satisfied, be also that trigger condition is not when be triggered, without current log information is sent to described log memory block, carry out persistence, but be sent to described log buffer zone, carry out buffer memory.While specifically implementing in the present invention, described log buffering is not with the same in prior art, the current log information of test generation is stored to described log buffer zone always, but is subject to the spatial cache size restriction of described log buffer zone to carry out the processing that store on deletion limit, limit.For example, when described log buffer zone is full, and described log buffer zone in chronological sequence order exists: text1, text2, text3, text4, text5 and six log information of text6, if there is again new log information text7 to input into, text7 is covered to text1, when also deleting text1, store text7.
Step S300, when described trigger condition is triggered, the log information of described log buffer stores is sent to described log memory block and stores, and the log information of output after described trigger condition is triggered is sent to described log memory block and stores.
In embodiments of the invention, when described trigger condition is triggered, first the log information of described log buffer stores is sent to described log memory block and stores, and the log information of output after simultaneously trigger condition being triggered is sent to described log memory block and stores.Now tester is kept at the log information of log buffer zone and the log information that trigger condition meets rear output before meeting in conjunction with trigger condition, can analyze the reason of reproduction problem, reaches the object of test b ug.
Embodiment further, described trigger condition is that battery electric quantity is lower than default power threshold, subscriber dialing, video playback or music.During concrete enforcement, the trigger condition that tester arranges is not limited to above-mentioned trigger condition, as long as the setting of trigger condition is the Bug for testing mobile terminal.
Embodiment further, as shown in Figure 2, in described step S200, the idiographic flow of buffer memory log information comprises:
Step S201, when described trigger condition is not triggered and the remaining cache space of described log buffer zone is greater than the byte number of current log information, current log information is sent to described log buffer zone and stores.
Obviously, when described trigger condition is not triggered and when the remaining cache space of described log buffer zone is also enough to store current log information, without the log information of storage before covering, but continue to continue in log buffer zone the current log information of storage.Each log information of storing in described log buffer zone has the corresponding stored time one by one, be also each log information all bind one storage time label.
Step S202, be not triggered and the remaining cache space of described log buffer zone is less than the byte number of current log information when described trigger condition, to storage time in described log buffer area, log information was the earliest deleted processing, and current log information is sent to described log buffer zone stores.
When current log information is continued to be stored to described log buffer zone, the remaining cache insufficient space that described log buffer zone detected is when storing current log information, delete in described log buffer zone the storage time of log information the earliest, and current log information is sent to described log buffer zone stores.Owing to not being triggered in trigger condition described in step S201 and step S202 always, therefore the log information producing is all the log information of the normal operation of mobile terminal.Now by current log information, covering the log information of morning storage time can't impact test job, and realized utilize limited storage space log buffer stores to the effective log information of test job, deleted the log information of the normal operation of the mobile terminal that repeats in a large number.
Embodiment further, as shown in Figure 3, in described step S300, the idiographic flow of trigger condition after being triggered comprises:
Step S301, when described trigger condition is triggered, by the log information of described log buffer stores by storage time sequencing be sent to successively described log memory block and store, and discharge described log buffer zone.
When described trigger condition is triggered, if continue, current log information is stored in to described log buffer zone, the log information of having stored in described log buffer zone may be covered, after thereby the log information that before causing tester not to be triggered in conjunction with described trigger condition, has stored described log buffer zone and described trigger condition are triggered, the up-to-date log information of output is found test b ug, makes test job inefficiency.In embodiments of the invention, when described trigger condition is triggered, by the log information of described log buffer stores by storage time sequencing be sent to successively described log memory block and store, discharge afterwards described log buffer zone and be convenient to test the storage log information that continues next time.
Step S302, described trigger condition is triggered after the log information of output by log information generation time sequencing, be sent to successively described log memory block and store.
In embodiment of the present invention, after described trigger condition is triggered, first the log information of described log buffer zone being sent to described log memory block stores, and then the log information of output after described trigger condition is triggered is sent to described log memory block and stores, and be by log information generation time sequencing, to be sent to successively described log memory block to store.In order to ensure described log memory block, can store above-mentioned log information, thus the spatial cache size that while specifically implementing, the memory capacity of described log memory block is set to be greater than described log buffer zone be triggered with described trigger condition after the log information of output occupy storage space sum.
Embodiment further, as shown in Figure 1, the described method based on test condition dynamic memory log also comprises:
Step S400, when described log memory block is during without residual memory space, close log and finish test by a pop-up box prompting tester.
Visible, by the method based on test condition dynamic memory log of the present invention, the trigger condition that can pre-enter according to tester is dynamically controlled the storage of log information in the process of test according to described trigger condition.When reproduction problem, can cannot not preserve effective log information because of the finite capacity of log buffer zone, greatly promote test validity.
Based on above-described embodiment, as shown in Figure 4, the present invention also provides the system based on test condition dynamic memory log, comprising:
Module 100 is set, for mobile terminal, receives tester's operational order, the trigger condition of a control log storage, the spatial cache size of log buffer zone and the memory capacity of log memory block are set; As detailed above.
The first control module 200, for when described trigger condition is not triggered, is sent to log information described log buffer zone and stores; As detailed above.
The second control module 300, for when described trigger condition is triggered, the log information of described log buffer stores is sent to described log memory block and stores, and the log information of output after described trigger condition is triggered is sent to described log memory block and stores; As detailed above.
Embodiment further, in the described system based on test condition dynamic memory log, described the first control module 200 specifically comprises:
The first control module, for not being triggered when described trigger condition and the remaining cache space of described log buffer zone is greater than the byte number of current log information, being sent to described log buffer zone by current log information and storing; As detailed above.
The second control module, for not being triggered when described trigger condition and the remaining cache space of described log buffer zone is less than the byte number of current log information, to storage time in described log buffer area, log information was the earliest deleted processing, and current log information is sent to described log buffer zone stores; As detailed above.
Embodiment further, in the described system based on test condition dynamic memory log, described the second control module 300 specifically comprises:
The 3rd control module, for when described trigger condition is triggered, by the log information of described log buffer stores by storage time sequencing be sent to successively described log memory block and store, and discharge described log buffer zone; As detailed above.
The 4th control module, is sent to successively described log memory block for the log information of output after trigger condition is triggered by log information generation time sequencing and stores; As detailed above.
Embodiment further, as shown in Figure 4, in the described system based on test condition dynamic memory log, also comprises:
Close and reminding module 400, for when described log memory block is during without residual memory space, close log and finish test by a pop-up box prompting tester; As detailed above.
In sum, the invention discloses a kind of method and system thereof based on test condition dynamic memory log, method comprises: mobile terminal receives tester's operational order, and the trigger condition of a control log storage, the spatial cache size of log buffer zone and the memory capacity of log memory block are set; When described trigger condition is not triggered, log information is sent to described log buffer zone and stores; When described trigger condition is triggered, the log information of described log buffer stores is sent to described log memory block and stores, and the log information of output after trigger condition is triggered is sent to described log memory block and stores.The invention enables in the process of the mobile test reception tester, when reproduction problem, can cannot not preserve effective log information because of the finite capacity of log buffer zone, greatly promote test validity.
Should be understood that, application of the present invention is not limited to above-mentioned giving an example, and for those of ordinary skills, can be improved according to the above description or convert, and all these improvement and conversion all should belong to the protection domain of claims of the present invention.