The invention discloses a FLASH data reading / writing method and
system. The method comprises a step of distributing N pages as data storage areas in a FLASH, wherein the data storage areas are used for storing
data records, one page is taken as an index area and the other N-1 areas are taken as
record areas. The method furthermore comprises the following steps of: S101, judging whether a target page Nm is fully written or not, if the judging result is negative, executing the step S103, and otherwise, turning to the steps S1a to S1c; S102, writing to-be-written data into the target pages Nm of the
record areas in sequence; S1a, erasing information of pages Nm+2 of the
record areas, namely, setting all the contents of the pages as identification information of 0xff; S1b, writing page numbers of the pages Nm+1 of the to-be-written data in the data record areas into the index area in sequence; and S1c, writing the to-be-written data into the pages Nm+1 of the record areas in sequence, wherein the pages N-1 of the record areas form a
storage area of a round-robin
queue. According to the method and
system disclosed by the invention, the erasing frequency of the FLASH is reduced, the service life is prolonged, and the position of the final
storage record during the last power down can be rapidly searched after power up.