CN1744090A - File distribution list file system read-write method and device - Google Patents

File distribution list file system read-write method and device Download PDF

Info

Publication number
CN1744090A
CN1744090A CN 200510102691 CN200510102691A CN1744090A CN 1744090 A CN1744090 A CN 1744090A CN 200510102691 CN200510102691 CN 200510102691 CN 200510102691 A CN200510102691 A CN 200510102691A CN 1744090 A CN1744090 A CN 1744090A
Authority
CN
China
Prior art keywords
information
bunch
successive clusters
file
chain structure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200510102691
Other languages
Chinese (zh)
Other versions
CN100419756C (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.)
Vimicro Corp
Original Assignee
Vimicro Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vimicro Corp filed Critical Vimicro Corp
Priority to CNB2005101026917A priority Critical patent/CN100419756C/en
Priority to TW094146871A priority patent/TW200725268A/en
Priority to JP2005379914A priority patent/JP2007080240A/en
Publication of CN1744090A publication Critical patent/CN1744090A/en
Application granted granted Critical
Publication of CN100419756C publication Critical patent/CN100419756C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

First, the method reads FAT table, and picks up information of cluster chain structure of stored file. Based on the said information, the method determines position information of first cluster of continuous clusters and information of length of the continuous clusters. Then, the method stores the said position information of first cluster and information of length of the continuous clusters into buffer area to form information for replacing the FAT table. Finally, based on the replaced information, reading / writing operation is carried out for files. Advantages are: less buffer area needed for storing cluster chain structure in FAT table, reducing burden on main processor since only needed for sending commands for once to access each file.

Description

File distribution list file system read-write method and device
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;
Buffer stores module 603 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;
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 (10)

1, a kind of 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 storage file;
(2) according to bunch chain structure information of this document, determine first bunch the positional information of successive clusters wherein and the length information of this successive clusters;
(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, to form the alternative information of this FAT table;
(4) according to this alternative information file is read and write.
2, the method for claim 1 is characterized in that described storage file is made up of one or more successive clusters.
3, method as claimed in claim 1 or 2 is characterized in that described successive clusters comprises one or more bunches.
4, 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).
5, 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.
6, a kind of 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 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.
7, device as claimed in claim 6 is characterized in that described storage file is made up of one or more successive clusters.
8,, it is characterized in that described successive clusters comprises one or more bunches as claim 6 or 7 described devices.
9, device as claimed in claim 6 is characterized in that described first bunch of positional information is bunch number, logical address or LBA (Logical Block Addressing).
10, device as claimed in claim 6, it is characterized in that described buffer stores device, 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.
CNB2005101026917A 2005-09-13 2005-09-13 File distribution list file system read-write method and device Expired - Fee Related CN100419756C (en)

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 true CN1744090A (en) 2006-03-08
CN100419756C 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)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007107073A1 (en) * 2006-03-23 2007-09-27 Beijing Watch Data System Co., Ltd. Smart card storage system and file management method therein
CN101996250A (en) * 2010-11-15 2011-03-30 中国科学院计算技术研究所 Hadoop-based mass stream data storage and query method and system
US8255706B2 (en) 2006-12-26 2012-08-28 Beijing Watch Data System Co., Ltd. Dual usage smart card of CPU and logical encryption and its data synchronization method
US8266619B2 (en) 2006-04-03 2012-09-11 Beijing Watch Data System Co., Ltd. Embedded operating system architecture for smart card
CN101908050B (en) * 2009-06-03 2013-04-24 晨星软件研发(深圳)有限公司 File format conversion method
CN104394371A (en) * 2014-12-01 2015-03-04 北京理工大学 System for large amount continuous image collection and quick storage
CN105243090A (en) * 2015-09-10 2016-01-13 北京北信源软件股份有限公司 Exclusive file acquisition method and system
CN111506272A (en) * 2020-07-02 2020-08-07 深圳市千分一智能技术有限公司 Storage method, device and equipment of note file and computer readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
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
KR100477119B1 (en) * 2002-02-18 2005-03-18 마츠시타 덴끼 산교 가부시키가이샤 File reproduction apparatus and file reproduction method
JP2003308234A (en) * 2002-02-18 2003-10-31 Matsushita Electric Ind Co Ltd File reproducing apparatus and file reproducing method

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007107073A1 (en) * 2006-03-23 2007-09-27 Beijing Watch Data System Co., Ltd. Smart card storage system and file management method therein
US8266619B2 (en) 2006-04-03 2012-09-11 Beijing Watch Data System Co., Ltd. Embedded operating system architecture for smart card
US8255706B2 (en) 2006-12-26 2012-08-28 Beijing Watch Data System Co., Ltd. Dual usage smart card of CPU and logical encryption and its data synchronization method
CN101908050B (en) * 2009-06-03 2013-04-24 晨星软件研发(深圳)有限公司 File format conversion method
CN101996250A (en) * 2010-11-15 2011-03-30 中国科学院计算技术研究所 Hadoop-based mass stream data storage and query method and system
CN101996250B (en) * 2010-11-15 2012-07-25 中国科学院计算技术研究所 Hadoop-based mass stream data storage and query method and system
CN104394371A (en) * 2014-12-01 2015-03-04 北京理工大学 System for large amount continuous image collection and quick storage
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
CN111506272A (en) * 2020-07-02 2020-08-07 深圳市千分一智能技术有限公司 Storage method, device and equipment of note file and computer readable storage medium

Also Published As

Publication number Publication date
CN100419756C (en) 2008-09-17
TW200725268A (en) 2007-07-01
JP2007080240A (en) 2007-03-29

Similar Documents

Publication Publication Date Title
Bender et al. Don't thrash: How to cache your hash on flash
US20200175070A1 (en) Low ram space, high-throughput persistent key-value store using secondary memory
US7529905B2 (en) Method of storing transformed units of data in a memory system having fixed sized storage blocks
KR101369996B1 (en) Method and system for dual mode access for storage devices
CN102129458B (en) Method and device for storing relational database
US8572312B2 (en) Data de-duplication and solid state memory device
US20070088904A1 (en) Memory system storing transformed units of data in fixed sized storage blocks
CN101051315A (en) A method of storing files in a data storage device and data storage device thereof
US20100082537A1 (en) File system for storage device which uses different cluster sizes
CN101408880A (en) Methods and apparatus for file management using partitioned file metadata
WO2007138585A1 (en) Predictive data-loader
CN105511802A (en) Buffer memory writing method and apparatus and synchronizing method and apparatus for disk cache region
JP2007200333A (en) Object-based data storage device
CN1858746A (en) Apparatus and method for storing and managing additional data in file system
CN101263462A (en) Nonvolatile memory with block management
US20060218347A1 (en) Memory card
KR101348255B1 (en) Storage of transformed units of data in a memory system having fixed sized storage blocks
EP2425324A1 (en) Description
CN100347705C (en) Method for file merge
CN1744090A (en) File distribution list file system read-write method and device
CN102024060B (en) Method for memorizing files and restoring error deleted files
CN1146819C (en) Computer file title searching system
CN1975935A (en) External storing performance testing method and apparatus
CN1764905A (en) Method of addressing data in a shared memory by means of an offset
CN116414304B (en) Data storage device and storage control method based on log structured merging tree

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