CN102096612A - Embedded type equipment parameter storing method and device - Google Patents

Embedded type equipment parameter storing method and device Download PDF

Info

Publication number
CN102096612A
CN102096612A CN200910242685XA CN200910242685A CN102096612A CN 102096612 A CN102096612 A CN 102096612A CN 200910242685X A CN200910242685X A CN 200910242685XA CN 200910242685 A CN200910242685 A CN 200910242685A CN 102096612 A CN102096612 A CN 102096612A
Authority
CN
China
Prior art keywords
address
parameter
value
preserving
zone bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN200910242685XA
Other languages
Chinese (zh)
Inventor
郭锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing PKU Founder Broadband Network Technology Co., Ltd.
Original Assignee
Beijing Pku Founder Broadband Network Technology Co Ltd
Peking University Founder Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Pku Founder Broadband Network Technology Co Ltd, Peking University Founder Group Co Ltd filed Critical Beijing Pku Founder Broadband Network Technology Co Ltd
Priority to CN200910242685XA priority Critical patent/CN102096612A/en
Publication of CN102096612A publication Critical patent/CN102096612A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The embodiment of the invention discloses an embedded type equipment parameter storing method and device, relating to the field of embedded equipment and ensuring that system parameters are not lost so that a system can normally and reliably operate when in power failure or re-starting. The method comprises the following steps of: setting a first address and a second address in an internal storage space of a flash memory, wherein the first address and the second address are used for storing parameters of the embedded type equipment and respectively storing a bit zone used for marking whether the parameters are effective currently; when the parameters of the embedded type equipment, dynamically synchronously accessed in the flash memory, are changed and required to be stored, selecting an address with the bit zone value being an ineffective value from the first address and the second address as an address for storing the changed parameters according to the bit zone; erasing the parameters in the selected address, and storing the changed parameters in the selected address. The embodiment of the invention is mainly used in a process of protecting the parameters of the embedded type equipment.

Description

Embedded device parameter store method and device
Technical field
The present invention relates to the embedded device field, relate in particular to a kind of embedded device parameter store method and device.
Background technology
In embedded system, system need use and preserve when controlling and be provided with or optimum parameters.If operational factor only is stored in RAM (Random Access Memory, the random access memory) district of single-chip microcomputer, then these important parameters will be lost in power down or when restarting by system, cause system normally not move.In order to address the above problem, guarantee control system normally, operation reliably, in the prior art these operational factors are kept among the electricity erasable memorizer flash (flash memory) of enough capacity, when using, take out and send to RAM being kept at these parameters among the flash, thus the assurance system can be normally in power down or when restarting, move reliably.
In the process of carrying out the above-mentioned parameter preservation, the inventor finds that there are the following problems at least in the prior art: flash storage data characteristic is, before carrying out write operation, at first want earlier the data erase of having stored among the flash to be fallen, at this time just there is a problem, if the content of flash has been wiped, and mistake has appearred when writing flash, original like this configuration parameter has just been lost, the configuration parameter of newly writing does not write, cause system can not be normally in power down or when restarting, operation reliably.
Summary of the invention
Embodiments of the invention provide a kind of embedded device parameter store method and device, guarantee that systematic parameter do not lose, thus make system can be normally in power down or when restarting, move reliably.
For achieving the above object, embodiments of the invention adopt following technical scheme:
A kind of embedded device parameter store method comprises:
In the memory headroom of flash memory, be provided for preserving first address and second address of embedded device parameter, also preserve respectively in described first address and second address and be used to indicate the current whether effectively zone bit of described parameter;
When the embedded device parameter in the Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit;
The described parameter of choosing in the address is wiped, and described variation back parameter is saved in described choosing in the address.
A kind of embedded device parameter save set comprises:
Whether effectively the address setting unit is used for being provided for preserving at the memory headroom of flash memory first address and second address of embedded device parameter, also preserve respectively in described first address and second address to be used to indicate the current zone bit of described parameter;
Choose the unit, be used for when the embedded device parameter of Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit;
Erase unit is used for the described parameter of choosing in the unit selection address is wiped;
Preserve the unit, be used for described variation back parameter is saved in the described address of choosing unit selection.
In the technical solution of the present invention, two addresses are set in order to preserve parameter in flash memory, and in the address of described preservation parameter, preserve one and be used to indicate the current whether effectively zone bit of parameter in this address, when parameter need be preserved, choose the current invalid address of parameter in the address according to described sign place value, so that described variation back parameter is saved in the described address of choosing; Compared with prior art, in the technical solution of the present invention, when the embedded device parameter in the Synchronous Dynamic Random Access Memory changes the needs preservation, described parameter of need preserving is saved in the address that parameter current do not using, because described current being in of choosing in the address of parameter do not have user mode, even if in the process of preserving described parameter, raw parameter in this address is wiped, preserve the not success of described parameter, and the current parameter of using is not wiped, keep original state, guaranteed that systematic parameter do not lose, thereby make system in power down or can be normal when restarting, operation reliably.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the embodiment of the invention 1 an embedded device parameter store method process flow diagram;
Fig. 2 is the embodiment of the invention 2 embedded device parameter store method process flow diagrams;
Fig. 3 is the embodiment of the invention 3 embedded device parameter save set composition frame charts;
Fig. 4 is 4 one kinds of embedded device parameters of embodiment of the invention save set composition frame chart;
Fig. 5 is the embodiment of the invention 4 another kind of embedded device parameter save set composition frame charts.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Embodiment 1
The embodiment of the invention provides a kind of embedded device parameter store method, and as shown in Figure 1, this method comprises:
101, in the memory headroom of flash memory, be provided for preserving first address and second address of embedded device parameter, also preserve respectively in described first address and second address and be used to indicate whether effectively zone bit of described parameter.
Wherein, being provided with of described first address and second address can specifically be provided with according to user's demand, for example, the first address Address1=0x80000000, the second address Address2=0x90000000, but the size of described parameter can not surpass Address1-Address2=0x10000000 byte.
102, when the embedded device parameter in the Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit.Described sign place value is that invalid value shows that the parameter of preserving in this address is current and is not used, and described sign place value is that effective value shows that the parameter of preserving in this address is current and is used.
Wherein, described sign place value can be according to user's use habit setting, and the effective value of this zone bit and invalid value also can be according to user's custom settings, and the embodiment of the invention does not limit this; For example, it is the value of one 16 system that described sign place value is set, and 0x5a is set is effective value, and the value except 0x5a is all thought invalid value; But when described sign place value is the value of one 16 system,, therefore when described sign place value is set, generally do not use 0x00 and 0xff two values in order to be different from default value because 0x00 and two values of 0xff are traditionally arranged to be the default value of system.
103, the described parameter of choosing in the address is wiped, and described variation back parameter is saved in described choosing in the address.
In the embodiment of the invention, two addresses are set in order to preserve parameter in flash memory, and in the address of described preservation parameter, preserve one and be used to indicate the current whether effectively zone bit of parameter in this address, when parameter need be preserved, choose the current invalid address of parameter in the address according to described sign place value, so that described variation back parameter is saved in the described address of choosing; Compared with prior art, in the embodiment of the invention, when the embedded device parameter in the Synchronous Dynamic Random Access Memory changes the needs preservation, described parameter of need preserving is saved in the address that parameter current do not using, because described current being in of choosing in the address of parameter do not have user mode, even if in the process of preserving described parameter, raw parameter in this address is wiped, preserve the not success of described parameter, and the current parameter of using is not wiped, keep original state, guaranteed that systematic parameter do not lose, thereby make system in power down or can be normal when restarting, operation reliably.
Embodiment 2
The embodiment of the invention provides a kind of embedded device parameter store method, and as shown in Figure 2, this method comprises:
201, in the memory headroom of flash memory, be provided for preserving first address and second address of embedded device parameter, also preserve respectively in described first address and second address and be used to indicate whether effectively zone bit of described parameter.
Wherein, being provided with of described first address and second address can specifically be provided with according to user's demand, for example, the first address Address1=0x80000000, the second address Address2=0x90000000, but the size of described parameter can not surpass Address1-Address2=0x10000000 byte.
Wherein, described embedded device parameter and zone bit are kept in described first address and second address with the form of structure member variable; Before being saved in described parameter and zone bit in the described address, need write structure, and the described structure of writing stated in code with the form of global variable, this global variable is kept at SDRAM (Synchronous Dynamic Random Access Memory, Synchronous Dynamic Random Access Memory); The member variable that comprises embedded device parameter and described zone bit in the described structure, the particular type of described structure body weight member variable can specifically be provided with as the case may be by the user, the embodiment of the invention does not limit this, for example: define a PARA_INFO_S structure, be specially:
Struct?PARA_INFO_S
{
Int flag; // zone bit
Int num; // parameter
Char value; // parameter
......
}。
202, when the embedded device parameter in the Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit.Described sign place value is that invalid value shows that the parameter of preserving in this address is current and is not used, and described sign place value is that effective value shows that the parameter of preserving in this address is current and is used.
Wherein, described according to described zone bit from described first address and second address, the address that to choose described sign place value be invalid value comprises as preserving the described address that changes the back parameter:
Read the value of described zone bit in described first address and second address;
If the sign place value of described first address of reading is an effective value, then choose described second address as preserving the described address that changes the back parameter;
If the sign place value of described second address of reading is an effective value, then choose described first address as preserving the described address that changes the back parameter;
If the sign place value of described first address of reading and the sign place value of described second address all be invalid value, then choose arbitrary address in described first address and described second address as preserving the described address of parameter afterwards that changes.
Wherein, described sign place value can be according to user's use habit setting, and the effective value of this zone bit and invalid value also can be according to user's custom settings, and the embodiment of the invention does not limit this; For example, it is the value of one 16 system that described sign place value is set, and 0x5a is set is effective value, and the value except 0x5a is all thought invalid value; But when the value of described zone bit is the value of one 16 system,, therefore when the value of described sign is set, generally do not use 0x00 and 0xff two values in order to be different from default value because 0x00 and two values of 0xff are traditionally arranged to be the default value of system.
And described embedded device parameter in Synchronous Dynamic Random Access Memory changes when needing to preserve, if there are hold-over command or button in system, can when the user wishes to preserve, call packaged preservation function, but inventive embodiments does not limit to this.
203, the described parameter of choosing in the address is wiped, and described variation back parameter is saved in described choosing in the address.
204, judge described variations back parameter is saved in describedly whether successfully to choose the address; If judge described variation back parameter is saved in the described address success of choosing, then execution in step 205; If judge that described variation back parameter is saved in the described address of choosing to get nowhere, then execution in step 207;
205, the described sign place value of choosing the address is set to effective value, in the time of need using described parameter with convenient system, so that operate accordingly according to described sign place value.
206, the parameter of preserving in another address in the described flash memory space is wiped, and the sign place value of described another address is set to invalid value, so that operate accordingly according to the value of described zone bit.
207, withdraw from the preservation of described parameter.
Further, when needs use the embedded device parameter that is kept in the described flash memory,,, need realize reading of parameter according to following method in order to obtain correct parameter owing to comprise the address of two stored parameters in the described flash memory:
Obtain described parameter according to described zone bit;
The described parameter of obtaining is duplicated the described parameter that obtains duplicating;
The described parameter of duplicating is sent to described Synchronous Dynamic Random Access Memory.
Wherein, describedly obtain described parameter according to described zone bit and comprise: the value that reads described zone bit in described first address and second address; If the sign place value of described first address of reading is an effective value, then from described first address, obtain described parameter; If the sign place value of described second address of reading is an effective value, then from described second address, obtain described parameter; If the sign place value of described first address of reading and the sign place value of described second address all are effective value, then from described first address or described second address, obtain described parameter; If the sign place value of described first address and the sign place value of described second address all are invalid value, then will use default parameters as described parameter.
In the embodiment of the invention, two addresses are set in order to preserve parameter in flash memory, and in the address of described preservation parameter, preserve one and be used to indicate the current whether effectively zone bit of parameter in this address, when parameter need be preserved, choose the current invalid address of parameter in the address according to the value of described zone bit, so that described variation back parameter is saved in the described address of choosing; Compared with prior art, in the embodiment of the invention, when the embedded device parameter in the Synchronous Dynamic Random Access Memory need be preserved, described parameter of need preserving is saved in the address that parameter current do not using, because described current being in of choosing in the address of parameter do not have user mode, even if in the process of preserving described parameter, raw parameter in this address is wiped, preserve the not success of described parameter, and the current parameter of using is not wiped, keep original state, guaranteed that systematic parameter do not lose, thereby make system in power down or can be normal when restarting, operation reliably.
Further, after the method for the preservation parameter of the employing embodiment of the invention, because when preserving variation back parameter, as if preserving successfully, then the sign place value of described address is set to effectively, and be not used in the sign place value that preserve to change the back argument address be set to invalid; If preserve when getting nowhere, the sign place value of the parameter corresponding address that maintenance is being used is effective value; Therefore by above-mentioned setting, change back parameter success or not no matter preserve, it is complete can both keeping in the described flash memory in two addresses a parameter in the address being arranged, and has guaranteed that systematic parameter do not lose, thus make system can be normally in power down or when restarting, operation reliably; After needs used parameter in the described flash memory, according to the parameter in the described zone bit address that to choose described sign place value be effective value, the system that just can realize can be normally in power down or when restarting, operation reliably.
Embodiment 3
The embodiment of the invention provides a kind of embedded device parameter save set, and as shown in Figure 3, this device comprises: address setting unit 31, choose unit 32, erase unit 33 and preserve unit 34.
Whether effectively address setting unit 31 is used for being provided for preserving at the memory headroom of flash memory first address and second address of embedded device parameter, also preserve respectively in described first address and second address to be used to indicate described parameter zone bit; Wherein, being provided with of described first address and second address can specifically be provided with according to user's demand, for example, the first address Address1=0x80000000, the second address Address2=0x90000000, but the size of described parameter can not surpass Address1-Address2=0x10000000 byte.
Choose unit 32, be used for when the embedded device parameter of Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit; Described sign place value is that invalid value shows that the parameter of preserving in this address is current and is not used, and described sign place value is that effective value shows that the parameter of preserving in this address is current and is used.Wherein, the value of described zone bit can be according to user's use habit setting, and the effective value of this zone bit and invalid value also can be according to user's custom settings, and the embodiment of the invention does not limit this; For example, the value that described zone bit is set is the value of one 16 system, and 0x5a is set is effective value, and the value except 0x5a is all thought invalid value; But when the value of described zone bit is the value of one 16 system,, therefore when the value of described sign is set, generally do not use 0x00 and 0xff two values in order to be different from default value because 0x00 and two values of 0xff are traditionally arranged to be the default value of system.
Erase unit 33 is used for the described parameter of choosing in the address unit 32 of choosing is wiped; Preserve unit 34, be used for described variation back parameter is saved in the described address that unit 32 is chosen of choosing.
In the embodiment of the invention, two addresses are set in order to preserve parameter in flash memory, and in the address of described preservation parameter, preserve one and be used to indicate the current whether effectively zone bit of parameter in this address, when parameter need be preserved, choose the current invalid address of parameter in the address according to described sign place value, so that described variation back parameter is saved in the described address of choosing; Compared with prior art, in the embodiment of the invention, when the embedded device parameter in the Synchronous Dynamic Random Access Memory need be preserved, described parameter of need preserving is saved in the address that parameter current do not using, because described current being in of choosing in the address of parameter do not have user mode, even if in the process of preserving described parameter, raw parameter in this address is wiped, preserve the not success of described parameter, and the current parameter of using is not wiped, keep original state, guaranteed that systematic parameter do not lose, thereby make system in power down or can not be normal when restarting, operation reliably.
Embodiment 4
The embodiment of the invention provides a kind of embedded device parameter save set, and as shown in Figure 4, this device comprises: address setting unit 41, choose unit 42, erase unit 43, preserve unit 44, judging unit 45 and sign unit 46 is set.
Whether effectively address setting unit 41 is used for being provided for preserving at the memory headroom of flash memory first address and second address of embedded device parameter, also preserve respectively in described first address and second address to be used to indicate described parameter zone bit; Wherein, being provided with of described first address and second address can specifically be provided with according to user's demand, for example, the first address Address1=0x80000000, the second address Address2=0x90000000, but the size of described parameter can not surpass Address1-Address2=0x10000000 byte.
Wherein, described embedded device parameter and zone bit are kept in described first address and second address with the form of structure member variable; Before being saved in described parameter and zone bit in the described address, need writing structure, and the described structure of writing is stated in code that with the form of global variable this global variable is kept in the Synchronous Dynamic Random Access Memory; The member variable that comprises embedded device parameter and described zone bit in the described structure, the particular type of described structure body weight member variable can specifically be provided with as the case may be by the user, and the embodiment of the invention does not limit this.
Choose unit 42, be used for when the embedded device parameter of Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit; Described sign place value is that invalid value shows that the parameter of preserving in this address is current and is not used, and described sign place value is that effective value shows that the parameter of preserving in this address is current and is used.
Erase unit 43 is used for the described parameter of choosing in the address unit 42 of choosing is wiped; Preserve unit 44, be used for described variation back parameter is saved in the described address that unit 43 is chosen of choosing.
Judging unit 45, be used for described variation back parameter is saved in described choose unit 43 and choose the address after, judge described variations back parameter is saved in the described whether success of address of choosing; Judge at described judging unit 45 described variations back parameter is saved in the described address of choosing when successful that zone bit is provided with unit 46 and is used for the described sign place value of choosing the address and is set to effective value; Described erase unit 43 also is used for the parameter of preserving in another address of described flash memory space is wiped; Described zone bit is provided with the sign place value that unit 46 also is used for described another address and is set to invalid value, so that operate accordingly according to the value of described zone bit.
Judge at described judging unit 45 described variations back parameter to be saved in described when choosing the address and getting nowhere, withdraw from the preservation of described parameter.
Wherein, the described unit 42 of choosing comprises: read module 421 and choose module 422.
When the described unit 42 of choosing changes when need preserving in described parameter, according to described zone bit from described first address and second address, the value of described zone bit in described first address and second address is at first read when preserving the described address that changes the back parameter in the address that to choose described sign place value be invalid value by described read module 421; If the sign place value of first address that described read module 421 reads is an effective value, then chooses module 422 and choose described second address as preserving the described address that changes the back parameter; If the sign place value of second address that described read module 421 reads is an effective value, then chooses module 422 and choose described first address as preserving the described address that changes the back parameter; If the sign place value of described read module 421 first address of reading and the sign place value of described second address all be invalid value, then choose module 422 and choose arbitrary address in described first address and described second address as preserving the described address of parameter afterwards that changes.
Wherein, described sign place value can be according to user's use habit setting, and the effective value of this zone bit and invalid value also can be according to user's custom settings, and the embodiment of the invention does not limit this; For example, the value that described zone bit is set is the value of one 16 system, and 0x5a is set is effective value, and the value except 0x5a is all thought invalid value; But when the value of described zone bit is the value of one 16 system,, therefore when the value of described sign is set, generally do not use 0x00 and 0xff two values in order to be different from default value because 0x00 and two values of 0xff are traditionally arranged to be the default value of system.
And described embedded device parameter in Synchronous Dynamic Random Access Memory changes when needing to preserve, if there are hold-over command or button in system, can when the user wishes to preserve, call packaged preservation function, but inventive embodiments does not limit to this.
Further, when needs use the embedded device parameter that is kept in the described flash memory, owing to comprise the address of two stored parameters in the described flash memory, in order to obtain correct parameter, as shown in Figure 5, this device also comprises: acquiring unit 47, copied cells 48 and transmitting element 49.
Acquiring unit 47 is used for obtaining described parameter according to described zone bit; After obtaining described parameter, copied cells 48 is used for the described parameter that acquiring unit 47 obtains is duplicated the described parameter that obtains duplicating; Transmitting element 49 is used for the described parameter that described copied cells 48 duplicates is sent to Synchronous Dynamic Random Access Memory, so that make system finish corresponding operation according to described parameter.
Wherein, described acquiring unit 47 comprises: second read module 471 and acquisition module 472.When described acquiring unit 47 obtains described parameter according to described zone bit, at first read the value of described zone bit in described first address and second address by described second read module 471; When the sign place value in first address that described second read module 471 reads was effective value, acquisition module 472 obtained described parameter from described first address; When the sign place value in second address that second read module 471 reads was effective value, described acquisition module 472 obtained described parameter from described second address; If when the sign place value of first address that described second read module 471 reads and the sign place value of described second address all were effective value, described acquisition module 472 obtained described parameter from described first address or described second address; When the sign place value in the sign place value of first address that described second read module 471 reads and described second address all is invalid value, will use default parameters as described parameter.
In the embodiment of the invention, two addresses are set in order to preserve parameter in flash memory, and in the address of described preservation parameter, preserve one and be used to indicate the current whether effectively zone bit of parameter in this address, when parameter need be preserved, choose the current invalid address of parameter in the address according to described sign place value, so that described variation back parameter is saved in the described address of choosing; Compared with prior art, in the embodiment of the invention, when the embedded device parameter in the Synchronous Dynamic Random Access Memory need be preserved, described parameter of need preserving is saved in the address that parameter current do not using, because described current being in of choosing in the address of parameter do not have user mode, even if in the process of preserving described parameter, raw parameter in this address is wiped, preserve the not success of described parameter, and the current parameter of using is not wiped, keep original state, guaranteed that systematic parameter do not lose, thereby make system in power down or can be normal when restarting, operation reliably.
Further, after the method for the preservation parameter of the employing embodiment of the invention, because when the parameter of preserving after changing, if preserve successfully, then the sign place value of described address is set to effectively, and be not used in the sign place value that preserve to change the back argument address be set to invalid; If preserve when getting nowhere, the sign place value of the parameter corresponding address that maintenance is being used is effective value; Therefore by above-mentioned setting, no matter preserve the parameter success or not after changing, it is complete can both keeping in the described flash memory in two addresses the parameter of an address being arranged, and has guaranteed that systematic parameter do not lose, thus make system can be normally in power down or when restarting, operation reliably; After needs used parameter in the described flash memory, the value of choosing described zone bit according to described zone bit was the parameter in the effective address, and the system that just can realize can be normally in power down or when restarting, operation reliably.
Through the above description of the embodiments, the those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential common hardware, can certainly pass through hardware, but the former is better embodiment under a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium that can read, floppy disk as computing machine, hard disk or CD etc., comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.

Claims (10)

1. an embedded device parameter store method is characterized in that, comprising:
In the memory headroom of flash memory, be provided for preserving first address and second address of embedded device parameter, also preserve respectively in described first address and second address and be used to indicate the current whether effectively zone bit of described parameter;
When the embedded device parameter in the Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit;
The described parameter of choosing in the address is wiped, and described variation back parameter is saved in described choosing in the address.
2. method according to claim 1 is characterized in that, described variation back parameter is saved in described choose the address after, this method also comprises:
The parameter of judgement after with described variation is saved in the described whether success of address of choosing;
If judge the parameter after the described variation is saved in the described address success of choosing, the then described sign place value of choosing the address is set to effective value;
The parameter of preserving in another address in the described flash memory space is wiped, and the sign place value of described another address is set to invalid value.
3. method according to claim 1 is characterized in that, described according to described zone bit from described first address and second address, the address that to choose described sign place value be invalid value comprises as preserving the described address that changes the back parameter:
Read the value of described zone bit in described first address and second address;
If the sign place value of described first address of reading is an effective value, then choose described second address as preserving the described address that changes the back parameter;
If the sign place value of described second address of reading is an effective value, then choose described first address as preserving the described address that changes the back parameter;
If the sign place value of described first address of reading and the sign place value of described second address all be invalid value, then choose arbitrary address in described first address and described second address as preserving the described address of parameter afterwards that changes.
4. method according to claim 1 is characterized in that, this method also comprises:
When needs use the embedded device parameter that is kept in the described flash memory, obtain described parameter according to described zone bit;
The described parameter of obtaining is duplicated the described parameter that obtains duplicating;
The described parameter of duplicating is sent to described Synchronous Dynamic Random Access Memory.
5. method according to claim 4 is characterized in that, describedly obtains described parameter according to described zone bit and comprises:
Read the value of described zone bit in described first address and second address;
If the sign place value of described first address of reading is an effective value, then from described first address, obtain described parameter;
If the sign place value of described second address of reading is an effective value, then from described second address, obtain described parameter;
If the sign place value and the described second address mark place value of described first address of reading all are effective value, then from described first address or described second address, obtain described parameter;
If the value of the described first address mark position and the value of the described second address mark position all are invalid value, then will use default parameters as described parameter.
6. according to arbitrary described method in the claim 1 to 5, it is characterized in that, described parameter and zone bit are kept in described first address and second address with the form of structure member variable, described structure was write before preserving described parameter, and was kept in the described Synchronous Dynamic Random Access Memory with the form of global variable.
7. an embedded device parameter save set is characterized in that, comprising:
Whether effectively the address setting unit is used for being provided for preserving at the memory headroom of flash memory first address and second address of embedded device parameter, also preserve respectively in described first address and second address to be used to indicate the current zone bit of described parameter;
Choose the unit, be used for when the embedded device parameter of Synchronous Dynamic Random Access Memory changes the needs preservation, from described first address and second address, the address that to choose described sign place value be invalid value is as preserving the described address that changes the back parameter according to described zone bit;
Erase unit is used for the described parameter of choosing in the unit selection address is wiped;
Preserve the unit, be used for described variation back parameter is saved in the described address of choosing unit selection.
8. device according to claim 7 is characterized in that, this device also comprises:
Judging unit, be used for described variation back parameter is saved in described choose the address after, judge described variations back parameter is saved in the described whether success of address of choosing;
Zone bit is provided with the unit, is used for judging at described judging unit described variations back parameter is saved in the described address of choosing when successful, and the described sign place value of choosing the address is set to effective value;
Described erase unit is used for the parameter of preserving in another address of described flash memory space is wiped;
Described zone bit is provided with the unit, and the sign place value that also is used for described another address is set to invalid value.
9. device according to claim 7 is characterized in that, the described unit of choosing comprises:
Read module is used to read the value of described zone bit in described first address and second address;
Choose module, when being used for sign place value and being effective value, choose described second address as preserving the described address that changes the back parameter in first address that described read module reads;
The described module of choosing also is used for, and when the sign place value in second address that described read module reads is effective value, chooses described first address as preserving the described address that changes the back parameter;
The described module of choosing also is used for, when the sign place value in the sign place value of first address that described read module reads and described second address all is invalid value, choose arbitrary address in described first address and described second address as preserving the described address that changes the back parameter.
10. device according to claim 7 is characterized in that, this device also comprises:
Acquiring unit is used for obtaining described parameter according to described zone bit when the needs use is kept at the embedded device parameter of described flash memory;
Copied cells is used for the described parameter that described acquiring unit obtains is duplicated;
Transmitting element is used for that described copied cells is duplicated the described parameter that obtains and sends to described Synchronous Dynamic Random Access Memory.
CN200910242685XA 2009-12-14 2009-12-14 Embedded type equipment parameter storing method and device Pending CN102096612A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910242685XA CN102096612A (en) 2009-12-14 2009-12-14 Embedded type equipment parameter storing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910242685XA CN102096612A (en) 2009-12-14 2009-12-14 Embedded type equipment parameter storing method and device

Publications (1)

Publication Number Publication Date
CN102096612A true CN102096612A (en) 2011-06-15

Family

ID=44129716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910242685XA Pending CN102096612A (en) 2009-12-14 2009-12-14 Embedded type equipment parameter storing method and device

Country Status (1)

Country Link
CN (1) CN102096612A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810205A (en) * 2012-11-13 2014-05-21 腾讯科技(深圳)有限公司 Method and device for online reading and synchronously updating music information
CN109032500A (en) * 2018-06-11 2018-12-18 广州视源电子科技股份有限公司 Data storage method and device of single chip microcomputer, single chip microcomputer and storage medium
CN110187922A (en) * 2019-04-24 2019-08-30 苏州浪潮智能科技有限公司 It is arranged and verifies the method, apparatus, equipment and storage medium of BIOS parameter

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810205A (en) * 2012-11-13 2014-05-21 腾讯科技(深圳)有限公司 Method and device for online reading and synchronously updating music information
CN103810205B (en) * 2012-11-13 2016-03-30 腾讯科技(深圳)有限公司 The method of online reading and synchronized update music information and device
CN109032500A (en) * 2018-06-11 2018-12-18 广州视源电子科技股份有限公司 Data storage method and device of single chip microcomputer, single chip microcomputer and storage medium
CN109032500B (en) * 2018-06-11 2021-12-14 广州视源电子科技股份有限公司 Data storage method and device of single chip microcomputer, single chip microcomputer and storage medium
CN110187922A (en) * 2019-04-24 2019-08-30 苏州浪潮智能科技有限公司 It is arranged and verifies the method, apparatus, equipment and storage medium of BIOS parameter
CN110187922B (en) * 2019-04-24 2023-01-10 苏州浪潮智能科技有限公司 Method, device, equipment and storage medium for setting and verifying BIOS (basic input output System) parameters

Similar Documents

Publication Publication Date Title
US8386698B2 (en) Data accessing method for flash memory and storage system and controller using the same
US9063728B2 (en) Systems and methods for handling hibernation data
TWI385669B (en) Wear leveling method and storage system and controller using the same
KR100672996B1 (en) Memory apparatus with meta data stored fram
US9075733B1 (en) Selective storage of address mapping metadata in a system having multiple memories
US20090307413A1 (en) Data writing method for flash memory and storage system and controller using the same
KR101139076B1 (en) Memory device and file system
US9208101B2 (en) Virtual NAND capacity extension in a hybrid drive
CN112882650B (en) Data storage device and non-volatile memory control method
US10162561B2 (en) Managing backup of logical-to-physical translation information to control boot-time and write amplification
JP2011022657A (en) Memory system and information processor
WO2006067923A1 (en) Memory controller, nonvolatile storage, nonvolatile storage system, and memory control method
TWI381393B (en) Block management and replacement method, flash memory storage system and controller using the same
CN104317671A (en) Power-down data storage and recovery algorithm prolonging service life of non-volatile memory
US8261013B2 (en) Method for even utilization of a plurality of flash memory chips
CN112882649B (en) Data storage device and non-volatile memory control method
US8819329B2 (en) Nonvolatile storage device, access device and nonvolatile storage system
CN102314321B (en) Storage system, utilization storage system carry out the method and apparatus of data access
CN107544912B (en) Log recording method, loading method and device
CN102096612A (en) Embedded type equipment parameter storing method and device
CN112181725A (en) Power-down anti-pulling backup method and system for on-chip and off-chip data of embedded system
CN107544866B (en) Log updating method and device
CN107407953B (en) Method for reducing memory power consumption and computer equipment
US11188265B2 (en) Method for performing storage space management, associated data storage device, and controller thereof
CN112885397B (en) Data storage device and non-volatile memory control method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: BEIJING PKU FOUNDER BROADBAND NETWORK TECHNOLOGY C

Free format text: FORMER OWNER: BEIDA FANGZHENG GROUP CO. LTD.

Effective date: 20110727

Free format text: FORMER OWNER: BEIJING PKU FOUNDER BROADBAND NETWORK TECHNOLOGY CO., LTD.

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20110727

Address after: 100871 Beijing, Haidian District into the house road, founder of the building on the 5 floor, No. 298

Applicant after: Beijing PKU Founder Broadband Network Technology Co., Ltd.

Address before: 100871 Beijing, Haidian District into the house road, founder of the building on the 5 floor, No. 298

Applicant before: Peking Founder Group Co., Ltd.

Co-applicant before: Beijing PKU Founder Broadband Network Technology Co., Ltd.

C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110615