A kind of method and apparatus for updating nonvolatile memory item information
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and dress for updating nonvolatile memory item information
Put.
Background technology
NV (Non-volatile, non-volatile memory) item information refers to that each processor preserved in mobile terminal is corresponding and matches somebody with somebody
Confidence ceases.In the mobile terminal of the framework of Flashless AP+Modem, its structure is as shown in Figure 1.Modem (i.e. CP,
Communication Processor, Communication processor) permanent storage media is not configured, its OS (Operation System,
Operating system) mirror image and NV items information is all stored in forever depositing for AP (Application Processor, application processor) sides
In storage media.Modem is in running or under Modem in electric process, if NV item information has renewal, the NV items that can be updated
Information passes to AP by IPC (Inter Processor Communication, communication among processors), is then write by AP
Enter in the permanent storage media of AP sides and preserved, so that loading is used during Modem startups next time.
In existing Flashless AP+Modem frameworks, the main NV item information updating strategies using based on priority,
Different NV item information updating strategies are formulated according to the priority of NV item information, the more New Policy of NV items is to affect mobile terminal
Can be with the key factor of power consumption.
For the NV item information of high priority, Modem calibration data etc. is directed primarily to, such NV items information change is not
It is many, can produce change when mainly mobile terminal is calibrated.Because such NV items information directly influences the use of Modem, therefore
Once change needs to be updated in real time;
For the NV item information of low priority, such NV items information data can more frequent updating, and such renewal
NV items information is not to force to need persistence.For low priority NV item information updatings strategy is including following several:
Update during shutdown:When the NV items information of all low priorities is until system closedown or into offline mode just more
Newly;
Timing updates:Intervalometer is enabled, is updated within a certain period of time;
Do not update:Never update low priority NV item information.
During the present invention is realized, inventor has found that prior art at least has problems with:
In for low priority NV item information updating strategies, updating during shutdown can increase shutdown and into offline mode
Time, reduce the experience of user;Timing updates can frequently wake up AP, increase the consumption of system;Not updating then can be because low preferential
The disappearance of level NV item information and update again, cause to extend start or close the time that the i.e. registered network of net is searched after offline mode,
Reduce the experience of user.
The content of the invention
In order to improve the renewal efficiency of renewal NV item information and avoid renewal NV items information from reducing lacking for Consumer's Experience
Fall into, embodiments provide a kind of method and apparatus of renewal nonvolatile memory item information.The technical scheme is as follows:
The embodiment of the present invention proposes a kind of method of renewal nonvolatile memory item information, including:
Receive nonvolatile memory item NV item fresh information;
Obtain the current state of terminal;
According to the current state of the NV items fresh information, the terminal and the corresponding NV of the SOT state of termination for pre-setting
The update mode of item fresh information, to the NV items fresh information operation is updated.
The embodiment of the present invention also proposed a kind of device of renewal nonvolatile memory item information, including:
Receiver module, for receiving nonvolatile memory item NV item fresh information;
Acquisition module, the state current for obtaining terminal;
First update module, for according to the current state of the NV items fresh information, the terminal and pre-setting
The corresponding NV items fresh information of the SOT state of termination update mode, operation is updated to the NV items fresh information.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:By arranging in different conditions to terminal
The update mode of corresponding NV items fresh information, effectively reduces when fixed mode NV items fresh information is returned and writes the prolongation for causing
The problem of unused time, and active wake-up system cause increase system power dissipation problem, and reduce because NV items update believe
Breath loses the start for causing and searches the slow problem of net.Improve and update the efficiency of NV item fresh informations, and improve the experience of user.
Description of the drawings
Technical scheme in order to be illustrated more clearly that the embodiment of the present invention, below will be to making needed for embodiment description
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, can be obtaining other according to these accompanying drawings
Accompanying drawing.
Fig. 1 is the structural representation of the Flashless AP+Modem frameworks provided in prior art;
Fig. 2 is the schematic flow sheet of the method for the renewal nonvolatile memory item information provided in the embodiment of the present invention 1;
Fig. 3 is the schematic flow sheet of the method for the renewal nonvolatile memory item information provided in the embodiment of the present invention 2;
Fig. 4 is the structural representation of the device of the renewal nonvolatile memory item information provided in the embodiment of the present invention 3.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Embodiment 1
Referring to Fig. 2, the embodiment of the present invention proposes a kind of method of renewal nonvolatile memory item information, including:
Step 201:Receive nonvolatile memory item NV item fresh information;
Step 202:Obtain the current state of terminal;
Step 203:According to the current state of the NV items fresh information, the terminal and the SOT state of termination for pre-setting
The update mode of corresponding NV items fresh information, to the NV items fresh information operation is updated.
The embodiment of the present invention has by the update mode to terminal in the corresponding NV items fresh information of different conditions setting
Effect reduces the problem of the prolongation unused time caused during fixed mode NV items fresh information write-back, and actively wakes up system
The problem of the increase system power dissipation for causing, and reduce because the slow problem of net is searched in the start that NV items fresh information loss is caused.Carry
It is high to update the efficiency of NV item fresh informations, and improve the experience of user.
Embodiment 2
Referring to Fig. 3, the embodiment of the present invention proposes a kind of method of renewal nonvolatile memory item information, is in embodiment 1
On the basis of improve, including:
Step 301:Modem receives NV item fresh informations.
Update content and the priority of the NV item fresh informations are carried in NV item fresh informations.Wherein, NV items update letter
The priority of breath is corresponding with what update mode was carried out when NV items fresh information updates.Due in different update mode, some
Update mode with the NV item fresh informations of low priority with a certain discrimination can be treated high priority.
Step 302:Terminal is configured according to state model set in advance to being presently in state.
Specifically, the embodiment of the present invention is the NV items more New Policy for being based on the SOT state of termination, therefore pre-defines four NV items
The state that fresh information updates:Align mode, charged state, normal operating conditions, resting state.Various states can and be deposited,
A state set is included in terminal, terminal can be added into the state in the state set when being in certain state, work as state
During change, then the state is removed from state set.For example when terminal is in align mode, can also simultaneously in charging
State.Can be that condition adjudgement enters to updating by whether being identified in triggering state or cancellation state to various states
Row is distinguished.The different SOT states of termination are distinguished, both can ensure that the NV items fresh information of limit priority can timely be updated,
And the NV items fresh information of low priority different conditions point situation can be updated according to residing for its terminal at that time.
It is below the trigger condition of activation and the setting of every kind of state:
Align mode:
When the calibration command information that application processor AP or debugging terminal send is received, align mode is added into into institute
In stating the state set of terminal;After calibration terminates, the align mode is removed from the state set of the terminal.
Align mode is usually to produce in terminal production process, is that terminal is wirelessly sent out before terminal is dispatched from the factory
The adjustment process that radio frequency rate, received signal strength etc. are carried out.The NV items for producing high priority are updated during calibration, therefore is now connect
The update mode for receiving NV item fresh informations is real-time update, to ensure that the NV items fresh information of high priority can not be lost
Lose.Further, if receiving the NV item fresh informations of low priority, under align mode, real-time update is similarly carried out.
The judgement of align mode is carried out by Modem sides.When system is calibrated, AP or test terminal can items
Modem sends calibration command, i.e. AP or debugging terminal sends AT orders or correlation RPC (Remote by IPC interfaces to Modem
Procedure Call Protocol, remote procedure call protocol) call instruction, Modem receives and will calibrate after calibration command shape
State is added in state set, and carries out dependent correction operation;After the completion of Modem calibrations, Modem is by align mode from state
Remove in set.
Charged state:
When the charge information of AP transmissions is received, charged state is added in the state set of the terminal;When connecing
When information is cancelled in the charging for receiving AP transmissions, the charged state is removed from the state set of the terminal.
Charged state is the charging that terminal is carrying out battery, and system charges to be controlled by AP, the insertion of charger or
Extract, all detected by AP, Modem cannot then detect whether terminal is being charged.Therefore the triggering of charged state
Need to be assisted to complete by AP with cancelling.When user inserts charger, AP can detect system and be charged, and AP leads to
Cross IPC channel and notify that now terminal is charged Modem to Modem transmission charge informations, then Modem adds charged state
In adding state set;When user extracts charger, AP can detect charger and extract, then AP passes through IPC channel to Modem
Send charging cancellation information and notify that Modem now extract by charger, then Modem removes charged state from state set.
AP normal operating conditions:
When the wake-up information sent after receiving AP and being waken up by external event, AP normal operating conditions is added into described
In the state set of terminal, AP resting states are removed from the state set of the terminal.
AP sleep states:
When the dormancy information that AP sends into after resting state is received, the AP resting states are added into into the end
In the state set at end, the AP normal operating conditions is removed from the state set of the terminal.
AP normal operating conditions and AP sleep states are controlled by AP, therefore AP normal operating conditions and AP sleep states
Triggering and message need to be assisted to complete by AP.
When AP is in sleep state, waken up (for example by external event:User carries out the operation such as button), AP initialization
IPC communication interfaces, and notify that Modem enters normal mode of operation to Modem transmission wake-up information by IPC channel, Modem is received
AP normal operating conditions is added in state set to after message, AP resting states are removed from state set.
When AP is prepared to enter into sleep state, dormancy information is sent to Modem by IPC channel, Modem receives message
Afterwards, AP resting states are added in state set, AP normal operating conditions is removed from state set.
Further, because various states may and be deposited, it is therefore desirable to the priority of each state is arranged, by excellent
The judgement of first level height obtains the state that terminal is currently at.Wherein, the priority of align mode is higher than charged state, charging shape
The priority of state is higher than normal operating conditions, and the priority of normal operating conditions is higher than resting state.
It should be noted that this step performed before step 301 can also, can equally reach identical effect.Step
Rapid exchange, also should fall under the scope of the present invention.
Modem obtains the current state of terminal.
Further, the priority of the NV items fresh information is obtained.Because various states can and be deposited, therefore obtaining
During terminal current state, after needs are contrasted by the priority for state being true state, the state of highest priority is selected
As the current state of terminal.Wherein, state is the state for very then illustrating current state already at triggering.
Wherein Modem obtains the current state of terminal and can be specially:
Step 3031:Modem obtains all of state in the SOT state of termination set.
Wherein, the state in the SOT state of termination set includes one or more in following state:Align mode, charging
State, AP normal operating conditions, AP resting states;The priority of the align mode is higher than the charged state, the charging
The priority of state is higher than the AP normal operating conditions, and the priority of the AP normal operating conditions is higher than the AP dormancy shape
State;State in the SOT state of termination set can timely be updated to the NV items fresh information for ensureing limit priority.
Step 3032:According to the priority of all of state in the SOT state of termination set, the shape of highest priority is set
State is used as the current state of the terminal.
Modem is according to the NV items fresh information, the current state of the terminal and the SOT state of termination pair for pre-setting
The update mode of the NV item fresh informations answered, to the NV items fresh information operation is updated.
According to the update mode of the corresponding NV items fresh information of the current state of terminal, NV item fresh informations are updated
Operation.After Modem determines the update mode of current NV items fresh information, NV items fresh information is transmitted by IPC channel
To AP, being then written in the permanent storage media of AP outfits by AP carries out persistence, to load during Modem startups next time
Use.Wherein, when terminal is charged state, the priority according to NV item fresh informations is needed, respectively to limit priority
The information of information and other priority is processed respectively, therefore also needs to obtain the NV item fresh informations when terminal is charged state
Priority.
Therefore, Modem is according to the NV items fresh information, the current state of the terminal and the terminal shape for pre-setting
The update mode of the corresponding NV items fresh information of state, operation is updated to the NV items fresh information can be specially:
Step 3041:When the current state of the terminal is align mode, all NV items fresh informations are carried out in real time more
New operation;
Step 3042:When the current state of the terminal is charged state, the preferential of the NV items fresh information is obtained
Level, limit priority NV items fresh information carries out real-time update operation, and it is fixed that other NV items fresh informations are carried out according to preset period of time
Shi Gengxin is operated;
Step 3043:When the current state of the terminal is AP normal operating conditions, all NV items fresh informations are carried out
Real-time update is operated;
Step 3044:When the current state of the terminal is AP resting states, all NV items fresh informations are protected
Deposit, be not updated operation.
Step 305:After the terminal is waken up by AP resting states, all presence in the SOT state of termination set are judged
The priority of state, according to the update mode of the corresponding NV items fresh information of the state of highest priority, the institute to the preservation
There are NV item fresh informations to be updated operation.
Because under resting state, terminal receives NV items fresh information and real-time update is not carried out to it, Modem will can connect
The NV item fresh informations for receiving are preserved.If being waken up to AP when user operates to terminal or user being charged to insertion
Device is charged or receives the calibration command that debugging middle-end sends, and terminal can proceed to other states, then sentence from resting state
The priority of the state of all presence in the disconnected now state set of terminal, according to the corresponding NV items of the state of highest priority more
All NV items fresh informations of the preservation are updated operation by the update mode of fresh information.
The embodiment of the present invention has by the update mode to terminal in the corresponding NV items fresh information of different conditions setting
Effect is reduced writes the problem of the prolongation unused time caused when fixed mode NV items fresh information is returned, and actively wakes up system
The problem of the increase system power dissipation for causing, and reduce because the slow problem of net is searched in the start that NV items fresh information loss is caused.Carry
It is high to update the efficiency of NV item fresh informations, and improve the experience of user.
Embodiment 3
Referring to Fig. 4, the embodiment of the present invention proposes a kind of device of renewal nonvolatile memory item information, including:
It should be noted that the device in the embodiment of the present invention is the Modem in mobile terminal.
Receiver module 401, for receiving nonvolatile memory item NV item fresh information;
Acquisition module 402, the state current for obtaining terminal;
First update module 403, for setting according to the current state of the NV items fresh information, the terminal and in advance
The update mode of the corresponding NV items fresh information of the SOT state of termination put, to the NV items fresh information operation is updated.
In a specific embodiment, the acquisition module 402, specifically includes:
Acquiring unit 4021, for obtaining the SOT state of termination set in all of state;Wherein, the SOT state of termination collection
State in conjunction includes one or more in following state:Align mode, charged state, AP normal operating conditions, AP dormancy
State;The priority of the align mode is higher than the charged state, and the priority of the charged state is normal higher than the AP
Working condition, the priority of the AP normal operating conditions is higher than the AP resting states;Shape in the SOT state of termination set
State can timely be updated to the NV items fresh information for ensureing limit priority;
Setting unit 4022, for according to the priority of all of state in the SOT state of termination set, arranging priority
Highest state is used as the current state of the terminal.
First update module 403, specifically includes:
First updating block 4031, for when the current state of the terminal is align mode, all NV items to update letter
Breath carries out real-time update operation;
Second updating block 4032, for when the current state of the terminal is charged state, obtaining the NV items more
The priority of fresh information, limit priority NV items fresh information carries out real-time update operation, and other NV items fresh informations are according to pre-
If the period is timed renewal operation;
3rd updating block 4033, for when the current state of the terminal be AP normal operating conditions when, all NV items
Fresh information carries out real-time update operation;
4th updating block 4034, for when the current state of the terminal be AP resting states when, by all NV items more
Fresh information is preserved, and is not updated operation.
Described device also includes:
Second update module 404, for after the terminal is waken up by AP resting states, judging the SOT state of termination collection
The priority of the state of all presence in conjunction, according to the update mode of the corresponding NV items fresh information of the state of highest priority,
Operation is updated to all NV items fresh informations of the preservation.
First state processing module 405, for when the calibration command for receiving application processor AP or debugging terminal transmission
During information, align mode is added in the state set of the terminal;After calibration terminates, by the align mode from described
Remove in the state set of terminal;
Second status processing module 406, for when the charge information of AP transmissions is received, charged state being added into into institute
In stating the state set of terminal;When information is cancelled in the charging for receiving AP transmissions, by the charged state from the terminal
Remove in state set;
Third state processing module 407, for when after receiving AP and being waken up by external event send wake-up information when, will
AP normal operating conditions is added in the state set of the terminal, and AP resting states are moved from the state set of the terminal
Remove;
4th status processing module 408, for when the dormancy information that AP sends into after resting state is received, by institute
State AP resting states to be added in the state set of the terminal, by the AP normal operating conditions from the state set of the terminal
Remove in conjunction.
The embodiment of the present invention has by the update mode to terminal in the corresponding NV items fresh information of different conditions setting
Effect is reduced writes the problem of the prolongation unused time caused when fixed mode NV items fresh information is returned, and actively wakes up system
The problem of the increase system power dissipation for causing, and reduce because the slow problem of net is searched in the start that NV items fresh information loss is caused.Carry
It is high to update the efficiency of NV item fresh informations, and improve the experience of user.
One of ordinary skill in the art will appreciate that realizing all or part of step of above-described embodiment can pass through hardware
To complete, it is also possible to which the hardware that correlation is instructed by program is completed, and described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read only memory, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, not to limit the present invention, all spirit in the present invention and
Within principle, any modification, equivalent substitution and improvements made etc. should be included within the scope of the present invention.