CN104102521A - Method and device for updating nonvolatile storage - Google Patents

Method and device for updating nonvolatile storage Download PDF

Info

Publication number
CN104102521A
CN104102521A CN201410359872.7A CN201410359872A CN104102521A CN 104102521 A CN104102521 A CN 104102521A CN 201410359872 A CN201410359872 A CN 201410359872A CN 104102521 A CN104102521 A CN 104102521A
Authority
CN
China
Prior art keywords
data
memory
write
address
preserving
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
CN201410359872.7A
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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201410359872.7A priority Critical patent/CN104102521A/en
Publication of CN104102521A publication Critical patent/CN104102521A/en
Pending legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a method and a device for updating a nonvolatile storage. The method comprises the following steps: according to a preset first address and a preset first length, reading first data from the nonvolatile storage, and storing the first data into a memory; erasing the nonvolatile storage; according to a preset second address and a preset second length, writing second data pre-stored in the memory into the nonvolatile storage; and according to the first address and the first length, writing first data stored in the memory into the nonvolatile storage. Through a technical scheme provided by the invention, one nonvolatile storage is used for replacing two nonvolatile storages to update the functions of a control unit in a server, the design difficulty and the product cost of a printed circuit board are lowered, and market requirements can be favorably met.

Description

A kind of method and apparatus that upgrades nonvolatile memory
Technical field
The present invention relates to non-volatile memory technologies, espespecially a kind of method and apparatus that upgrades nonvolatile memory.
Background technology
In server, comprise the multiple control module with respective control function, for example, server admin unit.For some of them control module, can be kept at by renewal the mode of the firmware in the nonvolatile memory corresponding with these control modules, realize the renewal to these control module functions.
Conventionally, the data corresponding to firmware of preserving in the nonvolatile memory corresponding with control module, are comprised of the data that can upgrade and the data that cannot upgrade.The data that can upgrade are kept in a nonvolatile memory, it typically is the conventional data of all control modules of the same type.And the data that cannot upgrade are kept in another nonvolatile memory, it typically is the private data of each control module.Like this, need to use two nonvolatile memories, realize the renewal of a control module function, increase design difficulty and the cost of products of printed circuit board (PCB), cannot meet well the demand in market.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides a kind of method and apparatus that upgrades nonvolatile memory, renewal that can simple realization control module function, has reduced design difficulty and the cost of products of printed circuit board (PCB).
In order to reach the object of the invention, the invention discloses a kind of method of upgrading nonvolatile memory, comprising:
According to predefined the first address and the first length, from nonvolatile memory, read the first data, and the first data are saved in internal memory;
Erasable nonvolatile memory;
According to predefined the second address and the second length, to second data of preserving in advance in nonvolatile memory write memory;
According to the first address and the first length, to first data of preserving in nonvolatile memory write memory.
Described read the first data after, before described preservation the first data, the inventive method also comprises:
According to predefined determination strategy, determine that whether described the first data that read are effective, if effectively, carry out the step of described preservation the first data, otherwise described the first data that prompting is read are invalid, finish the inventive method.
Described determination strategy is: when binary numeral corresponding to described the first data reading is complete one or complete zero, described in described the first data of reading invalid.
After second data of preserving in advance in said write internal memory, before first data of preserving in said write internal memory, the inventive method also comprises: according to described the second address and the second length, from nonvolatile memory, read the second data that write, and it is compared with second data of preserving in advance in internal memory, if comparative result is unequal, return to the step of second data of preserving in advance in said write internal memory.
After first data of preserving in said write internal memory, the inventive method also comprises: according to described the first address and the first length, read the first data that write, and it is compared with first data of preserving in internal memory, if comparative result is unequal, return to the step of first data of preserving in said write internal memory.
The inventive method also discloses a kind of device that upgrades nonvolatile memory, and comprise cache module, wipe module, the first update module and the second update module, wherein,
Cache module, for according to predefined the first address and the first length, reads the first data from nonvolatile memory, and the first data is saved in internal memory;
Wipe module, for erasable nonvolatile memory;
The first update module, for according to predefined the second address and the second length, to second data of preserving in advance in nonvolatile memory write memory;
The second update module, for according to the first address and the first length, to first data of preserving in nonvolatile memory write memory.
Described cache module also for: when reading out the first data, according to predefined determination strategy, determine that whether described the first data read effective, if effectively, carry out described preservation the first data, otherwise described the first data that prompting is read are invalid, and stop the operation of this device.
Described determination strategy is: when binary numeral corresponding to described the first data reading is complete one or complete zero, described in described the first data of reading invalid.
Described the first update module also for: when completing the second data that write memory preserves in advance, according to described the second address and the second length, from nonvolatile memory, read the second data that write, and it is compared with second data of preserving in advance in internal memory, if comparative result is unequal, described the first update module is reruned once.
Described the second update module also for: when completing the first data that write memory preserves, according to described the first address and the first length, read the first data that write, and it is compared with first data of preserving in internal memory, if comparative result is unequal, described the second update module is reruned once.
Compared with prior art, technical scheme of the present invention comprises: according to predefined the first address and the first length, from nonvolatile memory, read the first data, and the first data are saved in internal memory; Erasable nonvolatile memory; According to predefined the second address and the second length, to second data of preserving in advance in nonvolatile memory write memory; According to the first address and the first length, to first data of preserving in nonvolatile memory write memory.By technical scheme provided by the invention, use nonvolatile memory to replace two nonvolatile memories, simple realization the renewal of control module function, effectively reduce design difficulty and the cost of products of printed circuit board (PCB).In addition, by technical scheme of the present invention, after the firmware that completes control module upgrades, also read the data in write non-volatile memory and correspondingly it compared with the data of preserving in internal memory, realized the Correctness checking of new data more, effectively promoted the stability of the renewal of control module function.
Other features and advantages of the present invention will be set forth in the following description, and, partly from instructions, become apparent, or understand by implementing the present invention.Object of the present invention and other advantages can be realized and be obtained by specifically noted structure in instructions, claims and accompanying drawing.
Accompanying drawing explanation
Accompanying drawing is used to provide the further understanding to technical solution of the present invention, and forms a part for instructions, is used from explanation technical scheme of the present invention with the application's embodiment mono-, does not form the restriction to technical solution of the present invention.
Fig. 1 is the process flow diagram that the present invention upgrades the method for nonvolatile memory;
Fig. 2 is the composition structural representation of the present invention's device of upgrading nonvolatile memory.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, hereinafter in connection with accompanying drawing, embodiments of the invention are elaborated.It should be noted that, in the situation that not conflicting, the embodiment in the application and the feature in embodiment be combination in any mutually.
In the step shown in the process flow diagram of accompanying drawing, can in the computer system such as one group of computer executable instructions, carry out.And, although there is shown logical order in flow process, in some cases, can carry out shown or described step with the order being different from herein.
Fig. 1 is the process flow diagram that the present invention upgrades the method for nonvolatile memory, and as shown in Figure 1, the method comprises the steps:
Step 101: according to predefined the first address and the first length, read the first data from nonvolatile memory, and the first data are saved in internal memory.Wherein,
The first address is first address corresponding to the first data being kept in nonvolatile memory.
The first length is the number that is kept at the address that the first data in nonvolatile memory take in nonvolatile memory.
The first data are the private data of each control module, that is to say the data of the first data for upgrading.Take server admin unit in server is example, and the first data can be MAC Address.Wherein, server admin unit is used for providing the functions such as Long-distance Control and the monitoring of server system status information.
The first data are saved in internal memory and are referred to, in the internal memory that can access in the inventive method, preserve the first data.
Specific implementation according to address and length from nonvolatile memory reading out data, the conventional techniques means for those skilled in the art, are not intended to limit the scope of the invention, and repeat no more herein.
Step 102: erasable nonvolatile memory.Specifically,
Erasable nonvolatile memory is on storage space corresponding to all addresses of nonvolatile memory, to write scale-of-two complete one or complete zero numerical value.
The object of erasable nonvolatile memory is, avoids the legacy data in nonvolatile memory, after the inventive method is carried out, partly remains in nonvolatile memory, may affect the control module that has upgraded firmware and carry out new function.Wherein, new function is function corresponding to new data in nonvolatile memory.
Wherein, the specific implementation of erasable nonvolatile memory, the conventional techniques means for those skilled in the art, are not intended to limit the scope of the invention, and repeat no more herein.
Step 103: according to predefined the second address and the second length, to second data of preserving in advance in nonvolatile memory write memory.Wherein,
The second address is by first address corresponding to the second data being kept in nonvolatile memory.
The number that the second length is address that the second data that are kept in nonvolatile memory are taken in nonvolatile memory.
The second data are the shared data of all control modules of the same type, that is to say the data of the second data for upgrading.Second data of preserving in advance in internal memory refer to, the data of preserving in advance in the internal memory that can access in the inventive method.
Specific implementation according to address and from length to nonvolatile memory data writing, the conventional techniques means for those skilled in the art, are not intended to limit the scope of the invention, and repeat no more herein.
Step 104: according to the first address and the first length, to first data of preserving in nonvolatile memory write memory.
It should be added that, address space corresponding to the second address and the second length can comprise the first address and address space corresponding to the first length.In this case, if the inventive method does not comprise step 101 and step 104, carry out so any one step in the step 102 of the inventive method and step 103, all can cause the second loss of data.The inventive method has solved the problem of the second loss of data in above-mentioned situation by step 101 and step 104.
Further,
After reading the first data in step 101, before preserving the first data in step 101, the inventive method can also comprise:
According to predefined determination strategy, determine that whether the first data read are effective, if effectively, perform step and in 101, preserve the first data, otherwise the first data that prompting is read are invalid, process ends.Wherein, determination strategy is: when binary numeral corresponding to the first data that read is complete one or complete zero, the first data that read are invalid.
If determine that the first data that read are invalid, the first data that prompting is read are invalid, process ends.Next, can carry out respective handling according to prompting, afterwards, re-execute the inventive method.Wherein, respective handling can be, effective the first data of artificial enquiry and corresponding the first address and the first length, and according to the first address inquiring and the first length, to nonvolatile memory, write the first data that inquire.
Further,
After second data of preserving in advance in write memory in step 103, before first data of preserving in write memory in step 104, the inventive method also comprises:
According to the second address and the second length, from nonvolatile memory, read the second data that write, and it is compared with second data of preserving in advance in internal memory, if comparative result is unequal, return to step 103.Like this, realized the Correctness checking of new data more.
Similarly,
After first data of preserving in write memory in step 104, the inventive method also comprises:
According to the first address and the first length, read the first data that write, it is compared with first data of preserving in internal memory, if comparative result is unequal, perform step 104.Like this, realized the Correctness checking of new data more.
Fig. 2 is the composition structural representation of the present invention's device of upgrading nonvolatile memory, as shown in Figure 2, comprises cache module, wipes module, the first update module and the second update module, wherein,
Cache module, for according to predefined the first address and the first length, reads the first data from nonvolatile memory, and the first data is saved in internal memory.
Wipe module, for erasable nonvolatile memory.
The first update module, for according to predefined the second address and the second length, to second data of preserving in advance in nonvolatile memory write memory.
The second update module, for according to the first address and the first length, to first data of preserving in nonvolatile memory write memory.
Further,
Cache module also for: when reading out the first data, according to predefined determination strategy, determine that whether the first data read effective, if effectively, carry out and preserve the first data, otherwise the first data that prompting is read are invalid, and stop the operation of apparatus of the present invention.Wherein,
Determination strategy is: when binary numeral corresponding to the first data that read is complete one or complete zero, the first data that read are invalid.
The first update module also for: when completing the second data that write memory preserves in advance, according to the second address and the second length, from nonvolatile memory, read the second data that write, and it is compared with second data of preserving in advance in internal memory, if comparative result is unequal, the first update module is reruned once.
The second update module also for: when completing the first data that write memory preserves, according to the first address and the first length, read the first data that write, and it is compared with first data of preserving in internal memory, if comparative result is unequal, the second update module is reruned once.
Although the disclosed embodiment of the present invention as above, the embodiment that described content only adopts for ease of understanding the present invention, not in order to limit the present invention.Those of skill in the art under any the present invention; do not departing under the prerequisite of the disclosed spirit and scope of the present invention; can in the form of implementing and details, carry out any modification and variation; but scope of patent protection of the present invention, still must be as the criterion with the scope that appending claims was defined.

Claims (10)

1. a method of upgrading nonvolatile memory, is characterized in that, comprising:
According to predefined the first address and the first length, from nonvolatile memory, read the first data, and the first data are saved in internal memory;
Erasable nonvolatile memory;
According to predefined the second address and the second length, to second data of preserving in advance in nonvolatile memory write memory;
According to the first address and the first length, to first data of preserving in nonvolatile memory write memory.
2. method according to claim 1, is characterized in that, described in read the first data after, before described preservation the first data, the method also comprises:
According to predefined determination strategy, determine that whether described the first data that read are effective, if effectively, carry out the step of described preservation the first data, otherwise described the first data that prompting is read are invalid, finish the method.
3. method according to claim 2, is characterized in that, described determination strategy is: when binary numeral corresponding to described the first data reading is complete one or complete zero, described in described the first data of reading invalid.
4. method according to claim 1, it is characterized in that, after second data of preserving in advance in said write internal memory, before first data of preserving in said write internal memory, the method also comprises: according to described the second address and the second length, read the second data that write from nonvolatile memory, and it is compared with second data of preserving in advance in internal memory, if comparative result is unequal, return to the step of second data of preserving in advance in said write internal memory.
5. method according to claim 1, it is characterized in that, after first data of preserving in said write internal memory, the method also comprises: according to described the first address and the first length, read the first data that write, and it is compared with first data of preserving in internal memory, if comparative result is unequal, return to the step of first data of preserving in said write internal memory.
6. a device that upgrades nonvolatile memory, is characterized in that, comprises cache module, wipes module, the first update module and the second update module, wherein,
Cache module, for according to predefined the first address and the first length, reads the first data from nonvolatile memory, and the first data is saved in internal memory;
Wipe module, for erasable nonvolatile memory;
The first update module, for according to predefined the second address and the second length, to second data of preserving in advance in nonvolatile memory write memory;
The second update module, for according to the first address and the first length, to first data of preserving in nonvolatile memory write memory.
7. device according to claim 6, described cache module also for: when reading out the first data, according to predefined determination strategy, determine that whether described the first data that read are effective, if effectively, carry out described preservation the first data, otherwise described the first data that prompting is read are invalid, and stop the operation of this device.
8. device according to claim 7, is characterized in that, described determination strategy is: when binary numeral corresponding to described the first data reading is complete one or complete zero, described in described the first data of reading invalid.
9. device according to claim 6, it is characterized in that, described the first update module also for: when completing the second data that write memory preserves in advance, according to described the second address and the second length, from nonvolatile memory, read the second data that write, and it is compared with second data of preserving in advance in internal memory, if comparative result is unequal, described the first update module is reruned once.
10. device according to claim 6, it is characterized in that, described the second update module also for: when completing the first data that write memory preserves, according to described the first address and the first length, read the first data that write, and it is compared with first data of preserving in internal memory, if comparative result is unequal, described the second update module is reruned once.
CN201410359872.7A 2014-07-25 2014-07-25 Method and device for updating nonvolatile storage Pending CN104102521A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410359872.7A CN104102521A (en) 2014-07-25 2014-07-25 Method and device for updating nonvolatile storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410359872.7A CN104102521A (en) 2014-07-25 2014-07-25 Method and device for updating nonvolatile storage

Publications (1)

Publication Number Publication Date
CN104102521A true CN104102521A (en) 2014-10-15

Family

ID=51670694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410359872.7A Pending CN104102521A (en) 2014-07-25 2014-07-25 Method and device for updating nonvolatile storage

Country Status (1)

Country Link
CN (1) CN104102521A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017157158A1 (en) * 2016-03-17 2017-09-21 中兴通讯股份有限公司 Data writing method and apparatus, and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6141723A (en) * 1998-04-07 2000-10-31 Microware Virtual machine system for accessing external subprogram functions
US6212632B1 (en) * 1998-07-31 2001-04-03 Flashpoint Technology, Inc. Method and system for efficiently reducing the RAM footprint of software executing on an embedded computer system
CN1692330A (en) * 2002-10-08 2005-11-02 松下电器产业株式会社 Program updating method and terminal device
CN101751328A (en) * 2008-12-12 2010-06-23 北京中电华大电子设计有限责任公司 Simulation method of FLASH/electrically erasable programmable read-only memory (EEPROM)
CN103677745A (en) * 2013-12-10 2014-03-26 中国船舶重工集团公司第七0九研究所 Method for writing and reading equipment identification in Loongson mainboard

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6141723A (en) * 1998-04-07 2000-10-31 Microware Virtual machine system for accessing external subprogram functions
US6212632B1 (en) * 1998-07-31 2001-04-03 Flashpoint Technology, Inc. Method and system for efficiently reducing the RAM footprint of software executing on an embedded computer system
CN1692330A (en) * 2002-10-08 2005-11-02 松下电器产业株式会社 Program updating method and terminal device
CN101751328A (en) * 2008-12-12 2010-06-23 北京中电华大电子设计有限责任公司 Simulation method of FLASH/electrically erasable programmable read-only memory (EEPROM)
CN103677745A (en) * 2013-12-10 2014-03-26 中国船舶重工集团公司第七0九研究所 Method for writing and reading equipment identification in Loongson mainboard

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017157158A1 (en) * 2016-03-17 2017-09-21 中兴通讯股份有限公司 Data writing method and apparatus, and computer storage medium

Similar Documents

Publication Publication Date Title
US9817588B2 (en) Memory device and operating method of same
CN104699417A (en) Data storage device and data access method thereof
US8060794B2 (en) NAND flash memory and method for managing data thereof
CN108874298B (en) Data storage method and device
CN103279406A (en) Method and device for isolating internal memories
CN105446664B (en) A kind of pair of memory carries out file memory method and storage device
CN103996412A (en) Power-fail protection method applied to intelligent-card nonvolatile memories
US8868793B2 (en) SAS expander system and method for dynamically allocating SAS addresses to SAS expander devices
CN110297603A (en) Random write performance method for improving, device and computer equipment based on solid state hard disk
CN104598165A (en) Method and device for improving durability of storage on embedded equipment
US20130159604A1 (en) Memory storage device and memory controller and data writing method thereof
US9195582B2 (en) Data storing method and apparatus applied to flash memory storage device
CN102651674B (en) Data transmission method of reflective memory network
US20200167235A1 (en) Data processing method for solid state drive
CN104102521A (en) Method and device for updating nonvolatile storage
CN104408126A (en) Persistent writing method, device and system of database
CN108519860B (en) SSD read hit processing method and device
CN107908500B (en) Bad block identification method and device
DE102018123311A1 (en) Background firmware update
JP4127307B2 (en) Data storage device, data processing system, data processing method, and data processing device
US20200151119A1 (en) Method and apparatus for performing access control between host device and memory device
US20200133495A1 (en) Method, electronic device and computer program product for reading data
WO2009129340A4 (en) Flash memory management
US20190286343A1 (en) Mapping table management method for solid state storage device
CN105573802B (en) Multiprocessor mainboard power supply management program remote upgrading 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20141015