WO2018059565A1 - Method and system for backing up flash memory data - Google Patents

Method and system for backing up flash memory data Download PDF

Info

Publication number
WO2018059565A1
WO2018059565A1 PCT/CN2017/104623 CN2017104623W WO2018059565A1 WO 2018059565 A1 WO2018059565 A1 WO 2018059565A1 CN 2017104623 W CN2017104623 W CN 2017104623W WO 2018059565 A1 WO2018059565 A1 WO 2018059565A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data area
flash memory
backup
partition
Prior art date
Application number
PCT/CN2017/104623
Other languages
French (fr)
Chinese (zh)
Inventor
何美玲
Original Assignee
深圳创维数字技术有限公司
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 深圳创维数字技术有限公司 filed Critical 深圳创维数字技术有限公司
Publication of WO2018059565A1 publication Critical patent/WO2018059565A1/en

Links

Images

Classifications

    • 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/1448Management of the data involved in backup or backup restore
    • 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
    • G06F11/1469Backup restoration techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

A method for backing up flash memory data, comprising: when data is corrupted in both an original data area and a backup data area of a flash memory, using default data in a planned partition of the flash memory for system startup, where the default data comprises division data of one or more partitions of the flash memory or partition division data of a major partition and essential startup data required for system startup, and the planned partition is a flash memory partition that is either unmodifiable or minimally modifiable. Also disclosed is a system for backing up flash memory data.

Description

闪存数据的备份方法及系统Flash data backup method and system 技术领域Technical field
本公开涉及闪存(flash)技术领域,例如,涉及一种闪存数据的备份方法及系统。The present disclosure relates to the field of flash technology, for example, to a method and system for backing up flash data.
背景技术Background technique
通过串行外接口(serial peripheral interface,SPI)向闪存(flash)写入数据时,数据的写入速度慢。如果上述写入过程,或者读取数据的过程中发生异常断电,可能会损坏重要数据(文件),如与系统启动相关的数据(文件)。如果损坏与系统启动相关的数据(文件),系统无法启动。When data is written to the flash (flash) via the serial peripheral interface (SPI), the data is written at a slow rate. If the above write process or abnormal power failure occurs during data reading, important data (files) may be damaged, such as data (files) related to system startup. If the data (file) related to system startup is damaged, the system cannot be started.
相关技术中的闪存备份方法包括:一级备份机制和二级备份机制。在一级备份机制中,闪存存储器包括或由用户增加有备份数据区,原始数据区中的数据损坏可以使用备份数据区中的数据,备份数据区中的数据损坏可以使用原始数据区中的数据。在二级备份机制中,闪存存储器包括原始数据区、备份数据区以及交换区,使用原始数据区、备份数据区以及交换区中至少一个中的重要数据(文件)恢复损坏的数据。The flash backup method in the related art includes: a primary backup mechanism and a secondary backup mechanism. In the primary backup mechanism, the flash memory includes or is added by the user to have a backup data area, the data in the original data area is damaged, the data in the backup data area can be used, and the data in the backup data area can be used to use the data in the original data area. . In the secondary backup mechanism, the flash memory includes a raw data area, a backup data area, and a swap area, and recovers the corrupted data using important data (files) in at least one of the original data area, the backup data area, and the swap area.
上述相关技术中的闪存备份方法中,在闪存的总存储容量不变的情况下,用户可分配的存储容量小。每增加一个原始数据区,相应地增加一个备份数据区甚至再增加一个交换区,用户无法使用备份数据区和交换区。由于通过spi向闪存写入数据时,数据写入的速度慢,每更新一次数据,这种闪存都会比无自备有备份数据区的闪存耗费两倍甚至三倍的时间。用户使用采用一级备份机制的闪存,闪存自身或闪存的驱动存在潜在的缺陷可能导致写入或数据校验异常,以及损坏原始数据和备份数据。在电压出现波动或有静电的情况下,生产带有闪存的电子设备,或使用闪存时,向闪存中写入数据,也可能损坏写入的数据。市面上的闪存存储器大多是没有做自备份技术的,虽有一些闪存具有自备份机制,但自备份技术是针对整个闪存做的。In the flash backup method of the related art described above, the storage capacity that the user can allocate is small in the case where the total storage capacity of the flash memory is constant. Each time a raw data area is added, a backup data area is added correspondingly and even a swap area is added, and the user cannot use the backup data area and the swap area. Since data is written to the flash memory through spi, the data is written at a slow rate. Each time the data is updated, the flash memory takes twice or even three times longer than the flash memory without the backup data area. Users using flash memory with a one-level backup mechanism, potential defects in the flash itself or flash drive may cause write or data check exceptions, as well as corrupted raw and backup data. In the case of fluctuations in voltage or static electricity, when electronic devices with flash memory are produced, or when flash memory is used, writing data to the flash memory may also corrupt the written data. Most of the flash memory on the market is not self-backup technology. Although some flash memories have a self-backup mechanism, the self-backup technology is for the entire flash memory.
发明内容 Summary of the invention
提供了一种闪存数据的备份方法及系统,通过保存在规划分区中的默认数据启动系统,在原始数据区和备份数据区中的数据均异常时能够保证系统启动。A backup method and system for flash data is provided. The system is started by using the default data stored in the planned partition to start the system when the data in the original data area and the backup data area are abnormal.
一种闪存数据的备份方法,包括:A method for backing up flash data, including:
当闪存中的原始数据区和备份数据区中的数据均损坏时,使用所述闪存的规划分区中的默认数据启动系统,其中,所述默认数据包括所述闪存中的一个或多个分区的划分数据或者重要分区的分区规划划分数据、和系统启动所需的必要启动数据,以及所述规划分区为不会被改动或改动少的闪存分区。When the data in the original data area and the backup data area in the flash memory are both damaged, the system is started using the default data in the planned partition of the flash memory, wherein the default data includes one or more partitions in the flash memory. Divide data or partitions of important partitions to plan partitioning data, and necessary boot data required for system startup, and the planned partitions are flash partitions that will not be altered or modified.
可选的,所述的方法还包括:Optionally, the method further includes:
判断闪存的原始数据区中的数据是否损坏;以及Determining whether the data in the original data area of the flash memory is damaged;
若所述原始数据区中的数据已损坏,判断闪存的备份数据区中的数据是否损坏,若所述备份数据区中的数据已损坏,则确定闪存中的原始数据区和备份数据区中的数据均损坏,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区中,其中,If the data in the original data area is damaged, determining whether the data in the backup data area of the flash memory is damaged, and if the data in the backup data area is damaged, determining the original data area in the flash memory and the backup data area The data is corrupted, and the default data saved in the planned partition of the flash memory is copied into the original data area, wherein
所述原始数据区、所述备份数据区及所述规划分区所占用闪存的扇区是预先设定的。The original data area, the backup data area, and the sector of the flash memory occupied by the planned partition are preset.
可选的,所述的方法还包括:Optionally, the method further includes:
若所述原始数据区中的数据没有损坏,判断所述备份数据区中的数据是否损坏,若所述备份数据区中的数据没有损坏,使用所述原始数据区中的数据启动系统;以及If the data in the original data area is not damaged, determining whether the data in the backup data area is damaged, and if the data in the backup data area is not damaged, using the data in the original data area to start the system;
若所述原始数据区中的数据没有损坏且所述备份数据区中的数据已损坏,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。If the data in the original data area is not damaged and the data in the backup data area is corrupted, copy the data in the original data area to the backup data area, and use the data in the original data area to start system.
可选的,所述判断闪存的备份数据区中的数据是否损坏之后,所述方法还包括:Optionally, after the determining whether the data in the backup data area of the flash memory is damaged, the method further includes:
若所述备份数据区中的数据没有损坏,将所述备份数据区中的数据拷贝到所述原始数据区,使用所述备份数据区中的数据启动系统。If the data in the backup data area is not corrupted, the data in the backup data area is copied to the original data area, and the system is started using the data in the backup data area.
可选的,所述规划分区还保存有闪存启动所需要的数据。 Optionally, the planning partition also stores data required for flash booting.
可选的,所述判断原始数据区是否损坏之前,所述方法还包括:Optionally, before the determining whether the original data area is damaged, the method further includes:
将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入所述原始数据区中;Writing the partition data of each partition in the flash memory and the data related to system startup into the original data area;
将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入备份数据区中;以及Writing the partitioned data of each partition in the flash memory and the data related to system startup into the backup data area;
将所述闪存中每个分区的划分数据或者闪存中重要分区的划分数据、和默认数据写入所述规划分区中。The divided data of each partition in the flash memory or the partitioned data of important partitions in the flash memory, and default data are written into the planned partition.
可选的,判断原始数据区中的数据是否损坏之前,所述方法还包括:预先划分闪存中的多个分区,以确定所述原始数据区、所述备份数据区及所述规划分区各自占用的扇区。Optionally, before determining whether the data in the original data area is damaged, the method further includes: pre-dividing a plurality of partitions in the flash memory to determine that the original data area, the backup data area, and the planning partition respectively occupy Sector.
可选的,所述判断原始数据区中的数据是否损坏之前,所述方法还包括:驱动闪存。Optionally, before the determining whether the data in the original data area is damaged, the method further includes: driving the flash memory.
一种闪存数据的备份系统,包括:A backup system for flash data, comprising:
第一启动模块,设置为当闪存中的原始数据区和备份数据区中的数据均损坏时,使用所述闪存的规划分区中的默认数据启动系统,其中,所述默认数据包括所述闪存的中一个或多个分区的划分数据或者重要分区的分区规划划分数据、和系统启动所需的必要启动数据,以及所述规划分区为不会被改动或改动少的闪存分区。a first booting module configured to boot a system using default data in a planned partition of the flash memory when data in both the original data area and the backup data area in the flash memory is damaged, wherein the default data includes the flash memory Divided data of one or more partitions or partitioned plan data of important partitions, and necessary boot data required for system startup, and the planned partition is a flash partition that is not altered or modified.
可选的,所述的系统还包括:Optionally, the system further includes:
第一判断模块,设置为判断闪存的原始数据区中的数据是否损坏;以及a first determining module configured to determine whether data in the original data area of the flash memory is damaged;
第二判断模块,设置为若所述第一判断模块判断出所述原始数据区中的数据已损坏,判断闪存的备份数据区中的数据是否损坏;其中,a second determining module, configured to determine whether the data in the backup data area of the flash memory is damaged if the first determining module determines that the data in the original data area is damaged;
所述第一启动模块,设置为若所述第二判断模块判断出所述备份数据区中的数据已损坏,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区和所述备份数据区中;以及The first startup module is configured to: if the second determining module determines that the data in the backup data area is damaged, copy the default data saved in the planned partition of the flash memory to the original data area and the In the backup data area;
所述原始数据区、所述备份数据区、及所述规划分区所占用闪存的扇区是预先设定的。 The original data area, the backup data area, and the sector of the flash memory occupied by the planned partition are preset.
可选的,所述的系统还包括:Optionally, the system further includes:
第三判断模块,设置为若所述第一判断模块判断出所述原始数据区中的数据没有损坏,判断备份数据区中的数据是否损坏;The third determining module is configured to determine whether the data in the backup data area is damaged if the first determining module determines that the data in the original data area is not damaged;
第二启动模块,设置为若所述第三判断模块判断出所述备份数据区中的数据没有损坏,使用所述原始数据区中的数据启动系统;若所述第三判断模块判断出所述备份数据区中的数据已损坏,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。a second startup module, configured to: if the third determining module determines that the data in the backup data area is not damaged, use the data in the original data area to start the system; if the third determining module determines the The data in the backup data area is corrupted, the data in the original data area is copied to the backup data area, and the system is started using the data in the original data area.
可选的,所述第一启动模块还设置为若所述第二判断模块判断出所述备份数据区中的数据没有损坏,将所述备份数据区中的数据拷贝到所述原始数据区,使用所述备份数据区中的数据启动系统。Optionally, the first startup module is further configured to: if the second determining module determines that the data in the backup data area is not damaged, copy the data in the backup data area to the original data area, The system is booted using the data in the backup data area.
可选的,所述规划分区还保存有设备启动所需要的数据。Optionally, the planning partition further stores data required for device startup.
可选的,所述的系统还包括,Optionally, the system further includes
写入模块,设置为:在所述判断原始数据区是否损坏之前,将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入所述原始数据区中;Writing to the module, configured to: before the determining whether the original data area is damaged, writing the partition data of each partition in the flash memory and the data related to system startup into the original data area;
将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入备份数据区中;以及Writing the partitioned data of each partition in the flash memory and the data related to system startup into the backup data area;
将所述闪存中每个分区的划分数据或者闪存中重要分区的划分数据、和默认数据写入所述规划分区中。The divided data of each partition in the flash memory or the partitioned data of important partitions in the flash memory, and default data are written into the planned partition.
可选的,所述的系统还包括:Optionally, the system further includes:
设计模块,设置为预先划分闪存中的多个分区,以确定所述原始数据区、所述备份数据区、及所述规划分区各自占用的扇区。The design module is configured to pre-divide a plurality of partitions in the flash memory to determine sectors occupied by the original data area, the backup data area, and the planned partition.
可选的,所述的系统还包括:Optionally, the system further includes:
驱动模块,设置为驱动闪存。Drive module, set to drive flash.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述方法。A computer readable storage medium storing computer executable instructions arranged to perform the above method.
一种电子设备,包括:An electronic device comprising:
至少一个处理器;以及 At least one processor;
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器执行上述的方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
附图说明DRAWINGS
图1是第一实施例提供的一种闪存数据的备份方法的流程图。FIG. 1 is a flowchart of a method for backing up flash data provided by the first embodiment.
图2是第二实施例提供的一种闪存数据的备份方法的流程图。2 is a flow chart of a method for backing up flash data provided by the second embodiment.
图3是第三实施例提供的一种闪存数据的备份系统的结构方框图。FIG. 3 is a structural block diagram of a backup system for flash data provided by the third embodiment.
图4是第四实施例提供的一种闪存数据的备份系统的结构方框图。4 is a block diagram showing the structure of a backup system for flash data provided by the fourth embodiment.
图5是一实施例提供的一种电子设备的硬件结构示意图。FIG. 5 is a schematic structural diagram of hardware of an electronic device according to an embodiment.
具体实施方式detailed description
图1是具体实施方式中提供的一种闪存数据的备份方法的流程图。如图1所示,该方法包括以下步骤。1 is a flow chart of a method for backing up flash data provided in a specific embodiment. As shown in Figure 1, the method includes the following steps.
步骤101中,判断闪存的原始数据区中的数据是否损坏;若所述原始数据区中的数据没有损坏,则执行步骤102;若所述原始数据区中的数据已损坏,则执行步骤105。In step 101, it is determined whether the data in the original data area of the flash memory is damaged; if the data in the original data area is not damaged, step 102 is performed; if the data in the original data area is damaged, step 105 is performed.
进入系统(如Linux操作系统)之前,可以判断原始数据区中的数据是否损坏,以根据判断结果决定使用闪存中哪个分区的数据启动系统。本实施例可适用于无自备份机制的闪存,用户可预先设置原始数据区占用的扇区,所述原始数据区中的数据包括闪存中每个分区的规划信息、和与系统启动相关的重要数据。其中,重要数据可以是Linux操作系统或安卓(Adroid)操作系统中的启动参数bootcmd和bootargs,也可以是mtdparts(存储有闪存的划分数据)。原始数据区中的数据还可以包括一些环境相关的数据。环境相关的数据可以是ethaddr、bootdelay和baudrate中的至少一个。Before entering the system (such as the Linux operating system), it can be judged whether the data in the original data area is damaged, so as to decide which partition data in the flash memory is used to start the system according to the judgment result. The embodiment can be applied to a flash memory without a self-backup mechanism. The user can preset a sector occupied by the original data area, and the data in the original data area includes planning information of each partition in the flash memory and an important relationship related to system startup. data. Among them, the important data may be the boot parameters bootcmd and bootargs in the Linux operating system or the Android (Adroid) operating system, or mtdparts (the divided data storing the flash memory). The data in the raw data area may also include some environment related data. The environment related data may be at least one of ethaddr, bootdelay, and baudrate.
步骤102中,判断闪存的备份数据区中的数据是否损坏,若所述备份数据区中的数据没有损坏,则执行步骤103;若所述备份数据区中的数据已损坏,则执行步骤104。 In step 102, it is determined whether the data in the backup data area of the flash memory is damaged. If the data in the backup data area is not damaged, step 103 is performed; if the data in the backup data area is damaged, step 104 is performed.
若原始数据区中的数据没有损坏,判断备份数据区中的数据是否损坏,原始数据区中的数据与备份数据区中的数据互为备份,不管原始数据区中的数据是否损坏都可以判断备份数据区中的数据是否损坏。如果备份数据区中的数据损坏,可以把原始数据区中的数据拷贝到备份数据区。If the data in the original data area is not damaged, it is judged whether the data in the backup data area is damaged, and the data in the original data area and the data in the backup data area are mutually backed up, and the backup can be judged regardless of whether the data in the original data area is damaged or not. Whether the data in the data area is damaged. If the data in the backup data area is corrupted, the data in the original data area can be copied to the backup data area.
用户可以设置备份数据区占用的扇区,所述备份数据区中的数据包括闪存的每个分区的划分数据、和与系统启动相关的重要数据。备份数据区中的数据可以与原始数据区中的数据相同,备份数据区中的数据可以与原始数据区中的数据互为备份。The user can set the sector occupied by the backup data area, the data in the backup data area includes the partition data of each partition of the flash memory, and important data related to system startup. The data in the backup data area can be the same as the data in the original data area, and the data in the backup data area can be backed up with the data in the original data area.
可选的,使用数据校验算法(如,循环冗余校验(Cyclic Redundancy Check,CRC))校验数据的完整性。例如,对数据校验之后,如果数据完整,则数据未被损坏;如果数据不完整,则数据已损坏。数据损坏后,还可以通过重新擦写的方法向闪存分区中写入新的数据。Optionally, data integrity algorithms (eg, Cyclic Redundancy Check (CRC)) are used to verify data integrity. For example, after data verification, if the data is complete, the data is not corrupted; if the data is incomplete, the data is corrupted. After the data is corrupted, new data can also be written to the flash partition by rewriting.
步骤103中,使用所述原始数据区中的数据启动系统。In step 103, the system is started using the data in the original data area.
若原始数据区中的数据没有损坏,备份数据区中的数据也没有损坏,可以使用原始数据区中的数据启动系统。If the data in the original data area is not damaged, the data in the backup data area is not damaged, and the system can be started using the data in the original data area.
步骤104中,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。In step 104, the data in the original data area is copied to the backup data area, and the system is started using the data in the original data area.
若原始数据区中的数据没有损坏,备份数据区中的数据已损坏,可将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。在向闪存中写入数据的过程中若出现突然掉电的情况,可能导致备份数据区与原始数据区中的一个分区中的数据损坏。由于备份数据区中的数据与原始数据区中的数据互为备份,当备份数据区与原始数据区中的一个分区中的数据损坏时,仍能获取启动系统的数据。If the data in the original data area is not corrupted, the data in the backup data area is corrupted, the data in the original data area can be copied to the backup data area, and the system is started using the data in the original data area. In the event of a sudden power loss during the writing of data to the flash memory, data in the backup data area and one of the original data areas may be corrupted. Since the data in the backup data area and the data in the original data area are mutually backed up, when the data in one of the backup data area and the original data area is damaged, the data of the booting system can still be obtained.
步骤105中,判断所述备份数据区中的数据是否损坏,若所述备份数据区中的数据没有损坏,则执行步骤106;若所述备份数据区中的数据已损坏,则执行步骤107。In step 105, it is determined whether the data in the backup data area is damaged. If the data in the backup data area is not damaged, step 106 is performed; if the data in the backup data area is damaged, step 107 is performed.
若原始备份数据区中的数据已损坏,判断所述备份数据区中的数据是否损坏。 If the data in the original backup data area is damaged, it is determined whether the data in the backup data area is damaged.
步骤106中,将所述备份数据区中的数据拷贝到所述原始数据区,使用所述备份数据区中的数据启动系统。In step 106, the data in the backup data area is copied to the original data area, and the system is started using the data in the backup data area.
若原始备份数据区中的数据已损坏,备份数据区中的数据没有损坏,则将所述备份数据区中的数据拷贝到所述原始数据区,使用所述备份数据区中的数据启动系统。在向闪存中写入数据的过程中若出现突然掉电等情况,导致备份数据区与原始数据区其中一区数据损坏。由于备份数据区中的数据与原始数据区中的数据互为备份,系统仍可以启动。If the data in the original backup data area is corrupted and the data in the backup data area is not damaged, the data in the backup data area is copied to the original data area, and the system is started using the data in the backup data area. If a sudden power failure occurs during the process of writing data to the flash memory, the data in one of the backup data area and the original data area is damaged. Since the data in the backup data area and the data in the original data area are backed up to each other, the system can still be started.
步骤107中,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区和所述备份数据区中,使用所述默认数据启动系统。In step 107, the default data stored in the planned partition of the flash memory is copied into the original data area and the backup data area, and the system is started using the default data.
在原始数据区中的数据和备份数据区中的数据均损坏时,可以通过保存在闪存的规划分区中的默认数据启动系统。When both the data in the original data area and the data in the backup data area are corrupted, the system can be booted by default data stored in the planned partition of the flash memory.
若原始备份数据区中的数据已损坏,备份数据区中的数据也已损坏,可以将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区和所述备份数据区中,使用所述默认数据启动系统。所述默认数据包括闪存中每个分区的分区划分数据或者闪存中重要分区的分区划分数据、和系统启动所需的数据。默认数据包括启动系统的必要数据。默认数据是系统启动的必要数据,占用存储空间小,将默认数据保存在闪存的规划分区中可保证系统启动。闪存的规划分区可以为除原始数据区和备份数据区的其他分区。If the data in the original backup data area is damaged, and the data in the backup data area is also damaged, the default data stored in the planned partition of the flash memory may be copied into the original data area and the backup data area. The default data startup system. The default data includes partition partition data for each partition in the flash memory or partition partition data of important partitions in the flash memory, and data required for system startup. The default data includes the necessary data to start the system. The default data is the necessary data for system startup. It takes up less storage space and saves the default data in the planned partition of the flash memory to ensure system startup. The planned partition of the flash memory can be other partitions than the original data area and the backup data area.
重要分区包括引导(boot)数据所在的分区,还可以包括系统内核(kernel)数据、Linux系统中的根文件系统(Root File System,rootfs)数据以及用户数据(userdata)所在的分区。Important partitions include the partition where the boot data resides. It can also include system kernel (kernel) data, root file system (rootfs) data in Linux systems, and partitions where user data (userdata) resides.
默认数据也可单独占用一个分区。在一个实施例中,所述默认数据保存在启动数据区,所述启动数据区还保存有闪存启动所需要的数据,如引导(boot)数据等。在生产闪存或使用闪存的过程中,不会或极少改动启动数据区中的数据,将默认数据存储在启动数据区中可以保护默认数据。也可将默认数据存储于在闪存的生产或使用过程中不会被改动或改动少的分区(例如,闪存的第一个扇区)中。所述启动数据区还可以保存有外部设备(例如,网口或通用串行总线(Universal Serial Bus,USB)设备中的至少一种)启动所需要的数据,The default data can also occupy a single partition. In one embodiment, the default data is stored in a boot data area that also holds data required for flash boot, such as boot data and the like. In the process of producing flash memory or using flash memory, the data in the boot data area is not changed or rarely changed, and the default data is stored in the boot data area to protect the default data. The default data can also be stored in a partition (eg, the first sector of the flash) that will not be altered or altered during the production or use of the flash. The boot data area may also store data required for booting of an external device (for example, at least one of a network port or a Universal Serial Bus (USB) device).
上述实施例中,所述原始数据区、所述备份数据区及所述规划分区所占用 的扇区是由用户预先设置的。每个分区可以占用一个扇区,每个分区也可以占用多个扇区。原始数据区和备份数据区中的数据可以是由用户按其需要写入,默认数据也可由用户按其需要写入到规划分区中。In the above embodiment, the original data area, the backup data area, and the planned partition are occupied by The sectors are preset by the user. Each partition can occupy one sector, and each partition can also occupy multiple sectors. The data in the original data area and the backup data area can be written by the user according to his needs, and the default data can also be written into the planning partition by the user according to his needs.
上述实施例中,用户设置分区,通过使用原始数据区、备份数据区以及保存在规划分区中的默认数据来保证系统启动。默认数据既不多占用扇区又能保证在原始数据区和备份数据区中的数据均损坏时提供系统启动的数据,能够解决相关技术中因闪存的重要数据被损坏而导致系统无法启动从而给闪存生产和使用带来不便的问题。In the above embodiment, the user sets the partition to ensure system startup by using the original data area, the backup data area, and the default data stored in the planned partition. The default data not only occupies a large number of sectors, but also ensures that the data in the original data area and the backup data area are damaged when the system starts data, which can solve the problem in the related art that the important data of the flash memory is damaged and the system cannot be started. The problem of inconvenience caused by the production and use of flash memory.
图2是具体实施方式中提供的一种闪存中数据的备份方法的流程图。本实施例中与上述实施例中相同的步骤,请参见上述闪存数据的备份方法中的描述。如图2所示,该方法包括以下步骤。2 is a flow chart of a method for backing up data in a flash memory provided in a specific embodiment. For the same steps in the embodiment as in the above embodiment, please refer to the description in the above backup method of flash data. As shown in FIG. 2, the method includes the following steps.
步骤201中,驱动闪存。In step 201, the flash memory is driven.
驱动闪存,以对闪存进行操作。Drive the flash to operate on the flash.
步骤202中,判断原始数据区中的数据是否损坏;若所述原始数据区中的数据没有损坏,则执行步骤203;若所述原始数据区中的数据已损坏,则执行步骤206。In step 202, it is determined whether the data in the original data area is damaged. If the data in the original data area is not damaged, step 203 is performed; if the data in the original data area is damaged, step 206 is performed.
驱动闪存之后,在进入系统之前,可以判断原始数据区中的数据是否损坏,以根据判断结果决定使用闪存中的哪个分区的数据启动系统。After driving the flash memory, before entering the system, it can be judged whether the data in the original data area is damaged, so as to decide which partition data in the flash memory is used to start the system according to the judgment result.
步骤203中,判断备份数据区中的数据是否损坏,若所述备份数据区中的数据没有损坏,则执行步骤204;若所述备份数据区中的数据已损坏,则执行步骤205。In step 203, it is determined whether the data in the backup data area is damaged. If the data in the backup data area is not damaged, step 204 is performed; if the data in the backup data area is damaged, step 205 is performed.
步骤204中,使用所述原始数据区中的数据启动系统。In step 204, the system is launched using the data in the original data area.
步骤205中,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。In step 205, the data in the original data area is copied to the backup data area, and the system is started using the data in the original data area.
步骤206中,判断所述备份数据区中的数据是否损坏,若所述备份数据区中的数据没有损坏,则执行步骤207;若所述备份数据区中的数据已损坏,则执行步骤208。In step 206, it is determined whether the data in the backup data area is damaged. If the data in the backup data area is not damaged, step 207 is performed; if the data in the backup data area is damaged, step 208 is performed.
步骤207中,将所述备份数据区中的数据拷贝到所述原始数据区,使用所 述备份数据区中的数据启动系统。In step 207, the data in the backup data area is copied to the original data area, and the location is used. The data in the backup data area starts the system.
步骤208中,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区和所述备份数据区中,使用所述默认数据启动系统。In step 208, the default data stored in the planned partition of the flash memory is copied into the original data area and the backup data area, and the system is started using the default data.
一实施例中,所述判断原始数据区中的数据是否损坏之前,所述方法还包括:预先划分闪存中的多个分区,以确定所述原始数据区、所述备份数据区、及所述规划分区所占用的扇区。对无自备份技术的闪存,也可在生产过程中划分闪存中的多个分区,也可由用户在使用过程中划分闪存中的多个分区。In an embodiment, before the determining whether the data in the original data area is damaged, the method further includes: pre-dividing a plurality of partitions in the flash memory to determine the original data area, the backup data area, and the Plan the sectors occupied by the partition. For flash memory without self-backup technology, multiple partitions in the flash memory can also be divided in the production process, and multiple partitions in the flash memory can be divided by the user during use.
在一个可选的实施例中,所述规划分区为启动数据区,所述启动数据区还保存有闪存启动自身所需要的数据,如引导(boot)数据等。可选的,所述判断原始数据区中的数据是否损坏之前,所述方法还包括:In an optional embodiment, the planning partition is a boot data area, and the boot data area also stores data required for the flash boot itself, such as boot data. Optionally, before the determining whether the data in the original data area is damaged, the method further includes:
将所述闪存中每个分区的划分数据、和与系统启动相关的重要数据写入所述原始数据区中;Writing the partition data of each partition in the flash memory and important data related to system startup into the original data area;
将所述闪存中每个分区的划分数据、和与系统启动相关的重要数据写入备份数据区中;Writing the partitioned data of each partition in the flash memory and important data related to system startup into the backup data area;
将所述闪存中每个分区的划分数据或者闪存中重要分区的划分数据、和默认数据写入启动数据区中。The divided data of each partition in the flash memory or the divided data of important partitions in the flash memory, and default data are written in the boot data area.
可以在首次使用闪存时划分闪存中的多个分区,并向原始数据区、备份数据区及启动数据区中写入数据。在后期使用闪存中,步骤201至步骤208为使用原始数据区、备份数据区及启动数据区三个数据区的过程。Multiple partitions in the flash memory can be divided when the flash memory is used for the first time, and data is written to the original data area, the backup data area, and the boot data area. In the later use of the flash memory, steps 201 to 208 are processes of using the original data area, the backup data area, and the three data areas of the start data area.
上述实施例中,用户划分多个分区,通过使用原始数据区、备份数据区以及保存在规划分区中的默认数据来保证系统启动,默认数据既不多占用扇区又能保证在原始数据区和备份数据区中的数据均异常时系统能启动,解决了相关技术中因闪存的重要数据被损坏而导致系统无法启动,从而给闪存生产和使用带来不便的问题。In the above embodiment, the user divides multiple partitions, and the system is started by using the original data area, the backup data area, and the default data stored in the planned partition. The default data does not occupy more sectors and can guarantee the original data area and When the data in the backup data area is abnormal, the system can be started, which solves the problem that the system cannot be started due to the damage of the important data of the flash memory, which causes inconvenience to the production and use of the flash memory.
与相关技术中采用二级备份机制的闪存存储器相比,上述实施例中方法中的数据可占用较少的闪存空间,缩短闪存的读写操作时间。在闪存的存储空间不足时,系统能启动的同时占用较少的闪存空间。Compared with the flash memory using the secondary backup mechanism in the related art, the data in the method in the above embodiment can occupy less flash space and shorten the read and write operation time of the flash memory. When the storage space of the flash memory is insufficient, the system can start up while occupying less flash space.
与相关技术中采用一级备份机制的闪存相比,在原始数据和备份数据均被 损坏的情况下,上述实施例中的方法能靠默认数据启动系统,方便在线升级闪存中的数据,减少包括闪存的电子设备的维护成本。Compared with the flash memory of the related art adopting the primary backup mechanism, both the original data and the backup data are In the case of damage, the method in the above embodiment can start the system by default data, facilitate online upgrade of data in the flash memory, and reduce maintenance cost of the electronic device including the flash memory.
以下是具体实施方式中提供的闪存数据的备份系统的实施例,闪存数据的备份系统的实施例基于上述的闪存数据的备份方法的实施例,在闪存数据的备份系统中未尽的描述,请参考前述闪存数据的备份方法的实施例。The following is an embodiment of a backup system for flash data provided in a specific embodiment. The embodiment of the backup system for flash data is based on the above-described embodiment of the backup method of flash data, and is not described in the backup system of the flash data. Reference is made to an embodiment of the backup method of the aforementioned flash data.
图3是具体实施方式中提供的一种闪存数据的备份系统的结构方框图。本实施例是在闪存数据的备份方法的第一个实施例的基础上实现的,本实施例中未详尽的内容,请参考前述闪存数据的备份方法的第一个实施例。如图3所示,该系统包括:第一判断模块31、第二判断模块32以及第一启动模块33。FIG. 3 is a structural block diagram of a backup system for flash data provided in a specific embodiment. This embodiment is implemented on the basis of the first embodiment of the backup method of the flash data. For the details not in the embodiment, please refer to the first embodiment of the backup method of the flash data. As shown in FIG. 3, the system includes: a first judging module 31, a second judging module 32, and a first starting module 33.
第一判断模块31,设置为判断闪存的原始数据区中的数据是否损坏。The first determining module 31 is configured to determine whether the data in the original data area of the flash memory is damaged.
所述原始数据区中的数据包括闪存的每个分区的划分数据、和与系统启动相关的重要数据。The data in the original data area includes partition data for each partition of the flash memory, and important data related to system startup.
第二判断模块32设置为若所述第一判断模块判断出所述原始数据区中的数据已损坏,判断闪存的备份数据区中的数据是否损坏。The second determining module 32 is configured to determine whether the data in the backup data area of the flash memory is damaged if the first determining module determines that the data in the original data area is damaged.
所述备份数据区中的数据包括闪存中每个分区的规划、和与系统启动相关的重要数据。The data in the backup data area includes the planning of each partition in the flash memory and important data related to system startup.
第一启动模块33设置为若所述第二判断模块判断出所述备份数据区中的数据已损坏,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区和所述备份数据区中,使用所述默认数据启动系统。The first startup module 33 is configured to: if the second determination module determines that the data in the backup data area is damaged, copy the default data saved in the planned partition of the flash memory to the original data area and the backup data. In the zone, the system is started using the default data.
可选的,所述系统还包括:第三判断模块34和第二启动模块35。Optionally, the system further includes: a third determining module 34 and a second starting module 35.
第三判断模块34设置为若所述第一判断模块判断出所述原始数据区中的数据没有损坏,判断备份数据区中的数据是否损坏。The third determining module 34 is configured to determine whether the data in the backup data area is damaged if the first determining module determines that the data in the original data area is not damaged.
第二启动模块35设置为若所述第三判断模块判断出所述备份数据区中的数据没有损坏,使用所述原始数据区中的数据启动系统;若所述第三判断模块判断出所述备份数据区中的数据已损坏,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。The second startup module 35 is configured to: if the third determining module determines that the data in the backup data area is not damaged, use the data in the original data area to start the system; if the third determining module determines the The data in the backup data area is corrupted, the data in the original data area is copied to the backup data area, and the system is started using the data in the original data area.
所述第一启动模块33还可以设置为若所述第二判断模块判断出所述备份数据区中的数据没有损坏,将所述备份数据区中的数据拷贝到所述原始数据区, 使用所述备份数据区中的数据启动系统。The first startup module 33 may be further configured to: if the second determining module determines that the data in the backup data area is not damaged, copy the data in the backup data area to the original data area, The system is booted using the data in the backup data area.
所述默认数据包括闪存中每个分区的划分数据或者重要分区的划分数据、和系统启动所需的数据。所述原始数据区、所述备份数据区及所述闪存的规划分区所占用的扇区可由用户预先设定。The default data includes partitioned data for each partition in the flash memory or partitioned data of important partitions, and data required for system startup. The sectors occupied by the original data area, the backup data area, and the planned partition of the flash memory may be preset by a user.
本实施例中,用户划分分区,通过使用原始数据区、备份数据区以及保存在规划分区中的默认数据来保证系统的正常启动,默认数据既不多占用扇区又能保证在原始数据区和备份数据区中的数据均被损坏时系统能启动,解决了相关技术中因闪存的重要数据被损坏而导致系统无法启动,从而给闪存生产和使用带来不便的问题。In this embodiment, the user divides the partition, and uses the original data area, the backup data area, and the default data stored in the planned partition to ensure normal startup of the system. The default data does not occupy more sectors but also ensures the original data area and When the data in the backup data area is damaged, the system can be started, which solves the problem that the system cannot be started due to the damage of the important data of the flash memory, which causes inconvenience to the production and use of the flash memory.
图4是具体实施方式中提供的一种闪存数据的备份系统的结构方框图。本实施例是在一种闪存数据的备份方法的第二个实施例的基础上实现的,本实施例中未详尽的内容,请参考前述闪存数据的备份方法的第二个实施例。如图4所示,该系统包括:驱动模块41、第一判断模块42、第二判断模块43以及第一启动模块44。4 is a structural block diagram of a backup system for flash data provided in a specific embodiment. This embodiment is implemented on the basis of a second embodiment of a method for backing up flash data. For details not in this embodiment, please refer to the second embodiment of the foregoing method for backing up flash data. As shown in FIG. 4, the system includes a driving module 41, a first determining module 42, a second determining module 43, and a first starting module 44.
驱动模块41设置为驱动闪存。The drive module 41 is arranged to drive the flash memory.
第一判断模块42设置为判断原始数据区中的数据是否损坏。The first decision module 42 is arranged to determine if the data in the original data area is corrupt.
所述原始数据区中的数据包括闪存中每个分区的划分数据、和与系统启动相关的重要数据。The data in the original data area includes partition data for each partition in the flash memory and important data related to system startup.
第二判断模块43设置为若所述第一判断模块判断出所述原始数据区中的数据已损坏,判断所述备份数据区中的数据是否损坏。The second determining module 43 is configured to determine whether the data in the backup data area is damaged if the first determining module determines that the data in the original data area is damaged.
所述备份数据区中的数据包括闪存中每个分区的划分数据、和与系统启动相关的重要数据。The data in the backup data area includes partition data for each partition in the flash memory and important data related to system startup.
第一启动模块44设置为若所述第二判断模块判断出所述备份数据区中的数据已损坏,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区和所述备份数据区中,使用所述默认数据启动系统。The first startup module 44 is configured to: if the second determination module determines that the data in the backup data area is damaged, copy the default data saved in the planned partition of the flash memory to the original data area and the backup data. In the zone, the system is started using the default data.
可选的,所述系统还包括:第三判断模块45和第二启动模块46。Optionally, the system further includes: a third determining module 45 and a second starting module 46.
第三判断模块45设置为若所述第一判断模块判断出所述原始数据区中的数据没有损坏,判断备份数据区中的数据是否损坏。 The third determining module 45 is configured to determine whether the data in the backup data area is damaged if the first determining module determines that the data in the original data area is not damaged.
第二启动模块46设置为若所述第三判断模块判断出所述备份数据区中的数据没有损坏,使用所述原始数据区中的数据启动系统;若所述第三判断模块判断出所述备份数据区中的数据已损坏,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。The second startup module 46 is configured to: if the third determining module determines that the data in the backup data area is not damaged, use the data in the original data area to start the system; if the third determining module determines the The data in the backup data area is corrupted, the data in the original data area is copied to the backup data area, and the system is started using the data in the original data area.
所述第一启动模块44还可以设置为若所述第二判断模块判断出所述备份数据区中的数据没有损坏,将所述备份数据区中的数据拷贝到所述原始数据区,使用所述备份数据区中的数据启动系统。The first startup module 44 may be further configured to: if the second determining module determines that the data in the backup data area is not damaged, copy the data in the backup data area to the original data area, and use the The data in the backup data area starts the system.
所述默认数据包括闪存的整个或者重要分区的分区规划、和系统启动所需的数据。所述原始数据区、所述备份数据区及所述闪存规划所占用的扇区由用户预先设置。The default data includes partition planning for the entire or important partition of the flash memory, and data required for system startup. The original data area, the backup data area, and a sector occupied by the flash memory plan are preset by a user.
在一个可选的实施例中,所述规划分区为启动数据区,所述启动数据区还保存有闪存启动所需要的数据。In an optional embodiment, the planning partition is a boot data area, and the boot data area also holds data required for flash booting.
所述系统还可以包括写入模块47。所述写入模块设置为:The system can also include a write module 47. The write module is set to:
将所述闪存中每个分区的划分数据、和与系统启动相关的重要数据写入所述原始数据区中;Writing the partition data of each partition in the flash memory and important data related to system startup into the original data area;
将所述闪存中的每个分区的划分数据、和与系统启动相关的重要数据写入备份数据区中;以及Writing the partitioned data of each partition in the flash memory and important data related to system startup into the backup data area;
将所述闪存中的每个分区的规划数据或者重要分区的分区规划信息、和默认数据写入启动数据区中。The planning data of each partition in the flash memory or the partition planning information of the important partition, and the default data are written in the startup data area.
在一个可选的实施例中,所述系统还包括:设计模块48,设置为预先划分闪存中的多个分区,以确定所述原始数据区、所述备份数据区、及所述规划分区各自占用的扇区。综上所述,本实施例提供闪存数据备份的使用系统,用户可以划分闪存中的分区,通过使用原始数据区、备份数据区以及保存在规划分区中的默认数据来保证系统启动,默认数据既不用多占用扇区又能保证在原始数据区和备份数据区中的数据均异常时系统能启动,解决了相关技术中因闪存的重要数据被损坏而导致系统无法启动的问题。In an optional embodiment, the system further includes: a design module 48 configured to pre-divide a plurality of partitions in the flash memory to determine the original data area, the backup data area, and the planning partition Occupied sector. In summary, the embodiment provides a system for using flash data backup. The user can divide the partition in the flash memory, and ensure the system startup by using the original data area, the backup data area, and the default data stored in the planned partition. The default data is The system can be started when the data in the original data area and the backup data area are abnormal, and the problem that the system cannot be started due to the damage of the important data of the flash memory is solved.
本实施例提供了一种电子设备的硬件结构示意图。参见图5,该电子设备包括: This embodiment provides a hardware structure diagram of an electronic device. Referring to FIG. 5, the electronic device includes:
至少一个处理器(processor)50,图5中以一个处理器50为例;存储器(memory)51;还可以包括通信接口(Communications Interface)52和总线53。其中,处理器50、存储器51以及通信接口52可以通过总线53完成相互间的通信。通信接口52可以传输数据和信号。处理器50可以调用存储器51中的逻辑指令,以执行上述实施例的方法。At least one processor 50 is exemplified by a processor 50 in FIG. 5; a memory 51; and a communication interface 52 and a bus 53. The processor 50, the memory 51, and the communication interface 52 can complete communication with each other through the bus 53. Communication interface 52 can transmit data and signals. Processor 50 can invoke logic instructions in memory 51 to perform the methods of the above-described embodiments.
此外,上述的存储器51中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。Furthermore, the logic instructions in the memory 51 described above may be implemented in the form of software functional units and sold or used as separate products, and may be stored in a computer readable storage medium.
存储器51作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如上述实施例中的方法对应的程序指令或模块。处理器50通过运行存储在存储器51中的软件程序、指令或模块,从而执行功能应用以及数据处理,即实现上述实施例中的方法。The memory 51 is a computer readable storage medium and can be used to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the above embodiments. The processor 50 executes the functional application and data processing by executing software programs, instructions or modules stored in the memory 51, i.e., implements the methods in the above embodiments.
存储器51可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据设备的使用所创建的数据等。此外,存储器51可以包括高速随机存取存储器,还可以包括非易失性存储器。The memory 51 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the device, and the like. Further, the memory 51 may include a high speed random access memory, and may also include a nonvolatile memory.
以上技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行上述实施例所述方法的全部或部分步骤。The above technical solution may be embodied in the form of a software product stored in a storage medium, including one or more instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to execute All or part of the steps of the method described in the above embodiments.
工业实用性Industrial applicability
闪存数据的备份方法和系统中,通过保存在规划分区中的默认数据启动系统,保证在原始数据区和备份数据区中的数据均被损坏时系统能启动。 In the flash data backup method and system, the system is started by the default data stored in the planned partition, and the system can be started when the data in the original data area and the backup data area are damaged.

Claims (17)

  1. 一种闪存数据的备份方法,包括:A method for backing up flash data, including:
    当闪存中的原始数据区和备份数据区中的数据均损坏时,使用所述闪存的规划分区中的默认数据启动系统,其中,所述默认数据包括所述闪存中的一个或多个分区的划分数据或者重要分区的分区划分数据、和系统启动所需的必要启动数据,以及所述规划分区为不会被改动或改动少的闪存分区。When the data in the original data area and the backup data area in the flash memory are both damaged, the system is started using the default data in the planned partition of the flash memory, wherein the default data includes one or more partitions in the flash memory. Divide data or partition partition data of important partitions, and necessary boot data required for system startup, and the planned partition is a flash partition that will not be altered or changed.
  2. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    判断闪存的原始数据区中的数据是否损坏;以及Determining whether the data in the original data area of the flash memory is damaged;
    若所述原始数据区中的数据已损坏,判断闪存的备份数据区中的数据是否损坏,若所述备份数据区中的数据已损坏,则确定闪存中的原始数据区和备份数据区中的数据均损坏,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区中,其中,If the data in the original data area is damaged, determining whether the data in the backup data area of the flash memory is damaged, and if the data in the backup data area is damaged, determining the original data area in the flash memory and the backup data area The data is corrupted, and the default data saved in the planned partition of the flash memory is copied into the original data area, wherein
    所述原始数据区、所述备份数据区及所述规划分区所占用闪存的扇区是预先设定的。The original data area, the backup data area, and the sector of the flash memory occupied by the planned partition are preset.
  3. 根据权利要求2所述的方法,还包括:The method of claim 2 further comprising:
    若所述原始数据区中的数据没有损坏,判断所述备份数据区中的数据是否损坏,若所述备份数据区中的数据没有损坏,使用所述原始数据区中的数据启动系统;以及If the data in the original data area is not damaged, determining whether the data in the backup data area is damaged, and if the data in the backup data area is not damaged, using the data in the original data area to start the system;
    若所述原始数据区中的数据没有损坏且所述备份数据区中的数据已损坏,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。If the data in the original data area is not damaged and the data in the backup data area is corrupted, copy the data in the original data area to the backup data area, and use the data in the original data area to start system.
  4. 根据权利要求2所述的方法,所述判断闪存的备份数据区中的数据是否损坏之后,所述方法还包括: The method of claim 2, after the determining whether the data in the backup data area of the flash memory is damaged, the method further comprises:
    若所述备份数据区中的数据没有损坏,将所述备份数据区中的数据拷贝到所述原始数据区,使用所述备份数据区中的数据启动系统。If the data in the backup data area is not corrupted, the data in the backup data area is copied to the original data area, and the system is started using the data in the backup data area.
  5. 根据权利要求1-4任一项所述的方法,其中,所述规划分区还保存有闪存启动所需要的数据。The method of any of claims 1-4, wherein the planning partition further holds data required for flash booting.
  6. 根据权利要求2-5任一项所述的方法,所述判断原始数据区是否损坏之前,所述方法还包括:The method according to any one of claims 2 to 5, before the determining whether the original data area is damaged, the method further comprises:
    将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入所述原始数据区中;Writing the partition data of each partition in the flash memory and the data related to system startup into the original data area;
    将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入备份数据区中;以及Writing the partitioned data of each partition in the flash memory and the data related to system startup into the backup data area;
    将所述闪存中每个分区的划分数据或者闪存中重要分区的划分数据、和默认数据写入所述规划分区中。The divided data of each partition in the flash memory or the partitioned data of important partitions in the flash memory, and default data are written into the planned partition.
  7. 根据权利要求2所述的方法,判断原始数据区中的数据是否损坏之前,所述方法还包括:预先划分闪存中的多个分区,以确定所述原始数据区、所述备份数据区及所述规划分区各自占用的扇区。The method of claim 2, before determining whether the data in the original data area is damaged, the method further comprising: pre-dividing a plurality of partitions in the flash memory to determine the original data area, the backup data area, and the The sectors occupied by the planned partitions.
  8. 根据权利要求2所述的方法,所述判断原始数据区中的数据是否损坏之前,所述方法还包括:驱动闪存。The method of claim 2, before the determining whether the data in the original data area is corrupted, the method further comprising: driving the flash memory.
  9. 一种闪存数据的备份系统,包括:A backup system for flash data, comprising:
    第一启动模块,设置为当闪存中的原始数据区和备份数据区中的数据均损坏时,使用所述闪存的规划分区中的默认数据启动系统,其中,所述默认数据包括所述闪存的中一个或多个分区的划分数据或者重要分区的分区规划划分数据、和系统启动所需的必要启动数据,以及所述规划分区为不会被改动或改动 少的闪存分区。a first booting module configured to boot a system using default data in a planned partition of the flash memory when data in both the original data area and the backup data area in the flash memory is damaged, wherein the default data includes the flash memory Divided data for one or more partitions or partitioned plan data for important partitions, and necessary boot data required for system startup, and the planned partitions are not altered or modified Less flash partitions.
  10. 根据权利要求9所述的系统,还包括:The system of claim 9 further comprising:
    第一判断模块,设置为判断闪存的原始数据区中的数据是否损坏;以及a first determining module configured to determine whether data in the original data area of the flash memory is damaged;
    第二判断模块,设置为若所述第一判断模块判断出所述原始数据区中的数据已损坏,判断闪存的备份数据区中的数据是否损坏;其中,a second determining module, configured to determine whether the data in the backup data area of the flash memory is damaged if the first determining module determines that the data in the original data area is damaged;
    所述第一启动模块,设置为若所述第二判断模块判断出所述备份数据区中的数据已损坏,将保存在闪存的规划分区中的默认数据拷贝到所述原始数据区和所述备份数据区中;以及The first startup module is configured to: if the second determining module determines that the data in the backup data area is damaged, copy the default data saved in the planned partition of the flash memory to the original data area and the In the backup data area;
    所述原始数据区、所述备份数据区、及所述规划分区所占用闪存的扇区是预先设定的。The original data area, the backup data area, and the sector of the flash memory occupied by the planned partition are preset.
  11. 根据权利要求10所述的系统,还包括:The system of claim 10 further comprising:
    第三判断模块,设置为若所述第一判断模块判断出所述原始数据区中的数据没有损坏,判断备份数据区中的数据是否损坏;The third determining module is configured to determine whether the data in the backup data area is damaged if the first determining module determines that the data in the original data area is not damaged;
    第二启动模块,设置为若所述第三判断模块判断出所述备份数据区中的数据没有损坏,使用所述原始数据区中的数据启动系统;若所述第三判断模块判断出所述备份数据区中的数据已损坏,将所述原始数据区中的数据拷贝到所述备份数据区,使用所述原始数据区中的数据启动系统。a second startup module, configured to: if the third determining module determines that the data in the backup data area is not damaged, use the data in the original data area to start the system; if the third determining module determines the The data in the backup data area is corrupted, the data in the original data area is copied to the backup data area, and the system is started using the data in the original data area.
  12. 根据权利要求10所述的系统,其中,The system of claim 10 wherein
    所述第一启动模块还设置为若所述第二判断模块判断出所述备份数据区中的数据没有损坏,将所述备份数据区中的数据拷贝到所述原始数据区,使用所述备份数据区中的数据启动系统。The first startup module is further configured to: if the second determining module determines that the data in the backup data area is not damaged, copy the data in the backup data area to the original data area, and use the backup The data in the data area starts the system.
  13. 根据权利要求9-12任一项所述的系统,其中, A system according to any one of claims 9-12, wherein
    所述规划分区还保存有闪存启动所需要的数据。The planning partition also holds the data needed for flash booting.
  14. 根据权利要求10-13任一项所述的系统,还包括,A system according to any of claims 10-13, further comprising
    写入模块,设置为:在所述判断原始数据区是否损坏之前,将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入所述原始数据区中;Writing to the module, configured to: before the determining whether the original data area is damaged, writing the partition data of each partition in the flash memory and the data related to system startup into the original data area;
    将所述闪存中每个分区的划分数据、和与系统启动相关的数据写入备份数据区中;以及Writing the partitioned data of each partition in the flash memory and the data related to system startup into the backup data area;
    将所述闪存中每个分区的划分数据或者闪存中重要分区的划分数据、和默认数据写入所述规划分区中。The divided data of each partition in the flash memory or the partitioned data of important partitions in the flash memory, and default data are written into the planned partition.
  15. 根据权利要求10所述的系统,还包括:The system of claim 10 further comprising:
    设计模块,设置为预先划分闪存中的多个分区,以确定所述原始数据区、所述备份数据区、及所述规划分区各自占用的扇区。The design module is configured to pre-divide a plurality of partitions in the flash memory to determine sectors occupied by the original data area, the backup data area, and the planned partition.
  16. 根据权利要求10所述的系统,还包括:The system of claim 10 further comprising:
    驱动模块,设置为驱动闪存。Drive module, set to drive flash.
  17. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行权利要求1-8中任一项的方法。 A computer readable storage medium storing computer executable instructions arranged to perform the method of any of claims 1-8.
PCT/CN2017/104623 2016-09-29 2017-09-29 Method and system for backing up flash memory data WO2018059565A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610864885.9 2016-09-29
CN201610864885.9A CN106484567A (en) 2016-09-29 2016-09-29 A kind of using method of flash data backup and system

Publications (1)

Publication Number Publication Date
WO2018059565A1 true WO2018059565A1 (en) 2018-04-05

Family

ID=58268274

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/104623 WO2018059565A1 (en) 2016-09-29 2017-09-29 Method and system for backing up flash memory data

Country Status (2)

Country Link
CN (1) CN106484567A (en)
WO (1) WO2018059565A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287059A (en) * 2019-05-21 2019-09-27 广东九联科技股份有限公司 A kind of more backup methods of spi flash

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484567A (en) * 2016-09-29 2017-03-08 深圳创维数字技术有限公司 A kind of using method of flash data backup and system
CN113296850B (en) * 2021-07-26 2021-12-03 湖南博匠信息科技有限公司 Backup starting method for embedded board card operating system and embedded system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6459624B1 (en) * 2000-09-01 2002-10-01 Megawin Technology Co., Ltd. Memory structure capable of preventing data loss therein and method for protecting the same
US20120054540A1 (en) * 2010-08-25 2012-03-01 Smartsynch, Inc. System and method for automated unattended recovery for remotely deployed intelligent communication devices
CN103514013A (en) * 2013-09-11 2014-01-15 深圳市共进电子股份有限公司 Gateway product FLASH configuration loss processing method
CN103530138A (en) * 2012-07-02 2014-01-22 京信通信技术(广州)有限公司 Method and device for protecting file system data based on embedded LINUX
CN106484567A (en) * 2016-09-29 2017-03-08 深圳创维数字技术有限公司 A kind of using method of flash data backup and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515259B (en) * 2009-03-26 2011-05-25 浙江大华技术股份有限公司 Inserted device configuring data protecting method
CN101546284B (en) * 2009-04-28 2010-11-03 冠捷科技(武汉)有限公司 Method for recovering data information of liquid crystal display equipment
CN103176859A (en) * 2011-12-21 2013-06-26 北京普源精电科技有限公司 Flash data backup/recovery method, equipment and signal source

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6459624B1 (en) * 2000-09-01 2002-10-01 Megawin Technology Co., Ltd. Memory structure capable of preventing data loss therein and method for protecting the same
US20120054540A1 (en) * 2010-08-25 2012-03-01 Smartsynch, Inc. System and method for automated unattended recovery for remotely deployed intelligent communication devices
CN103530138A (en) * 2012-07-02 2014-01-22 京信通信技术(广州)有限公司 Method and device for protecting file system data based on embedded LINUX
CN103514013A (en) * 2013-09-11 2014-01-15 深圳市共进电子股份有限公司 Gateway product FLASH configuration loss processing method
CN106484567A (en) * 2016-09-29 2017-03-08 深圳创维数字技术有限公司 A kind of using method of flash data backup and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287059A (en) * 2019-05-21 2019-09-27 广东九联科技股份有限公司 A kind of more backup methods of spi flash
CN110287059B (en) * 2019-05-21 2023-12-15 广东九联科技股份有限公司 Multi-backup method of spiflash

Also Published As

Publication number Publication date
CN106484567A (en) 2017-03-08

Similar Documents

Publication Publication Date Title
US9489274B2 (en) System and method for performing efficient failover and virtual machine (VM) migration in virtual desktop infrastructure (VDI)
US8918778B2 (en) Method of fail safe flashing management device and application of the same
TWI471726B (en) Managing cache data and metadata
TWI386846B (en) Method, system and flash memory component for initializing multiple processing components utilizing a shared nonvolatile memory
EP3764237A1 (en) System startup method and apparatus, electronic device and storage medium
US9766992B2 (en) Storage device failover
JP6297715B2 (en) Compute device initialization trace
US9239725B2 (en) System and method for installing an OS via a network card supporting PXE
US20120117555A1 (en) Method and system for firmware rollback of a storage device in a storage virtualization environment
US9448889B2 (en) BIOS failover update with service processor
US9448808B2 (en) BIOS update with service processor without serial peripheral interface (SPI) access
US20060036832A1 (en) Virtual computer system and firmware updating method in virtual computer system
JP6201049B2 (en) System and method for updating system level services in a read-only system image
US20160085445A1 (en) Method operating raid system and data storage systems using write command log
JP4712102B2 (en) Storage device, data processing method, and data processing program
WO2018059565A1 (en) Method and system for backing up flash memory data
CN114222975A (en) Data preservation using memory aperture flush sequence
TW201301016A (en) System and method for performing data backup and recovery
EP3989052B1 (en) Method of operating storage device and method of operating storage system using the same
US8788800B2 (en) OS processing method, system and non-transitory computer readable storage medium thereof
CN109582332B (en) System upgrading method and device for Internet camera
US9619340B1 (en) Disaster recovery on dissimilar hardware
CN115562593A (en) Abnormal RAID member disk processing method, device and medium
JP6070115B2 (en) Information processing apparatus, BMC and BIOS update method
CN113950673A (en) Non-volatile storage partition identifier

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17855015

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17855015

Country of ref document: EP

Kind code of ref document: A1