CN101650692B - Method and device for modifying data in memory - Google Patents

Method and device for modifying data in memory Download PDF

Info

Publication number
CN101650692B
CN101650692B CN2009100883780A CN200910088378A CN101650692B CN 101650692 B CN101650692 B CN 101650692B CN 2009100883780 A CN2009100883780 A CN 2009100883780A CN 200910088378 A CN200910088378 A CN 200910088378A CN 101650692 B CN101650692 B CN 101650692B
Authority
CN
China
Prior art keywords
data
data block
block
erasable
revised
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.)
Expired - Fee Related
Application number
CN2009100883780A
Other languages
Chinese (zh)
Other versions
CN101650692A (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.)
Feitian Technologies Co Ltd
Original Assignee
Beijing Feitian Technologies 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 Feitian Technologies Co Ltd filed Critical Beijing Feitian Technologies Co Ltd
Priority to CN2009100883780A priority Critical patent/CN101650692B/en
Publication of CN101650692A publication Critical patent/CN101650692A/en
Application granted granted Critical
Publication of CN101650692B publication Critical patent/CN101650692B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses method and device for modifying data in a memory, which belong to the technical field of memory. The method comprises the following steps: obtaining an available data block from a data area, which can be used as a replacing data block; reading data in a data block to be modified and replacing the date with new data; writing the new data in the replacing data block; judging whether the data block to be modified is the head of a file or not; and modifying the data according to the judging result. The device comprises an acquiring module, a replacing module, a writing module, a judgment module, a first processing module and a second processing module. An erasable counting position is set in the indexing area of a flash memory so as to use the data block with least erasing as a replacing data block during erasing every time, the times of erasing are balanced, and the life of the flash memory is prolonged.

Description

A kind of method and apparatus of in memory device, revising data
Technical field
The present invention relates to technical field of memory, particularly a kind of method and apparatus of in memory device, revising data.
Background technology
Along with popularizing of computing machine, various storage mediums more and more are subjected to people's attention.And flash memory and has been applied to every field because the convenience of its storage and the high speed of transfer rate are subject to the people's attention very piece.What flash memory adopted is semiconductor technology, compares with the storage medium of common hard disk, disc, and flash memory is static relatively; And have smaller volume, be easy to carry; And along with development of semiconductor, the price of flash memory is also constantly descending, and therefore, storage medium adopts flash memory technology mostly at present.
Flash memory also can be called Flash ROM, and it is a kind of electrically erasable nonvolatile (still can keep institute's data information stored under the situation of outage) storer, is made of the floating gate type field effect transistor.When writing data, utilize thermoelectron to inject, make floating boom charged; During obliterated data, utilize the tunnel effect under the high pressure, make floating boom lose electronics.Carry out the storage of data by the state that changes floating boom, having can repeatedly erasable characteristic.
EEPROM also is a kind of electrically erasable nonvolatile memory, its data storing method is the same with flash memory, also be charged and lose the electron pair data and store by the floating boom electronics, but in write data and obliterated data, but have different, EEPROM is that unit carries out with the position to the erasable of data, only need revise the part that to change during revised file like this, but but cause the erasable speed of mass data very slow.
In order to increase erasable speed, the storage mode of flash memory is normally such: in the process that flash memory is stored and revised file, be not that step-by-step or byte are carried out usually, but flash memory is divided into piece, store a certain size data in each piece.
In realizing process of the present invention, the inventor finds that there is following shortcoming in prior art:
The file of storing in to flash memory is made amendment or when creating, need be carried out erasable operation to the data of monoblock.In erasable operation, can select first blank piece to carry out write operation; And in the middle of the use of reality, tend to occur certain file is carried out frequent modification, cause a part of piece is carried out frequent erasable, to the erasable balance that do not reach of flash memory.And the erasable life cycle of flash memory is generally 100,000 times, and certain piece is carried out the excessive erasable premature damage that will cause flash memory, has a strong impact on the life-span of flash memory.
And, when the data in the flash memory are made amendment, because power down suddenly can cause losing of data, and data are not easy to be resumed often.
Summary of the invention
In order to improve the life-span of flash memory, the embodiment of the invention provides a kind of method and apparatus of revising data in memory device.Technical scheme is as follows:
A kind of method of in memory device, revising data, wherein said memory device comprises first storage medium and second storage medium, the data field of described memory device is arranged in described first storage medium, the recording areas of described memory device and index area are arranged in described second storage medium, when needs were revised data in the described memory device, described method comprised:
The available block that obtains erasable number of times minimum in the erasable meter digital in described data field is data block as an alternative;
New data is read and replaced with to data in the data block to be revised;
Described new data is write in the described replacement data piece;
Judge whether data block described to be revised is file header;
If, revise first concordance list in the described index area, from described first concordance list, read the index bit in the sign of data block described to be revised, and use the index bit of data block described to be revised to replace the index bit of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length; To be revised as described replacement data piece with data block described to be revised as the file header of the file of file header in the described recording areas; Data block described to be revised is changed to available block;
If not, revise first concordance list in the described index area, the index bit in the sign of the previous data block of data block to be revised described in described first concordance list is revised as the piece number of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length, and the piece of the next data block of data block described to be revised number is write in the index bit of sign of described replacement data piece; Data block described to be revised is changed to available block.
Described method also comprises: the preprocessing process of described memory device;
Described preprocessing process specifically comprises:
Described data field is divided into a plurality of data blocks, the equal and opposite in direction of described a plurality of data blocks, and have separately piece number;
In first concordance list of described index area, state to each data block in the described data field identifies respectively, described sign comprises index bit and erasable meter digital, described index bit is used for writing down the piece number of the next data block that the file be made up of a plurality of data blocks is connected with current data block or the state of current data block, and described erasable meter digital is used to write down current data block by erasable number of times;
The content of described first concordance list of backup in second concordance list of described index area.
The available block of erasable number of times minimum data block as an alternative in the erasable meter digital of described acquisition specifically comprises:
Search described first concordance list, the available block that obtains erasable meter digital minimum is data block as an alternative;
When having the available block of a plurality of erasable meter digital minimums, use in the available block of described a plurality of erasable meter digital minimums one data block as an alternative, specifically comprise:
The available block of selecting first the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting last the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting an erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums at random is data block as an alternative.
Described available block is: Blank data block or dirty;
Described Blank data block, writes described new data in the described Blank data block when described acquisition available block is Blank data block for not comprising the data block of data;
Described dirty for recorded data the invalid but data block that is not wiped free of, when the available block of described acquisition was dirty, the data of wiping in described dirty became Blank data block, and described new data is write in the described Blank data block.
Describedly judge that whether data block described to be revised is file header, specifically comprises:
Judge whether data block described to be revised is recorded in the described recording areas;
If data block then described to be revised is a file header;
If not, data block then described to be revised is not a file header.
Before first concordance list in the described index area of described modification, described method also comprises:
Described second concordance list is set to effectively.
Described method also comprises:
It is effective that first concordance list is set, in the content backup of described amended first concordance list second concordance list in the described index area.
A kind of device of in memory device, revising data, wherein said memory device comprises first storage medium and second storage medium, the data field of described memory device is arranged in described first storage medium, the recording areas of described memory device and index area are arranged in described second storage medium, and described device comprises:
Obtain module, the available block that is used for obtaining in described data field erasable number of times minimum in the erasable meter digital is data block as an alternative;
Replace module, be used for new data is read and replaced with to the data of data block to be revised;
Writing module is used for described new data is write described replacement data piece;
Judge module is used to judge whether data block described to be revised is file header;
First processing module, be used for when the judged result of described judge module when being, revise first concordance list in the described index area, from described first concordance list, read the index bit in the sign of data block described to be revised, and use the index bit of data block described to be revised to replace the index bit of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length; To be revised as described replacement data piece with data block described to be revised as the file header of the file of file header in the described recording areas; Data block described to be revised is changed to available block;
Second processing module, be used for when the judged result of described judge module for not the time, revise first concordance list in the described index area, the index bit in the sign of the previous data block of data block to be revised described in described first concordance list is revised as the piece number of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length, and the piece of the next data block of data block described to be revised number is write in the index bit of sign of described replacement data piece; Data block described to be revised is changed to available block;
Described device also comprises: pretreatment module specifically comprises:
Division unit is used for described data field is divided into a plurality of data blocks, the equal and opposite in direction of described a plurality of data blocks, and have separately piece number;
Identify unit, be used for first concordance list in described index area, state to each data block in the described data field identifies respectively, described sign comprises index bit and erasable meter digital, described index bit is used for writing down the piece number of the next data block that the file be made up of a plurality of data blocks is connected with current data block or the state of current data block, and described erasable meter digital is used to write down current data block by erasable number of times;
Backup units is used for the content at described first concordance list of second concordance list backup of described index area.
Described acquisition module specifically is used for:
Search described first concordance list, the available block that obtains erasable meter digital minimum is data block as an alternative;
When having the available block of a plurality of erasable meter digital minimums, use in the available block of described a plurality of erasable meter digital minimums one data block as an alternative, specifically comprise:
The available block of selecting first the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting last the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting an erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums at random is data block as an alternative.
Described available block is: Blank data block or dirty;
Described Blank data block, writes described new data in the described Blank data block when described available block is Blank data block for not comprising the data block of data;
Described dirty for recorded data the invalid but data block that is not wiped free of, when described available block was dirty, the data of wiping in described dirty became Blank data block, and described new data is write in the described Blank data block.
Described judge module specifically is used for:
Judge whether data block described to be revised is recorded in the described recording areas;
If data block then described to be revised is a file header;
If not, data block then described to be revised is not a file header.
Described device also comprises:
Module is set, is used for described second concordance list and is set to effectively.
Described device also comprises:
Backup module is used for content backup with described amended first concordance list in second concordance list of described index area.
The beneficial effect that the technical scheme that the embodiment of the invention provides is brought is:
By for the data block in the memory device is provided with erasable meter digital, thus make erasable each time can be with minimum erasable data block data block as an alternative, balance erasable number of times, prolonged life-span of flash memory;
Description of drawings
Fig. 1 provides flash memory through pretreated structural representation in the embodiment of the invention 1;
Fig. 2 is the arrangement synoptic diagram of the data block of the storage file that provides in the embodiment of the invention 1;
Fig. 3 is the synoptic diagram of the concordance list sign that provides in the embodiment of the invention 1;
Fig. 4 is the memory state synoptic diagram in the flash memory that provides in the embodiment of the invention 1;
Fig. 5 is the arrangement synoptic diagram of the data block of the storage file that provides in the embodiment of the invention 1;
Fig. 6 is the memory state synoptic diagram in the flash memory before the modification that provides in the embodiment of the invention 1;
Fig. 7 is the method flow diagram of revising data in memory device that provides in the embodiment of the invention 1;
Fig. 8 is the memory state synoptic diagram in the amended flash memory that provides in the embodiment of the invention 1;
Fig. 9 is the apparatus structure synoptic diagram of revising data in memory device that provides in the embodiment of the invention 2.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
Present embodiment provides a kind of method of revising data in memory device, and in the present embodiment, we preferably use in memory device the partial data to a file to carry out erasablely describing as example.Comprise first storage medium and second storage medium at the employed memory device of present embodiment, in the present embodiment with first storage medium with second storage medium is respectively EEPROM and Flash describes.Wherein, EEPROM and Flash are electrically-erasable memory, and EEPROM can make amendment to data in step-by-step, and Flash can only monoblock make amendment to data.
Introduce in memory device, revising before the method for data that the embodiment of the invention provides, introduce the initialization procedure of memory device at first in conjunction with the accompanying drawings.
Referring to Fig. 1, in whole memory device, except the code district, memory device is divided into three districts: index area, recording areas and data field.
(1) data field is deposited among the Flash of memory device
Wherein, can be a plurality of equal-sized with data separation, be called data block 1, data block 2, data block 3 etc.
When at file of data area stores, use one or more data blocks that file data is stored, the data block of using in storing process must be that integer is individual.File of being made up of a plurality of data blocks shows by the form of chained list, comprising file header, center section and end-of-file.File header is first data block of a file data, and end-of-file is last data block of a file data, store an employed all data blocks of file and can arrange in order, and also can be out of order arrangement, as shown in Figure 2.
(2) index area is deposited among the EEPROM of memory device
Wherein, the index area comprises first concordance list and second concordance list.State to all data blocks of data field in first concordance list identifies successively, and as shown in Figure 3, this sign comprises erasable meter digital and index bit, and the figure place of sign is according to the number decision of data block.Erasable meter digital has write down this data block by erasable number of times, and index bit has write down the piece number of the next data block that is connected with this data block or the state of this data block in a file of being made up of a plurality of data block.In the present embodiment, the number of supposing data block in the flash memory then preferably uses two bytes that each data block is identified less than 254.Wherein, the erasable number of times of first this data block of byte records, the state of second this data block of byte records or record be the piece number of the next data block of this data block hereof.The sign of all Blank data blocks in first concordance list all is set to 0xXX00, the end-of-file data block be designated 0xXXFF (wherein, XX represents the erasable number of times of this data block).For example when initialization, first concordance list all is set to 0x0000, file as shown in Figure 4, and data block 3 corresponding identification should be 0xXX05, and data block 6 corresponding identification should be 0xXXFF.Wherein, second concordance list is the backup of first concordance list, can prevent that reasons such as unexpected power down or misoperation from causing the first concordance list loss of data and cause and can not the file in the flash memory be read and write;
(3) recording areas is also deposited among the EEPROM of memory device
It has write down file header, file attribute, the size of file, the Time of Day of document creation of the All Files of storing etc. in flash memory.
So far, introduced the initialization procedure of flash memory after, be described in detail in conjunction with the method for the following examples erasable data in the flash memory.
In the present embodiment, with a data block revising a file is that example describes this method, set a file A, its memory state in flash memory as shown in Figure 5, take 4 data blocks of flash memory altogether, file header 2, data block 4, data block 7 and end-of-file 9, first concordance list of its correspondence as shown in Figure 6.With the data in the data block 4 are made amendment (being that data block 4 is data block to be revised) is that example describes, referring to Fig. 7.
Step 101: the available block of seeking erasable number of times minimum in the erasable meter digital in the data field is data block as an alternative;
In this step, seek erasable number of times minimum available block method can for: scan all signs in first concordance list, and the byte of searching the erasable number of times of recording data blocks, with the available block of the erasable number of times minimum that finds data block as an alternative.
Wherein, if there is the available block of a plurality of erasable number of times minimums, then can search: for example according to other rules, first available block in the available block of the erasable number of times minimum that selection finds is data block as an alternative, or select last available block data block as an alternative in the available block of the erasable number of times minimum find, or from the available block of erasable number of times minimum the method etc. of picked at random replacement data piece.In the present embodiment, the method for data block and the replacement data piece that finds are that data block 11 describes as an alternative with first available block in the available block of the erasable number of times minimum selecting to find.
Available block specifically can comprise Blank data block and dirty, and so-called Blank data block is not for comprising the data block of data, but so-called dirty is meant the invalid data block that is not wiped free of of recorded data.
Step 102: the content of data block 4 that will be to be revised reads and is updated to the new data of desiring in the writing data blocks 4 from data block 4;
Wherein, find the process of the data block of prepare revising 4 to be: in recording areas, to find the data block at the file header place that needs revise according to filename, read first index area and find data block 4, it is read according to side-play amount.
With the content in the data block 4 read and be updated to desire the new data in the writing data blocks 4 process can for: the content of storage in the data block 4 is read in internal memory, is new data with content update in internal memory.
Step 103: new data is write replacement data piece 11;
In this step, when the available block that obtains in the step 101 is Blank data block, when promptly replacement data piece 11 is Blank data block, can directly new data be write replacement data piece 11;
When the available block that obtains in the step 101 is dirty, when promptly replacement data piece 11 is dirty, need earlier replacement data piece 11 to be carried out erase operation, make it become Blank data block, again new data is write replacement data piece 11.
Step 104: judge whether the data block 4 that will revise is file header;
If, execution in step 105;
If not, execution in step 108.
Wherein, the judgment data piece whether be file header method can for: judge whether this data block is registered as file header in recording areas:
If then be file header;
Otherwise, be not file header.
Need to prove that before execution in step 105 or 108, can also comprise: it is effective that second concordance list is set, the purpose of this step mainly is the effect that prevents power down in order to play, even power down suddenly, second tables of data is effective, can not exert an influence, can recover legacy data overall data.
Step 105: first concordance list is made amendment, sign in first concordance list is read with data block 4 and data block 11, and the index bit in the sign of use data block 4 is replaced the index bit of the sign of above-mentioned data block 11, and the counting in the erasable meter digital of the sign of replacement data piece 11 increased a step-length, be set to increase by 1 in the present embodiment;
Wherein, in the present embodiment, aforesaid operations is specifically as follows:
Read the sign 0x0507 of data block 4 in first concordance list, the index bit of sign that will the index bit 07 replacement data piece 11 of sign among the 0x0507 adds 1 with the counting in the erasable meter digital of the sign of replacement data piece 11.Aforesaid operations obtains the new identification information 0x0507 of replacement data piece 11.
Step 106: the sign of data block 4 in first concordance list is set to available block;
In the present embodiment, sign that can data block 4 is set to 0x0500;
Step 107: it is effective that first concordance list is set, and in recording areas data block 4 is updated to data block 11, execution in step 110 as the file header of the file of file header;
In the present embodiment; if power down takes place suddenly in the process of execution in step 105 to 108; because second concordance list is effective; and the data in the data block 4 are not wiped free of as yet; when next time, flash memory powered on, compare the content of first concordance list and second concordance list, and the content of second concordance list is copied in first concordance list; and it is effective that first concordance list is set, and can effectively play the effect that prevents that power down, protected data from not losing.
Step 108: first concordance list is made amendment, the piece of replacement data piece No. 11 11 is written to the index bit of sign of the previous data block of data block to be revised 4, and with the step-length of erasable meter digital increase in the sign of replacement data piece, be that erasable meter digital is increased by 1 in the present embodiment, and the piece of the next piece of data block that will be to be revised No. 4 is that the sign of data block 4 is set to available block in the index bit of piece numbers 7 sign that writes replacement data piece 11;
In this enforcement, the previous data block of the data block of revising 4 is data blocks 2, the call number of its sign in first concordance list is 0x0504, because use data block 11 to replace data block 4, therefore the piece of data block No. 11 is written in the index bit of sign 0x0504, obtain the new sign 0x050B of data block 2, and sign that can data block 4 is set to 0x0500.
Step 109: it is effective that first concordance list is set;
Step 110: in second concordance list, file modification finishes with the content backup of first concordance list.
Wherein, the concordance list content after file modification is finished as shown in Figure 8.
In this step, if generation power down, because this moment, the content of first concordance list was correct, content the unknown of second concordance list, the content that compared first concordance list and second concordance list when next time, flash memory powered on, and the content of first concordance list copied in second concordance list, overall data is just upgraded for new data.
The embodiment of the invention is by for the data block in the memory device is provided with erasable meter digital, thus make erasable each time can be with minimum erasable data block data block as an alternative, balance erasable number of times, prolonged life-span of flash memory; Simultaneously, since first concordance list and the mutually redundant relation of second concordance list, contingent loss of data when effectively having prevented power down.
Embodiment 2
The embodiment of the invention provides a kind of device of revising data in memory device, and for the description of the method for revising data, referring to Fig. 9, this device comprises in the reference example 1:
Obtain module 201, be used for obtaining available block data block as an alternative in the data field;
Replace module 202, be used for new data is read and replaced with to the data of data block to be revised;
Writing module 203 is used for new data is write the replacement data piece;
Judge module 204 is used to judge whether data block to be revised is file header;
First processing module 205, be used for when the judged result of judge module when being, revise first concordance list in the index area, from first concordance list, read the index bit in the sign of data block to be revised, and use the index bit of data block to be revised to replace the index bit of replacement data piece; Erasable meter digital in the sign of replacement data piece is increased a step-length; To be revised as the replacement data piece with data block to be revised as the file header of the file of file header in the recording areas; Data block to be revised is changed to available block;
Second processing module 206, be used for when the judged result of judge module for not the time, revise first concordance list in the index area, index bit in the sign of the previous data block of data block to be revised in first concordance list is revised as the piece number of replacement data piece, erasable meter digital in the sign of replacement data piece is increased a step-length, and the piece that will wait to revise the next piece of data block number writes in the index bit of replacement data piece; Data block to be revised is changed to available block.
Further, this device also comprises: pretreatment module, and this module specifically comprises:
Division unit is used for the data field is divided into a plurality of data blocks, the equal and opposite in direction of a plurality of data blocks, and have separately piece number;
Identify unit, be used for first concordance list in the index area, state to each data block in the data field identifies respectively, sign comprises index bit and erasable meter digital, index bit is used for writing down the piece number of the next data block that the file be made up of a plurality of data blocks is connected with current data block or the state of current data block, and erasable meter digital is used to write down current data block by erasable number of times;
Backup units is used for the content at second concordance list backup, first concordance list of index area.
Obtaining module 201 specifically is used for:
Search first concordance list, the available block that obtains erasable meter digital minimum is data block as an alternative;
When having the available block of a plurality of erasable meter digital minimums, use in the available block of a plurality of erasable meter digital minimums one data block as an alternative, can comprise several different methods: for example, first available block in the available block of a plurality of erasable meter digital minimum that selection finds is data block as an alternative, or select last available block data block as an alternative in the available block of a plurality of erasable meter digital minimum find, or from the available block of a plurality of erasable meter digital minimums the method etc. of picked at random replacement data piece;
Need to prove that available block is: Blank data block or dirty;
Blank data block when the available block that obtains module 201 acquisitions is Blank data block, can directly write new data this Blank data block for not comprising the data block of data;
Dirty for recorded data the invalid but data block that is not wiped free of, when obtaining available block that module 201 obtains and be dirty, need earlier should dirty to be erased to Blank data block, again new data is write above-mentioned new Blank data block.
Wherein, judge module 204 specifically is used for:
Judge whether data block to be revised is recorded in the recording areas;
If data block then to be revised is a file header;
If not, data block then to be revised is not a file header.
Further, this device also comprises:
Module is set, is used for second concordance list and is set to effectively.
Further, this device also comprises:
Backup module is used for content backup with amended first concordance list in second concordance list of index area.
The embodiment of the invention is by for the data block in the memory device is provided with erasable meter digital, thus make erasable each time can be with minimum erasable data block data block as an alternative, balance erasable number of times, prolonged life-span of flash memory; Simultaneously, since first concordance list and the mutually redundant relation of second concordance list, contingent loss of data when effectively having prevented power down.
Below only be preferred embodiment of the present invention, or not within the spirit and principles in the present invention not all in order to restriction the present invention, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (14)

1. method of in memory device, revising data, wherein said memory device comprises first storage medium and second storage medium, the data field of described memory device is arranged in described first storage medium, the recording areas of described memory device and index area are arranged in described second storage medium, it is characterized in that, when needs were revised data in the described memory device, described method comprised:
The available block that obtains erasable number of times minimum in the erasable meter digital in described data field is data block as an alternative;
New data is read and replaced with to data in the data block to be revised;
Described new data is write in the described replacement data piece;
Judge whether data block described to be revised is file header;
If, revise first concordance list in the described index area, from described first concordance list, read the index bit in the sign of data block described to be revised, and use the index bit of data block described to be revised to replace the index bit of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length; To be revised as described replacement data piece with data block described to be revised as the file header of the file of file header in the described recording areas; Data block described to be revised is changed to available block;
If not, revise first concordance list in the described index area, the index bit in the sign of the previous data block of data block to be revised described in described first concordance list is revised as the piece number of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length, and the piece of the next data block of data block described to be revised number is write in the index bit of sign of described replacement data piece; Data block described to be revised is changed to available block.
2. the method for claim 1 is characterized in that, described method also comprises: the preprocessing process of described memory device;
Described preprocessing process specifically comprises:
Described data field is divided into a plurality of data blocks, the equal and opposite in direction of described a plurality of data blocks, and have separately piece number;
In first concordance list of described index area, state to each data block in the described data field identifies respectively, described sign comprises index bit and erasable meter digital, described index bit is used for writing down the piece number of the next data block that the file be made up of a plurality of data blocks is connected with current data block or the state of current data block, and described erasable meter digital is used to write down current data block by erasable number of times;
The content of described first concordance list of backup in second concordance list of described index area.
3. the method for claim 1 is characterized in that, the available block of erasable number of times minimum data block as an alternative in the erasable meter digital of described acquisition specifically comprises:
Search described first concordance list, the available block that obtains erasable meter digital minimum is data block as an alternative;
Wherein, when having the available block of a plurality of erasable meter digital minimums, use in the available block of described a plurality of erasable meter digital minimums one data block as an alternative, specifically comprise:
The available block of selecting first the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting last the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting an erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums at random is data block as an alternative.
4. as claim 1 or 3 described methods, it is characterized in that described available block is: Blank data block or dirty;
Described Blank data block, writes described new data in the described Blank data block when described acquisition available block is Blank data block for not comprising the data block of data;
Described dirty for recorded data the invalid but data block that is not wiped free of, when the available block of described acquisition was dirty, the data of wiping in described dirty became Blank data block, and described new data is write in the described Blank data block.
5. the method for claim 1 is characterized in that, describedly judges that whether data block described to be revised is file header, specifically comprises:
Judge whether data block described to be revised is recorded in the described recording areas;
If data block then described to be revised is a file header;
If not, data block then described to be revised is not a file header.
6. the method for claim 1 is characterized in that, before first concordance list in the described index area of described modification, described method also comprises:
Described second concordance list is set to effectively.
7. the method for claim 1 is characterized in that, described method also comprises:
It is effective that first concordance list is set, in the content backup of described amended first concordance list second concordance list in the described index area.
8. device of in memory device, revising data, wherein said memory device comprises first storage medium and second storage medium, the data field of described memory device is arranged in described first storage medium, the recording areas of described memory device and index area are arranged in described second storage medium, it is characterized in that described device comprises:
Obtain module, the available block that is used for obtaining in described data field erasable number of times minimum in the erasable meter digital is data block as an alternative;
Replace module, be used for new data is read and replaced with to the data of data block to be revised;
Writing module is used for described new data is write described replacement data piece;
Judge module is used to judge whether data block described to be revised is file header;
First processing module, be used for when the judged result of described judge module when being, revise first concordance list in the described index area, from described first concordance list, read the index bit in the sign of data block described to be revised, and use the index bit of data block described to be revised to replace the index bit of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length; To be revised as described replacement data piece with data block described to be revised as the file header of the file of file header in the described recording areas; Data block described to be revised is changed to available block;
Second processing module, be used for when the judged result of described judge module for not the time, revise first concordance list in the described index area, the index bit in the sign of the previous data block of data block to be revised described in described first concordance list is revised as the piece number of described replacement data piece; Erasable meter digital in the sign of described replacement data piece is increased a step-length, and the piece of the next data block of data block described to be revised number is write in the index bit of sign of described replacement data piece; Data block described to be revised is changed to available block.
9. device as claimed in claim 8 is characterized in that, described device also comprises: pretreatment module specifically comprises:
Division unit is used for described data field is divided into a plurality of data blocks, the equal and opposite in direction of described a plurality of data blocks, and have separately piece number;
Identify unit, be used for first concordance list in described index area, state to each data block in the described data field identifies respectively, described sign comprises index bit and erasable meter digital, described index bit is used for writing down the piece number of the next data block that the file be made up of a plurality of data blocks is connected with current data block or the state of current data block, and described erasable meter digital is used to write down current data block by erasable number of times;
Backup units is used for the content at described first concordance list of second concordance list backup of described index area.
10. device as claimed in claim 8 is characterized in that, described acquisition module specifically is used for:
Search described first concordance list, the available block that obtains erasable meter digital minimum is data block as an alternative;
When having the available block of a plurality of erasable meter digital minimums, use in the available block of described a plurality of erasable meter digital minimums one data block as an alternative, specifically comprise:
The available block of selecting first the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting last the erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums is data block as an alternative;
Or,
The available block of selecting an erasable meter digital minimum in the available block of described a plurality of erasable meter digital minimums at random is data block as an alternative.
11., it is characterized in that described available block is: Blank data block or dirty as claim 8 or 10 described devices;
Described Blank data block, writes described new data in the described Blank data block when described available block is Blank data block for not comprising the data block of data;
Described dirty for recorded data the invalid but data block that is not wiped free of, when described available block was dirty, the data of wiping in described dirty became Blank data block, and described new data is write in the described Blank data block.
12. device as claimed in claim 8 is characterized in that, described judge module specifically is used for:
Judge whether data block described to be revised is recorded in the described recording areas;
If data block then described to be revised is a file header;
If not, data block then described to be revised is not a file header.
13. device as claimed in claim 8 is characterized in that, described device also comprises:
Module is set, is used for described second concordance list and is set to effectively.
14. device as claimed in claim 8 is characterized in that, described device also comprises:
Backup module is used for content backup with described amended first concordance list in second concordance list of described index area.
CN2009100883780A 2009-07-02 2009-07-02 Method and device for modifying data in memory Expired - Fee Related CN101650692B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100883780A CN101650692B (en) 2009-07-02 2009-07-02 Method and device for modifying data in memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100883780A CN101650692B (en) 2009-07-02 2009-07-02 Method and device for modifying data in memory

Publications (2)

Publication Number Publication Date
CN101650692A CN101650692A (en) 2010-02-17
CN101650692B true CN101650692B (en) 2011-01-05

Family

ID=41672931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100883780A Expired - Fee Related CN101650692B (en) 2009-07-02 2009-07-02 Method and device for modifying data in memory

Country Status (1)

Country Link
CN (1) CN101650692B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102097125B (en) * 2010-12-07 2013-03-20 清华大学 Phase-memory write operation method
CN102810092B (en) * 2011-05-31 2017-07-07 腾讯科技(深圳)有限公司 data read-write method and system
CN109947842B (en) * 2017-07-27 2021-06-18 杭州海康威视数字技术股份有限公司 Data storage method, device and system in distributed storage system
CN111400302B (en) * 2019-11-28 2023-09-19 杭州海康威视系统技术有限公司 Modification method, device and system for continuous storage data
CN111338853B (en) * 2020-03-16 2023-06-16 南京云信达科技有限公司 Linux-based data real-time storage system and method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127004A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 System and method for accessing data on flash memory
CN101441639A (en) * 2007-11-21 2009-05-27 英业达股份有限公司 Generating method of mapping file

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127004A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 System and method for accessing data on flash memory
CN101441639A (en) * 2007-11-21 2009-05-27 英业达股份有限公司 Generating method of mapping file

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JP特开2005-100509A 2005.04.14
JP特开平6-35780A 1994.02.10

Also Published As

Publication number Publication date
CN101650692A (en) 2010-02-17

Similar Documents

Publication Publication Date Title
CN1045676C (en) Memory card and recording, reproducing and erasing method using the same
CN101515276B (en) Method for write operation of file data, and recovery method and recovery system for file data
CN102737715B (en) For the method for power fail safeguard of data of NOR flash memory
CN102779096B (en) Page, block and face-based three-dimensional flash memory address mapping method
CN102135942B (en) Method for realizing wear-leveling in storage equipment as well as the storage equipment
CN101527142B (en) Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof
CN101364166B (en) Method and device for simulating Nand flash of 2048 byte page into hard disk
CN101241472B (en) Mapping management process and system
CN101650692B (en) Method and device for modifying data in memory
US6636941B1 (en) Enhanced stable disk storage
CN101645043B (en) Methods for reading and writing data and memory device
CN102483714A (en) Restore Index Page
CN103890856A (en) Shiftable memory supporting in-memory data structures
CN102024060B (en) Method for memorizing files and restoring error deleted files
CN113190180A (en) Storage device based on mixed media and distributed storage system
CN105302665A (en) Improved copy-on-write snapshot method and system
CN105205008B (en) Reduce the method that log blocks mapping table memory source occupies in mixed-use developments algorithm
CN101105774A (en) Logic and physical address index conversion management method
CN107133334A (en) Method of data synchronization based on high bandwidth storage system
CN102736981B (en) Improve the method for NOR FLASH erase/write life
CN101303667A (en) Method and device for establishing magnetic disk null cluster table and seeking magnetic disk null cluster
CN108376121B (en) Data storage method of Flash memory
Lee et al. Efficient logging of metadata using NVRAM for NAND flash based file system
WO2019136969A1 (en) High-efficiency method for mapping physical position to logical mapping position
CN109284201A (en) Temperature equalization data reconstruction method and system, storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee

Owner name: FEITIAN CHENGXIN TECHNOLOGY CO., LTD.

Free format text: FORMER NAME: BEIJING FEITIAN CHENGXIN SCIENCE + TECHNOLOGY CO. LTD.

CP03 Change of name, title or address

Address after: 100085 Beijing city Haidian District Xueqing Road No. 9 Ebizal building B block 17 layer

Patentee after: Feitian Technologies Co.,Ltd.

Address before: 100191, Haidian District, Xueyuan Road, No. 40 research, 7 floor, 5 floor, Beijing

Patentee before: FEITIAN TECHNOLOGIES Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110105

CF01 Termination of patent right due to non-payment of annual fee