CN1204501C - FLASH storage file management method - Google Patents
FLASH storage file management method Download PDFInfo
- Publication number
- CN1204501C CN1204501C CN 01142240 CN01142240A CN1204501C CN 1204501 C CN1204501 C CN 1204501C CN 01142240 CN01142240 CN 01142240 CN 01142240 A CN01142240 A CN 01142240A CN 1204501 C CN1204501 C CN 1204501C
- Authority
- CN
- China
- Prior art keywords
- file
- piece
- steps
- management method
- flash
- 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
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention discloses a FLASH storage file management method. The present invention comprises the steps that an FLAHS memory is divided into a file data storage area and a file index area, and the file data storage area and the file index area are composed of basic allocation unit blocks; the file data storage area is used for storing specific contents of files, and the file index area is used for recording the allocation information of file directories and blocks; based on the division, file write-in operation, file read-out operation and file erasing operation are carried out so that the space of the FLASH memory si dynamically allocated in use according to the quantity and length of the files. By using the method, resources are reasonably utilized; when the quantity of the files is regulated, or the size of the files is changed, codes do not need to be modified, and software does not need to be upgraded. Besides, the present invention has the advantages of flexible and convenient use and economization of storage space.
Description
Technical field
The present invention relates to storage management method, relate in particular to a kind of FLASH (flash Electrically Erasable Read Only Memory) storage file management method.
Background technology
A FLASH chip storage capacity is fixed, for storing different data files, existing technology is generally taked following management method, fixedly be divided into several storage areas according to FLASH capacity, number of files and big young pathbreaker FLASH earlier, for example, want 5 different files of storage size, just earlier FLASH is divided into five zones that differ in size, again to the start address of each file correspondence record in addition respectively.Data such as each above field capacity size and start address are all with in the constant form write-in program code, when operation such as need carry out reading and writing to certain file, wipe, find the start address and the area size of its correspondence earlier, operation such as carry out the data reading and writing to this address then, wipe.Simple, the realization easily of this scheme, the FLASH management of existing product all is to adopt said method basically.
And this method has the following disadvantages: (1) programmer must know the number of files that will store in advance before writing FLASH management software code, with decision FLASH is divided into several zones, be unfavorable for that product stores the indefinite file of number in application, if the number of files of storage is more than the subregion number, just must remodify code, upgrade software.(2) size of programmer's each file that estimation in advance will be stored before writing FLASH management software code, with the decision is that this document distributes great FLASH zone, if the file size of storage is bigger than the zone of reserving, then this document can't correctly be stored, and also disturb the file storage of close region.
(3) because the file size of pre-estimating is inaccurate, or meet file modification, very likely give an original very little bigger storage area of file allocation, cause the waste of storage space.
Summary of the invention
The object of the present invention is to provide a kind of FLASH storage file management method that distributes rationally, uses flexibly and save storage space.
For achieving the above object, the technical solution used in the present invention is: at first, the FLASH storage space is divided into file index district and two zones of file data storage region, the file index district is used for the assignment information of log file catalogue and basic allocation unit " piece ", and file data storage region is used for the particular content of storage file;
The operation that file writes may further comprise the steps:
A1, search for first sky piece as starting block;
A2, with in the file data write-in block;
Whether A3, inspection file have all been write, if finish write operation; If not, execution in step A4;
A4, the next empty piece of search, and in the assignment information of " piece " the link order of record " piece ", steps A 2 is changeed in the back;
The operation that file is read may further comprise the steps:
B1, from file directory, obtain starting block;
B2, read file data;
B3, from the assignment information of " piece ", find next piece;
If last piece of B4 no show file, repeated execution of steps B2 to B4;
The operation that file is wiped may further comprise the steps:
C1, from file directory, obtain starting block;
C2, wipe file data;
C3, from the assignment information of " piece ", find next piece;
If last piece of C4 no show file, repeated execution of steps C2 to C4.
Owing to adopt above technical scheme, make the FLASH space in use according to quantity of documents and length dynamic assignment, change static allocation in the prior art, fixed the deficiency of using and bringing, more reasonable to the utilization of resource; Need not to revise code, upgrade software when adjusting number of files or changing file size, flexible and convenient to use and saving storage space.
Description of drawings
Fig. 1 is FLASH partitioned organization figure among the present invention program;
Fig. 2 is a kind of embodiment synoptic diagram of FLASH index area among the present invention program;
Fig. 3 is a kind of embodiment process flow diagram that file writes FLASH among the present invention program;
Fig. 4 is a kind of embodiment process flow diagram of reading file among the present invention program from FLASH
Fig. 5 is a kind of embodiment process flow diagram of wiping file among the present invention program from FLASH
Embodiment
With reference to Fig. 1, FLASH storage file management method of the present invention at first is divided into FLASH two zones, one of them zone file data storage region that is used for the storage file particular content for being made up of basic allocation unit " piece "; Another zone is the file index district that is used for the assignment information of log file catalogue and basic allocation unit " piece ".Common FLASH chip physically is divided into tens of unit length and arrives hundreds of " piece ", is divided into 128 as every of INTEL 28F128 FLAH chip, and every 128K byte can be with these " pieces " as basic allocation unit when specifically dividing.According to such division, the file index district only accounts for 1 to 2 " piece " just can satisfy the storage needs, and all the other pieces are all to file data storage region.
With reference to Fig. 2, the file index district can be further divided into two sections of branches, i.e. file directory section 1 and " piece " table section 2.The catalogue of existing file among the file directory section 1 record FLASH, but every file catalogue include file name, starting block number, file size and file status information can also comprise other attributes such as FileVersion, author, time.The information that the assignment information of " piece " table section 2 records " piece " and each file are shared.
The FLASH storage space is carried out after the above-mentioned division, can writing, reading and erase operation by the inventive method execute file.
Figure 3 shows that file writes a kind of embodiment of FLASH, program checks for this document whether enough storage spaces are arranged earlier, if having, continues steps A 1; If do not have, finish after then returning the not enough information in space.Steps A 1 is that first sky piece of search is as starting block; Check subsequently whether file directory successfully writes file directory section 1, if then the seizure condition of current block is changed to and takies, and continue steps A 2; If not, finish after returning corresponding information; Steps A 2 is with in the file data write-in block, and after this, the program checkout file data writes whether success, if not, finishes after returning corresponding information; If execution in step A3 checks whether file has all been write, if finish write operation; If not, execution in step A4; Steps A 4 is searched for next empty piece, and writes down the link order of " piece " in the assignment information of " piece ", and steps A 2 is changeed in the back; The assignment information of " piece " shown in Fig. 2 comprises this piece piece number, seizure condition, next piece piece number, promptly this piece piece of occupied each piece number and next piece piece number is noted down by the link order of this embodiment steps A 4 described records " piece ".In embodiment shown in Figure 3, " piece " user mode information comprises seizure condition and the chain list index that is used in reference to next piece, and the link of steps A 4 described records " piece " is to write its chained list pointer position of last with occupied number in proper order.When finishing write operation, present embodiment in chained list, writes end-of-file marker, replacement file status.
Figure 4 shows that a kind of embodiment of reading file from FLASH, at first execution in step B1 obtains starting block from file directory; Execution in step B2 reads file data again, checks subsequently and reads whether success of file data blocks, if not, finishes after returning corresponding information; If, continue step B3, from the assignment information of " piece ", find next piece; Execution in step B4 again, it is last whether inspection arrives file, can be to check whether the chain list index points to tail tag will in concrete the enforcement, if, the operation that file is read in end if not, is back to step B2, the effect of step B4 is if last piece of no show file, repeated execution of steps B2 to B4.
Figure 5 shows that a kind of embodiment of wiping file from FLASH, at first execution in step C1 obtains starting block from file directory; Execution in step C2 wipes file data again, checks subsequently and wipes whether success of file data blocks, if not, finishes after returning corresponding information; If, the piece seizure condition is changed to data wipes, continue step C3 again, from the assignment information of " piece ", find next piece; Execution in step C4 again, it is last whether inspection arrives file, can be to check whether the chain list index points to tail tag will in concrete the enforcement, if, the operation that file is wiped in end if not, is back to step C2, the effect of step C4 is if last piece of no show file, repeated execution of steps C2 to C4.When present embodiment finished erase operation, putting file status was that data are wiped.
The length of basic allocation unit described in the inventive method " piece " also can make space availability ratio improve according to the operating position explication by User Defined.
Claims (5)
1, a kind of FLASH storage file management method, it is characterized in that: the FLASH storage space is divided into file index district and two zones of file data storage region, the file index district is used for the assignment information of the basic allocation unit " piece " of log file catalogue and file data storage region, described file directory comprises the piece number of the starting block of filename and store file data, the assignment information of described " piece " comprises the link order of piece number, piece seizure condition and piece, and file data storage region is used for the particular content of storage file;
The operation that file writes may further comprise the steps:
A1, search for the starting block of first sky piece, the piece of described starting block number is kept in the described file index district corresponding file catalogue as file data storage;
A2, with in the file data write-in block, the piece seizure condition of this piece be changed to take;
Whether A3, inspection file have all been write, if finish write operation; If not, execution in step A4;
A4, the next empty piece of search, and in the assignment information of " piece " the link order of record " piece ", steps A 2 is changeed in the back;
The operation that file is read may further comprise the steps:
B1, from file directory, obtain starting block;
B2, read file data;
B3, from the assignment information of " piece ", find next piece;
If last piece of B4 no show file, repeated execution of steps B2 to B4;
The operation that file is wiped may further comprise the steps:
C1, from file directory, obtain starting block;
C2, wipe file data, described seizure condition is changed to data wipes;
C3, from the assignment information of " piece ", find next piece;
If last piece of C4 no show file, repeated execution of steps C2 to C4.
2, FLASH storage file management method as claimed in claim 1, it is characterized in that: described file directory also comprises file size, file status.
3, FLASH storage file management method as claimed in claim 1 is characterized in that: the link of steps A 4 described records " piece " order promptly number is noted down to this piece piece of occupied each piece number and next piece piece.
4, FLASH storage file management method as claimed in claim 1 is characterized in that: the link of steps A 4 described records " piece " is to write its chained list pointer position of last with occupied number in proper order.
5, FLASH storage file management method as claimed in claim 1 is characterized in that: the length of described basic allocation unit " piece " is by User Defined.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 01142240 CN1204501C (en) | 2001-09-18 | 2001-09-18 | FLASH storage file management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 01142240 CN1204501C (en) | 2001-09-18 | 2001-09-18 | FLASH storage file management method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1405683A CN1405683A (en) | 2003-03-26 |
CN1204501C true CN1204501C (en) | 2005-06-01 |
Family
ID=4676714
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 01142240 Expired - Fee Related CN1204501C (en) | 2001-09-18 | 2001-09-18 | FLASH storage file management method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1204501C (en) |
Families Citing this family (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100336392C (en) * | 2003-12-03 | 2007-09-05 | 北京中视联数字***有限公司 | Data storage managing method of set-top box |
CN100431051C (en) * | 2005-08-12 | 2008-11-05 | 中兴通讯股份有限公司 | Method for configuring parameter in NOR FLASH |
KR101320917B1 (en) | 2006-10-02 | 2013-10-21 | 삼성전자주식회사 | Method for writing file by different writing scheme according to file characteristic and electronic device thereof |
CN100557611C (en) * | 2007-11-15 | 2009-11-04 | 深圳华为通信技术有限公司 | A kind of disposal route of file and device |
CN101221581B (en) * | 2008-01-24 | 2010-06-02 | 北京中星微电子有限公司 | Data file generation method and device |
CN101334823B (en) * | 2008-07-17 | 2010-07-07 | 成都市华为赛门铁克科技有限公司 | File virtualization processing method and device |
CN101799788B (en) | 2010-03-23 | 2014-06-11 | 中兴通讯股份有限公司 | Level-to-level administration method and system of storage resources |
CN102004700A (en) * | 2010-11-26 | 2011-04-06 | 华为终端有限公司 | Memory space distribution method and device for flash memory |
CN102279805A (en) * | 2011-09-06 | 2011-12-14 | 四川九洲电器集团有限责任公司 | Memory data storing and reading method |
CN104572723A (en) * | 2013-10-21 | 2015-04-29 | 华为技术有限公司 | File access method and file access device |
CN104077167A (en) * | 2014-07-11 | 2014-10-01 | 杭州华三通信技术有限公司 | Boot loading method and device based on NAND FLASH |
CN104376099A (en) * | 2014-11-25 | 2015-02-25 | 贵州电力试验研究院 | Flash-memory-based file system implementation method and device |
CN104462280A (en) * | 2014-11-27 | 2015-03-25 | 国网上海市电力公司 | Data information storage and fast inquiry method used for embedded system |
CN105718530B (en) * | 2016-01-15 | 2020-02-04 | 上海磁宇信息科技有限公司 | File storage system and file storage control method thereof |
CN106440256A (en) * | 2016-11-11 | 2017-02-22 | 四川长虹电子部品有限公司 | Remote controller for air conditioner and data storage method of remote controller |
CN106959823B (en) * | 2017-03-13 | 2020-04-17 | 许继集团有限公司 | Implementation method for increasing FLASH parameter storage times |
CN108629927A (en) * | 2017-03-23 | 2018-10-09 | 惠尔丰(中国)信息***有限公司 | A kind of optimization method of the memory of low dump machine |
CN108664482B (en) * | 2017-03-27 | 2021-09-07 | 珠海极海半导体有限公司 | FLASH memory and storage file management method |
CN114035749B (en) * | 2018-01-12 | 2023-02-28 | 珠海极海半导体有限公司 | Electronic equipment and Flash memory |
CN108415852B (en) * | 2018-03-01 | 2021-12-14 | 曲阜师范大学 | Data access method of Flash memory |
CN108376121B (en) * | 2018-03-01 | 2021-10-22 | 曲阜师范大学 | Data storage method of Flash memory |
CN108710578B (en) * | 2018-04-20 | 2022-07-26 | 深圳市战音科技有限公司 | Data storage method and device based on flash memory |
CN109002399B (en) * | 2018-07-09 | 2021-05-18 | 北京智芯微电子科技有限公司 | Method for recording embedded equipment event |
CN113934371B (en) * | 2021-10-08 | 2024-04-12 | 福建星网视易信息***有限公司 | Memory, data management method thereof and computer storage medium |
-
2001
- 2001-09-18 CN CN 01142240 patent/CN1204501C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN1405683A (en) | 2003-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1204501C (en) | FLASH storage file management method | |
US7610434B2 (en) | File recording apparatus | |
CN101027651B (en) | FAT analysis for optimized sequential cluster management | |
KR100390616B1 (en) | System and method for persistent and robust storage allocation | |
CN101147119B (en) | Direct data file storage implementation techniques in flash memories | |
CN1078364C (en) | Flash file system | |
Chiang et al. | Cleaning policies in mobile computers using flash memory | |
JP3771803B2 (en) | System and method for persistent and robust memory management | |
US6587915B1 (en) | Flash memory having data blocks, spare blocks, a map block and a header block and a method for controlling the same | |
CN102831071B (en) | For the method and system that the memory address of storage arrangement remaps | |
CN1223945C (en) | Improved flash file system | |
US8214583B2 (en) | Direct file data programming and deletion in flash memories | |
CN101263462B (en) | Nonvolatile memory with block management | |
CN1079552C (en) | Real time data migration system and method employing sparse files | |
CN1146795C (en) | Memory management method | |
US20060218347A1 (en) | Memory card | |
KR20080043806A (en) | Method and system for dual mode access for storage devices | |
CN101606133A (en) | Use with immediate data file system of continuous logical address space interface | |
JP2011519095A (en) | Method and system for storage address remapping for multi-bank storage devices | |
CN1466060A (en) | Flash memory file system | |
CN101408880A (en) | Methods and apparatus for file management using partitioned file metadata | |
WO2010035124A1 (en) | File system for storage device which uses different cluster sizes | |
CN101051317A (en) | FAT file system and its processing method | |
US5678024A (en) | Method and system for dynamic performance resource management within a computer based system | |
KR100907477B1 (en) | Apparatus and method for managing index of data stored in flash memory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20050601 Termination date: 20130918 |