CN113760195B - FATFS file system based on embedded type - Google Patents

FATFS file system based on embedded type Download PDF

Info

Publication number
CN113760195B
CN113760195B CN202111075639.2A CN202111075639A CN113760195B CN 113760195 B CN113760195 B CN 113760195B CN 202111075639 A CN202111075639 A CN 202111075639A CN 113760195 B CN113760195 B CN 113760195B
Authority
CN
China
Prior art keywords
area
data
address
flash
writing
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
CN202111075639.2A
Other languages
Chinese (zh)
Other versions
CN113760195A (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.)
Hengbao Co Ltd
Original Assignee
Hengbao 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 Hengbao Co Ltd filed Critical Hengbao Co Ltd
Priority to CN202111075639.2A priority Critical patent/CN113760195B/en
Publication of CN113760195A publication Critical patent/CN113760195A/en
Application granted granted Critical
Publication of CN113760195B publication Critical patent/CN113760195B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses an embedded FATFS-based file system, which comprises a configuration area arranged in an internal FLASH and a data area arranged in an external FLASH, wherein the configuration area comprises a guide area, a FAT area and a catalog area, and the internal FLASH and the external FLASH are managed by uniformly using logical addresses. By adopting the technical scheme of the application, the time is saved for the read-write access of the area based on FATFS file system structure, thereby accelerating the processing time of the whole business layer.

Description

FATFS file system based on embedded type
Technical Field
The invention relates to the field of data storage, in particular to an embedded FATFS file system.
Background
In the existing embedded system, for processing in the aspect of file system, to save space, a FATFS file system structure is used. The file system structure is a simplified file system structure aiming at embedded use scenes and requirements on the basis of the original FAT32 file system structure.
In the prior art, FATFS file systems are generally used on external FLASH to manage the external FLASH area. For external FLASH, the access speed is generally driven by SPI or I2C interface protocol, and is slower than that of internal CPU and internal FLASH. In some use scenarios, specific time requirements are required for the time of the transaction processing process, and the FLASH access processing is performed outside, so that the speed cannot meet the requirements.
Disclosure of Invention
The invention provides an embedded FATFS-based file system, which comprises a configuration area arranged in an internal FLASH and a data area arranged on an external FLASH, wherein the configuration area comprises a guide area, a FAT area and a catalog area, and the internal FLASH and the external FLASH are managed by uniformly using logical addresses.
The file system based on the embedded FATFS as described above, wherein the FAT area only includes the FAT1 area, the internal FLASH and the external FLASH perform unified power-down management, and the backup area of the internal FLASH is used for data backup.
An embedded-based FATFS file system as described above, wherein, in response to a normal write operation command, a write address is obtained from the write operation command;
Judging a write operation area corresponding to the write address:
If the writing operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the writing address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, writing the data of the configuration area into the internal FLASH backup area for backup, writing the data to be written in the writing operation into the real address of the internal FLASH, and discarding the corresponding content of the internal FLASH backup area if the writing is successful;
If the writing operation is the writing operation of the data area of the external FLASH, the external FLASH address data is written into the internal FLASH backup area, the data is written into the real address of the external FLASH, and the corresponding content of the internal FLASH backup area is discarded if the writing is successful.
The file system based on the embedded FATFS as described above, wherein unified power-down management is specifically: and powering on to detect whether the internal FLASH backup area has data of the configuration area or the data area, if so, restoring the data of the configuration area in the internal FLASH backup area to the corresponding position of the configuration area of the internal FLASH, or restoring the data of the data area in the internal FLASH backup area to the corresponding position of the data area of the external FLASH.
The embedded-based FATFS file system as described above, wherein, in response to a normal read operation command, a read address is obtained from the read operation command;
Judging a read operation area corresponding to the read address:
If the read operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the read address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, and reading out corresponding data;
if the read operation is the read operation of the data area of the external FLASH, the read operation of the external FLASH is directly called, and the corresponding data is read from the data area of the external FLASH.
The file system based on the embedded FATFS as described above, wherein the FAT area includes a FAT1 area and a FAT2 area, and the FAT1 area and the FAT2 area are backed up.
An embedded-based FATFS file system as described above, wherein, in response to a normal write operation command, a write address is obtained from the write operation command;
Judging a write operation area corresponding to the write address:
if the writing operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the writing address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, writing the data of the configuration area into the FAT2 area for backup, writing the data to be written in the writing operation into the real address of the internal FLASH, and discarding the corresponding content of the FAT2 area if the writing is successful;
If the writing operation is the writing operation of the external FLASH data area, writing the data in the writing command into the external FLASH data area, updating the FAT1 area data, and correspondingly updating the FAT2 area data.
The embedded FATFS file system, wherein the power-down protection of the internal FLASH is specifically as follows: and electrifying, detecting whether the data in the FAT1 area and the FAT2 area are consistent, if so, successfully writing the data, if not, detecting the legality of the data in the FAT1 area and the FAT2 area, if the data in the FAT1 area is legal, updating the FAT2 area according to the data in the FAT1 area, and if the data in the FAT2 area is legal, updating the FAT1 area according to the data in the FAT2 area.
The embedded-based FATFS file system as described above, wherein, in response to a normal read operation command, a read address is obtained from the read operation command;
Judging a read operation area corresponding to the read address:
If the read operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the read address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, and reading out corresponding data;
if the read operation is the read operation of the data area of the external FLASH, the read operation of the external FLASH is directly called, and the corresponding data is read from the data area of the external FLASH.
The application also provides a computer readable storage medium, which comprises an external FLASH and an internal FLASH, and is used for storing any of the above-mentioned file systems based on the embedded FATFS, and specifically comprises a data area in the FATFS file system stored in the external FLASH and a configuration area in the FATFS file system stored in the internal FLASH.
The beneficial effects achieved by the application are as follows: by adopting the technical scheme of the application, the time is saved for the read-write access of the area based on FATFS file system structure, thereby accelerating the processing time of the whole business layer.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a block diagram of a conventional FATFS file system;
FIG. 2 is a schematic diagram of an embedded-based FATFS file system according to the present application;
FIG. 3 is a flow chart of a write method based on an embedded FATFS file system;
FIG. 4 is a flow chart of a read method based on an embedded FATFS file system;
FIG. 5 is a flowchart of another writing method based on an embedded FATFS file system.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Prior to introducing the embedded FATFS file system of the present application, the structure of the existing FATFS file system will be described. As shown in fig. 1, the existing FATFS file system includes a configuration area and a data area, both of which are provided in the external FLASH to manage the external FLASH area, and the configuration area includes a boot area, a FAT1 area (document allocation table, file Allocation Table), a FAT2 area, and a directory area.
When writing file content to the existing FATFS file system, a cluster (the minimum unit of disk file storage management in the microsoft operating system is called a cluster) is taken as a basic unit, firstly, the corresponding cluster number of corresponding addresses in the file is found from the FAT1 area, the cluster position of a data area to be written is calculated according to the linking mode of the FAT1 area, then data is written, after the data is written successfully, the related cluster position is required to be mapped into the FAT1 area, writing corresponding marks are carried out, and meanwhile, the content of the FAT1 area is synchronized in the FAT2 and used as a backup FAT area. The addition and deletion operation of the file directory is performed by managing the corresponding cluster in the FAT area and also by performing addition and deletion on the cluster position of the changed directory in the directory area.
As can be seen from the data writing operation to the existing FATFS file system, the boot area, the FAT1 area, the FAT2 area and the directory area are frequently accessed during the data writing, and the access speed of the external FLASH is generally driven by the SPI or I2C interface protocol, so that for some operations with higher requirements on the access processing time, the existing FATFS file system cannot meet the requirements in speed. Based on the discovery of the problems of the existing FATFS file system, the first embodiment of the application constructs an embedded FATFS file system to solve the problem of low access speed of the existing FATFS file system.
Example 1
As shown in fig. 2, a first embodiment of the present application provides an embedded FATFS-based file system, which includes a configuration area set in an internal FLASH and a data area set in an external FLASH, where the configuration area includes a boot area, a FAT area and a directory area, and the internal FLASH and the external FLASH are managed by using logical addresses in a unified manner.
The FAT area can only comprise an FAT1 area, the internal FLASH and the external FLASH are subjected to unified power-down management, the backup area of the internal FLASH is used for data backup, the FAT2 area is omitted, the space occupation of the internal FLASH area is further reduced, and the write operation of the internal FLASH is also reduced, so that the performance of the read-write operation of the external file is faster.
Accordingly, as shown in fig. 3, the writing method based on the embedded FATFS file system includes:
step 310, responding to a normal write operation command, and acquiring a write address from the write operation command;
Step 320, determining a write operation area corresponding to the write address:
If the writing operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the writing address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, writing the data of the configuration area into the internal FLASH backup area for backup, writing the data to be written in the writing operation into the real address of the internal FLASH, and discarding the corresponding content of the internal FLASH backup area if the writing is successful;
It should be noted that, in general, the boot area in the configuration area is set to be a fixed area, and no writing process is required, and the FAT area is used to manage the index parameter area including the directory area and the external FLASH data area, so the configuration area data backed up to the internal FLASH backup area during writing operation is generally referred to as FAT area data.
Because the internal FLASH and the external FLASH are uniformly managed by using logical addresses, the configuration area of the internal FLASH and the data area of the external FLASH are respectively represented by unique logical addresses, namely, the configuration area address is not repeated with the data area address, the configuration area of the internal FLASH and the data area of the external FLASH can be uniformly mapped by setting an address mapping table, and the write address in the write operation command corresponds to the unique address of the configuration area of the internal FLASH or the data area of the external FLASH in the address mapping table, so that whether the write area corresponding to the write address is the data area of the external FLASH or the configuration area of the internal FLASH can be determined.
If the writing operation is the writing operation of the data area of the external FLASH, the external FLASH address data is written into the internal FLASH backup area, the data is written into the real address of the external FLASH, and the corresponding content of the internal FLASH backup area is discarded if the writing is successful.
In the embodiment of the application, unified power-down management is specifically as follows: and powering on to detect whether the internal FLASH backup area has data of the configuration area or the data area, if so, restoring the data of the configuration area in the internal FLASH backup area to the corresponding position of the configuration area of the internal FLASH, or restoring the data of the data area in the internal FLASH backup area to the corresponding position of the data area of the external FLASH.
As shown in fig. 4, the method for reading the file system based on the embedded FATFS includes:
step 410, responding to the normal read operation command, and acquiring a read address from the read operation command;
step 420, judging the read operation area corresponding to the read address, if the read operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the read address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, and reading out the corresponding data; and if the read operation is the read operation of the data area of the external FLASH, calling the read operation of the external FLASH, and reading out the corresponding data from the data area of the external FLASH.
In addition, the FAT area can also comprise a FAT1 area and a FAT2 area, wherein the FAT1 area and the FAT2 area are mutually backed up, and in this case, the internal FLASH and the external FLASH are uniformly managed by using logical addresses, but the uniform power-down management can be omitted;
Accordingly, as shown in fig. 5, the writing method based on the embedded FATFS file system includes:
Step 510, responding to the normal write operation command, and acquiring a write address from the write operation command;
step 520, determining a write operation area corresponding to the write address:
if the writing operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the writing address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, writing the data of the configuration area into the FAT2 area for backup, writing the data to be written in the writing operation into the real address of the internal FLASH, and discarding the corresponding content of the FAT2 area if the writing is successful;
If the writing operation is the writing operation of the external FLASH data area, the data in the writing command is written into the external FLASH data area, then the FAT1 area data is updated, and then the FAT2 area data is correspondingly updated.
The power-down protection mechanism corresponding to the FAT1 area and the FAT2 area is specifically as follows: and (3) powering on, detecting whether the data in the FAT1 area and the FAT2 area are consistent, if so, successfully writing the data, if not, detecting the validity of the data in the FAT1 area and the FAT2 area (specifically, checking whether the addresses are correct through checksum), if the data in the FAT1 area is legal, updating the FAT2 area according to the data in the FAT1 area, and if the data in the FAT2 area is legal, updating the FAT1 area according to the data in the FAT2 area.
The reading method based on the embedded FATFS file system corresponding to the FAT1 area and the FAT2 area is the same as the reading method based on the embedded FATFS file system corresponding to the FAT1 area, and is not described in detail herein.
Corresponding to the above embodiment, the embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium includes an external FLASH and an internal FLASH, and is configured to store a data area in a FATFS file system in the external FLASH and store a configuration area in a FATFS file system in the internal FLASH.
The disclosed embodiments provide a computer readable storage medium having stored therein computer program instructions which, when run on a computer, cause the computer to perform the above-described method.
In the embodiment of the invention, the processor may be an integrated circuit chip with signal processing capability. The Processor may be a general purpose Processor, a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field programmable gate array (FieldProgrammable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The processor reads the information in the storage medium and, in combination with its hardware, performs the steps of the above method.
The storage medium may be memory, for example, may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory.
The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable ROM (ELECTRICALLY EPROM, EEPROM), or a flash Memory.
The volatile memory may be a random access memory (Random Access Memory, RAM for short) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (STATIC RAM, SRAM), dynamic random access memory (DYNAMIC RAM, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate Synchronous dynamic random access memory (Double DATA RATESDRAM, ddr SDRAM), enhanced Synchronous dynamic random access memory (ENHANCEDSDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCHLINK DRAM, SLDRAM), and direct memory bus random access memory (DirectRambus RAM, DRRAM).
The storage media described in embodiments of the present invention are intended to comprise, without being limited to, these and any other suitable types of memory.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the present invention may be implemented in a combination of hardware and software. When the software is applied, the corresponding functions may be stored in a computer-readable medium or transmitted as one or more instructions or code on the computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention in further detail, and are not to be construed as limiting the scope of the invention, but are merely intended to cover any modifications, equivalents, improvements, etc. based on the teachings of the invention.

Claims (5)

1. The FATFS file system based on the embedded type is characterized by comprising a configuration area and a data area, wherein the configuration area is arranged in an internal FLASH and the data area is arranged in an external FLASH, the configuration area comprises a guide area, a FAT area and a catalog area, and the internal FLASH and the external FLASH are managed by uniformly using logical addresses;
The FAT area only comprises an FAT1 area, the internal FLASH and the external FLASH are subjected to unified power-down management, and a backup area of the internal FLASH is used for carrying out data backup;
Responding to a normal write operation command, and acquiring a write address from the write operation command;
Judging a write operation area corresponding to the write address:
If the writing operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the writing address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, writing the data of the configuration area into the internal FLASH backup area for backup, writing the data to be written in the writing operation into the real address of the internal FLASH, and discarding the corresponding content of the internal FLASH backup area if the writing is successful;
If the writing operation is the writing operation of the data area of the external FLASH, writing the external FLASH address data into the internal FLASH backup area, writing the data into the real address of the external FLASH, and discarding the corresponding content of the internal FLASH backup area if the writing is successful;
Unified power-down management is specifically as follows: powering on to detect whether the internal FLASH backup area has data of a configuration area or a data area, if so, restoring the data of the configuration area in the internal FLASH backup area to the corresponding position of the configuration area of the internal FLASH, or restoring the data of the data area in the internal FLASH backup area to the corresponding position of the data area of the external FLASH;
Responding to a normal read operation command, and acquiring a read address from the read operation command;
Judging a read operation area corresponding to the read address:
If the read operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the read address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, and reading out corresponding data;
if the read operation is the read operation of the data area of the external FLASH, the read operation of the external FLASH is directly called, and the corresponding data is read from the data area of the external FLASH.
2. The FATFS file system based on the embedded type is characterized by comprising a configuration area and a data area, wherein the configuration area is arranged in an internal FLASH and the data area is arranged in an external FLASH, the configuration area comprises a guide area, a FAT area and a catalog area, and the internal FLASH and the external FLASH are managed by uniformly using logical addresses;
The FAT area comprises a FAT1 area and a FAT2 area, and the FAT1 area and the FAT2 area are backed up;
Responding to a normal write operation command, and acquiring a write address from the write operation command;
Judging a write operation area corresponding to the write address:
if the writing operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the writing address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, writing the data of the configuration area into the FAT2 area for backup, writing the data to be written in the writing operation into the real address of the internal FLASH, and discarding the corresponding content of the FAT2 area if the writing is successful;
If the writing operation is the writing operation of the data area of the external FLASH, writing the data in the writing command into the data area of the external FLASH, updating the data of the FAT1 area, and correspondingly updating the data of the FAT2 area;
The power-down protection of the internal FLASH is specifically as follows: powering on, detecting whether the data in the FAT1 area and the FAT2 area are consistent, if yes, successfully writing the data, if not, detecting the validity of the data in the FAT1 area and the FAT2 area, if the data in the FAT1 area is legal, updating the FAT2 area according to the data in the FAT1 area, and if the data in the FAT2 area is legal, updating the FAT1 area according to the data in the FAT2 area;
Responding to a normal read operation command, and acquiring a read address from the read operation command;
Judging a read operation area corresponding to the read address:
If the read operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the read address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, and reading out corresponding data;
if the read operation is the read operation of the data area of the external FLASH, the read operation of the external FLASH is directly called, and the corresponding data is read from the data area of the external FLASH.
3. The embedded-based FATFS file system of claim 2,
Responding to a normal write operation command, and acquiring a write address from the write operation command;
Judging a write operation area corresponding to the write address:
If the writing operation is performed on the configuration area of the internal FLASH, searching an address mapping table, mapping the address of the configuration area corresponding to the writing address to the address of the corresponding size of the internal FLASH in an address corresponding mapping mode, writing the data of the configuration area into the internal FLASH backup area for backup, writing the data to be written in the writing operation into the real address of the internal FLASH, and discarding the corresponding content of the internal FLASH backup area if the writing is successful;
If the writing operation is the writing operation of the data area of the external FLASH, the external FLASH address data is written into the internal FLASH backup area, the data is written into the real address of the external FLASH, and the corresponding content of the internal FLASH backup area is discarded if the writing is successful.
4. The embedded FATFS-based file system of claim 3, wherein unified power down management is specifically: and powering on to detect whether the internal FLASH backup area has data of the configuration area or the data area, if so, restoring the data of the configuration area in the internal FLASH backup area to the corresponding position of the configuration area of the internal FLASH, or restoring the data of the data area in the internal FLASH backup area to the corresponding position of the data area of the external FLASH.
5. A computer readable storage medium, comprising an external FLASH and an internal FLASH, for storing an embedded FATFS file system according to any one of claims 1-4, in particular comprising storing a data area in FATFS file system in the external FLASH and storing a configuration area in FATFS file system in the internal FLASH.
CN202111075639.2A 2021-09-14 2021-09-14 FATFS file system based on embedded type Active CN113760195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111075639.2A CN113760195B (en) 2021-09-14 2021-09-14 FATFS file system based on embedded type

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111075639.2A CN113760195B (en) 2021-09-14 2021-09-14 FATFS file system based on embedded type

Publications (2)

Publication Number Publication Date
CN113760195A CN113760195A (en) 2021-12-07
CN113760195B true CN113760195B (en) 2024-05-07

Family

ID=78795685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111075639.2A Active CN113760195B (en) 2021-09-14 2021-09-14 FATFS file system based on embedded type

Country Status (1)

Country Link
CN (1) CN113760195B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104007939A (en) * 2014-06-23 2014-08-27 深圳供电局有限公司 Embedded type FAT file system and method for frequent write-in of small files
CN112181725A (en) * 2020-09-25 2021-01-05 江苏恒宝智能系统技术有限公司 Power-down anti-pulling backup method and system for on-chip and off-chip data of embedded system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104007939A (en) * 2014-06-23 2014-08-27 深圳供电局有限公司 Embedded type FAT file system and method for frequent write-in of small files
CN112181725A (en) * 2020-09-25 2021-01-05 江苏恒宝智能系统技术有限公司 Power-down anti-pulling backup method and system for on-chip and off-chip data of embedded system

Also Published As

Publication number Publication date
CN113760195A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
US7711923B2 (en) Persistent flash memory mapping table
US8307149B2 (en) Nonvolatile memory device including a logical-to-physical logig-to-physical address conversion table, a temporary block and a temporary table
US20070016719A1 (en) Memory device including nonvolatile memory and memory controller
US20070130442A1 (en) Apparatus and Methods Using Invalidity Indicators for Buffered Memory
US9195578B2 (en) Systems, methods and computer program products memory space management for storage class memory
CN108733306B (en) File merging method and device
US11132145B2 (en) Techniques for reducing write amplification on solid state storage devices (SSDs)
KR20170010810A (en) Method, device and user equipment for reading/writing data in nand flash
CN111026678B (en) Cache design method and device based on solid state disk and computer equipment
CN113760195B (en) FATFS file system based on embedded type
JP2022184735A (en) Program starting method and device, and storage medium
US7773433B2 (en) Method for managing a non-volatile memory in a smart card
CN114168225A (en) Method and device for delaying updating of solid state disk mapping table, computer equipment and storage medium
CN112433959A (en) Method and device for realizing data storage processing, computer storage medium and terminal
KR101939361B1 (en) Method for logging using non-volatile memory
EP2306294A1 (en) Method for accessing a storage system with numerous file systems
CN112540732B (en) Data processing method and related product
CN114816833B (en) Writing method, device and system of flash data
US11481143B2 (en) Metadata management for extent-based storage system
US20230045119A1 (en) Data access method and apparatus
KR101881038B1 (en) Method for atomic update of memory mapped files stored in non-volatile memory and control apparatus thereof
KR101847861B1 (en) Apparatus and method of computing and storage for data management
CN117421141A (en) Inter-process data parameter sharing method, device, equipment and medium
CN115840532A (en) Non-continuous length-variable Flash cache method, electronic equipment and storage medium
CN116089415A (en) Method and apparatus for key-value storage, and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant