Non-volatile memory file read / write management methods
Patent Information
- Application Number
- TW113108306
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2026-10-01
- Estimated Expiration
- 2044-03-06
AI Technical Summary
The FAT file system (e.g., FAT32) lacks essential file management applications such as read-only and hidden functions, necessitating additional software installations, leading to unnecessary cost waste for enterprises.
A record management mechanism based on the FAT archive system, utilizing a computer system with a storage module, output module, and processing module to manage non-volatile memory, including a file configuration table and read/write permission table, to enable convenient file management.
Enables efficient and cost-effective implementation of various archive management applications by ensuring that file data operations adhere to read/write permissions, preventing system crashes and optimizing file access.
Smart Images

Figure TWG2TB001913493_001 
Figure TWG2TB001913493_002 
Figure TWG2TB001913493_003
Abstract
Description
Technical Field
[0001] This invention relates to a method for managing file reading and writing, and more particularly to a method for managing file reading and writing for non-volatile memory. Prior Technology
[0002] Currently, the FAT file system (e.g., FAT32) does not offer many file management applications, such as read-only and hidden functions. Therefore, companies often need to build additional file databases or install additional file management software to implement more effective and convenient file management applications, which also results in unnecessary cost waste.
[0003] In view of this, it is imperative to propose an archive management mechanism based on the FAT archive system, so that enterprises can implement various archive management applications more conveniently. Summary of the Invention
[0004] Therefore, the purpose of this invention is to provide a record management mechanism based on the FAT record system, enabling enterprises to implement various record management applications more conveniently.
[0005] Therefore, the file read / write management method for non-volatile memory of the present invention is implemented by a computer system. The computer system includes a storage module, an output module, and a processing module electrically connected to the storage module and the output module. The storage module includes a non-volatile memory unit and a volatile memory unit. The non-volatile memory unit stores a file configuration table, multiple files, and a read / write permission table. Each file includes unique directory information and file information. The file configuration table is used to manage the non-volatile memory unit. Multiple clusters are defined, each corresponding to a number of clusters. Each cluster contains a directory cluster and multiple file data clusters. The root directory cluster stores the directory data and a starting cluster number corresponding to each file. Each starting cluster number is one of the cluster numbers. The file data clusters store the file data. The read / write permission table contains the cluster numbers and a read / write permission code corresponding to each cluster number. Each read / write permission code indicates a type of read / write permission. The file read / write management method for non-volatile memory includes steps (A) to (F).
[0006] Step (A) is that after receiving a read instruction for a target file, the processing module obtains the starting cluster number corresponding to the target file based on the directory information of the target file and the file configuration table, and uses the starting cluster number corresponding to the target file as a target cluster number.
[0007] Step (B) involves the processing module querying and obtaining a corresponding read / write permission code for the target cluster number based on the target cluster number and the read / write permission table, and using the read / write permission code corresponding to the target cluster number as a target read / write permission code.
[0008] Step (C) is to use the processing module to determine whether the type of read / write permission indicated by the target read / write permission code is readable.
[0009] Step (D) is to determine that the read / write permission type indicated by the target read / write permission code is readable when the processing module reads the file data stored in the file data cluster corresponding to the target starting cluster number into the volatile memory unit, and determine whether the target file has been read completely based on the read file data.
[0010] Step (E) is to use the processing module to take one of the file data read in step (D) that indicates the next file data cluster containing the target file as the target cluster number when it is determined that the target file has not been read completely, and return to step (B).
[0011] Step (F) is to transfer the file data of the target file in the volatile memory unit to the output module when it is determined that the target file has been read.
[0012] The advantages of this invention are as follows: When a user issues a read command to read the file data of the target file, the computer system first obtains the cluster numbers corresponding to all file data clusters used to store the file data of the target file from the file configuration table (e.g., FAT32) of the file management system, and then uses the read and write permission table to query the corresponding read and write permission code to confirm whether all file data clusters used to store the file data of the target file are readable. Then, the management application of such files is realized through the read and write permission expression based on the file configuration table. Simple Explanation of the Diagram
[0013] Other features and effects of the present invention will be clearly presented in the embodiments with reference to the drawings, wherein: Figure 1 is a block diagram illustrating a computer system for implementing one embodiment of the file read / write management method for non-volatile memory of the present invention; Figure 2 is a flowchart illustrating a file data reading procedure of this embodiment; Figure 3 is a flowchart illustrating a file data writing procedure of this embodiment; Figure 4 is a flowchart illustrating the one-time data writing procedure of this embodiment; Figure 5 is a flowchart illustrating steps 601-607 of a specific group reading procedure in this embodiment; Figure 6 is a flowchart illustrating steps 608-612 of the specific group reading procedure in this embodiment; Figure 7 is a flowchart illustrating a directory data writing procedure in this embodiment; and Figure 8 is a flowchart illustrating the one-time writing procedure for directory data in this embodiment. Implementation
[0014] Before the invention is described in detail, it should be noted that similar elements are represented by the same numbers in the following description.
[0015] Referring to Figure 1, one embodiment of the file read / write management method for non-volatile memory of the present invention is implemented by a computer system 1 operated by a user. The computer system 1 includes a storage module 11, an input module 12, an output module 13, and a processing module 14 electrically connected to the storage module 11, the input module 12, and the output module 13.
[0016] The storage module 11 includes a non-volatile memory unit 111 and a volatile memory unit 112.
[0017] The non-volatile memory unit 111 stores a file configuration table, multiple files, and a read / write permission table. Each file contains unique directory information and file information.
[0018] The file configuration table is used to plan the non-volatile memory unit 111 into multiple clusters, each corresponding to a different cluster number. These clusters include a root directory cluster and multiple file data clusters. The root directory cluster stores the directory data and a starting cluster number corresponding to each file, where each starting cluster number is one of the cluster numbers. The file data clusters store the file data. The read / write permission table includes the cluster numbers and a read / write permission code corresponding to each cluster number, where each read / write permission code indicates a type of read / write permission.
[0019] It should be further noted that, in this embodiment, the read / write permission codes are implemented using 4 bits, and the number of read / write permission types that can be represented is 16, including read-and-write, read-and-not-write, not-read, read-and-write-once, read-and-write for a specific group, and read-and-not-write for a specific group, but not limited to the above. The file configuration table is FAT32, but not limited to this.
[0020] The non-volatile memory unit 111 also stores a root directory read / write permission table. This root directory read / write permission table contains multiple pieces of location information about the storage location of the directory data within the root directory cluster, and a read / write permission code corresponding to each location.
[0021] It should be further explained that the root directory cluster contains multiple sectors, each sector contains multiple sub-sectors, and each sub-sector is used to store any file directory. Specifically, each location information in the root directory read / write permission table includes sector location information about the sector where the corresponding directory data is stored, and sub-sector location information about the sub-sector location within that sector. In the FAT32 system architecture, the root directory cluster contains 64 sectors totaling 32,768 bytes, each sector includes 16 sub-sectors totaling 512 bytes, and each sub-sector is 32 bytes and used to store any file directory. Therefore, in this embodiment, the root directory read / write permission table uses 8 bits to distinguish the sector location information represented by the 64 different sectors and 4 bits to distinguish the sub-sector location information represented by the 16 different sub-sectors.
[0022] The non-volatile memory unit 111 also stores multiple account records corresponding to multiple users and a user permission table. Each account record includes a username and a password, and the user permission table includes the account and one of multiple groups corresponding to each account.
[0023] The computer system 1 may be a personal computer, a tablet computer, a laptop computer, a smart device, or a server, but is not limited thereto. The output module 13 may be a monitor, but is not limited thereto.
[0024] The following will describe the operation details of the computer system 1 in conjunction with this embodiment of the file read / write management method for non-volatile memory of the present invention. The file read / write management method for non-volatile memory includes a file data reading program, a file data writing program, a file data one-time writing program, a specific group reading program, a directory data writing program, and a directory data one-time writing program.
[0025] Referring to Figure 2, the document retrieval procedure includes steps 301 to 308.
[0026] In step 301, the processing module 14 responds to the input module 12 via user input operation, generating a first read instruction for file data of a target file.
[0027] In step 302, after receiving the first read instruction, the processing module 14 obtains the starting cluster number corresponding to the target file based on the directory information of the target file and the file configuration table, and uses the starting cluster number corresponding to the target file as a target cluster number. It is worth mentioning that each directory information in FAT32 contains at least a filename and a subfilename. The processing module 14 can obtain the starting cluster number corresponding to the target file by querying the file configuration table using the unique combination of the filename and the subfilename.
[0028] In step 303, the processing module 14 queries and obtains a read / write permission code corresponding to the target cluster number based on the target cluster number and the read / write permission table, and uses the read / write permission code corresponding to the target cluster number as a target read / write permission code.
[0029] In step 304, the processing module 14 determines whether the read / write permission type indicated by the target read / write permission code is readable. When the processing module 14 determines that the read / write permission type indicated by the target read / write permission code is readable, it proceeds to step 305; when the processing module 14 determines that the read / write permission type indicated by the target read / write permission code is not readable (i.e., not readable), it proceeds to step 307.
[0030] In step 305, the processing module 14 reads the file data stored in the file data cluster corresponding to the target starting cluster number into the volatile memory unit 112, and determines whether the target file has been completely read based on the read file data. When the processing module 14 determines that the target file has not been completely read, it proceeds to step 306; when the processing module 14 determines that the target file has been completely read, it proceeds to step 308.
[0031] In step 306, the processing module 14 uses one of the cluster numbers from the file data read in step 305 that indicates the next file data cluster containing the target file as the target cluster number, and returns to step 303. It is worth noting that if the target file is stored using more than one cluster, the file data read in step 305 will contain the cluster number that indicates the next file data cluster containing the target file.
[0032] In step 307, the processing module 14 reads the file data stored in the file data cluster corresponding to the target starting cluster number into the volatile memory unit 112, and modifies the file data of the read file data cluster using a preset rule. It is worth noting that in this embodiment, the preset rule modifies all bits representing the file data of the read file data cluster to "0" or "1", so that subsequent step 308 cannot present the actual file data of the target file, but this is not limited to the aforementioned preset rule. Furthermore, if the computer system 1 receives the read command but fails to return the read data, it will also cause the computer system 1 to crash. Therefore, this method can effectively prevent crashes.
[0033] In step 308, the processing module 14 transmits the file data of the target file in the volatile memory unit 112 to the output module 13 so as to present the file data of the target file through the output module 13.
[0034] Referring to Figure 3, the file writing procedure is executed after the file reading procedure and includes steps 401 to 405.
[0035] In step 401, the processing module 14 responds to the input module 12 via user input operation, generating a first write instruction for the file data of the target file.
[0036] In step 402, after receiving the first write instruction, the processing module 14 determines, based on the cluster numbers corresponding to the n target file data clusters used to store the target file and the read / write permission table, whether the read / write permission types indicated by the n read / write permission codes corresponding to the n target file data clusters used to store the target file are all readable and writable, where n ≥ 1. When the processing module 14 determines that the read / write permission types indicated by the n read / write permission codes corresponding to the n target file data clusters are not all readable and writable, it proceeds to step 403; when the processing module 14 determines that the read / write permission types indicated by the n read / write permission codes corresponding to the n target file data clusters are all readable and writable, it proceeds to step 404.
[0037] In step 403, the processing module 14 generates and transmits a first unmodifiable message indicating that the file data of the target file cannot be modified to the output module 13, so as to present the first unmodifiable message through the output module 13.
[0038] In step 404, the processing module 14 responds to the input signal generated by the input module 12 through the user input operation to update the file data about the target file that has been read into the volatile memory unit 112, and at the same time transmits the updated file data about the target file in the volatile memory unit 112 to the output module 13 so that the updated file data of the target file can be presented through the output module 13.
[0039] In step 405, when the file data of the target file is updated, the processing module updates and replaces the file data of the target file stored in the n target file data clusters according to the updated file data of the target file.
[0040] Referring to Figure 4, the one-time file writing procedure is executed after the file reading procedure and includes steps 501 to 506.
[0041] In step 501, the processing module 14 responds to the input module 12 via user input operation by generating a second write command for the file data of the target file.
[0042] In step 502, after receiving the second write instruction, the processing module 14 determines, based on the cluster numbers corresponding to the m target file data clusters used to store the target file and the read / write permission table, whether the read / write permission types indicated by the m read / write permission codes corresponding to the m target file data clusters used to store the target file are all readable and write-once, where m ≧ 1. When the processing module 14 determines that the read / write permission types indicated by the m read / write permission codes corresponding to the m target file data clusters are not all readable and write-once, it proceeds to step 503; when the processing module 14 determines that the read / write permission types indicated by the m read / write permission codes corresponding to the m target file data clusters are all readable and write-once, it proceeds to step 504.
[0043] In step 503, the processing module 14 generates and transmits a second unmodifiable message indicating that the file data of the target file cannot be modified to the output module 13, so as to present the second unmodifiable message through the output module 13.
[0044] In step 504, the processing module 14 responds to the input signal generated by the input module 12 through the user input operation to update the file data about the target file that has been read into the volatile memory unit 112, and at the same time transmits the updated file data about the target file in the volatile memory unit 112 to the output module 13 so that the updated file data of the target file can be presented through the output module 13.
[0045] In step 505, when the file data of the target file is updated, the processing module 14 updates and replaces the file data of the target file stored in the m target file data clusters according to the updated file data of the target file.
[0046] In step 506, the processing module 14 updates the m read / write permission codes corresponding to the m target file data clusters in the read / write permission table to indicate read-only and write-only permission codes.
[0047] Referring to Figures 5 and 6, the specific group reading procedure includes steps 601 to 612.
[0048] In step 601, the processing module 14 responds to the input module 12 via user input by generating a verification command for a target user, including a target account and a target password. The target account is one of the aforementioned accounts, and the target password is one of the aforementioned passwords.
[0049] In step 602, after receiving the verification instruction, the processing module 14 determines whether the verification instruction is successfully verified based on the account information and the verification instruction. If the processing module 14 determines that the verification instruction fails, it proceeds to step 603; if the processing module 14 determines that the verification instruction is successfully verified, it proceeds to step 604.
[0050] In step 603, the processing module 14 generates and transmits a verification failure message indicating verification failure to the output module 13, so that the verification failure message is presented through the output module 13.
[0051] In step 604, the processing module 14 obtains a target group corresponding to the target account based on the target account and the user permission table. The target group is one of the groups.
[0052] In step 605, the processing module 14 responds to the input module 12 via user input operation by generating a second read instruction for the file data of the target file.
[0053] In step 606, after receiving the second read instruction, the processing module 14 obtains the starting cluster number corresponding to the target file according to the directory information of the target file and the file configuration table, and uses the starting cluster number corresponding to the target file as the target cluster number.
[0054] In step 607, the processing module 14 queries the target cluster number and the read / write permission table to obtain the read / write permission code corresponding to the target cluster number, and uses the read / write permission code corresponding to the target cluster number as the target read / write permission code.
[0055] In step 608, the processing module 14 determines whether the read / write permission type indicated by the target read / write permission code belongs to the target group and is readable. When the processing module 14 determines that the read / write permission type indicated by the target read / write permission code belongs to the target group and is readable, it proceeds to step 609; when the processing module 14 determines that the read / write permission type indicated by the target read / write permission code does not belong to the target group and is not readable, it proceeds to step 611. It is worth mentioning that these groups are defined by the system administrator, such as, but not limited to, a first group and a second group, and the read / write permission types indicating that the first group and the second group are readable correspond to different read / write permission codes.
[0056] In step 609, the processing module 14 reads the file data stored in the file data cluster corresponding to the target starting cluster number into the volatile memory unit 112, and determines whether the target file has been completely read based on the read file data. When the processing module 14 determines that the target file has not been completely read, it proceeds to process step 610; when the processing module 14 determines that the target file has been completely read, it proceeds to process step 612.
[0057] In step 610, the processing module 14 takes the cluster number in the file data read in step 305 that indicates the next file data cluster containing the target file as the target cluster number, and returns to step 607.
[0058] In step 611, the processing module 14 reads the file data stored in the file data cluster corresponding to the target starting cluster number into the volatile memory unit 112, and modifies the file data of the read file data cluster using the preset rules.
[0059] In step 612, the processing module 14 transmits the file data of the target file in the volatile memory unit 112 to the output module 13 so as to present the file data of the target file through the output module 13.
[0060] It is worth noting that those skilled in the art can also combine the technologies contained in the file writing program, the file one-time writing program, and the specific group reading program to determine whether the type of read and write permission indicated by the target read and write permission code belongs to the target group and can be read and written, thereby obtaining a specific permission writing program; or, by determining whether the type of read and write permission indicated by the target read and write permission code belongs to the target group and can be read and written at once, thereby obtaining a specific permission one-time writing program. Therefore, no further details will be provided here.
[0061] Referring to Figure 7, the directory data writing procedure is used after the directory data of the target file has been read, and includes steps 701 to 707.
[0062] In step 701, the processing module 14 responds to the input module 12 via user input operation, generating a first directory write instruction for the directory data of the target file.
[0063] In step 702, after receiving the first directory write instruction, the processing module 14 retrieves target location information about the storage location of the target file's directory information in the root directory cluster from the file configuration table, based on the target file's directory information. This target location information includes target sector location information indicating the location of the stored sector, and target sub-region location information indicating the location of the stored sub-region.
[0064] In step 703, the processing module 14 obtains a read / write permission code corresponding to the target location information based on the target location information and the root directory read / write permission table. To further explain, the processing module 14 searches the root directory read / write permission table based on the target sector location information and the target sub-sector location information in the target location information to obtain the read / write permission code corresponding to the target location information.
[0065] In step 704, the processing module 14 determines whether the read / write permission type indicated by the read / write permission code corresponding to the target location information is both readable and writable. When the processing module 14 determines that the read / write permission type indicated by the read / write permission code corresponding to the target location information is not both readable and writable, it proceeds to step 705; when the processing module 14 determines that the read / write permission type indicated by the read / write permission code corresponding to the target location information is both readable and writable, it proceeds to step 706.
[0066] In step 705, the processing module 14 generates and transmits a first unmodifiable directory message indicating that the directory data of the target file cannot be modified to the output module 13, so as to present the first unmodifiable directory message through the output module 13.
[0067] In step 706, the processing module 14 responds to the input signal generated by the input module 13 through the user input operation, updates the directory data of the target file that has been read into the volatile memory unit 112, and transmits the updated directory data of the target file in the volatile memory unit 112 to the output module 13 so that the updated directory data of the target file can be presented through the output module 13.
[0068] In step 707, when the directory data of the target file is updated, the processing module 14 updates and replaces the directory data of the target file stored in the root directory cluster according to the updated directory data of the target file.
[0069] Referring to Figure 8, the one-time directory data writing procedure is used after the directory data of the target file has been read, and includes steps 801 to 808.
[0070] In step 801, the processing module 14 responds to the input module 12 via user input operation, generating a second directory write command for the directory data of the target file.
[0071] In step 802, after receiving the second directory write instruction, the processing module 14 retrieves target location information about the storage location of the target file's directory information in the root directory cluster from the file configuration table based on the target file's directory information.
[0072] In step 803, the processing module 14 obtains the read / write permission code corresponding to the target location information based on the target location information and the root directory read / write permission table.
[0073] In step 804, the processing module 14 determines whether the read / write permission type indicated by the read / write permission code corresponding to the target location information is readable and can be written in one go. When the processing module 14 determines that the read / write permission type indicated by the read / write permission code corresponding to the target location information is not readable and can be written in one go, it proceeds to step 805; when the processing module 14 determines that the read / write permission type indicated by the read / write permission code corresponding to the target location information is readable and can be written in one go, it proceeds to step 806.
[0074] In step 805, the processing module 14 generates and transmits a second unmodifiable directory message indicating that the directory data of the target file cannot be modified to the output module 13, so as to present the second unmodifiable directory message through the output module 13.
[0075] In step 806, the processing module 14 responds to the input signal generated by the input module 13 through the user input operation, updates the directory data of the target file that has been read into the volatile memory unit 112, and transmits the updated directory data of the target file in the volatile memory unit 112 to the output module 13 so that the updated directory data of the target file can be presented through the output module 13.
[0076] In step 807, when the directory data of the target file is updated, the processing module 14 updates and replaces the directory data of the target file stored in the root directory cluster according to the updated directory data of the target file.
[0077] In step 808, the processing module 14 updates the read / write permission code corresponding to the target location information in the root directory read / write permission table to a read / write permission code indicating that it can be read but not written.
[0078] In summary, the file read / write management method for non-volatile memory of the present invention, when a user issues a read or write command for the target file, the processing module 14 first obtains the cluster numbers corresponding to all file clusters used to store the target file from the file configuration table (e.g., FAT32) of the file management system, and then uses the read / write permission table to query the corresponding read / write permission codes to confirm whether all file clusters used to store the target file are readable or writable; and when the user issues a close command ... When a write instruction is given for the directory data of the target file, the processing module 14 can also use the directory data of the target file to query the file configuration table to obtain the target location information of the storage location of the directory data of the target file in the root directory cluster. Then, it compares the root directory read / write permission table with the target location information to confirm whether the directory data of the target file can be modified. In this way, various management applications of such files can be realized through the read / write permission table based on the file configuration table and the root directory read / write permission table, thus achieving the purpose of the present invention.
[0079] However, the above description is merely an embodiment of the present invention and should not be construed as limiting the scope of the present invention. Any simple equivalent changes and modifications made in accordance with the scope of the patent application and the contents of the patent specification of the present invention shall still fall within the scope of the patent of the present invention.
[0080] 1: Computer System 11: Storage Module 12: Input Module 13: Output Module 14: Processing Module 301~308: Steps 401~405: Steps 501~506: Steps 601~612: Steps 701~707: Steps 801~808: Steps
Claims
1. A method for managing file read / write operations on non-volatile memory, implemented by a computer system, the computer system comprising a storage module, an output module, and a processing module electrically connected to the storage module and the output module, the storage module comprising a non-volatile memory unit and a volatile memory unit, the non-volatile memory unit storing a file configuration table, multiple files, and a read / write permission table, each file comprising unique directory information and file information, the file configuration table being used to divide the non-volatile memory unit into multiple clusters corresponding to multiple cluster numbers, each cluster comprising a directory cluster and multiple file data clusters, the root directory cluster storing the directory information and a starting cluster number corresponding to each file, each starting cluster number being one of the cluster numbers, the file data clusters storing the file information, the read / write permission table comprising the cluster numbers and a read / write permission code corresponding to each cluster number, each read / write permission code indicating a read / write permission type, the method for managing file read / write operations on non-volatile memory comprising the following steps: (A) Upon receiving a read instruction for a target file, the processing module obtains the starting cluster number corresponding to the target file based on the target file's directory information and the file configuration table, and uses the starting cluster number corresponding to the target file as a target cluster number; (B) Based on the target cluster number and the read / write permission table, the processing module queries and obtains the read / write permission code corresponding to the target cluster number, and uses the read / write permission code corresponding to the target cluster number as a target read / write permission code; (C) The processing module determines whether the read / write permission type indicated by the target read / write permission code is readable; (D) When it is determined that the read / write permission type indicated by the target read / write permission code is not readable, the processing module reads the file data stored in the file data cluster corresponding to the target cluster number into the volatile memory unit, and modifies the file data of the read file data cluster using a preset rule; (E) (F) When the read / write permission type indicated by the target read / write permission code is determined to be readable, the processing module reads the file data stored in the file data cluster corresponding to the target cluster number into the volatile memory unit, and determines whether the target file has been read completely based on the read file data; (G) When it is determined that the target file has not been read completely, the processing module uses one of the file data read in step (F) to indicate the cluster number of the next file data cluster storing the target file as the target cluster number, and returns to step (B); and (H) When it is determined that the target file has been read completely, the processing module transmits the file data of the target file in the volatile memory unit to the output module.
2. A method for managing file read / write operations on non-volatile memory, implemented by a computer system, the computer system comprising a storage module, an input module, an output module, and a processing module electrically connected to the storage module, the input module, and the output module, the storage module comprising a non-volatile memory unit and a volatile memory unit, the non-volatile memory unit storing a file configuration table, multiple files, and a read / write permission table, each file comprising unique directory information and file information, the file configuration table being used to manage the non-volatile memory... The non-volatile memory unit is planned with multiple clusters, each corresponding to a cluster number. These clusters include a root directory cluster and multiple file data clusters. The root directory cluster stores the directory data and a starting cluster number corresponding to each file. Each starting cluster number is one of the cluster numbers. The file data clusters store the file data. The read / write permission table includes the cluster numbers and a read / write permission code corresponding to each cluster number. Each read / write permission code indicates a type of read / write permission. The file read / write management method for non-volatile memory includes the following steps: (A) Upon receiving a read instruction for a target file, the processing module obtains the starting cluster number corresponding to the target file based on the target file's directory information and the file configuration table, and uses the starting cluster number as a target cluster number; (B) Based on the target cluster number and the read / write permission table, the processing module queries and obtains the read / write permission code corresponding to the target cluster number, and uses the read / write permission code as a target read / write permission code; (C) The processing module determines whether the read / write permission type indicated by the target read / write permission code is readable; (D) When it is determined that the read / write permission type indicated by the target read / write permission code is readable, the processing module reads the file data stored in the file data cluster corresponding to the target cluster number into the volatile memory unit, and determines whether the target file has been completely read based on the read file data; (E) When it is determined that the target file has not been fully read, the processing module uses one of the file data read in step (D) that indicates the next file data cluster containing the target file as the target cluster number, and returns to step (B); (F) When it is determined that the target file has been fully read, the processing module uses the file data of the target file in the volatile memory unit to transfer to the output module; (G) After receiving a write instruction for the target file, the processing module uses the cluster number corresponding to all n target file data clusters used to store the target file and the read / write permission table to determine whether the read / write permission types indicated by the n read / write permission codes corresponding to the n target file data clusters used to store the target file are all readable and writable, n≧1;(H) When it is determined that the read / write permissions indicated by the n read / write permission codes are both readable and writable, the processing module responds to the input signal generated by the input module through user input to update the file data of the target file in the volatile memory unit; and (I) when the file data of the target file is updated, the processing module updates and replaces the file data of the target file stored in the n target file data clusters according to the updated file data of the target file.
3. A method for managing file read / write operations on non-volatile memory, implemented by a computer system, the computer system comprising a storage module, an input module, an output module, and a processing module electrically connected to the storage module, the input module, and the output module, the storage module comprising a non-volatile memory unit and a volatile memory unit, the non-volatile memory unit storing a file configuration table, multiple files, and a read / write permission table, each file comprising unique directory information and file information, the file configuration table being used to manage the non-volatile memory... The non-volatile memory unit is planned with multiple clusters, each corresponding to a cluster number. These clusters include a root directory cluster and multiple file data clusters. The root directory cluster stores the directory data and a starting cluster number corresponding to each file. Each starting cluster number is one of the cluster numbers. The file data clusters store the file data. The read / write permission table includes the cluster numbers and a read / write permission code corresponding to each cluster number. Each read / write permission code indicates a type of read / write permission. The file read / write management method for non-volatile memory includes the following steps: (A) Upon receiving a read instruction for a target file, the processing module obtains the starting cluster number corresponding to the target file based on the target file's directory information and the file configuration table, and uses the starting cluster number as a target cluster number; (B) Based on the target cluster number and the read / write permission table, the processing module queries and obtains the read / write permission code corresponding to the target cluster number, and uses the read / write permission code as a target read / write permission code; (C) The processing module determines whether the read / write permission type indicated by the target read / write permission code is readable; (D) When it is determined that the read / write permission type indicated by the target read / write permission code is readable, the processing module reads the file data stored in the file data cluster corresponding to the target cluster number into the volatile memory unit, and determines whether the target file has been completely read based on the read file data; (E) When it is determined that the target file has not been fully read, the processing module uses one of the file data read in step (D) that indicates the next file data cluster containing the target file as the target cluster number, and returns to step (B); (F) When it is determined that the target file has been fully read, the processing module uses the file data of the target file in the volatile memory unit to transfer to the output module; (G) After receiving a write instruction for the target file, the processing module uses the cluster number corresponding to all m target file data clusters used to store the target file and the read / write permission table to determine whether the read / write permission types indicated by the m read / write permission codes corresponding to the m target file data clusters used to store the target file are all readable and write-once, m≧1;(H) When it is determined that the read / write permission types indicated by the m read / write permission codes are all readable and writable at once, the processing module responds to the input signal generated by the input module through user input to update the file data of the target file in the volatile memory unit; (I) When the file data of the target file is updated, the processing module updates and replaces the file data of the target file stored in the m target file data clusters according to the updated file data of the target file; and (J) The processing module updates the m read / write permission codes corresponding to the m target file data clusters in the read / write permission table to read / write permission codes indicating readable but not writable.
4. A method for managing file read / write operations on non-volatile memory, implemented by a computer system. The computer system includes a storage module, an input module, an output module, and a processing module electrically connected to the storage module, the input module, and the output module. The storage module includes a non-volatile memory unit and a volatile memory unit. The non-volatile memory unit stores a file configuration table, multiple files, a read / write permission table, multiple account records corresponding to multiple users, and a user permission table. Each file includes unique directory information and file information. The file configuration table is used to divide the non-volatile memory unit into multiple sub-modules. Each cluster corresponds to multiple cluster numbers. These clusters include a directory cluster and multiple file data clusters. The root directory cluster stores the directory data and a starting cluster number corresponding to each file. Each starting cluster number is one of the cluster numbers. The file data clusters store the file data. The read / write permission table includes the cluster numbers and a read / write permission code corresponding to each cluster number. Each read / write permission code indicates a type of read / write permission. Each account data includes an account and a password. The user permission table includes the accounts and one of multiple groups corresponding to each account. This non-volatile memory file read / write management method includes the following steps: (A) Upon receiving a verification command for a target user, including a target account and a target password, the processing module determines whether the verification command was successfully verified based on the account information and the verification command. (B) If the verification command was successfully verified, the processing module obtains the target group corresponding to the target account based on the target account and the user permission table. (C) Upon receiving a read command for a target file, the processing module obtains the starting cluster number corresponding to the target file based on the target file's directory information and the file configuration table, and uses the starting cluster number corresponding to the target file as a target cluster number. (D) The processing module queries the read / write permission table based on the target cluster number and obtains the read / write permission code corresponding to the target cluster number, and uses the read / write permission code corresponding to the target cluster number as a target read / write permission code. (E) The processing module determines whether the read / write permission type indicated by the target read / write permission code belongs to the target group and is readable. (F) When it is determined that the read / write permission type indicated by the target read / write permission code belongs to the target group and can be read, the processing module reads the file data stored in the file data cluster corresponding to the target cluster number into the volatile memory unit, and determines whether the target file has been read completely based on the read file data; (G) When it is determined that the target file has not been read completely, the processing module uses one of the file data read in step (F) to indicate the cluster number of the next file data cluster storing the target file as the target cluster number, and returns to step (D);(H) When it is determined that the target file has been completely read, the processing module transfers the file data related to the target file in the volatile memory unit to the output module.
5. A method for managing file read / write operations on non-volatile memory, implemented by a computer system, the computer system comprising a storage module, an input module, an output module, and a processing module electrically connected to the storage module, the input module, and the output module. The storage module comprises a non-volatile memory unit and a volatile memory unit. The non-volatile memory unit stores a file configuration table, multiple files, a read / write permission table, and a directory read / write permission table. Each file contains unique directory information and file information. The file configuration table is used to divide the non-volatile memory unit into multiple clusters, each corresponding to a different cluster number. A root directory cluster contains a root directory cluster and multiple file data clusters. The root directory cluster stores the directory data and a starting cluster number corresponding to each file. Each starting cluster number is one of the cluster numbers. The file data clusters store the file data. The read / write permission table contains the cluster numbers and a read / write permission code corresponding to each cluster number. Each read / write permission code indicates a type of read / write permission. The root directory read / write permission table contains multiple location information about the storage location of the directory data in the root directory cluster, and the read / write permission code corresponding to each location information. The file read / write management method for non-volatile memory includes the following steps: (A) Upon receiving a read instruction for a target file, the processing module obtains the starting cluster number corresponding to the target file based on the target file's directory information and the file configuration table, and uses the starting cluster number as a target cluster number; (B) Based on the target cluster number and the read / write permission table, the processing module queries and obtains the read / write permission code corresponding to the target cluster number, and uses the read / write permission code as a target read / write permission code; (C) The processing module determines whether the read / write permission type indicated by the target read / write permission code is readable; (D) When it is determined that the read / write permission type indicated by the target read / write permission code is readable, the processing module reads the file data stored in the file data cluster corresponding to the target cluster number into the volatile memory unit, and determines whether the target file has been completely read based on the read file data; (E) When it is determined that the target file has not been fully read, the processing module uses one of the file data read in step (D) to indicate the cluster number of the next file data cluster containing the target file as the target cluster number, and returns to step (B); (F) When it is determined that the target file has been fully read, the processing module transmits the file data of the target file in the volatile memory unit to the output module; (G) After receiving a directory write instruction for the target file, the processing module obtains the target location information of the directory data of the target file in the root directory cluster according to the directory data of the target file and the file configuration table.(H) The processing module obtains a read / write permission code corresponding to the target location information based on the target location information and the root directory read / write permission table; (I) The processing module determines whether the read / write permission type indicated by the read / write permission code corresponding to the target location information is readable and writable; (J) When it is determined that the read / write permission type indicated by the read / write permission code corresponding to the target location information is readable and writable, the input signal generated by the input module through user input is responded to, and the directory data of the target file that has been read into the volatile memory unit is updated; and (K) When the directory data of the target file is updated, the processing module updates and replaces the directory data of the target file stored in the root directory cluster according to the updated directory data of the target file.
6. The file read / write management method for non-volatile memory as described in claim 5, wherein the root directory cluster comprises multiple sectors, each sector comprises multiple sub-regions, each sub-region is used to store any file directory, and each location information in the root directory read / write permission table includes sector location information about the sector location where the corresponding directory data is stored, and sub-region location information about the sub-region location within the sector location where the corresponding directory data is stored, wherein... In step (H), the processing module uses the target sector location information and the target sub-sector location information in the target location information to look up the root directory read / write permission table to obtain the read / write permission code corresponding to the target location information.
7. A method for managing file read / write operations on non-volatile memory, implemented by a computer system, the computer system comprising a storage module, an input module, an output module, and a processing module electrically connected to the storage module, the input module, and the output module, the storage module comprising a non-volatile memory unit and a volatile memory unit, the non-volatile memory unit storing a file configuration table, multiple files, a read / write permission table, and a directory read / write permission table, each file comprising unique directory information and file information, the file configuration table being used to divide the non-volatile memory unit into multiple clusters corresponding to multiple cluster numbers. A root directory cluster contains a root directory cluster and multiple file data clusters. The root directory cluster stores the directory data and a starting cluster number corresponding to each file. Each starting cluster number is one of the cluster numbers. The file data clusters store the file data. The read / write permission table contains the cluster numbers and a read / write permission code corresponding to each cluster number. Each read / write permission code indicates a type of read / write permission. The root directory read / write permission table contains multiple location information about the storage location of the directory data in the root directory cluster, and the read / write permission code corresponding to each location information. The file read / write management method for non-volatile memory includes the following steps: (A) Upon receiving a read instruction for a target file, the processing module obtains the starting cluster number corresponding to the target file based on the target file's directory information and the file configuration table, and uses the starting cluster number as a target cluster number; (B) Based on the target cluster number and the read / write permission table, the processing module queries and obtains the read / write permission code corresponding to the target cluster number, and uses the read / write permission code as a target read / write permission code; (C) The processing module determines whether the read / write permission type indicated by the target read / write permission code is readable; (D) When it is determined that the read / write permission type indicated by the target read / write permission code is readable, the processing module reads the file data stored in the file data cluster corresponding to the target cluster number into the volatile memory unit, and determines whether the target file has been completely read based on the read file data; (E) When it is determined that the target file has not been fully read, the processing module uses one of the file data read in step (D) to indicate the cluster number of the next file data cluster containing the target file as the target cluster number, and returns to step (B); (F) When it is determined that the target file has been fully read, the processing module transmits the file data of the target file in the volatile memory unit to the output module; (G) After receiving a directory write instruction for the target file, the processing module obtains the target location information of the directory data of the target file in the root directory cluster according to the directory data of the target file and the file configuration table.(H) The processing module obtains a read / write permission code corresponding to the target location information based on the target location information and the root directory read / write permission table; (I) The processing module determines whether the read / write permission type indicated by the read / write permission code corresponding to the target location information is readable and write-once; (J) When it is determined that the read / write permission type indicated by the read / write permission code corresponding to the target location information is readable and write-once, the input signal generated by the input module through user input is responded to, and the directory data of the target file that has been read into the volatile memory unit is updated; (K) When the directory data of the target file is updated, the processing module updates the directory data of the target file stored in the root directory cluster according to the updated directory data of the target file; and (L) The processing module updates the read / write permission code corresponding to the target location information in the root directory read / write permission table to indicate a read-only and write-only read / write permission code.
Citation Information
Patent Citations
Data writing method and related equipment thereof
CN114519033A
Method and apparatus for securing computer mass storage data
TW201514749A
Data processing method, memory controller and memory storage apparatus
US20130179626A1
Response reading method and data transmission system
US9483195B2
