CN102402468A - Data backup loading method and device of embedded device - Google Patents

Data backup loading method and device of embedded device Download PDF

Info

Publication number
CN102402468A
CN102402468A CN2010102849541A CN201010284954A CN102402468A CN 102402468 A CN102402468 A CN 102402468A CN 2010102849541 A CN2010102849541 A CN 2010102849541A CN 201010284954 A CN201010284954 A CN 201010284954A CN 102402468 A CN102402468 A CN 102402468A
Authority
CN
China
Prior art keywords
backup
data
file
load
module
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.)
Granted
Application number
CN2010102849541A
Other languages
Chinese (zh)
Other versions
CN102402468B (en
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.)
Mid Star Technology Ltd By Share Ltd
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CN201010284954.1A priority Critical patent/CN102402468B/en
Publication of CN102402468A publication Critical patent/CN102402468A/en
Application granted granted Critical
Publication of CN102402468B publication Critical patent/CN102402468B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a data backup loading method and device of an embedded device. The data backup loading method comprises the steps of: selecting a data backup file from a plurality of data backup files stored in a nandflash, and loading a first data block, wherein the data backup file comprises a plurality of data blocks, corresponding blocks among the data backup files can be mutually replaced; and selecting another data backup file from a plurality of data backup files stored in the nandflash, and loading the next data block; repeating the steps until the files are loaded completely. A block replacement method is used in backed-up data files (such as operation program files or resource files), so that the programs are more flexibly and conveniently replaced, meanwhile, the utilization rate of the backed-up programs is increased, the backup efficiency is remarkably increased, and backup number can be reduced. Furthermore, a random mechanism of backup data is added, so that read-write of the backup data is more uniform, and the possibility of using bad blocks for a long time is remarkably reduced.

Description

A kind of data backup loading method of embedded device and data backup charger
Technical field
The present invention relates to the decoding technique field, particularly relate to a kind of data backup loading method and data backup charger of embedded device.
Background technology
Along with the development of informationization technology, embedded system has become very popular topic of current I T industrial community.Series of advantages such as, low cost efficient, high reliability, abundant code and application program extensibility, portability because of it; More and more become at present the main force of industrial system and civilian system; Especially in information-based product, be applied to the notion of embedded system (embedded device) more and more.
The data of general embedded device (for example, using working procedure and resource file) all can be stored in nandflash, along with the increase of embedded system (embedded device) to the data storage demand, and present embedded device more applications MLC nandfiash.
SLC and MLC are respectively the abbreviations of Single Layer Cell single layer cell and Multi-Level Cell multilevel-cell, and the characteristics of SLC are that cost is high, capacity is little, speed is fast, and the characteristics of MLC are capacity big cost is low, but speed is slow.Each unit of MLC is 2bit, relatively SLC totally how one times, capacity is big, low price.But, because the data of depositing in each MLC storage unit is more, the structure relative complex, along with the number of times increase of read-write, the probability of makeing mistakes can increase.Will occur program and resource file like this is easy to destroy; And in a single day these files are destroyed; To whole embedded system is fatal, so prior art all can back up with regard to program and resource file in order to read and write mistake correction to these usually accordingly.
Existing backup scenario is used usually run program file is backed up many parts; Many parts of resource file backups when mistake appears in first part of file of working procedure, are then read second part of file of working procedure; When mistake appears in first backup of resource file, then read second backup of resource file.
Such scheme no doubt can be realized data backup, solves the problem that occurs mistake when file, but there are some drawbacks in it, as follows:
One of which if the quantity of run program file and resource file backup is many, has then taken more storage space, and relatively waste reduces performance; If but the backup negligible amounts, in case certain piece mistake of stand-by program then, whole stand-by program just all can't use, and the vicious situation of file then still possibly occur, causes whole embedded device to use.
Its two, when having loaded backup file, need carry out CRC check to this backup file, no problem to guarantee it, but common run program file and resource file data amount is bigger, then whole stand-by program verification is time-consuming, requires great effort.
In a word; Need the urgent technical matters that solves of those skilled in the art to be exactly at present: the data backup loading scheme that how can propose a kind of embedded device with innovating; The utilization rate of Backup Data is improved, and the efficient of backup obviously improves, and can reduce the backup number.
Summary of the invention
Technical matters to be solved by this invention provides a kind of data backup loading method and device of embedded device; In order to solve the inefficient problem of Backup Data in the prior art; Utilization rate that can Backup Data improves, and the efficient of backup obviously improves, and can reduce the backup number.
In order to address the above problem, the invention discloses a kind of data backup loading method of embedded device, said method comprises: select a data backup file in many piece of data backup file of from nandflash, storing, load first data block; Said backup data file comprises a plurality of data blocks, and the relevant block between this backup data file can be replaced mutually; Select another backup data file in many piece of data backup file of from nandflash, storing, load next data block; Finish until file load.
Preferably, said backup data file is working procedure backup file or resource backup file.
Preferably, said method also comprises: treat the loading data piece and carry out CRC check, if verification is correct, then load; Otherwise, reselect a data backup file.
Preferably, the mode of said another backup data file of selection is for select or select in order at random.
Preferably, can select at random in the following manner: the value to random function obtains is got the surplus of N, with the foundation of this remainder as the selection backup data file; Wherein, N is the backup quantity of backup data file.
According to another embodiment of the present invention, a kind of data backup charger of embedded device is also disclosed, said method comprises:
Memory module is used at many piece of data of nandfiash storage backup file; Said backup data file comprises a plurality of data blocks, and the relevant block between this backup data file can be replaced mutually;
Select module, be used for from many piece of data backup file that nandflash stores, selecting a data backup file;
Load-on module is used for loading first data block through selecting module to confirm a data backup file; Then, confirm another backup data file, load next data block through selecting module; Finish until file load.
Preferably, said backup data file is working procedure backup file or resource backup file.
Preferably, this data backup charger can also comprise: the verification module, and be used to treat the loading data piece and carry out CRC check, if verification is correct, then notify load-on module to load; Otherwise the notice load-on module is reselected a data backup file,
Preferably, the mode of said another backup data file of selection is for select or select in order at random.
Preferably, said selection module specifically comprises:
Get the complement submodule piece, be used for the value that random function obtains is got the surplus of N; Wherein, N is the backup quantity of backup data file;
Confirm submodule, be used for confirming required backup data file with the foundation of this remainder as the selection backup data file.
Compared with prior art, the present invention has the following advantages:
The present invention has used the method for piece replacement to backed up data file (like run program file or resource file); Make the replacement of calling program more flexible; The utilization rate of the stand-by program that makes simultaneously improves, and the efficient of backup obviously improves, and can reduce the backup number.
Further, the present invention has added the chance mechanism of Backup Data, makes that the read-write of Backup Data is average, makes for a long time to damage the piece rate and obviously descend;
In addition, the piece of CRC check mistake is less in the loading procedure of program, and the operational efficiency of program also obviously improves.
Description of drawings
Fig. 1 is the data backup loading method process flow diagram of a kind of embedded device of the present invention;
Fig. 2 is a storage synoptic diagram of backup file of the present invention;
Fig. 3 is the process flow diagram of the data backup loading method of the another kind of embedded device of the present invention;
Fig. 4 is the structural representation of the data backup charger of a kind of embedded device of the present invention.
Embodiment
For make above-mentioned purpose of the present invention, feature and advantage can be more obviously understandable, below in conjunction with accompanying drawing and embodiment the present invention done further detailed explanation.
One of core concept of the present invention is: the present invention uses piece replacement backup mode; Be that the piece that logic is identical between stand-by program or the resource can at random carry out mutual alternative, can mutual alternative like the 1st piece of the 1st piece of the 1st stand-by program and the 2nd stand-by program; The present invention simultaneously realizes that each backup file replaces mechanism at random, during loading procedure, is not to begin to load at the 1st stand-by program or resource promptly; But, select arbitrarily stand-by program or resource to begin to load through load mechanism at random, just can from the 2nd stand-by program, get the 1st logical block; Follow the 2nd piece in fetch logic in the 1st stand-by program; Then get the 3rd logical block the 4th backup, the rest may be inferred, is combined into a complete working procedure or resource.
With reference to Fig. 1, show the data backup loading method embodiment of a kind of embedded device of the present invention, said method specifically comprises:
Select a data backup file in step 101, the many piece of data backup file from nandflash, stored, load first data block; Said backup data file comprises a plurality of data blocks, and the relevant block between this backup data file can be replaced mutually;
For embedded system, required data file can be divided into run program file and resource file usually, and backup data file promptly of the present invention can be working procedure backup file or resource backup file.In practical application, the present invention can select to load to the working procedure backup file, also can select to load to the resource backup file, and certainly, the two all is related usually.In the embodiment of back explanation, possibly adopt stand-by program or resource backup printed words to describe.
With reference to Fig. 2; Show a storage synoptic diagram of backup file of the present invention; The working procedure of embedded device and resource all are stored on the nandflash, and each program and resource all have the backup of N part, and each stand-by program or resource all are stored in nandflash continuously and go up (having removed the bad piece of nandflash here); For example, a backup file among Fig. 2 comprises n blcok.The content that so just can guarantee the logical block of each stand-by program or resource is identical, is convenient to replacement.In the earlier stored of each backup file backup file information, the memory location of writing down each backup file.
Select another backup data file in step 102, the many piece of data backup file from nandflash, stored, load next data block; Finish until file load.
In a preferred embodiment of the invention, comprise that also treating the loading data piece carries out CRC check,, then load if verification is correct; Otherwise, reselect a data backup file.Because when loading and do not know that this data block is bad; So can be through CRC check to confirm whether this data block exists mistake; If there is not mistake, then directly load, if verification is not passed through; M the data block (this data block to be loaded) that current backup data file then is described is bad, so need reselect a data backup file.
After reselecting a data backup file, still to carry out CRC check,, then load if verification is correct to its M data block (this data block to be loaded); Otherwise, continue to reselect a data backup file.
In a preferred embodiment of the invention, the mode of said another backup data file of selection is for select at random; Certainly, also can be for selecting in order.
A lot of realizations scheme is at random arranged in the prior art, and the present invention can adopt, and the present invention also provides a kind of preferable, better simply realization at this.Concrete, at first can obtain a value, then in surplus (assurance can not exceed backup quantity like this) of resulting value being got N, with the foundation of this remainder as the selection backup data file through random function; Wherein, N is the backup quantity of backup data file.
With reference to Fig. 3, show the working procedure backup loading method embodiment of the another kind of embedded device of the present invention, said method specifically comprises:
Step 301, embedded device bring into operation;
Step 302, boot loader; For example, the bootstrap loader through bootloader;
Step 303, loading procedure can obtain the information of stand-by program from preset address, for example, and the quantity of stand-by program and memory address etc.;
Step 304, back up loading at random according to backup information;
Step 305, load next logical block (, then loading first piece) if begin to load;
Whether step 306, judge to load and to finish, promptly judge in the backup file whether also have the logical block that can load, if do not have, then explanation, whole loaded then can end operation if loading and being through with;
If step 307 finds to exist in the backup file of current selection the logical block that can load; Explain that then backup file does not read completion; Then obtain archive index at random, in this stand-by program, load M required logical block (M is since 1, and each back of carrying out superposes);
Whether the piece CRC that step 308, judgement are loaded is correct;
If step 309 is correct, then load the memory field of this logical block to operation; And return step 305, load next logical block;
If step 310 CRC check is incorrect, then carry out the piece replacement, promptly other stand-by programs except this backup are selected at random;
Step 311, continue to load M logical block (index value that is logical block is constant), return step 308, M logical block of the new stand-by program that this was added in carried out CRC check to the stand-by program of selecting.
Above-mentioned steps is carried out in circulation, finishes until whole loadings, and embedded device can move based on correct run program file and resource file.Certainly, the file data that moves in its internal memory is to be obtained by the combination of the different pieces of information piece of a plurality of backup files.
With reference to Fig. 4, show the data backup charger embodiment of a kind of embedded device of the present invention, it specifically can comprise:
Memory module 401 is used at many piece of data of nandflash storage backup file; Said backup data file comprises a plurality of data blocks, and the relevant block between this backup data file can be replaced mutually; Said backup data file is working procedure backup file or resource backup file.
Select module 402, be used for from many piece of data backup file that nandflash stores, selecting a data backup file; The mode of said another backup data file of selection is for select or select in order at random.
Load-on module 403 is used for loading first data block through selecting module to confirm a data backup file; Then, confirm another backup data file, load next data block through selecting module; Finish until file load.
In a preferred embodiment of the invention, also comprise verification module 404, be used to treat the loading data piece and carry out CRC check,, then notify load-on module 403 to load if verification is correct; Otherwise notice load-on module 403 is reselected a data backup file,
The present invention preferably adopts the mode of selecting at random, like this, can realize on average reading of backup file data block, rather than frequently read the data block of certain several backup file, like this, can reduce bad piece rate so that the read-write between the backup file is average.
When adopting at random selection mode, said selection module specifically can comprise:
Get the complement submodule piece, be used for the value that random function obtains is got the surplus of N; Wherein, N is the backup quantity of backup data file;
Confirm submodule, be used for confirming required backup data file with the foundation of this remainder as the selection backup data file.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For device embodiment, because it is similar basically with method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than the data backup loading method and the data backup charger of a kind of embedded device provided by the present invention carried out detailed introduction; Used concrete example among this paper principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. the data backup loading method of an embedded device is characterized in that, said method comprises:
Select a data backup file in many piece of data backup file of from nandflash, storing, load first data block; Said backup data file comprises a plurality of data blocks, and the relevant block between this backup data file can be replaced mutually;
Select another backup data file in many piece of data backup file of from nandflash, storing, load next data block; Finish until file load.
2. the method for claim 1 is characterized in that, said backup data file is working procedure backup file or resource backup file.
3. the method for claim 1 is characterized in that, also comprises:
Treat the loading data piece and carry out CRC check,, then load if verification is correct; Otherwise, reselect a data backup file.
4. like claim 1 or 3 described methods, it is characterized in that the mode of said another backup data file of selection is for select or select in order at random.
5. method as claimed in claim 4 is characterized in that, selects at random in the following manner:
Value to random function obtains is got the surplus of N, with the foundation of this remainder as the selection backup data file; Wherein, N is the backup quantity of backup data file.
6. the data backup charger of an embedded device is characterized in that, said method comprises:
Memory module is used at many piece of data of nandflash storage backup file; Said backup data file comprises a plurality of data blocks, and the relevant block between this backup data file can be replaced mutually;
Select module, be used for from many piece of data backup file that nandflash stores, selecting a data backup file;
Load-on module is used for loading first data block through selecting module to confirm a data backup file; Then, confirm another backup data file, load next data block through selecting module; Finish until file load.
7. data backup charger as claimed in claim 6 is characterized in that, said backup data file is working procedure backup file or resource backup file.
8. data backup charger as claimed in claim 6 is characterized in that, also comprises:
The verification module is used to treat the loading data piece and carries out CRC check, if verification is correct, then notifies load-on module to load; Otherwise the notice load-on module is reselected a data backup file.
9. like claim 6 or 8 described data backup chargers, it is characterized in that the mode of said another backup data file of selection is for select or select in order at random.
10. data backup charger as claimed in claim 6 is characterized in that, said selection module specifically comprises:
Get the complement submodule piece, be used for the value that random function obtains is got the surplus of N; Wherein, N is the backup quantity of backup data file;
Confirm submodule, be used for confirming required backup data file with the foundation of this remainder as the selection backup data file.
CN201010284954.1A 2010-09-16 2010-09-16 A kind of data backup loading method of embedded device and data backup charger Active CN102402468B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010284954.1A CN102402468B (en) 2010-09-16 2010-09-16 A kind of data backup loading method of embedded device and data backup charger

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010284954.1A CN102402468B (en) 2010-09-16 2010-09-16 A kind of data backup loading method of embedded device and data backup charger

Publications (2)

Publication Number Publication Date
CN102402468A true CN102402468A (en) 2012-04-04
CN102402468B CN102402468B (en) 2016-01-20

Family

ID=45884696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010284954.1A Active CN102402468B (en) 2010-09-16 2010-09-16 A kind of data backup loading method of embedded device and data backup charger

Country Status (1)

Country Link
CN (1) CN102402468B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473098A (en) * 2013-09-10 2013-12-25 华为技术有限公司 Starting method of boot program and relevant device
CN111078307A (en) * 2019-12-19 2020-04-28 迈普通信技术股份有限公司 Starting method and device of embedded equipment, embedded equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6487561B1 (en) * 1998-12-31 2002-11-26 Emc Corporation Apparatus and methods for copying, backing up, and restoring data using a backup segment size larger than the storage block size
CN1794190A (en) * 2004-12-22 2006-06-28 国际商业机器公司 Method for storing and restoring a data file using several storage media
CN101118508A (en) * 2007-08-24 2008-02-06 成都索贝数码科技股份有限公司 Safety storage method for data
CN101241457A (en) * 2007-02-09 2008-08-13 国际商业机器公司 Destage management method and system of redundant data copies

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6487561B1 (en) * 1998-12-31 2002-11-26 Emc Corporation Apparatus and methods for copying, backing up, and restoring data using a backup segment size larger than the storage block size
CN1794190A (en) * 2004-12-22 2006-06-28 国际商业机器公司 Method for storing and restoring a data file using several storage media
CN101241457A (en) * 2007-02-09 2008-08-13 国际商业机器公司 Destage management method and system of redundant data copies
CN101118508A (en) * 2007-08-24 2008-02-06 成都索贝数码科技股份有限公司 Safety storage method for data

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473098A (en) * 2013-09-10 2013-12-25 华为技术有限公司 Starting method of boot program and relevant device
US9411689B2 (en) 2013-09-10 2016-08-09 Huawei Technologies Co., Ltd. Method and relevant apparatus for starting boot program
CN111078307A (en) * 2019-12-19 2020-04-28 迈普通信技术股份有限公司 Starting method and device of embedded equipment, embedded equipment and storage medium

Also Published As

Publication number Publication date
CN102402468B (en) 2016-01-20

Similar Documents

Publication Publication Date Title
CN101246738B (en) Memory system with backup circuit and programming method
CN103632722B (en) Memory system, program method thereof, and computing system including the same
EP2294510B1 (en) Method and apparatus for error correction according to erase counts of a solid-state memory
CN100435116C (en) Non-volatile memory and method with memory planes alignment
CN103797541B (en) Storage arrangement and the collocation method for storage arrangement
CN101923448A (en) Method for reading and writing conversion layer of NAND flash memory
CN102135927B (en) Method and device for system booting based on NAND FLASH
US20120260027A1 (en) Device bootup from a nand-type non-volatile memory
CN101515276B (en) Method for write operation of file data, and recovery method and recovery system for file data
CN100458718C (en) Method of correcting error code for multiple sector
CN102609334B (en) Nonvolatile flash memory is wiped abnormal memory block restorative procedure and device
CN102239477A (en) Continuous address space in non-volatile-memories (nvm) using efficient management methods for array deficiencies
CN101339806A (en) Apparatus and method to prevent data loss in nonvolatile memory
CN103366831A (en) Detection method for memory
CN107729174B (en) Memory device, method of storing data thereof, and controller thereof
CN103778964B (en) Process, using method and the device of a kind of NAND Flash programming data, system
CN102541690A (en) Intelligent card and method for recovering data
CN107918523A (en) Data storage device and data writing method thereof
KR20210024763A (en) Apparatus and method for handling firmware error in operation of memory system
CN102981969A (en) Method for deleting repeated data and solid hard disc thereof
CN101425342B (en) Access method for NAND Flash redundant code
CN111198780B (en) Apparatus and method for performing a restore operation of a memory system
CN101246429A (en) Electronic systems using flash memory modules as main storage and related system booting methods
CN109783005A (en) Control method, memory storage and its controller and electronic device of memory storage
CN102402468A (en) Data backup loading method and device of embedded device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C53 Correction of patent of invention or patent application
CB03 Change of inventor or designer information

Inventor after: Zhang Yinong

Inventor after: Ai Guo

Inventor before: Ai Guo

COR Change of bibliographic data

Free format text: CORRECT: INVENTOR; FROM: AI GUO TO: ZHANG YINONG AI GUO

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20171221

Address after: 100083 Haidian District, Xueyuan Road, No. 35, the world building, the second floor of the building on the ground floor, No. 16

Patentee after: Zhongxing Technology Co., Ltd.

Address before: 100083 Haidian District, Xueyuan Road, No. 35, the world building, the second floor of the building on the ground floor, No. 16

Patentee before: Beijing Vimicro Corporation

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100083 Haidian District, Xueyuan Road, No. 35, the world building, the second floor of the building on the ground floor, No. 16

Patentee after: Mid Star Technology Limited by Share Ltd

Address before: 100083 Haidian District, Xueyuan Road, No. 35, the world building, the second floor of the building on the ground floor, No. 16

Patentee before: Zhongxing Technology Co., Ltd.