Summary of the invention
The technical problem to be solved in the present invention is, for the above-mentioned defect of prior art, method and the mobile terminal of data in a kind of automatic preservation volatile memory are provided, even if make mobile terminal cause mobile terminal to crash because the long serviceability temperature of user is too high, can not cause not yet canned data loss of user yet, can not cause user's loss, bring convenience to user.
The technical scheme that technical solution problem of the present invention adopts is as follows:
A method for data in automatic preservation volatile memory, wherein, comprises step:
A, periodically detect successively the current operating temperature of battery of mobile terminal and power management chip, and whether the battery of mobile terminal current operating temperature that detects of judgement or the current operating temperature of power management chip exceed predetermined temperature range;
B, in the time detecting that the current operating temperature of battery of mobile terminal or power management chip exceeds predetermined temperature range, control produce interrupt signal;
C, according to produced interrupt signal, control the data in volatile memory are saved in nonvolatile memory.
The method of data in described automatic preservation volatile memory, wherein, also comprises before described steps A;
Set in advance the predetermined temperature range of battery and the predetermined temperature range of power management chip.
In described automatic preservation volatile memory, the method for data, is characterized in that, wherein, described steps A specifically comprises:
A01, periodically detect the current operating temperature of battery of mobile terminal;
Whether the current operating temperature of the battery of mobile terminal that A02, judgement detect exceeds the predetermined temperature range of battery, proceeds to step B in the time exceeding, and proceeds to steps A 03 in the time not exceeding;
The current operating temperature of A03, detection power management chip, and judge that whether the current operating temperature of the power management chip detecting exceeds the predetermined temperature range of power management chip, proceeds to step B in the time exceeding.
The method of data in described automatic preservation volatile memory wherein, also comprises step after described step C:
After D, described data storage success, control mobile terminal display screen and show corresponding information.
The method of data in described automatic preservation volatile memory, wherein, described steps A also comprises:
A11, be provided with two sense cycle T1 and T2, and T1 < T2;
A12, with cycle T 1, battery of mobile terminal is carried out to periodic temperature detection;
A13, judge whether twice operating temperature does not all exceed the temperature range of its normal work before and after battery of mobile terminal, enters steps A 14 when all not exceeding, and once exceeds and enters step B if any;
A14, judge whether the absolute value of twice operating temperature difference exceeds predefined temperature threshold values before and after battery of mobile terminal; Proceed to steps A 15 if do not exceed, return to steps A 12 if exceed;
A15, judge whether the difference of carrying out the system time of temperature detection before and after battery of mobile terminal for twice exceeds predefined time threshold values, proceeds to steps A 16 if exceed, and returns to steps A 12 if do not exceed;
A16, sense cycle are set to T2.
The method of data in described automatic preservation volatile memory, wherein, described steps A also comprises:
A21, be provided with two sense cycle T1 and T2, and T1 < T2;
A22, with cycle T 1, power management chip is carried out to periodic temperature detection;
A23, judge whether twice operating temperature does not all exceed the temperature range of its normal work before and after power management chip, enters steps A 24 when all not exceeding, and once exceeds and enters step B if any;
A24, judge whether the absolute value of twice operating temperature difference exceeds predefined temperature threshold values before and after power management chip; Proceed to steps A 25 if do not exceed, return to steps A 22 if exceed;
A25, judge whether the difference of carrying out the system time of temperature detection before and after power management chip for twice exceeds predefined time threshold values, proceeds to steps A 26 if exceed, and returns to steps A 22 if do not exceed;
A26, sense cycle are set to T2.
A mobile terminal that adopts the method for data in described automatic preservation volatile memory, wherein, comprising:
Temperature detecting module, for periodically detecting successively the current operating temperature of battery of mobile terminal and power management chip;
Interrupt signal generation module, for judging whether the battery of mobile terminal current operating temperature that detects or the current operating temperature of power management chip exceed predetermined temperature range, in the time detecting that the current operating temperature of battery of mobile terminal or power management chip exceeds predetermined temperature range, control and generate interrupt signal;
Cache module, for reading the data of mobile terminal volatile memory, and by described data write non-volatile memory.
Described mobile terminal, wherein, described temperature detecting module comprises:
The first temperature detecting unit, for periodically detecting battery of mobile terminal current operating temperature;
The second temperature detecting unit, for periodically detecting power management chip current operating temperature.
Described mobile terminal, wherein, described interrupt signal generation module comprises:
The first interrupt signal generation unit, for judging whether the battery of mobile terminal current operating temperature detecting exceeds predetermined temperature range, in the time detecting that the current operating temperature of battery of mobile terminal exceeds predetermined temperature range, control and generate the first interrupt signal;
The second interrupt signal generation unit, for judging whether the current operating temperature of the power management chip detecting exceeds predetermined temperature range, in the time detecting that the current operating temperature of power management chip exceeds predetermined temperature range, control and generate the second interrupt signal.
Described mobile terminal, wherein, described mobile terminal also comprises;
Notification module, for when described nonvolatile memory is by after described data storage success, controls mobile terminal display screen and shows corresponding information.
Method and the mobile terminal of data in a kind of automatic preservation volatile memory provided by the present invention, whether the current operating temperature that makes the power management chip of mobile terminal can detect periodically successively battery of mobile terminal and power management chip by described method exceeds predetermined temperature range, and in the time exceeding normal range of operation, produce interrupt signal, the data in volatile memory are saved in nonvolatile memory. Adopt the method for data in automatic preservation volatile memory of the present invention and mobile terminal that user is occurred when abnormal in the long-time temperature that uses mobile terminal or mobile terminal, the data of not preserving can be preserved automatically, thereby the loss of having avoided data, provides users with the convenient.
Detailed description of the invention
For making object of the present invention, technical scheme and advantage clearer, clear and definite, developing simultaneously referring to accompanying drawing, 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.
Below in conjunction with Fig. 1, the method for data in a kind of automatic preservation volatile memory provided by the present invention is elaborated, wherein, Fig. 1 is the flow chart of steps of the preferred embodiment of the method for data in a kind of automatic preservation volatile memory provided by the invention.
First enter step 101, set in advance predetermined temperature range and the predetermined temperature range of power management chip of battery;
Before mobile terminal dispatches from the factory, set voluntarily battery and the predetermined temperature range of power management chip by the manufacturer of mobile terminal. The referential factor of its setting generally has two: one is to set according to the performance of the battery of the mobile terminal of its production and power management chip: another is the environment temperature etc. that this mobile terminal is sold to ground.
In this preferred embodiment, the predetermined temperature range of battery is set to-20 to 60 degrees Celsius, and temperature range predetermined power management chip is also set to-20 to 60 degrees Celsius.
Step 102, the sense cycle of the power management chip of mobile terminal is set;
The sense cycle of power management chip can be set by the timer of mobile terminal, described timer can be arranged on the central processing unit of mobile terminal or be arranged on power management chip, manufacturer can arrange sense cycle in the time that mobile terminal dispatches from the factory, be more preferably, mobile terminal provides the interface that arranges of sense cycle, user is arranged interface sense cycle is set by this, if think, testing result is more accurate, can the shorter sense cycle (as 5 seconds) of setup times, save the power consumption of mobile terminal if want, longer sense cycle (as 30 seconds) can be set.
Step 103, battery of mobile terminal is carried out to periodic temperature detection;
In this preferred embodiment, sense cycle is set to 5 seconds in advance, will carry out temperature detection to the battery of mobile terminal every 5 seconds.
Whether the current operating temperature of the battery of mobile terminal that step 104, judgement detect exceeds the predetermined temperature range of battery;
In this preferred embodiment, whether the current operating temperature that the power management chip of mobile terminal detects battery exceeds the predetermined temperature range of battery ,-20 to 60 degrees Celsius; If the current operating temperature of battery is lower than-20 degrees Celsius or higher than 60 degrees Celsius, described battery of mobile terminal is in temperature anomaly state, now mobile terminal easily crashes, if now user's Edit Document or the document edited are not yet preserved, in the situation that mobile terminal crashes, easily cause the loss of data;
So in the time that the current operating temperature of battery exceeds the predetermined temperature range of battery, enter step 107;
In the time that the current operating temperature of battery does not exceed the predetermined temperature range of battery, enter step 105.
Step 105, power management chip is carried out to temperature detection;
Whether the current operating temperature of the power management chip that step 106, judgement detect exceeds the predetermined temperature range of power management chip;
In actual testing process, the power management chip of mobile terminal carries out the detection of succession to described battery of mobile terminal and described power management chip, first detect the current operating temperature of battery of mobile terminal and whether exceed its predetermined temperature range, only have when it and do not exceed in the situation of the predetermined temperature range of battery, whether the current operating temperature that just can detect power management chip is in its predetermined temperature range, and power management chip detects the current operating temperature of power management chip whether between-20 to 60 degrees Celsius.
,, if exceed between-20 to 60 degrees Celsius, enter step 107;
If do not exceed between-20 to 60 degrees Celsius, return to step 103.
Step 107, mobile terminal control produce interrupt signal;
When detecting that the current operating temperature of battery of mobile terminal can produce interrupt signal while exceeding its predetermined temperature range, and in the time detecting that power management chip current operating temperature exceeds its predetermined temperature range, also can produce interrupt signal, that is to say, no matter battery current operating temperature exceeds predetermined temperature range or power management chip current operating temperature exceeds its predetermined temperature range, described power management chip all can produce interrupt signal, thereby further guarantee in the time that temperature anomaly appears in mobile terminal, can not cause the loss of storage data.
Step 108, according to produced interrupt signal, control the data in volatile memory are saved in nonvolatile memory.
In this preferred embodiment, the central processing unit of mobile terminal receives described interrupt signal, and can judge the state of mobile terminal in temperature anomaly according to described interrupt signal, the situation of its temperature anomaly may be that the current operating temperature of battery exceeds between-20 to 60 degrees Celsius or the current operating temperature of power management chip exceeds between-20 to 60 degrees Celsius, easily there is situation about crashing in mobile terminal now, for make user not yet canned data be unlikely to lose, described central processing unit is saved to the data that are stored in volatile memory in nonvolatile memory, even if mobile terminal is crashed in temperature anomaly state because of it, because central processing unit before crashing is saved to nonvolatile memory by data, data can not be lost, can not cause user's loss.
Wherein, volatile memory refers to, after mobile terminal power-off and after restarting, data are by the memory disappearing, as RAM(RandomAccessMemory, random access memory) or DRAM(DynamicRandomAccessMemory, dynamic random access memory) and SRAM(StaticRandomAccessMemory, static RAM).
And nonvolatile memory refers to after mobile terminal power-off restarting, the memory that data still can be preserved, as FLASH(FlashEEPROMMemory, flash memory).
Finally enter step 109, described nonvolatile memory by after described data storage success, control mobile terminal display screen display reminding information;
When nonvolatile memory is by after data storage success, the display screen of central processing unit control mobile terminal shows information that can call user's attention, by described information, make user recognize that mobile terminal is in temperature anomaly state, and it is likely power-off deadlock at any time, the ensuing content of operation of reminding user is likely lost, user can take certain measure according to this prompting, use or do not use mobile terminal as reduced, make degradation measure at its temperature, the inconvenience of avoiding power-off to crash bringing to user;
Wherein, described information can be set by manufacturer in the time dispatching from the factory, also can be by user according to the setting of the speech habits of oneself or use habit personalization, in this preferred embodiment, described information is: " current mobile terminal, in temperature anomaly state, may crash at any time ".
By the preferred embodiment of the method for data in above-mentioned automatic preservation volatile memory, make when mobile terminal is during in temperature anomaly state, mobile terminal can be saved to the data that are stored in volatile memory in nonvolatile memory, even if making mobile terminal power-off crashes, data can not be lost, can not cause user's loss, and mobile terminal display screen meeting display reminding information, the state of prompting user temperature anomaly, make user can obtain this state, and then can take certain measure, avoid the mobile terminal inconvenience bringing to user of crashing as far as possible.
Certainly, mobile terminal manufacturer also can be not limited to the detection order of above-mentioned preferred embodiment, for example, can first detect the current operating temperature of power management chip, the current operating temperature of battery is detected afterwards again; Also can detect the current operating temperature of battery and power management chip, manufacturer can be according to technical conditions and different purposes of design simultaneously, choose different detection order and detection mode.
Because described power management chip periodically carries out temperature detection to battery of mobile terminal and power management chip, mobile terminal extra power consumption is increased, more easily cause mobile terminal not have electricity, bring inconvenience, the present invention is for solving in temperature detection process, expend the technical problem of power consumption, propose can pass through in advance the technical scheme in two temperature detection cycles of set timer.
Because mobile terminal is the rapid drawdown that can not rise sharply in normal environment for use, if now mobile terminal is carried out to temperature detection frequently, one there is no need, and two cause the waste of mobile terminal power consumption. Therefore this preferred embodiment is according to this characteristic of mobile terminal, by mobile terminal, this temperature detecting and the front temperature once detecting compare, if difference is between the two in uniform temperature threshold values, can think that mobile terminal current operating temperature is more steady, if this steady maintenance a period of time, can reduce battery to mobile terminal and power management chip and carry out the frequency of temperature detection. Arrange like this, the power consumption can reduce mobile terminal and carry out temperature detection time, can guarantee again the accuracy of detection to mobile terminal temperature anomaly situation.
Concrete steps are as follows:
S1, be provided with two sense cycle T1 and T2, and T1 < T2;
S2, with cycle T 1, battery of mobile terminal is carried out to periodic temperature detection;
S3, judge whether twice operating temperature does not all exceed the temperature range of its normal work before and after battery of mobile terminal, enters step S4 when all not exceeding, once exceed if any to control and produce interrupt signal;
S4, judge whether the absolute value of twice operating temperature difference exceeds predefined temperature threshold values before and after battery of mobile terminal; Proceed to step S5 if do not exceed, return to step S2 if exceed;
S5, judge whether the difference of carrying out the system time of temperature detection before and after battery of mobile terminal for twice exceeds predefined time threshold values, proceeds to step S6 if exceed, and returns to step S2 if do not exceed;
S6, sense cycle are set to T2.
Below in conjunction with Fig. 2, the testing process of this preferred embodiment is elaborated, wherein, Fig. 2 is preferred embodiment flow chart of steps of battery of mobile terminal being carried out to periodicity temperature detection provided by the present invention.
First the set timer that enters step 201, mobile terminal has two sense cycle T1 and T2;
Be set to variable timer of time by timer, this timer can be set to two gears of T1 and T2, and T1 < T2, and wherein, T1 is the sense cycle of mobile terminal acquiescence;
In this preferred embodiment, T1 is set as 5 seconds, and T2 is set as 60 seconds.
The current operating temperature C1 of step 202, detection battery of mobile terminal, and obtain current system time D 1, and judge whether current operating temperature C1 exceeds the temperature range of the normal work of battery, enters step 203 if do not exceed, and enters step 204 if exceed;
Represent the current operating temperature of battery of mobile terminal with C1, the system time while representing to obtain battery current operating temperature with D1; And can carry out temperature detection to battery by the power management chip of mobile terminal, and then obtain current operating temperature and current system time;
Step 203, in the time that described timer exceedes described sense cycle T1, again detect the current operating temperature C2 of battery of mobile terminal, and obtain current system time D 2; And judge whether current operating temperature C2 exceeds the temperature range of the normal work of battery, enters step 205 if do not exceed, and enters step 204 if exceed;
Step 204, control power management chip produce interrupt signal;
The central processing unit that is mobile terminal is saved to the data in volatile memory in nonvolatile memory according to described interrupt signal, thereby even if reach mobile phone automatic shutdown, the object that also can not make the information data of not yet preserving lose.
Step 205, judge whether the absolute value of C1 and C2 difference exceeds predefined temperature threshold values;
In the time exceeding described temperature threshold values, enter step 206; In the time not exceeding described temperature threshold values, enter step 207;
Whether the absolute value that judges C1 and C2 difference is less than 2, if be less than 2, the variations in temperature that can regard as battery of mobile terminal is little, enters step 207 and further judges;
If be greater than 2, the variations in temperature that can assert battery of mobile terminal is large, in temperature unsure state, be not suitable for improving the detection frequency to battery of mobile terminal, otherwise can cause when mobile terminal is during in temperature anomaly state, because timer does not have overtimely battery not to be carried out to temperature detection, and then make mobile terminal automatic shutdown in the time that user is offhand, make not store into the generation of the event of data loss in nonvolatile memory, so it is large to work as battery of mobile terminal variations in temperature, carry out step 206, preserve current system time, carry out step 208 afterwards, also with the cycle of originally giving tacit consent to, battery is periodically detected, then carry out step 209, preserve current operating temperature, and taking the current temperature of preserved and system time as benchmark, judge the whether within the specific limits variation of current operating temperature that the next cycle obtains, return to step 203.
Step 206, preservation current system time D 1=D2;
Step 207, judge whether the difference of D2 and D1 exceeds predefined time threshold values;
The power management chip that will extend mobile terminal carries out the cycle of temperature detection to battery, need to meet two conditions, one is to meet step 205, be that variations in temperature is steady within the specific limits, another will be satisfied condition step 207, be this variations in temperature state stably, continue the regular hour;
In this preferred embodiment, the power management chip of mobile terminal need to judge that whether the difference of D2 and D1 has exceeded 60 seconds, is set to 60 seconds by described time threshold values;
If exceeded 60 seconds, the battery temperature that mobile terminal is described changes steadily, and plateau has continued the regular hour, now can extend the cycle of battery being carried out to temperature detection, thereby save the power consumption of power management chip, enter step 210, the sense cycle of acquiescence is extended, and with the cycle T 2 after extending, battery of mobile terminal is periodically detected, in the present embodiment by cycle stretch-out to 60 second, thereby save mobile terminal battery carried out the energy consumption of temperature detection.
If do not exceed 60 seconds, although illustrate that battery temperature changes steadily, but lasting time of this plateau is shorter, this plateau is fly-by-night, if now extend the temperature detection cycle of battery, cannot guarantee the accuracy of detection to mobile terminal temperature anomaly situation, so for the not yet security consideration of save data of mobile terminal, also should further detect the variation of battery temperature, also with the sense cycle T1 originally giving tacit consent to, battery of mobile terminal is carried out to temperature detection, namely step 208; Can the object now with sense cycle T1, battery being detected be to detect battery temperature to change state stably and continue the regular hour, so, enter step 209, preserve the current operating temperature of battery, and no longer preserve current system time, and judge whether current operating temperature and this current operating temperature of being preserved that the next cycle is obtained also change within the specific limits with the temperature of being preserved for benchmark.
For example, the temperature while detecting battery is for the first time 10 degrees Celsius, and system time is 13.05;
Temperature while detecting battery is for the second time 11 degrees Celsius, and system time is 13.10, and wherein, sense cycle is 5 seconds;
Known, the absolute value of twice variations in temperature difference is in 2, and variations in temperature is stably, but the difference of system time is 0.05 second, does not exceed 60 seconds, so can not extend sense cycle;
So, retain the temperature this time detecting, 11 degrees Celsius, but do not retain this system time, also carry out the judgement of next cycle taking 13.05 system time as benchmark; Until the absolute value that before and after detecting, twice battery temperature changes difference is in 2, and exceed 60 seconds compared with the time 13.05, can extend sense cycle, the sense cycle of 5 seconds is extended to 60 seconds, thereby save the energy consumption of mobile terminal.
Step 208, with sense cycle T1, battery of mobile terminal is carried out to temperature detection; Enter afterwards step 209;
Step 209, preservation current operating temperature C1=C2; Return to afterwards step 203;
Step 210, sense cycle is changed to T2 by T1;
After step 210, mobile terminal will carry out temperature detection to battery taking T2 as sense cycle, because of the T2 time longer with respect to T1, so can save certain energy consumption, for mobile terminal has been saved electric weight, when with T2, battery being carried out to periodicity while detecting, if detected when battery current operating temperature exceeds normal range of operation, mobile terminal is in producing interrupt signal, can provide a prompting interface to user, user can select to continue to trust longer cycle T 2 according to described prompting interface battery is carried out to temperature detection, also selection T1 that can be careful carries out temperature detection, certainly mobile terminal also can change to T1 by T2 automatically.
In like manner, mobile terminal also can arrange two sense cycle to power management chip, and its concrete detection mode is;
S21, be provided with two sense cycle T1 and T2, and T1 < T2;
S22, with cycle T 1, power management chip is carried out to periodic temperature detection;
S23, judge whether twice operating temperature does not all exceed the temperature range of its normal work before and after power management chip, enters step S24 when all not exceeding, once exceed if any and control power management chip and produce control signal;
S24, judge whether the absolute value of twice operating temperature difference exceeds predefined temperature threshold values before and after power management chip; Proceed to step S25 if do not exceed, return to step S22 if exceed;
S25, judge whether the difference of carrying out the system time of temperature detection before and after power management chip for twice exceeds predefined time threshold values, proceeds to step S26 if exceed, and returns to step S22 if do not exceed;
S26, sense cycle are set to T2.
The concrete mode of power management chip being carried out to temperature detection below in conjunction with Fig. 3 is elaborated, and Fig. 3 is preferred embodiment flow chart of steps of mobile terminal power management chip being carried out to periodicity temperature detection provided by the present invention.
First the set timer that enters step 301, mobile terminal has two sense cycle T1 and T2;
The current operating temperature E1 of step 302, detection power management chip, and obtain current system time F1; And judge whether current operating temperature E1 exceeds the temperature range of the normal work of battery, enters step 303 if do not exceed, and enters step 304 if exceed;
Step 303, in the time that described timer exceedes described sense cycle T1, again detect the current operating temperature E2 of power management chip, and obtain current system time F2; And judge whether current operating temperature E2 exceeds the temperature range of the normal work of battery, enters step 305 if do not exceed, and enters step 304 if exceed;
Step 304, control power management chip produce interrupt signal;
Step 305, judge whether the absolute value of E1 and E2 difference exceeds predefined temperature threshold values; In the time exceeding described temperature threshold values, enter step 306; In the time not exceeding described temperature threshold values, enter step 307;
Step 306, preservation current system time F1=F2;
Step 307, judge whether the difference of F2 and F1 exceeds predefined time threshold values;
If exceeded, enter step 310, if do not exceeded, enter step 308;
Step 308, with sense cycle T1, battery of mobile terminal is carried out to temperature detection;
Step 309, preservation current operating temperature E1=E1; And return to step 303;
Step 310, sense cycle is changed to T2 by T1;
After step 310, mobile terminal will carry out temperature detection to power management chip taking T2 as sense cycle, because of the T2 time longer with respect to T1, so can save certain energy consumption, for mobile terminal has been saved electric weight, when with T2, power management chip being carried out to periodicity while detecting, if detected when the current operating temperature of power management chip exceeds normal range of operation, mobile terminal is in producing interrupt signal, can provide a prompting interface to user, user can select to continue to trust longer cycle T 2 according to described prompting interface power management chip is carried out to temperature detection, also selection T1 that can be careful carries out temperature detection, certainly mobile terminal also can change to T1 by T2 automatically.
Power management chip is carried out to temperature detection, judge whether to extend the sense cycle to power management chip, the preferred embodiment that it realizes principle and concrete mode and please refer to Fig. 2, does not repeat them here.
Known by the preferred embodiment described in Fig. 2 and Fig. 3, the timer of mobile terminal can arrange two sense cycle, the battery of mobile terminal and the variations in temperature of power management chip be (absolute value of variations in temperature difference remains on 2 with interior) steadily, and after plateau certain time (temperature smooth change kept 60 seconds), can extend the cycle of battery and power management chip being carried out to temperature detection, in ensureing battery and power management chip carried out to temperature detecting precision, the power consumption of saving mobile terminal.
Below in conjunction with Fig. 4, the structure that adopts the mobile terminal of the method for data in described automatic preservation volatile memory is elaborated, wherein, Fig. 4 is the preferred embodiment structural representation of the mobile terminal of the method for data in the automatic preservation volatile memory described in employing provided by the invention.
As shown in Figure 4, described mobile terminal comprises:
The power management chip 401 being connected with battery 403 and central processing unit 402 is provided with on described power management chip 401:
Temperature detecting module, for periodically detecting successively the current operating temperature of battery of mobile terminal and power management chip;
Interrupt signal generation module, for judging whether the battery of mobile terminal current operating temperature that detects or the current operating temperature of power management chip exceed predetermined temperature range, in the time detecting that the current operating temperature of battery of mobile terminal or power management chip exceeds predetermined temperature range, control and generate interrupt signal;
The central processing unit 402 being connected with described power management chip 401 is provided with on described central processing unit 402:
Cache module, for reading the data of mobile terminal volatile memory, and by described data write non-volatile memory.
The volatile memory 405 and the nonvolatile memory 406 that are connected with described central processing unit 402 respectively;
Wherein, volatile memory 405 refers to, after mobile terminal power-off and after restarting, data are by the memory disappearing, as RAM(RandomAccessMemory.
And nonvolatile memory 406 refers to after mobile terminal power-off restarting, the memory that data still can be preserved, as FLASH(FlashEEPROMMemory, flash memory).
Below in conjunction with Fig. 5, temperature detecting module is described further, wherein, Fig. 5 is the functional block diagram of the preferred embodiment of temperature detecting module provided by the invention;
As shown in Figure 5, described temperature detecting module comprises:
The first temperature detecting unit 501, for periodically detecting battery of mobile terminal current operating temperature;
The second temperature detecting unit 502, for periodically detecting power management chip current operating temperature.
Further, in conjunction with Fig. 6, described interrupt signal generation module is described in further detail, wherein, Fig. 6 is the functional block diagram of the preferred embodiment of interrupt signal generation module provided by the invention.
As shown in Figure 6, described interrupt signal generation module comprises:
The first interrupt signal generation unit 601, for judging whether the battery of mobile terminal current operating temperature detecting exceeds predetermined temperature range, in the time detecting that the current operating temperature of battery of mobile terminal exceeds predetermined temperature range, control and generate the first interrupt signal;
The second interrupt signal generation unit 602, whether exceed predetermined temperature range for the current operating temperature that judges the power management chip detecting, in the time detecting that the current operating temperature of power management chip exceeds predetermined temperature range, control and generate the second interrupt signal.
Again further, on described power management chip 401, notification module is also installed, for when described nonvolatile memory is by after described data storage success, controls mobile terminal display screen and show corresponding information;
Wherein, described information is: " current mobile terminal, in temperature anomaly state, may crash at any time "; By the shown information of display screen 404, make user can understand the state of mobile terminal in temperature anomaly, can take certain measure, the inconvenience of avoiding mobile terminal to crash bringing to user.
In sum, by method and the mobile terminal of data in a kind of automatic preservation volatile memory provided by the present invention, described mobile terminal can periodically be detected the temperature of battery and power management chip, in the time detecting the current operating temperature of battery or power management chip and exceed predetermined temperature range, produce interrupt signal, central processing unit is written to the data that are stored in volatile memory in nonvolatile memory, even if now mobile terminal crashes because of temperature anomaly, the information that user not yet preserves or editing also can not be lost, can not cause user's loss, thereby facilitate user, and the display screen of mobile terminal also can display reminding information, user can obtain the situation under temperature anomaly state of mobile terminal according to information, further facilitate user.
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.