The invention relates to the technical field of embedded data storage, and discloses a method and a
system for prolonging the service life of a FLASH
simulation EEPROM (Electrically Erasable Programmable Read-Only Memory) in a
single chip microcomputer, and the method comprises the following steps: firstly, initializing the FLASH, dividing the FLASH into a main data area, a mapping table area, a
backup area and a
transaction log area, selecting a physical block through a dynamic
wear leveling algorithm when data is written, and writing the data into a
database; the method comprises the following steps of: starting a
backup area or a
transaction log area, safely updating a mapping table by using a transaction mechanism, performing
cyclic redundancy check when reading data, if the
cyclic redundancy check fails, starting
cascade recovery from the
backup area or the
transaction log area, and finally, updating a transaction log to
record operation so as to form a closed-loop
management process. According to the invention, through a set of dynamic
wear leveling and
data classification management mechanism, global and uniform distribution of the write load in the storage array is realized, the physical block with the least erasing times is selected during writing, the
access frequency of the data can be identified, and cold data which is not changed frequently can be actively migrated.