Patent ID: 8271854

Claim:
An electronic device, comprising: a flash memory, comprising a plurality of data storage blocks; a random access memory; and a processor, wherein: the processor divides operation system data into a plurality of data block sets, each of which comprises at least one data block, and data amount stored in the data block equals to data amount stored in the data storage block; the processor performs a parity check process on the data blocks within each of the data block sets to generate parity data of the corresponding data block, and the parity data is used as backup for the operation system data; and the processor stores the operation system data and the parity data into the data storage block of the flash memory, wherein the processor further performs the following steps when executing the operation system data: determining whether the flash memory is damaged in the data storage block storing the operation system data; when the flash memory is damaged in the data storage block storing the operation system data, retrieving the parity data corresponding to the data block of the operation system data stored in the damaged data storage block; restoring operation system data that is meant to be stored in the damaged data storage block according to the retrieved parity data; and loading the restored operation system data into the random access memory.