摘要
嵌入式设备通常基于Flash存储器和TFFS文件系统构建数据存储方案,本文针对其存储性能和可靠性问题,提出了一种基于掉电中断的数据存储优化方案。该方案将频繁变化的数据缓存于内存中,仅在设备下电时将缓存数据写入文件,最大程度降低Flash擦写次数,避免设备掉电引起文件系统元数据不一致导致无法访问文件的可能,提高了设备存储可靠性,延长了Flash芯片使用寿命。
Embedded devices typically build data storage solutions based on Flash memory and TFFS file systems.This article proposes a data storage optimization scheme based on power outage interrupt to address their storage performance and reliability issues.This scheme caches frequently changing data in memory and only writes cached data to files when the device is powered down,minimizing the number of Flash writes and avoiding the possibility of inconsistent file system metadata caused by device power failure,thereby improving device storage reliability and extending the lifespan of the Flash chip.
作者
范波
王帅
Fan Bo;Wang Shuai(10th Research Institute of China Electronics Technology Group Corporation,Chengdu 610036,China)
出处
《单片机与嵌入式系统应用》
2023年第12期19-22,共4页
Microcontrollers & Embedded Systems