CN100419756C - File distribution list file system read-write method and device - Google Patents
File distribution list file system read-write method and device Download PDFInfo
- Publication number
- CN100419756C CN100419756C CNB2005101026917A CN200510102691A CN100419756C CN 100419756 C CN100419756 C CN 100419756C CN B2005101026917 A CNB2005101026917 A CN B2005101026917A CN 200510102691 A CN200510102691 A CN 200510102691A CN 100419756 C CN100419756 C CN 100419756C
- Authority
- CN
- China
- Prior art keywords
- information
- bunch
- read
- successive clusters
- file
- 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
- 238000000034 method Methods 0.000 title claims abstract description 21
- 238000003860 storage Methods 0.000 claims description 36
- 239000000284 extract Substances 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 9
- 230000006835 compression Effects 0.000 description 4
- 238000007906 compression Methods 0.000 description 4
- 239000012467 final product Substances 0.000 description 2
- 239000000047 product Substances 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention discloses an FAT file system read-write method and a device thereof. The method comprises the following steps: first, an FAT table is read, and information of a cluster chain structure of a stored file is picked up. According to the information of the cluster chain structure of the file, the position information of a first cluster of continuous clusters and the information of the length of the continuous clusters are determined; then, the position information of the first cluster of continuous clusters and the information of the length of the continuous clusters are in sequence stored into a buffer area to form replacing information for the FAT table; finally, reading and writing operation is carried out for the file based on the replacing information. The present invention only needs fewer buffer areas to buffer the cluster chain structure of the FAT table and reduces the burden of a main processor because the main processor is only needed once to send commands to have access to each file.
Description
Technical field
The present invention relates to a kind of reading/writing method and device of file system, relate in particular to a kind of reading/writing method and device of FAT file system.
Background technology
File allocation table (File Allocation Table is called for short FAT) file system is to use a kind of very widely file system at present.Present most of PC, movable memory equipment all adopt the FAT file system (comprise FAT12, FAT16, FAT32).Along with improving constantly of the performance of hand-held digital equipment (mobile phone, PDA, MP3, digital camera etc.), various digital products also more and more become a standard feature to the support of the storage card (SD card, mmc card, CF, built-in flash etc.) of various capacity.
When developing initial personal computer, in order to organize data on the memory device, which sector initial table of DOS system developer design indicates belong to which file, and which sectors free, operating system can maximally utilise these disk spaces like this, and file can be stored on the discontinuous sector.File data can disperse in an organized way to be stored in the different sectors of disk, and this is called file division.
Because it is sufficiently large that this table needs, and could identify each sector, and reserve some spaces in order to the following disk that adopts bigger storage space.But the information that will needing obtain from so long table will be spent the long time, and therefore, people have introduced the notion of bunch (cluster).This makes the minimum memory unit of equipment be increased to the fixed qty sector from single sector, and these fixed qty sectors are called bunch.
Bunch being one section continuous physically storage space, also is storage unit basic in the FAT file system.Each file is by one or more group compositions, and these bunches are continuous or discontinuous physically.
Operating system determines to use great FAT according to the needed number of clusters amount in performance whole magnetic disk space.If disk request bunch be less than 4,096, then can use 12 FAT; If less than 65,536 but greater than 4,096 bunches, just use 16 FAT; Otherwise, must adopt 32 FAT.
Generally, also have root directory area (DIR) after the FAT table, be used to store root folder, after the DIR district, be only data storage area truly, promptly the DATA district is used to store alternative document and file.As shown in Figure 1, be the organizational form synoptic diagram of FAT16.
FAT is a kind of lists of links, points to the other side in the lists of links between the relative recording mutually.As shown in Figure 2, be FAT table bunch chain structure synoptic diagram.Write down the second bunch of numbering of this document in the pairing list item of first bunch of a file of storage (numbering for example is 02): 03; Equally, record three bunch of numbering of storage this document in the list item of the second bunch of correspondence: 04; Record four bunch of numbering of storage this document in the list item of three bunch of correspondence: 07, up to last bunch 06 of this document, data are FF in the pairing list item of this bunch, the end position of respective file by that analogy.
Record the start element of each file (catalogue) in the data field in the DIR district, just first bunch of this file number, and there is corresponding number record first bunch the position of this document at the FAT table, its corresponding list item has been noted down the second bunch of numbering of this document, by above-mentioned bunch of chain structure, the particular location of file in the data in magnetic disk district and order just can have been known.
System to the visit principle of FAT table is: find earlier the directory entry of this document during access file from root directory, therefrom read first bunch number.Then, in FAT, find, bunch number be the sector number chain that file takies in logic sector on bunch chain, so just can carry out reading and writing data from bunch chain of this first bunch number beginning.
At present, the method for access file is from the FAT file partition: at first the FAT table of subregion is read; According to this document bunch chain structure this document is conducted interviews then.One of access principles is: for discontinuous storage bunch, primary processor need send different orders.
Yet for a lot of small-sized digital products, the buffer area resource is very limited, be used to store the buffer area expense of FAT table, though for most computing machine, be not a very big burden, but for some small-sized hand-held devices, expense is very tangible; And owing to the visit to a discontinuous storage file, primary processor need send a plurality of orders, and this has increased the burden of primary processor equally.
Therefore,, propose a kind of buffer area a resource shrinkage that takies, can alleviate the reading/writing method and the device of primary processor burden, become problem demanding prompt solution in the industry how at the characteristics that have the FAT file system now.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of FAT file system read-write method and device, only need bunch chain structure information in the less buffer zone buffer memory FAT table, visit for each file, primary processor only need send a subcommand and get final product, thereby has reduced the burden of primary processor.
The invention provides a kind of FAT file system read-write method, at first read the FAT table, and extract bunch chain structure information of storage file, bunch chain structure information according to this document, determine first bunch the positional information of successive clusters wherein and the length information of this successive clusters, in regular turn first bunch the positional information of successive clusters and the length information of this successive clusters are stored in the buffer zone then,, according to this alternative information file is read and write at last to form the alternative information of this FAT table.
The present invention and then a kind of FAT file system read-write device is provided comprises:
Bunch chain structure read module is used to read the FAT table, and extracts bunch chain structure information of storage file;
The alternative information enquiry module is used for bunch chain structure information according to this document, determines first bunch the positional information of successive clusters wherein and the length information of this successive clusters;
The buffer stores module is used for storing first bunch the positional information of successive clusters and the length information of this successive clusters into buffer zone in regular turn, to form the alternative information of this FAT table;
The file read-write module is used for according to this alternative information file being read and write.
The present invention compared with prior art, because bunch chain structure information in the existing FAT table has been carried out analyzing compression, storage continuously successively, therefore only need bunch chain structure in the less buffer zone buffer memory FAT table, and visit for each file, primary processor only need send a subcommand, thereby has reduced the burden of primary processor.
Description of drawings
Fig. 1 is the organizational form synoptic diagram of FAT16 file system;
Fig. 2 is FAT table bunch chain structure synoptic diagram;
Fig. 3 is bunch chain structure information synoptic diagram of a file in the FAT table;
Fig. 4 is the schematic flow sheet of FAT file system read-write method of the present invention;
Fig. 5 is after Fig. 4 is used the present invention, the event memory synoptic diagram in buffer zone;
Fig. 6 is a FAT file system read-write device synoptic diagram of the present invention.
Embodiment
Analyze problems of the prior art, main cause is that the length of FAT table is too big for the buffer zone of a lot of small-sized digital equipments, taken valuable buffer resource, and, caused primary processor need send repeatedly order because data are discontinuous storage in the FAT table.
As shown in Figure 3, be bunch chain structure information synoptic diagram of a file in FAT table, a represent the 1st row and the 1st row bunch address information, b represent the 3rd row and the 4th row bunch address information, c represent the 5th go and the 5th be listed as bunch address information.
Clearly, this bunch of chain structure is a kind of linear storage relation, during for discontinuous storage, is very useful, but for the situation of continuous storage, information redundancy clearly arranged then.Very natural just can expect, can use a kind of compression method to come existing FAT table information is compressed, to substitute existing FAT information.
For example, as shown in Figure 4, be the schematic flow sheet of FAT file system read-write method of the present invention, at first read the FAT table, and extract bunch chain structure information (step 401) of storage file; According to bunch chain structure information of this document, determine first bunch the positional information of successive clusters wherein and the length information (step 402) of this successive clusters; In regular turn first bunch the positional information of successive clusters and the length information of this successive clusters are stored in the buffer zone then, to form the alternative information (step 403) of this FAT table; According to this alternative information file is read and write (step 404) at last.
Wherein, described storage file can be made up of one or more successive clusters; Described successive clusters comprises one or more bunches.
Said method is exactly in fact that a bunch chain structure formula that is stored in the subregion FAT table is compressed, and stores in the buffer zone then.Compression method is: represent with a structure that to continuous bunch this structure comprises two parts:
First is first bunch of positional information of this successive clusters, can be bunch number, logical address or LBA (Logical Block Addressing).
Second portion is the length of this successive clusters.
As shown in Figure 5, exactly Fig. 3 is used the present invention after, the event memory in buffer zone can play substitution effect to existing FAT table information.
We know that a storage file can be by one or more continuous bunch storages, and each successive clusters chain information as a result stores in the buffer zone by method compression of the present invention; And for different, a plurality of successive clusters, only needs be pressed the order of this document bunch chain structure, store successively to get final product in buffer zone.
Data that obtain at buffer zone by this method, even bunch chain structure information of in existing FAT table, forming by a plurality of discontinuous each other successive clusters, owing to the present invention is to store continuously successively to compressed information, therefore the data in buffer zone of the present invention all are to store continuously.
When a file is carried out read-write operation, as long as primary processor sends a subcommand, this order comprises this document bunch first address of chain compressed information in buffer zone, the bias of the relative first address of first read-write byte and read-write length, the read-write steering logic of storer just can be carried out read-write operation to this document according to this order and this document bunch chain compressed information, and need not the primary processor intervention, thereby reduced the burden of primary processor.
Accordingly, the present invention also provides a kind of FAT file system read-write device, as shown in Figure 6, for FAT file system read-write device synoptic diagram of the present invention, comprise a bunch chain structure read module 601, alternative information enquiry module 602, buffer stores module 603, file read-write module 604.
Wherein, bunch chain structure read module 601 is used to read the FAT table, and extracts bunch chain structure information of storage file;
Alternative information enquiry module 602 is used for bunch chain structure information according to this document, determines first bunch the positional information of successive clusters wherein and the length information of this successive clusters;
File read-write module 604 is used for according to this alternative information file being read and write.
Wherein, described storage file is made up of one or more successive clusters; Described successive clusters comprises one or more bunches.
Described first bunch of positional information is bunch number, logical address or LBA (Logical Block Addressing).
Described buffer stores device for the document cluster chain structure information of being made up of a plurality of successive clusters, according to the order of this document bunch chain structure, is stored first bunch the positional information of successive clusters and the length information of this successive clusters successively in buffer zone.
Although embodiment of the present invention are open as above, but it is not restricted to listed utilization in instructions and the embodiment, it can be applied to various suitable the field of the invention fully, for those skilled in the art, can easily realize other modification, therefore under the universal that does not deviate from claim and equivalency range and limited, the legend that the present invention is not limited to specific details and illustrates here and describe.
Claims (8)
1. a FAT file system read-write method is characterized in that comprising the steps:
(1) reads the FAT table, and extract bunch chain structure information of the storage file of forming by one or more successive clusters;
(2) according to bunch chain structure information of being somebody's turn to do the storage file of forming by one or more successive clusters, determine first bunch the positional information of successive clusters wherein and the length information of this successive clusters, be saved in the buffer zone;
(3) in regular turn first bunch the positional information of successive clusters and the length information of this successive clusters are stored in the buffer zone, and the positional information of each successive clusters and length information deposit in buffer zone continuously, to form bunch chain compressed information of storage file;
When (4) described storage file being carried out read-write operation, primary processor sends a subcommand, comprise the first address of described storage file bunch chain compressed information in this order at buffer zone, first read-write byte is with respect to the bias of first address and read-write length, and the read-write steering logic of storer is finished read-write to described storage file according to bunch chain compressed information of described order and described storage file.
2. the method for claim 1 is characterized in that described successive clusters comprises one or more bunches.
3. the method for claim 1 is characterized in that described first bunch of positional information is bunch number, logical address or LBA (Logical Block Addressing).
4. the method for claim 1, it is characterized in that described step (3), for the document cluster chain structure information of forming by a plurality of successive clusters,, in buffer zone, store first bunch the positional information of successive clusters and the length information of this successive clusters successively according to the order of this document bunch chain structure.
5. FAT file system read-write device is characterized in that comprising:
Bunch chain structure read module is used to read the FAT table, and extracts bunch chain structure information of the storage file of being made up of one or more successive clusters;
The alternative information enquiry module is used for determining first bunch the positional information of successive clusters wherein and the length information of this successive clusters according to bunch chain structure information of being somebody's turn to do the storage file of being made up of one or more successive clusters;
The buffer stores module, be used for storing first bunch the positional information of successive clusters and the length information of this successive clusters into buffer zone in regular turn, and the positional information and the length information of each successive clusters are deposited in buffer zone continuously, to form bunch chain compressed information of storage file;
The file read-write module, be used to receive the order of sending when primary processor carries out read-write operation to described storage file, finish read-write according to bunch chain compressed information of described order and described storage file to described storage file, comprise the first address of described storage file bunch chain compressed information at buffer zone in the described order, first read-write byte is with respect to the bias and the read-write length of first address.
6. device as claimed in claim 5 is characterized in that described successive clusters comprises one or more bunches.
7. device as claimed in claim 5 is characterized in that described first bunch of positional information is bunch number, logical address or LBA (Logical Block Addressing).
8. device as claimed in claim 5, it is characterized in that described buffer stores module, for the document cluster chain structure information of forming by a plurality of successive clusters, according to the order of this document bunch chain structure, in buffer zone, store first bunch the positional information of successive clusters and the length information of this successive clusters successively.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005101026917A CN100419756C (en) | 2005-09-13 | 2005-09-13 | File distribution list file system read-write method and device |
TW094146871A TW200725268A (en) | 2005-09-13 | 2005-12-27 | Accessing mechanism of a file allocation table |
JP2005379914A JP2007080240A (en) | 2005-09-13 | 2005-12-28 | Technique for accessing file allocation table |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005101026917A CN100419756C (en) | 2005-09-13 | 2005-09-13 | File distribution list file system read-write method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1744090A CN1744090A (en) | 2006-03-08 |
CN100419756C true CN100419756C (en) | 2008-09-17 |
Family
ID=36139459
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2005101026917A Expired - Fee Related CN100419756C (en) | 2005-09-13 | 2005-09-13 | File distribution list file system read-write method and device |
Country Status (3)
Country | Link |
---|---|
JP (1) | JP2007080240A (en) |
CN (1) | CN100419756C (en) |
TW (1) | TW200725268A (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100485681C (en) * | 2006-03-23 | 2009-05-06 | 北京握奇数据***有限公司 | Smart card storage system and managing method for file creation in the system |
CN100517236C (en) | 2006-04-03 | 2009-07-22 | 北京握奇数据***有限公司 | Intelligent card embedded operation system and its control method |
CN100535935C (en) | 2006-12-26 | 2009-09-02 | 北京握奇数据***有限公司 | CPUCPU and logic encryption double-purpose smart card and its data synchronization method |
CN101908050B (en) * | 2009-06-03 | 2013-04-24 | 晨星软件研发(深圳)有限公司 | File format conversion method |
CN101996250B (en) * | 2010-11-15 | 2012-07-25 | 中国科学院计算技术研究所 | Hadoop-based mass stream data storage and query method and system |
CN104394371B (en) * | 2014-12-01 | 2017-09-29 | 北京理工大学 | A kind of system for being adapted to a large amount of sequential image acquisitions and quick storage |
CN105243090A (en) * | 2015-09-10 | 2016-01-13 | 北京北信源软件股份有限公司 | Exclusive file acquisition method and system |
CN111506272B (en) * | 2020-07-02 | 2020-10-27 | 深圳市千分一智能技术有限公司 | Storage method, device and equipment of note file and computer readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5371885A (en) * | 1989-08-29 | 1994-12-06 | Microsoft Corporation | High performance file system |
US5715455A (en) * | 1995-05-18 | 1998-02-03 | International Business Machines Corporation | Apparatus and method for storing file allocation table efficiently in memory |
JP2001056774A (en) * | 1999-08-18 | 2001-02-27 | Victor Co Of Japan Ltd | File area managing method |
JP2002163136A (en) * | 2000-11-24 | 2002-06-07 | Matsushita Electric Ind Co Ltd | File system |
EP1339063A1 (en) * | 2002-02-18 | 2003-08-27 | Matsushita Electric Industrial Co., Ltd. | File reproducing apparatus and file reproducing method |
JP2003308234A (en) * | 2002-02-18 | 2003-10-31 | Matsushita Electric Ind Co Ltd | File reproducing apparatus and file reproducing method |
-
2005
- 2005-09-13 CN CNB2005101026917A patent/CN100419756C/en not_active Expired - Fee Related
- 2005-12-27 TW TW094146871A patent/TW200725268A/en unknown
- 2005-12-28 JP JP2005379914A patent/JP2007080240A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5371885A (en) * | 1989-08-29 | 1994-12-06 | Microsoft Corporation | High performance file system |
US5715455A (en) * | 1995-05-18 | 1998-02-03 | International Business Machines Corporation | Apparatus and method for storing file allocation table efficiently in memory |
JP2001056774A (en) * | 1999-08-18 | 2001-02-27 | Victor Co Of Japan Ltd | File area managing method |
JP2002163136A (en) * | 2000-11-24 | 2002-06-07 | Matsushita Electric Ind Co Ltd | File system |
EP1339063A1 (en) * | 2002-02-18 | 2003-08-27 | Matsushita Electric Industrial Co., Ltd. | File reproducing apparatus and file reproducing method |
JP2003308234A (en) * | 2002-02-18 | 2003-10-31 | Matsushita Electric Ind Co Ltd | File reproducing apparatus and file reproducing method |
Also Published As
Publication number | Publication date |
---|---|
JP2007080240A (en) | 2007-03-29 |
TW200725268A (en) | 2007-07-01 |
CN1744090A (en) | 2006-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100419756C (en) | File distribution list file system read-write method and device | |
CN101263462B (en) | Nonvolatile memory with block management | |
JP5000316B2 (en) | Object-based data storage | |
CN101233480B (en) | Reprogrammable non-volatile memory systems with indexing of directly stored data files | |
CN102663090B (en) | Method and device for inquiry metadata | |
US7761648B2 (en) | Caching method for NAND flash translation layer | |
CN101446984B (en) | Method and device for storing files and method and device for deleting files | |
KR100714691B1 (en) | Apparatus and method for saving and managing additional data of file system | |
CN105511802A (en) | Buffer memory writing method and apparatus and synchronizing method and apparatus for disk cache region | |
EP1771862B1 (en) | Method and device to improve usb flash write performance | |
CN101408880A (en) | Methods and apparatus for file management using partitioned file metadata | |
CN101739351A (en) | Method for managing storage device and associated memory apparatus thereof | |
EP2169530B1 (en) | Method of managing memory storage space and a computer system | |
CN101546337A (en) | Memory system and data access method | |
CN101488153A (en) | Method for implementing high-capacity flash memory file system in embedded type Linux | |
CN102253985B (en) | File system data management method and system | |
US6182088B1 (en) | File system and file management method | |
CN102024060B (en) | Method for memorizing files and restoring error deleted files | |
CN101876956A (en) | File access method and device of SD (Secure Digital) card | |
CN103473258A (en) | Cloud storage file system | |
CN103309619A (en) | NAND Flash memory data storage method | |
CN104951569B (en) | File system and the file management method for using this document system | |
CN101339490A (en) | Flash memory drive apparatus and method | |
CN101673261A (en) | System structure and method for realizing support for long filenames in short-filename file systems | |
CN100405330C (en) | Method and device for getting residual space for FAT file system |
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 | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080917 Termination date: 20120913 |