CN102541969B - File protection method and system based on file allocation table (FAT) file system, and memory - Google Patents

File protection method and system based on file allocation table (FAT) file system, and memory Download PDF

Info

Publication number
CN102541969B
CN102541969B CN201110077081.1A CN201110077081A CN102541969B CN 102541969 B CN102541969 B CN 102541969B CN 201110077081 A CN201110077081 A CN 201110077081A CN 102541969 B CN102541969 B CN 102541969B
Authority
CN
China
Prior art keywords
file
write
folder
storer
fat
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.)
Active
Application number
CN201110077081.1A
Other languages
Chinese (zh)
Other versions
CN102541969A (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.)
ZHONGSHAN JIANGBOLONG ELECTRONICS CO., LTD.
Original Assignee
Shenzhen Netcom Electronics 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 Shenzhen Netcom Electronics Co Ltd filed Critical Shenzhen Netcom Electronics Co Ltd
Priority to CN201110077081.1A priority Critical patent/CN102541969B/en
Publication of CN102541969A publication Critical patent/CN102541969A/en
Application granted granted Critical
Publication of CN102541969B publication Critical patent/CN102541969B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention is suitable for the technical field of storage, and provides a file protection method and a file protection system based on a file allocation table (FAT) file system, and a memory. The file protection method comprises the following steps of: performing disk formatting on the memory; writing a file or a file folder requesting for writing protection into a cluster distributed by the memory for the file or the file folder, and acquiring an FAT; setting a table value of a residual register item of a section, in which the FAT is positioned, as an end-of-file marker; acquiring a file catalog table, in which a catalog item corresponding to the file or the file folder is positioned, and setting the residual bytes of contents behind the catalog item corresponding to the file or the file folder in the section, in which the file catalog table is positioned, as ineffective character; and setting a main guide recording area of the memory, a guide recording area of an operating system, sectors corresponding to the FAT and the file catalog table and the cluster distributed by the memory for the file or the file folder requesting for writing protection as data writing protection areas. According to the method and the system, the writing protection processing flow for memory data is simplified, and the safety of the memory data is improved.

Description

Based on the document protection method of FAT file system, system and storer
Technical field
The invention belongs to technical field of memory, particularly relate to a kind of document protection method based on FAT file system, system and storer.
Background technology
Storage card is a kind of memory device of based semiconductor fast-flash memory device, mainly contain safe digital card (SD card), smart media card (SM card), is used at present widely on mancarried device, such as digital camera, mobile phone, personal digital assistant (PDA) and multimedia player etc.
At present, in storage card, the protection of data can be realized by write-protect switch, when dialling lower write-protect switch, storage card will be subject to write-protect, read operation can only be carried out to the data stored in storage card, the write operation of data cannot be carried out, deleted by mistake to prevent data or replaced, thus the protection reached the data stored, other storer great majority then cannot carry out write-protect to the data stored in storer, therefore, when user needs to carry out read and write to the data in the storeies such as storage card, need the hardware such as operation write-protect switch, and storer is plugged, but due to write-protect switch make and use procedure loaded down with trivial details, and write operation cannot be carried out to storer under write-protect state, cause memory data security not high, write-protect complicated operation, reduce Consumer's Experience.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of document protection method based on FAT file system, system and storer, is intended to the security of solution memory data not high, the write-protect complex disposal process of memory data, the problem of poor user experience.
The embodiment of the present invention is achieved in that a kind of document protection method based on FAT file system, and described method comprises the steps:
Carry out disk formatting operation to storer, described storer adopts FAT file system;
The write-protected file or folder of request is write described storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder;
The list item value of the residue entry of sector, described file allocation table place is set to end of file mark, it is bunch corresponding that described residue entry and described storer are not assigned with;
Obtaining the File Directory Table at the corresponding directory entry place of this file or folder, is idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at described File Directory Table place directory entry;
By the sector corresponding to the Main Boot Record district of described storer, dos boot record district, file allocation table and File Directory Table, and described storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
Another object of the embodiment of the present invention is to provide a kind of file protecting system based on FAT file system, and described system comprises:
Formatting unit, for carrying out disk formatting operation to storer, described storer adopts FAT file system;
File allocation table acquiring unit, for by request write-protected file or folder write storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder;
List item value setting unit, the list item value for the residue entry by sector, file allocation table place is set to end of file mark, and it is bunch corresponding that described residue entry and described storer are not assigned with;
Curriculum offering unit, for obtaining the File Directory Table at the corresponding directory entry place of the write-protected file or folder of request, be idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at described File Directory Table place directory entry; And
Data protection region setting unit; for by the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table, and described storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
Another object of the embodiment of the present invention is to provide a kind of storer comprising the above-mentioned file protecting system based on FAT file system.
The embodiment of the present invention is when needs carry out write-protect to data, by carrying out disk formatting to storer, obtain the file allocation table at the entry place of last bunch of the write-protected file or folder of storage resource request, the list item value of the residue entry of this sector, file allocation table place is set to end of file mark, obtain the File Directory Table at the corresponding directory entry place of this file or folder, be idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at this File Directory Table place directory entry, and by the Main Boot Record district of storer, dos boot record district, file allocation table and the sector corresponding to File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area, thus simplify the write-protect processing procedure of memory data, improve the security of data.
Accompanying drawing explanation
Fig. 1 is the realization flow figure of the document protection method based on FAT file system that first embodiment of the invention provides;
Fig. 2 is the realization flow figure of the document protection method based on FAT file system that second embodiment of the invention provides;
Fig. 3 a, Fig. 3 b and Fig. 3 c are the instance graphs of the document protection method based on FAT file system that third embodiment of the invention provides;
Fig. 4 is the structural drawing of the file protecting system based on FAT file system that fourth embodiment of the invention provides.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The embodiment of the present invention is when needs carry out write-protect to data, by carrying out disk formatting to storer, obtain the file allocation table at the entry place of last bunch of the write-protected file or folder of storage resource request, the list item value of the residue entry of this sector, file allocation table place is set to end of file mark, obtain the File Directory Table at the corresponding directory entry place of this file or folder, be idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at this File Directory Table place directory entry, and by the Main Boot Record district of storer, dos boot record district, file allocation table and the sector corresponding to File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area, thus simplify the write-protect processing procedure of memory data, improve the security of data.
Embodiments provide a kind of document protection method based on FAT file system, described method comprises the steps:
Disk formatting operation is carried out to storer;
The write-protected file or folder of request is write described storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder;
The list item value of the residue entry of sector, described file allocation table place is set to end of file mark, it is bunch corresponding that described residue entry and described storer are not assigned with;
Obtaining the File Directory Table at the corresponding directory entry place of this file or folder, is idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at described File Directory Table place directory entry;
By the sector corresponding to the Main Boot Record district of described storer, dos boot record district, file allocation table and File Directory Table, and described storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
The embodiment of the present invention additionally provides a kind of file protecting system based on FAT file system, and described system comprises:
Formatting unit, for carrying out disk formatting operation to storer;
File allocation table acquiring unit, for by request write-protected file or folder write storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder;
List item value setting unit, the list item value for the residue entry by sector, file allocation table place is set to end of file mark, and it is bunch corresponding that described residue entry and described storer are not assigned with;
Curriculum offering unit, for obtaining the File Directory Table at the corresponding directory entry place of the write-protected file or folder of request, be idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at described File Directory Table place directory entry; And
Data protection region setting unit; for by the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table, and described storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
The embodiment of the present invention additionally provides a kind of storer comprising the above-mentioned file protecting system based on FAT file system.
The embodiment of the present invention is when needs carry out write-protect to data, by carrying out disk formatting to storer, obtain the file allocation table at the entry place of last bunch of the write-protected file or folder of storage resource request, the list item value of the residue entry of this sector, file allocation table place is set to end of file mark, obtain the File Directory Table at the corresponding directory entry place of this file or folder, be idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at this File Directory Table place directory entry, and by the Main Boot Record district of storer, dos boot record district, file allocation table and the sector corresponding to File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area, thus simplify the write-protect processing procedure of memory data, improve the security of data.
Below in conjunction with specific embodiment, specific implementation of the present invention is described in detail:
embodiment one:
In file allocation table (FAT) file system, the Logical Disk of storer is divided into five parts, is Main Boot Record district (MBR), dos boot record district (DBR), file allocation table (FAT), File Directory Table (FDT) and data field (DATA district) successively.
Series of parameters and one section of boot of disk is contained in MBR.The Main Function of disk bootstrap program wherein checks whether partition table is correct and after system hardware completes self-inspection, guides the operating system had on the subregion of activation marker, and give start-up routine by control.DBR is first sector that operating system can directly be accessed, it comprise a boot and one be called as BPB(Bios Parameter Block) this subregion reference record table.File allocation table (FAT) file system is used for carrying out Organization And Management to file.Wherein, FAT table have recorded the service condition of each bunch of storer in order successively, and in FAT table, the service condition of every bunch represents with entry, and the value of its correspondence is list item value.The list item value of corresponding entry bunch in FAT table be not assigned with in storer is zero, the list item value of bad bunch of corresponding entry in FAT table then inserts the particular value of system definition, the list item value of corresponding entry bunch in FAT table of having distributed then inserts nonzero value, be specially: if this bunch is the last cluster of file, then insert end of file mark, such as, 0XFF, if this bunch is not the last cluster of file, the value inserted be the next one that takies of this file bunch bunch number, thus file take all bunches then forms a bunch of chain, be kept in FAT table.FDT table for the start element of each file (catalogue) under recording root directory, the attribute etc. of file.Data field is used for the file data of storing write protection, after being positioned at FDT table, occupies the most of data space on hard disk.
Fig. 1 shows the realization flow of the document protection method based on FAT file system that first embodiment of the invention provides, and details are as follows:
In step S101, disk formatting operation is carried out to storer.
In embodiments of the present invention; in order to the write-protect realizing file in the readable storer write stores; replace to prevent user, revise or delete this file by mistake; before the write-protected file of needs is written to the readable storer write by user; tackle this storer and carry out disk formatting; thus generate DBR information, and initialization is carried out to FAT table, and carry out the mark of logistic bad track.In specific implementation process, storer can be the disk etc. of SD card, SM card, TF card and other employing FAT file system, at this not in order to limit the present invention.
In step s 102, by request write-protected file or folder write storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder.
In FAT file system, FAT table have recorded the service condition of each bunch of storer in order successively, and in FAT table, the service condition of every bunch represents with entry, and the value of its correspondence is list item value.Because FAT is for the importance of system, there are two identical FAT tables, the shared sector of FAT table is determined by system, when storer completes bunch allocation of space of writing in files, obtains the file allocation table at the entry place of last bunch storing this file.
In step s 103, the list item value of the residue entry of the sector, file allocation table place of acquisition is set to end of file mark, it is bunch corresponding that this residue entry and this storer are not assigned with.
Storer after format is the distribution in bunch space needing write-protected file is order-assigned, namely the entry stored after entry corresponding to last bunch of this file be all be not assigned with bunch corresponding to, in order to the data of anti-locking system to this sector are modified operation, improve the security of FAT table corresponding to write-protect file, in embodiments of the present invention, the list item value of the residue entry of the sector, file allocation table place obtained in step S102 is all set to end of file mark, thus prevent from operating this sector in follow-up file writing process.
In step S104, obtaining the File Directory Table at the corresponding directory entry place of write-protect file or folder, is idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at this File Directory Table place directory entry.
In embodiments of the present invention, in order to anti-locking system is modified to needing the FDT table at the corresponding directory entry place of write-protected file or folder, namely possible amendment is carried out to this file or folder, replace or deletion action, improve the security of FDT table, in embodiments of the present invention, by the File Directory Table institute at corresponding for this file or folder directory entry place in a sector, the curriculum offering of the remainder bytes after the corresponding directory entry of this file or folder is idle character, thus prevent from operating this sector in follow-up file writing process, in specific implementation process, idle character can be invalid long filenames etc.
In step S105, by the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
In embodiments of the present invention; corresponding interface or order can be provided the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table to user, and storer be the write-protected file allocation of request bunch be set to data write protected area.
In embodiments of the present invention, end of file mark is set to by the list item value of the residue entry by sector, FAT place corresponding for write-protected file or folder, be idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at File Directory Table place directory entry, and by the Main Boot Record district of storer, dos boot record district, file allocation table and the sector corresponding to File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area, thus the file realized storer stores carries out write-protect.
embodiment two:
Fig. 2 shows the realization flow of the document protection method based on FAT file system that second embodiment of the invention provides, and details are as follows:
In step s 201, disk formatting operation is carried out to storer.
In step S202, by request write-protected file or folder write storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder.
In step S203, the list item value of the residue entry of the sector, file allocation table place of acquisition is set to end of file mark, it is bunch corresponding that this residue entry and this storer are not assigned with.
In step S204, obtaining the File Directory Table at the corresponding directory entry place of write-protect file or folder, is idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at this File Directory Table place directory entry.
In step S205, by the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
In embodiments of the present invention; corresponding interface or order can be provided the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table to user, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
In step S206, receive the operation requests of file or folder write, obtain the writing address of this operation requests file or file.
In step S207, whether the writing address obtained in determining step S206 is arranged in the data write protected area that storer is arranged, and when being arranged in the data write protected area that storer is arranged, performs step S208, otherwise performs step S209.
In step S208, when the writing address obtained in step S206 is arranged in the data write protected area that storer arranges, abandon the operation requests of file or folder write.
In embodiments of the present invention, as the MBR of storer, DBR, FAT table and the sector corresponding to FDT table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area after, the write-protect completing storer file is arranged, in the follow-up use procedure of storer, when receiving the write operation request of file or folder, obtain the writing address of this operation requests, in specific implementation process, this writing address may be the amendment for system file, such as to the Main Boot Record district of storer, dos boot record district, the operation of file allocation table and the sector corresponding to File Directory Table, or need the trial of write-protected file or folder to revise to user, now should abandon the write operation request of file or folder, simultaneously, the information that also can be write-protected to the writing address of user's output function request file or file.
In step S209, when the writing address obtained in step S206 is not arranged in the data write protected area that storer arranges, carry out the write operation of file or folder.
In embodiments of the present invention; after setting up data write protected area; if when not being positioned at data write protected area to the write operation of storer; then normal write operation is carried out to storer; while ensureing that storer has writing protection function; normal write operation can be carried out to storer, improve Consumer's Experience.
embodiment three:
Fig. 3 a, Fig. 3 b and Fig. 3 c show the example of the document protection method based on FAT file system that third embodiment of the invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
Fig. 3 a is for showing the list item value of bunch entry corresponding in FAT table of storer shared by write-protected file, in embodiments of the present invention, file test1.doc, test2.mp3 and file test3 is write-protect file, 16 bits are used to represent the list item value of each entry, wherein the Offset of first row represents the side-play amount showing place sector-start-address relative to FAT, the first row then represents offset address, the list item value of both the intersection bunch entry corresponding in FAT table then shared by the write-protect file that stores in storer, such as, in embodiments of the present invention, what be that list item value 0x0300 that 0x3 and 0x4 represents represents the lower cluster that this list item value is corresponding by offset address bunch number is 0x0300, storing write protection file test1.doc, the list item value of last bunch of corresponding entry (offset address is 0x1E2 and 0x1E3) of test2.mp3 and file test3 is 0xFF, terminate in order to identification document, it is bunch corresponding that FAT shows that the residue entry of sector, place is not then assigned with storer, end of file mark 0xFF is used to fill, concrete corresponding 0x1E4 to the 0x1FF region of residue entry of sector.
Fig. 3 b shows the directory entry information stored in FDT table.In embodiments of the present invention; the directory entry address of write-protect file and system file directory be stored in byte 0xC0 before byte in; the region of 0xC0 to 0x1FF byte is the content that FDT shows the remainder bytes after the corresponding directory entry of write-protect file in the sector at place; fill by invalid long filenames particularly, such as M1111111 ... invalid long filenames.
Fig. 3 c illustrates the data write protected area arranged in embodiments of the present invention.In embodiments of the present invention; the write-protected region of data is represented with sector; first group address represents the address of MBR; second group represents the address that DBR and first FAT shows; 3rd group represents the address that second FAT shows; 4th group represents the address that FDT shows, the 5th group of memory address representing storing write protection file.
One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program has come, described program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk, CD etc.
embodiment four:
Fig. 4 shows the structure of the file protecting system based on FAT file system that fourth embodiment of the invention provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
Disk should be may be used for based on the file protecting system of FAT file system; or there are other storeies of memory function; such as, in disk, SD card etc.; can be run on the software unit in these storeies; also can be integrated in these storeies as independently suspension member or run in the application system of these storeies, wherein:
After formatting unit 41 pairs of storeies carry out disk formatting operation; file allocation table acquiring unit 42 by request write-protected file or folder write storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder.
In embodiments of the present invention; in order to the write-protect realizing file in the readable storer write stores; replace to prevent user, revise or delete this file by mistake; before user needs that this file is written to the readable storer write; tackle this storer and carry out disk formatting; thus generate DBR information, initialization is carried out to FAT table, and carries out the mark of logistic bad track.In specific implementation process, storer can be the disk etc. of SD card, SM card, TF card and other employing FAT file system, at this not in order to limit the present invention.
In FAT file system, FAT table have recorded the service condition of each bunch of storer in order successively, and in FAT table, the service condition of every bunch represents with entry, and the value of its correspondence is list item value.Because FAT is for the importance of system, there are two identical FAT tables, the shared sector of FAT table is determined by system, when storer completes bunch allocation of space storing writing in files, obtains the file allocation table at the entry place of last bunch storing this file.
List item value setting unit 43, the list item value for the residue entry of sector, file allocation table place obtained by file allocation table acquiring unit 42 is set to end of file mark, and this residue entry is bunch corresponding entry that storer is not assigned with.
Storer after format is the distribution in bunch space needing write-protected file is order-assigned, namely the entry stored after entry corresponding to last bunch of this file be all be not assigned with bunch corresponding to, in order to the data of anti-locking system to this sector are modified operation, improve the security of FAT table corresponding to write-protect file, in embodiments of the present invention, it is all end of file mark that the list item value of the residue entry of the sector, file allocation table place obtained by file allocation table acquiring unit 42 is arranged, thus prevent from operating this sector in follow-up file writing process.
Curriculum offering unit 44 obtains the File Directory Table at the corresponding directory entry place of the write-protected file or folder of request, is idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at File Directory Table place directory entry.
In embodiments of the present invention, in order to anti-locking system is modified to needing the FDT at the corresponding directory entry place of write-protected file or folder, namely possible amendment is carried out to this file or folder, replace or deletion action, improve the security of FDT table, in embodiments of the present invention, be idle character by the curriculum offering of the remainder bytes after the File Directory Table institute at corresponding for this file or folder directory entry place in a sector this file or folder correspondence directory entry, thus prevent from operating this sector in follow-up file writing process, in specific implementation process, idle character can be invalid long filenames etc.
Data protection region setting unit 45 by the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
Writing address acquiring unit 46 receives the operation requests of file or folder write, obtains the writing address of operation requests file or file.Judging unit 47 judges the data write protected area whether writing address that writing address acquiring unit 46 obtains is arranged in storer and arranges.When writing address is positioned at data write protected area, operation requests discarding unit 48 abandons the operation requests of file or folder write.
In embodiments of the present invention, when the Main Boot Record district of storer, dos boot record district, file allocation table and the sector corresponding to File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area after, the write-protect completing storer file is arranged, in the follow-up use procedure of storer, when receiving the write operation request of file, obtain the writing address of this operation requests, in specific implementation process, this writing address may be the amendment for system file, such as to the Main Boot Record district of storer, dos boot record district, the operation of file allocation table and the sector corresponding to File Directory Table, or need the trial of write-protected file to revise to user, now should abandon the write operation request of file, simultaneously, the information that also can be write-protected to the writing address of user's output function request file.Therefore, an information output unit can be provided after operation requests discarding unit 48, the information that the writing address for output function request file has been write-protected.
Write operation unit 49, when writing address is not positioned at default data write protected area, carries out the write operation of file or folder.
In embodiments of the present invention, end of file mark is set to by the list item value of the residue entry by sector, FAT place corresponding for write-protected file or folder, be idle character by the curriculum offering of the remainder bytes after corresponding for this file in the sector at File Directory Table place directory entry, and by the Main Boot Record district of storer, dos boot record district, file allocation table and the sector corresponding to File Directory Table, and storer be the write-protected file or folder of request distribute bunch be set to data write protected area, after setting up data write protected area, if when not being positioned at data write protected area to the write operation of storer, then normal write operation is carried out to storer, while ensureing that storer has writing protection function, normal write operation can be carried out to storer, improve the experience of user.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (7)

1. based on a document protection method for FAT file system, it is characterized in that, described method comprises the steps:
Before the write-protected file of needs is written to the readable storer write by user, carry out disk formatting operation to storer, described storer adopts FAT file system, to generate DBR information, and initialization is carried out to FAT table, and carry out the mark of logistic bad track;
The write-protected file or folder of request is write described storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder;
The list item value of the residue entry of sector, described file allocation table place is set to end of file mark, it is bunch corresponding that described residue entry and described storer are not assigned with;
Obtaining the File Directory Table at the corresponding directory entry place of this file or folder, is idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at described File Directory Table place directory entry;
By the sector corresponding to the Main Boot Record district of described storer, dos boot record district, file allocation table and File Directory Table, and described storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
2. the method for claim 1; it is characterized in that; described by the sector corresponding to the Main Boot Record district of described storer, dos boot record district, file allocation table and File Directory Table; and described storer be the write-protected file or folder of request distribute bunch be set to the step of data write protected area after, described method also comprises the steps:
Receive the operation requests of file or folder write, obtain the writing address of described operation requests file or file;
Judge whether said write address is positioned at described data write protected area;
When said write address is positioned at described data write protected area, abandon described operation requests;
When said write address is not positioned at default data write protected area, carry out the write operation of file or folder.
3. method as claimed in claim 2, it is characterized in that, described when said write address is positioned at described data write protected area, after abandoning the step of described operation requests, described method also comprises the steps:
The information that the writing address exporting described operation requests file or file has been write-protected.
4. based on a file protecting system for FAT file system, it is characterized in that, described system comprises:
Formatting unit, before the write-protected file of needs being written to the readable storer write as user, carries out disk formatting operation to storer, described storer adopts FAT file system, to generate DBR information, and initialization is carried out to FAT table, and carry out the mark of logistic bad track;
File allocation table acquiring unit, for by request write-protected file or folder write storer be this file or folder allocation bunch, obtain the file allocation table at the entry place of last bunch storing this file or folder;
List item value setting unit, the list item value for the residue entry by sector, file allocation table place is set to end of file mark, and it is bunch corresponding that described residue entry and described storer are not assigned with;
Curriculum offering unit, for obtaining the File Directory Table at the corresponding directory entry place of the write-protected file or folder of request, be idle character by the curriculum offering of the remainder bytes after corresponding for this file or folder in the sector at described File Directory Table place directory entry; And
Data protection region setting unit; for by the sector corresponding to the Main Boot Record district of storer, dos boot record district, file allocation table and File Directory Table, and described storer be the write-protected file or folder of request distribute bunch be set to data write protected area.
5. system as claimed in claim 4, it is characterized in that, described system also comprises:
Writing address acquiring unit, for receiving the operation requests of file or folder write, obtains the writing address of described operation requests file or file;
Judging unit, for judging the data write protected area whether writing address that said write address acquisition unit obtains is arranged in storer and arranges;
Operation requests discarding unit, during for being positioned at described data write protected area when writing address, abandons the operation requests of file or folder write; And
Write operation unit, during for not being positioned at default data write protected area when writing address, carries out the write operation of file or folder.
6. system as claimed in claim 5, it is characterized in that, described system also comprises:
Information output unit, the information that the writing address for output function request file or file has been write-protected.
7. a storer, is characterized in that, described storer comprises the file protecting system based on FAT file system described in any one of claim 4 to 6.
CN201110077081.1A 2011-03-29 2011-03-29 File protection method and system based on file allocation table (FAT) file system, and memory Active CN102541969B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110077081.1A CN102541969B (en) 2011-03-29 2011-03-29 File protection method and system based on file allocation table (FAT) file system, and memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110077081.1A CN102541969B (en) 2011-03-29 2011-03-29 File protection method and system based on file allocation table (FAT) file system, and memory

Publications (2)

Publication Number Publication Date
CN102541969A CN102541969A (en) 2012-07-04
CN102541969B true CN102541969B (en) 2015-04-29

Family

ID=46348883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110077081.1A Active CN102541969B (en) 2011-03-29 2011-03-29 File protection method and system based on file allocation table (FAT) file system, and memory

Country Status (1)

Country Link
CN (1) CN102541969B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677875A (en) * 2012-09-11 2014-03-26 联想(北京)有限公司 Method for starting electronic equipment, method for controlling permission and electronic equipment
CN103678026B (en) * 2012-09-18 2017-05-10 杭州海康威视系统技术有限公司 Storing and repairing method and storing and repairing device for repairable video monitoring data
CN103198850B (en) * 2013-03-20 2015-12-23 广东欧珀移动通信有限公司 A kind of method and apparatus of Android device built-in hard disk intelligent format
CN105279094A (en) * 2014-06-09 2016-01-27 中兴通讯股份有限公司 NAND Flash operation processing method, NAND Flash operation processing device and logic device
CN106598481B (en) * 2016-10-13 2019-06-14 武汉长江通信智联技术有限公司 A kind of guard method of vehicle-mounted predistribution FAT32 video file system
CN110286859B (en) * 2019-06-28 2020-04-14 中国海洋大学 Data storage method and device based on FAT file system
CN114327292B (en) * 2021-12-31 2024-02-02 上海移为通信技术股份有限公司 File management method, system, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1142080A (en) * 1995-02-17 1997-02-05 罗建平 Method for solidifying hard-disc document of computer
EP1811407A2 (en) * 2006-01-11 2007-07-25 Samsung Electronics Co., Ltd. Apparatus and method of managing hidden area
CN101246534A (en) * 2008-01-29 2008-08-20 北京理工大学 U disk with autorun virus immunity
CN101477469A (en) * 2009-02-06 2009-07-08 杭州华三通信技术有限公司 Reliable reading method, writing method and apparatus for starting code
CN101763426A (en) * 2010-01-08 2010-06-30 浙江大学 Method and device for realizing reliability of file allocation table file system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1142080A (en) * 1995-02-17 1997-02-05 罗建平 Method for solidifying hard-disc document of computer
EP1811407A2 (en) * 2006-01-11 2007-07-25 Samsung Electronics Co., Ltd. Apparatus and method of managing hidden area
CN101246534A (en) * 2008-01-29 2008-08-20 北京理工大学 U disk with autorun virus immunity
CN101477469A (en) * 2009-02-06 2009-07-08 杭州华三通信技术有限公司 Reliable reading method, writing method and apparatus for starting code
CN101763426A (en) * 2010-01-08 2010-06-30 浙江大学 Method and device for realizing reliability of file allocation table file system

Also Published As

Publication number Publication date
CN102541969A (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN102541969B (en) File protection method and system based on file allocation table (FAT) file system, and memory
CN101484882B (en) Method for flash-memory management
KR101767710B1 (en) Card-based management of discardable files
CN101983376B (en) Access device, information recording device, information recording system, file management method, and program
KR102061079B1 (en) File accessing method and related device
US20080195833A1 (en) Systems, methods and computer program products for operating a data processing system in which a file system's unit of memory allocation is coordinated with a storage system's read/write operation unit
EP1771862B1 (en) Method and device to improve usb flash write performance
WO2016086819A1 (en) Method and apparatus for writing data into shingled magnetic record smr hard disk
CN102227729A (en) Storage device presenting to hosts only files compatible with defined host capability
CN101027651A (en) FAT analysis for optimized sequential cluster management
KR20110107800A (en) Discardable files
US11640244B2 (en) Intelligent block deallocation verification
CN107479834A (en) A kind of file memory method and device based on COS
CN102253985B (en) File system data management method and system
KR20110127636A (en) Download management of discardable files
CN108664482B (en) FLASH memory and storage file management method
KR20090042570A (en) Apparatus and method for managing files and memory unit
CN107148612A (en) A kind of method and apparatus of extending user subregion
KR100977709B1 (en) A flash memory storage device and a manage method using the same
US8200936B2 (en) Systems and methods for recording information to a memory card
CN104657471A (en) Predistribution file establishing method and system of FAT (file allocation table) file system
US20220365677A1 (en) Storage management device, storage management method, and program
JP5972455B2 (en) How to delete information
CN106991021B (en) Method and system for constructing new data file from existing data file
CN111831224B (en) Method, system and equipment for erasing residual space of exFAT partition file

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
TR01 Transfer of patent right

Effective date of registration: 20171123

Address after: 528400 Zhongshan Zhongshan Torch Development Zone, Guangdong Province, No. 191, No. seven

Patentee after: ZHONGSHAN JIANGBOLONG ELECTRONICS CO., LTD.

Address before: 518000, Guangdong, Nanshan District Province, Shenzhen Road, No. 8 financial services technology innovation base, 8 floor, A, B, C, D, E,, F1

Patentee before: Shenzhen jiangbolong Electronic Co., Ltd.

TR01 Transfer of patent right