WO2017035759A1 - Method and system of rapid data backup on a solid state drive upon abnormal power off - Google Patents
Method and system of rapid data backup on a solid state drive upon abnormal power off Download PDFInfo
- Publication number
- WO2017035759A1 WO2017035759A1 PCT/CN2015/088675 CN2015088675W WO2017035759A1 WO 2017035759 A1 WO2017035759 A1 WO 2017035759A1 CN 2015088675 W CN2015088675 W CN 2015088675W WO 2017035759 A1 WO2017035759 A1 WO 2017035759A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- backup
- data
- page
- current physical
- channel
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
Definitions
- the invention belongs to the field of solid-state storage, and in particular relates to a method and a system for quickly backing up data of a solid-state hard disk based on an abnormal power-off of a capacitor.
- NAND Flash As a non-volatile memory device, Flash has excellent features such as small size, fast access speed, low power and shock resistance. Therefore, solid state hard disk based on NAND Flash technology (Solid State) Drives, SSD) is currently used in military and residential storage.
- NAND flash SLC NAND flash (Single-Level-Cell) NAND flash, single-layer NAND flash) and MLC NAND flash (Multi-Level-Cell NAND flash) Flash
- MLC NAND flash is more widely used due to its high storage density and low price.
- MLC NAND Flash uses a technique called "multi-page structure", that is, a physical page is divided into two logical pages, which are LSB (Least Significant Bit) pages and MSB (Most).
- the MLC NAND flash can achieve a lower bit error rate similar to SLC NAND flash of the same process.
- the typical storage system structure of a solid-state hard disk based on a large capacitor is shown in Figure 1.
- the solid-state hard disk power supply part includes a main power supply and a backup capacitor.
- the main power supply is generally provided by a main interface (such as USB, SATA, etc.), and is a solid-state storage system in normal operation. Provide power and charge the backup capacitor.
- One or more large capacitors store energy during normal operation and are used as a backup power source when the system is unexpectedly powered down. Since the voltage is unstable during the discharge process, the voltage regulator must be used to convert the capacitor voltage to provide a stable supply voltage for the solid-state storage system.
- the voltage regulator is generally a Zener diode, DC/DC, and the like.
- Solid state storage system by NAND A flash array and an SSD (Solid State Drive) controller. In order to increase the capacity of the solid-state storage system and reduce the package of the flash controller, multi-chip NAND is generally used.
- the flash chip is composed of multiple channels, which are then connected to the flash controller.
- the SSD controller is composed of a processor, a cache controller, a RAM, and a flash controller.
- the SSD controller mainly receives access requests from the main interface, performs address mapping operations on the requests, and finally controls the Flash. The controller completes these requests.
- the technical problem to be solved by the present invention is to provide a method and a system for quickly backing up data of a solid state hard disk during abnormal power failure, aiming at solving the problem that the prior art cannot solve the problem of safe, fast, accurate and effective data backup when the solid state hard disk is abnormally powered off. The problem.
- the present invention is implemented in such a manner that a method for quickly backing up data of a solid state hard disk during abnormal power failure includes the following steps:
- Step A monitoring whether an abnormal power failure occurs
- Step B If an abnormal power failure is detected, calculate whether the release energy of the backup capacitor satisfies the requirement of data backup;
- Step C If it is determined that the release energy of the backup capacitor can meet the data backup requirement, determine an idle channel, and use the idle channel as a write channel for data backup;
- step D data backup is performed through the idle channel.
- the present invention has the beneficial effects that the present invention adopts a dynamic channel selection method according to the discharge characteristic of the backup capacitor, and fully utilizes all available channels to back up data, thereby improving the data backup speed, and further,
- the method of programming only the LSB page is used for backup, which improves the backup efficiency, reduces the error rate of the backup data, and avoids the destruction of low page data.
- FIG. 1 is a schematic structural diagram of a typical storage system of a solid capacitor based on a large capacitor provided by the prior art.
- FIG. 2 is a schematic structural diagram of an intelligent backup system according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of an execution process of a data backup and data recovery task according to an embodiment of the present invention.
- FIG. 4 is a flowchart of a method for quickly backing up data of a solid state hard disk during abnormal power failure according to an embodiment of the present invention.
- FIG. 5 is a schematic flowchart of data backup and data recovery according to an embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of a solid state hard disk data fast backup system during abnormal power failure according to an embodiment of the present invention.
- the intelligent backup task is performed in the RAM and NAND when the power is abnormally powered off.
- a layer of software between Flash controllers The structure of the solid-state storage system with intelligent backup function is shown in Figure 2.
- the host and the storage system are connected through the main interface.
- the main interface is also the main power supply of the storage system and the charging power supply of the backup power module during normal operation.
- All requests to the host file system are made by FTL (Flash Translation Layer, Flash translation layer) is done by controlling the NAND Flash controller.
- FTL Flash Translation Layer, Flash translation layer
- FTL mainly completes file system logical address to NAND Flash physical address mapping, garbage collection and wear leveling.
- all or part of the FTL mapping table, current pending requests, and file system key data are stored in RAM for quick access and update.
- the backup capacitor acts as a temporary power source to power the storage system for data backup.
- the system generates a hardware interrupt, and the data backup task will be executed as an interrupt service routine.
- Figure 3 depicts the execution order and priority of data backup tasks and data recovery tasks.
- the purpose of data backup is to write data from RAM to NAND Flash arrays to avoid data loss.
- the data recovery task is first executed because of its higher priority, and the backup data in the NAND flash array is written to the RAM.
- NAND Flash is a "non-instant" updated storage device, namely NAND
- NAND Flash arrays require garbage collection operations to reclaim "dirty blocks" of written data.
- all physical blocks of the backup data partition will be erased together during data recovery to prepare for the next backup data write.
- the intelligent backup In order to obtain the real-time status of the backup capacitor to determine the number of channels for the next write parallel operation, the intelligent backup also needs to obtain the real-time voltage of the backup capacitor.
- the real-time voltage of the capacitor can be realized by a hardware acquisition circuit, or by calculating a model for a large capacitor and a system.
- the present invention provides a method for protecting data of a solid state hard disk during abnormal power failure as shown in FIG. 4, and the steps include:
- the release energy of the backup capacitor is calculated by the voltage of the backup capacitor and its capacitance value, and the release energy is compared with the backup energy required to back up all the data, if the release energy is less than The backup energy ends the backup and sends a signal to the system to indicate that the backup fails due to insufficient release of energy; if the release energy is greater than the backup energy, the following steps are continued.
- step S4 detecting the current state in the channel determined in step S3.
- some channels of the SSD are likely to be performing some operations during an unexpected power failure, they cannot be used, so the status of the channel capable of data writing is first detected for data backup.
- step S5 Select an idle channel according to the detection result in step S4.
- steps S3 to S5 in order to ensure the reliability of the write data and avoid the situation that multiple channels work at the same time, thereby causing the backup capacitor energy to be exhausted, before selecting the idle channel, the current capacitor must be calculated according to the voltage and capacity of the backup capacitor at this time.
- the number of channels that can support the write operation can be supported at the same time, and then one of the channels is selected for writing.
- the channel for data backup that can be used can be written in parallel, so that all channels can simultaneously perform data backup, but the SSD controller can only operate on one channel at a time, so Only one channel can be selected for the idle channel to write.
- S6 Determine whether the current physical page is the first page of the current physical block. In this step, once an available free channel is selected for data backup write operation, it is necessary to determine the current physical page of the data to be written (PPN). Current) Whether it is the first page of the current physical block (PBN current).
- step S6 If it is determined in step S6 that the current physical page is the first page of the current physical block, the current physical page is read to obtain a bad block flag.
- step S9 If it is determined that the current physical block is a bad block, the next physical block is directly read, and the process returns to step S8.
- the bad block flag is recorded to a fixed position (ie, a bad block flag bit) of each physical block of the backup partition, and when the bad block determination is performed, the bad block mark of the first page can be read. It is judged whether the current fast PBNcurrent is a bad block. If the current physical block PBNcurrent is a bad block, the next physical block is directly read, and the bad block judgment is performed again until a non-bad block is found for data writing.
- step S6 If it is determined in step S6 that the current physical page is not the first page of the current physical block, it is determined whether the current physical page is an LSB page. In this step, since the data is directly written into the LSB page, it is necessary to judge whether the current physical page is an LSB page.
- step S12 If the current physical page PPNcurrent is an LSB page, write the backup data of a physical page size into the data area of the current physical page PPNcurrent, and write the corresponding RAM address into the OOB; if the current physics determined in step S6 When the page PPNcurrent is the first page, the non-bad block flag needs to be written into the OOB.
- step S13 Determine whether all the data is backed up. If the data is not completely backed up, return to step S3; if it is determined that all the data is backed up, the backup process is ended.
- the intelligent backup first calculates the release energy of the backup capacitor by the backup capacitor voltage and its capacitance value, and compares it with the energy required to back up all the data. If the backup capacitor energy cannot back up all the backup data, the backup process Failure, and send a signal to the system; otherwise, the smart backup will use the dynamic channel selection method, that is, to detect the current state of all channels, and select one channel in all idle channels for the spare data write operation.
- intelligent backup needs to write multiple channels of SSD in parallel to improve the writing speed, in order to ensure the reliability of writing data and avoid the exhaustion of multiple channels simultaneously working backup capacitors, before selecting the idle channel, The intelligent backup must calculate the maximum number of simultaneous channels that can be supported at this time based on the voltage and capacity of the backup capacitor at this time, and then select one of the channels to perform the write operation. Once an available free channel is selected, if the current physical page (PPNcurrent) to be written is the first page of the current physical block (PBNcurrent), the bad block is judged first. Smart Backup logs bad block marks to a fixed location on the first page of each physical block of the backup partition. Therefore, as shown in FIG.
- the bad block flag of the first page is read to determine whether the PBNcurrent is a bad block. If the PBNcurrent is a bad block, the physical block is directly taken off, and once again. Bad blocks are judged until a non-bad block is found for data writing. When a non-bad block is selected, the smart backup writes the backup data to the LSB page of PBNcurrent, and writes the corresponding memory address into the OOB (free area). If PPNcurrent is the first page, the non-bad block is marked. It also needs to be written to OOB at the same time. In this way, the intelligent backup no longer needs to maintain a mapping table between a static physical address and a memory address, thereby reducing the problem of channel congestion caused by the static mapping table.
- FIG. 5 An example of intelligent backup is shown in Figure 5.
- the intelligent backup writes the data in the memory to the backup area. Since channel 3 is currently busy, the intelligent backup writes the backup data in parallel to the LSB physical page in the channel 0 to channel 2 physical block. At the same time, the corresponding memory address is written into the OOB of the corresponding physical page.
- Smart Backup needs to read data from the backup partition into RAM to recover the data. As shown in FIG. 5, the intelligent backup reads the backup partition in parallel. Since the physical page stores the backup and its corresponding memory address, the smart backup only needs to write the read backup partition data to the corresponding RAM address. When all data recovery is complete, Smart Backup will erase all physical blocks of the backup partition for the next backup operation.
- FIG. 6 is a data protection system for a solid state hard disk during abnormal power failure according to an embodiment of the present invention, including:
- the detecting unit 1 is configured to monitor whether an abnormal power failure occurs
- the calculating unit 2 is configured to calculate whether the release energy of the backup capacitor meets the requirement of data backup;
- the channel selection unit 3 is configured to determine a free channel when the release energy of the backup capacitor can meet the data backup requirement, and use the idle channel as the data backup backup channel;
- the backup unit 4 is configured to perform data backup through the idle channel.
- calculation unit 2 includes:
- the first calculating module 21 is configured to calculate a release energy of the backup capacitor by using a voltage and a capacitance value of the backup capacitor;
- the comparison module 22 is configured to compare the release energy of the backup capacitor with the backup energy required to back up all the data
- the energy judging module 23 is configured to end the backup when the release energy is less than the backup energy, and send an end signal to the system; and when the release energy is greater than the backup energy, generate a A channel selection command is sent to the channel selection unit.
- the channel selection unit 3 includes:
- a second calculation module 31 configured to calculate, according to the release energy, a number of channels that can simultaneously perform data backup, and obtain a corresponding channel according to the number of channels;
- a state detecting module 32 configured to detect a current state of the acquired channel
- the channel selection module 33 is configured to select an idle channel according to the detection result of the state detection module 32; and use the idle channel as the write channel of the data backup.
- the backup unit 4 includes:
- the page determining module 42 is configured to determine whether the current physical page of the data to be written is an LSB page
- the page search module 43 is configured to: when determining that the current physical page is not an LSB page, look down until an LSB page is found;
- the backup module 44 is configured to determine that the current physical page is an LSB page, write data of a physical page size to be backed up into a data area of the current physical page, and write the corresponding RAM address into the OOB;
- the backup determining module 45 is configured to confirm whether all the data is backed up, and if the data is all backed up, the data backup is ended;
- the backup unit 4 further includes a bad block determining module 41, specifically for:
- the current physical page is read to obtain the bad block flag bit
- determining whether the current physical block is a bad block if the current physical block is not a bad block, performing data backup through the idle channel;
- the backup module 44 is specifically configured to: when determining that the current physical page is an LSB page, write the backup data of a physical page size into the data area of the current physical page, and write the corresponding RAM address into the OOB; The page is the first page, you also need to write non-bad block tags into OOB.
- the smart backup dynamically calculates the number of channels that perform the write operation in parallel through the voltage value of the current backup capacitor, which avoids the capacitor power shortage that may occur during backup. Problem; Smart Backup writes all backup data to the LSB page with very low error rate, ensuring the reliability of the backup data.
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 of rapid data backup on a solid state drive upon abnormal power off is applicable to the field of solid state storage, said method comprising: step A: monitoring whether abnormal power off occurs; step B: if abnormal power off is monitored, calculating whether the energy released by a backup capacitor meets the requirement for data backup; step C: if it is determined that the energy released by the backup capacitor meets the requirement for data backup, determining an idle channel as the write channel for data backup; step D: performing data backup by means of the idle channel. The method, according to the discharge characteristics of a backup capacitor, uses dynamic channel selections to fully utilize all current available channels to backup data, thereby improving the speed of data backup; further, in order to ensure the reliability of the backup data, the method of only programming LSB pages is used during backup, improving the backup efficiency, reducing the bit error rate of the backup data, and avoiding low page data corruption.
Description
本发明属于固态存储领域,尤其涉及一种基于电容的异常断电时固态硬盘数据快速备份的方法及系统。 The invention belongs to the field of solid-state storage, and in particular relates to a method and a system for quickly backing up data of a solid-state hard disk based on an abnormal power-off of a capacitor.
NAND
Flash作为一种非易失性存储器件,具有体积小、访问速度快、功率小及抗震等优良特性,因此,基于NAND Flash技术的固态硬盘(Solid State
Drives, SSD)目前已经应用于军用及民用存储领域。NAND flash主要有两种:SLC NAND flash(Single-Level-Cell
NAND flash,单层NAND flash)和MLC NAND flash(Multi-Level-Cell NAND flash,多层NAND
flash),MLC NAND flash因其储存密度较大,价格便宜等优点,应用更加广泛。MLC NAND
flash采用一种称之为“多页结构”的技术,即一个物理页分为两个逻辑页,分别为LSB(Least Significant Bit)页和MSB(Most
Significant Bit)页。由于对MLC NAND
flash某一物理页编程时,必须先编程LSB页,再编程MSB页,因此LSB页对应着较低的参考电压,因此,LSB页具有较快的编程速度,并且当只使用LSB页时,MLC
NAND flash可以达到与同等制程的SLC NAND flash相近的较低的误码率。NAND
As a non-volatile memory device, Flash has excellent features such as small size, fast access speed, low power and shock resistance. Therefore, solid state hard disk based on NAND Flash technology (Solid State)
Drives, SSD) is currently used in military and residential storage. There are two main types of NAND flash: SLC NAND flash (Single-Level-Cell)
NAND flash, single-layer NAND flash) and MLC NAND flash (Multi-Level-Cell NAND flash)
Flash), MLC NAND flash is more widely used due to its high storage density and low price. MLC NAND
Flash uses a technique called "multi-page structure", that is, a physical page is divided into two logical pages, which are LSB (Least Significant Bit) pages and MSB (Most).
Significant Bit) page. Due to the MLC NAND
When programming a physical page of flash, the LSB page must be programmed first, and then the MSB page is programmed. Therefore, the LSB page corresponds to a lower reference voltage. Therefore, the LSB page has a faster programming speed, and when only the LSB page is used, the MLC
NAND flash can achieve a lower bit error rate similar to SLC NAND flash of the same process.
在固态硬盘的实际使用中,意外掉电情况时有发生,由于其不可预知性,意外掉电会造成固态硬盘临时数据丢失,而这些临时数据可能为地址映射表或者文件系统关键数据,一旦这些数据丢失,固态硬盘本身和用户系统就会面临崩溃的风险。因此,大电容作为意外掉电时的备用电源目前已经广泛应用于固态硬盘中。基于大电容的固态硬盘典型存储系统结构如图1所示,固态硬盘电源部分包括主电源和备份电容,主电源一般由主接口(如USB,SATA等)提供,在正常操作时为固态存储系统提供电源,并且为备份电容充电。一个或者多个大电容在正常操作时存储能量,并在系统意外掉电时作为备份电源使用。由于电容在放电过程中电压是不稳定的,因此,必须使用电压调节器对电容电压进行变换,以为固态存储系统提供稳定的供电电压,电压调节器一般为稳压管、DC/DC等。固态存储系统由NAND
flash阵列和SSD(Solid State Drive,固态硬盘)控制器组成。为了提高固态存储系统容量并减少Flash控制器封装,一般将多片NAND
flash芯片组成多个通道,这些通道再与Flash控制器相连接。如图1所示,SSD控制器由处理器、缓存控制器、RAM以及Flash控制器组成,SSD控制器主要是接收来自主接口的访问请求,并将这些请求进行地址映射等操作,最后控制Flash控制器完成这些请求。In the actual use of SSDs, unexpected power failures occur. Due to its unpredictability, accidental power loss can cause temporary data loss of SSDs. These temporary data may be address mapping tables or file system key data. Data loss, the SSD itself and the user system are at risk of crashing. Therefore, large capacitors have been widely used in solid state drives as a backup power source for accidental power failure. The typical storage system structure of a solid-state hard disk based on a large capacitor is shown in Figure 1. The solid-state hard disk power supply part includes a main power supply and a backup capacitor. The main power supply is generally provided by a main interface (such as USB, SATA, etc.), and is a solid-state storage system in normal operation. Provide power and charge the backup capacitor. One or more large capacitors store energy during normal operation and are used as a backup power source when the system is unexpectedly powered down. Since the voltage is unstable during the discharge process, the voltage regulator must be used to convert the capacitor voltage to provide a stable supply voltage for the solid-state storage system. The voltage regulator is generally a Zener diode, DC/DC, and the like. Solid state storage system by NAND
A flash array and an SSD (Solid State Drive) controller. In order to increase the capacity of the solid-state storage system and reduce the package of the flash controller, multi-chip NAND is generally used.
The flash chip is composed of multiple channels, which are then connected to the flash controller. As shown in FIG. 1 , the SSD controller is composed of a processor, a cache controller, a RAM, and a flash controller. The SSD controller mainly receives access requests from the main interface, performs address mapping operations on the requests, and finally controls the Flash. The controller completes these requests.
大电容容量一般是有限的,并且其容量会随着时间逐渐减小,因此,增强基于大电容的固态硬盘存储系统备份效率和可靠性是非常必要的。为了提高备份数据效率及可靠性,需要解决以下问题:Large capacitor capacity is generally limited, and its capacity will gradually decrease with time. Therefore, it is necessary to enhance the backup efficiency and reliability of solid-state hard disk storage systems based on large capacitance. In order to improve the efficiency and reliability of backup data, the following issues need to be resolved:
(1)由于备份电容寿命和容量的限制,备份数据需要尽可能快地备份到NAND
flash中。由于系统的意外掉电一般来说是不可预知的,在系统掉电的时刻系统有可能在处理一些耗时的任务,如NAND
flash的擦除操作,因此,在这些情况发生时,如何通过有效地调度NAND flash的使用从而达到安全快速的数据备份是一个亟待解决的问题;(1) Due to backup capacitor life and capacity limitations, backup data needs to be backed up to NAND as quickly as possible
In the flash. Since the system's unexpected power loss is generally unpredictable, the system may be able to handle some time-consuming tasks, such as NAND, when the system is powered down.
Flash erase operation, therefore, how to achieve safe and fast data backup by effectively scheduling the use of NAND flash is an urgent problem to be solved when these situations occur;
(2)由于备份电容在放电过程是不稳定的,虽然一般有电压调节器去稳压,但其放电过程却是存在一定的不可预知性,因此,如果在发生意外掉电时,仅仅提高数据备份效率就可能会出现一些数据可靠性的问题;(2) Since the backup capacitor is unstable during the discharge process, although the voltage regulator is generally regulated, the discharge process is unpredictable. Therefore, if the accidental power failure occurs, only the data is increased. Backup efficiency may cause some data reliability problems;
(3)如果在MLC NAND
flash的MSB页进行编程时发生意外掉电,则会发生低页数据破坏的现象(lower page corruption
phenomenon),即在重新上电时,已经编程完毕的LSB页数据误码率会显著上升,进一步危害了备份数据安全。(3) If in MLC NAND
When the MSB page of the flash is programmed to be powered off unexpectedly, low page data corruption occurs (lower page corruption)
Phenomenon), that is, when the power is turned on again, the error rate of the already programmed LSB page data will rise significantly, which further jeopardizes the security of the backup data.
本发明所要解决的技术问题在于提供一种异常断电时固态硬盘数据快速备份的方法及系统,旨在解决现有技术不能解决在固态硬盘在异常断电时进行安全快速、准确有效的数据备份的问题。
The technical problem to be solved by the present invention is to provide a method and a system for quickly backing up data of a solid state hard disk during abnormal power failure, aiming at solving the problem that the prior art cannot solve the problem of safe, fast, accurate and effective data backup when the solid state hard disk is abnormally powered off. The problem.
本发明是这样实现的,一种异常断电时固态硬盘数据快速备份的方法,步骤包括:The present invention is implemented in such a manner that a method for quickly backing up data of a solid state hard disk during abnormal power failure includes the following steps:
步骤A,监测是否出现异常断电;Step A, monitoring whether an abnormal power failure occurs;
步骤B,若监测到发生异常断电,计算备份电容的释放能量是否满足数据备份的需求;Step B: If an abnormal power failure is detected, calculate whether the release energy of the backup capacitor satisfies the requirement of data backup;
步骤C,若判断备份电容的释放能量能够满足数据备份需求,确定一空闲通道,以所述空闲通道为数据备份的写入通道;Step C: If it is determined that the release energy of the backup capacitor can meet the data backup requirement, determine an idle channel, and use the idle channel as a write channel for data backup;
步骤D,通过所述空闲通道进行数据备份。In step D, data backup is performed through the idle channel.
本发明与现有技术相比,有益效果在于:本发明根据备份电容的放电特性,采用动态通道选择的方法,充分利用目前所有可利用通道备份数据,从而提高了数据备份速度,进一步地,为了保证备份数据的可靠性,进行备份时采用只编程LSB页的方法,在提高了备份效率同时,降低了备份数据误码率,且避免了低页数据破坏的现象。
Compared with the prior art, the present invention has the beneficial effects that the present invention adopts a dynamic channel selection method according to the discharge characteristic of the backup capacitor, and fully utilizes all available channels to back up data, thereby improving the data backup speed, and further, To ensure the reliability of the backup data, the method of programming only the LSB page is used for backup, which improves the backup efficiency, reduces the error rate of the backup data, and avoids the destruction of low page data.
图1是现有技术提供的基于大电容的固态硬盘典型存储系统的结构示意图。FIG. 1 is a schematic structural diagram of a typical storage system of a solid capacitor based on a large capacitor provided by the prior art.
图2是本发明实施例提供的智能备份系统的结构示意图。FIG. 2 is a schematic structural diagram of an intelligent backup system according to an embodiment of the present invention.
图3是本发明实施例提供的数据备份和数据恢复任务的执行过程示意图。FIG. 3 is a schematic diagram of an execution process of a data backup and data recovery task according to an embodiment of the present invention.
图4是本发明实施例提供的一种异常断电时固态硬盘数据快速备份方法的流程图。FIG. 4 is a flowchart of a method for quickly backing up data of a solid state hard disk during abnormal power failure according to an embodiment of the present invention.
图5是本发明实施例提供的数据备份与数据恢复的流程示意图。FIG. 5 is a schematic flowchart of data backup and data recovery according to an embodiment of the present invention.
图6是本发明实施例提供的一种异常断电时固态硬盘数据快速备份系统的结构示意图。FIG. 6 is a schematic structural diagram of a solid state hard disk data fast backup system during abnormal power failure according to an embodiment of the present invention.
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明中,在异常断电时执行智能备份任务的是位于RAM和NAND
Flash控制器之间的一层软件。具有智能备份功能的固态存储系统的结构如图2所示,主机与存储系统通过主接口相连,主接口同时也是在正常操作时存储系统的主电源及备份电源模块的充电电源。主机文件系统的所有请求均由FTL(Flash
Translation Layer,Flash转译层)通过控制NAND Flash控制器完成。FTL主要完成文件系统逻辑地址到NAND
Flash物理地址的映射、垃圾回收及损耗均衡功能。为了提高系统I/O速率减少系统延时,FTL的全部或部分映射表、当前悬挂的请求以及文件系统关键数据等保存在RAM中,以便快速访问及更新。In the present invention, the intelligent backup task is performed in the RAM and NAND when the power is abnormally powered off.
A layer of software between Flash controllers. The structure of the solid-state storage system with intelligent backup function is shown in Figure 2. The host and the storage system are connected through the main interface. The main interface is also the main power supply of the storage system and the charging power supply of the backup power module during normal operation. All requests to the host file system are made by FTL (Flash
Translation Layer, Flash translation layer) is done by controlling the NAND Flash controller. FTL mainly completes file system logical address to NAND
Flash physical address mapping, garbage collection and wear leveling. In order to increase the system I/O rate and reduce system latency, all or part of the FTL mapping table, current pending requests, and file system key data are stored in RAM for quick access and update.
出现异常掉电时,备份电容作为临时电源为存储系统供电,以便进行数据备份。同时,系统产生一个硬件中断,数据备份任务作为中断服务程序将被执行。图3描述了数据备份任务和数据恢复任务的执行次序及优先级。数据备份的目的是将RAM中的数据写入到NAND
Flash阵列中以避免数据丢失。当主电源恢复时,数据恢复任务由于其优先级较高被首先执行,将NAND flash阵列中的备份数据写入到RAM中。In the event of an abnormal power loss, the backup capacitor acts as a temporary power source to power the storage system for data backup. At the same time, the system generates a hardware interrupt, and the data backup task will be executed as an interrupt service routine. Figure 3 depicts the execution order and priority of data backup tasks and data recovery tasks. The purpose of data backup is to write data from RAM to NAND
Flash arrays to avoid data loss. When the main power is restored, the data recovery task is first executed because of its higher priority, and the backup data in the NAND flash array is written to the RAM.
为了加快备份过程同时保证备份数据的可靠性,智能备份在NAND
Flash阵列中单独开辟一个固定的物理分区保存备份数据,为了利用NAND Flash阵列的并行性,此分区平均分布于NAND
Flash阵列的每个物理通道中。由于NAND Flash是一种“非即时”更新的存储器件,即NAND
flash的每一个物理块在写入数据前必须首先进行擦除操作,因此,NAND
Flash阵列需要垃圾回收操作以回收已写入数据的“脏块”。在智能备份方法中,备份数据分区的全部物理块将在数据恢复时一起被擦除,以准备下一次的备份数据写入。为了获得备份电容的实时状态以确定下一次写入并行工作的通道数量,智能备份还需要获得备份电容的实时电压。电容的实时电压可以通过硬件采集电路实现,也可以通过对大电容及系统建立模型通过计算获得。In order to speed up the backup process while ensuring the reliability of backup data, smart backup in NAND
A fixed physical partition is separately created in the Flash array to store backup data. In order to utilize the parallelism of the NAND Flash array, the partition is evenly distributed in NAND.
In each physical channel of the Flash array. Because NAND Flash is a "non-instant" updated storage device, namely NAND
Each physical block of flash must first be erased before writing data, so NAND
Flash arrays require garbage collection operations to reclaim "dirty blocks" of written data. In the smart backup method, all physical blocks of the backup data partition will be erased together during data recovery to prepare for the next backup data write. In order to obtain the real-time status of the backup capacitor to determine the number of channels for the next write parallel operation, the intelligent backup also needs to obtain the real-time voltage of the backup capacitor. The real-time voltage of the capacitor can be realized by a hardware acquisition circuit, or by calculating a model for a large capacitor and a system.
基于上述原理,本发明提供了如图4所示的一种异常断电时固态硬盘数据保护的方法,步骤包括:Based on the above principle, the present invention provides a method for protecting data of a solid state hard disk during abnormal power failure as shown in FIG. 4, and the steps include:
S1,监测到出现异常断电情况,则系统开始进入数据备份流程;S1, when abnormal power failure is detected, the system begins to enter the data backup process;
S2,计算备份电容的释放能量是否满足数据备份的需求。在本步骤中,先通过备份电容的电压及其电容值计算得到备份电容所能的释放能量,在将所述释放能量与备份所有数据所需的备份能量进行比较,若所述释放能量小于所述备份能量,则结束此次备份,并发送一信号给系统,用以提示此次因释放能量不足备份失败;如所述释放能量大于所述备份能量,则继续下述步骤。S2. Calculate whether the release energy of the backup capacitor satisfies the requirement of data backup. In this step, the release energy of the backup capacitor is calculated by the voltage of the backup capacitor and its capacitance value, and the release energy is compared with the backup energy required to back up all the data, if the release energy is less than The backup energy ends the backup and sends a signal to the system to indicate that the backup fails due to insufficient release of energy; if the release energy is greater than the backup energy, the following steps are continued.
S3,根据当前备份电容的电压计算最多能同时工作的通道数,据此获取对对应的通道。S3: Calculate the number of channels that can work at the same time according to the current backup capacitor voltage, and obtain the corresponding channel accordingly.
S4,检测步骤S3确定的通道中的当前状态。在本步骤中,由于在意外掉电时,SSD某些通道有可能在执行一些操作,因此不能被使用,因此首先检测能够进行数据写入的通道的状况以便进行数据备份。S4, detecting the current state in the channel determined in step S3. In this step, since some channels of the SSD are likely to be performing some operations during an unexpected power failure, they cannot be used, so the status of the channel capable of data writing is first detected for data backup.
S5,根据步骤S4中的检测结果选取一空闲通道。在步骤S3至S5中,为了保证写入数据的可靠性,避免多个通道同时工作从而导致备份电容能量耗尽的情况,在选择空闲通道前,必须根据此时备份电容的电压及容量计算此时能够最多同时支持写入工作的通道数,然后从这些通道中选择一个空闲通道进行写入操作。而且因为在意外掉电时,能够使用的进行数据备份的通道,可以进行并行写入,因此是所有通道是可以同时进行数据备份的,但SSD控制器每一次只能对一个通道进行操作,因此只能选取一个通道进行空闲通道进行写入操作。S5. Select an idle channel according to the detection result in step S4. In steps S3 to S5, in order to ensure the reliability of the write data and avoid the situation that multiple channels work at the same time, thereby causing the backup capacitor energy to be exhausted, before selecting the idle channel, the current capacitor must be calculated according to the voltage and capacity of the backup capacitor at this time. The number of channels that can support the write operation can be supported at the same time, and then one of the channels is selected for writing. Moreover, because in the case of accidental power failure, the channel for data backup that can be used can be written in parallel, so that all channels can simultaneously perform data backup, but the SSD controller can only operate on one channel at a time, so Only one channel can be selected for the idle channel to write.
S6,判断当前物理页是否为当前物理块的第一页。在本步骤中,一旦选择了一个可用的空闲通道进行数据备份写入操作,则需判断待写入数据的当前物理页(PPN
current)是否为当前物理块(PBN current)的第一页。S6. Determine whether the current physical page is the first page of the current physical block. In this step, once an available free channel is selected for data backup write operation, it is necessary to determine the current physical page of the data to be written (PPN).
Current) Whether it is the first page of the current physical block (PBN current).
S7,若步骤S6中判断当前物理页为当前物理块的第一页,则读取当前物理页,以获得坏块标志位。S7. If it is determined in step S6 that the current physical page is the first page of the current physical block, the current physical page is read to obtain a bad block flag.
S8,根据坏块标志位获取的坏块标记判断当前物理块是否为坏块。S8. Determine, according to the bad block flag obtained by the bad block flag, whether the current physical block is a bad block.
S9,若判断当前物理块为坏块,则直接读取下一物理块,并返回步骤S8。在上述步骤S6至S9中,将坏块标记记录到备份分区的每一物理块的固定位置(即坏块标志位),在进行坏块判断时,读取第一页的坏块标记即可判断当前快PBNcurrent是否为坏块,如果当前物理块PBNcurrent为坏块,则直接读取下一物理块,再一次进行坏块判断,直到找到一个非坏块以备数据写入。S9. If it is determined that the current physical block is a bad block, the next physical block is directly read, and the process returns to step S8. In the above steps S6 to S9, the bad block flag is recorded to a fixed position (ie, a bad block flag bit) of each physical block of the backup partition, and when the bad block determination is performed, the bad block mark of the first page can be read. It is judged whether the current fast PBNcurrent is a bad block. If the current physical block PBNcurrent is a bad block, the next physical block is directly read, and the bad block judgment is performed again until a non-bad block is found for data writing.
S10,若步骤S6中判断当前物理页非当前物理块的第一页,则判断当前物理页是否为LSB页。在本步骤中,因直接将数据写入LSB页中,因此需判断当前物理页是否为LSB页。S10. If it is determined in step S6 that the current physical page is not the first page of the current physical block, it is determined whether the current physical page is an LSB page. In this step, since the data is directly written into the LSB page, it is necessary to judge whether the current physical page is an LSB page.
S11,若判断当前物理页PPNcurrent非LSB页,则直接读取下一物理页,直至找到LSB页。S11. If it is determined that the current physical page PPNcurrent is not an LSB page, the next physical page is directly read until the LSB page is found.
S12,若当前物理页PPNcurrent为LSB页,则将一物理页大小的的备份数据写入当前物理页PPNcurrent的数据区,将相应的RAM地址写入到OOB中;若步骤S6中判断的当前物理页PPNcurrent为第一页,则还需将非坏块标记写入OOB中。S12. If the current physical page PPNcurrent is an LSB page, write the backup data of a physical page size into the data area of the current physical page PPNcurrent, and write the corresponding RAM address into the OOB; if the current physics determined in step S6 When the page PPNcurrent is the first page, the non-bad block flag needs to be written into the OOB.
S13,判断是否所有数据备份完毕,若数据未全部备份完毕,则返回步骤S3;若判断数据全部备份完毕,则结束此次备份程序。S13. Determine whether all the data is backed up. If the data is not completely backed up, return to step S3; if it is determined that all the data is backed up, the backup process is ended.
在上述方法中,智能备份首先通过备份电容电压及其电容值计算得到备份电容的释放能量,并与备份所有数据所需能量进行比较,若备份电容能量不能备份所有备份数据,则此次备份过程失败,并发送一个信号给系统;反之,智能备份将用动态通道选择的方法,即检测所有通道当前状态,在所有空闲的通道中,选择一个通道以备此次备件数据写入操作。因为智能备份需要将SSD的多个通道进行并行写入以提高写入速度,为了保证写入数据的可靠性,避免多个通道同时工作备份电容电量耗尽的情况,因此在选择空闲通道前,智能备份必须根据此时备份电容的电压及容量计算此时能够支持的最多同时工作的通道数,然后在这些通道中选择一个空闲通道进行写入操作。一旦选择了一个可用的空闲通道,如果当前待写入的物理页(PPNcurrent)为当前物理块(PBNcurrent)的第一页,则先进行坏块的判断。智能备份将坏块标记记录到备份分区每个物理块第一页的固定位置。因此,如图4所示,在进行坏块判断时,读取第一页的坏块标记即可判断PBNcurrent是否为坏块,如果PBNcurrent为坏块,则直接取下一个物理块,再一次进行坏块判断,直到找到一个非坏块以备数据写入。当一个非坏块选定后,智能备份将备份数据写入到PBNcurrent的LSB页中,同时将对应的内存地址写入到OOB(空闲区)中,如果PPNcurrent为第一页,非坏块标记也需要同时写入到OOB中。这样,智能备份不再需要维护一个静态的物理地址与内存地址之间的映射表,从而减少了静态映射表可能带来的通道堵塞等问题。In the above method, the intelligent backup first calculates the release energy of the backup capacitor by the backup capacitor voltage and its capacitance value, and compares it with the energy required to back up all the data. If the backup capacitor energy cannot back up all the backup data, the backup process Failure, and send a signal to the system; otherwise, the smart backup will use the dynamic channel selection method, that is, to detect the current state of all channels, and select one channel in all idle channels for the spare data write operation. Because intelligent backup needs to write multiple channels of SSD in parallel to improve the writing speed, in order to ensure the reliability of writing data and avoid the exhaustion of multiple channels simultaneously working backup capacitors, before selecting the idle channel, The intelligent backup must calculate the maximum number of simultaneous channels that can be supported at this time based on the voltage and capacity of the backup capacitor at this time, and then select one of the channels to perform the write operation. Once an available free channel is selected, if the current physical page (PPNcurrent) to be written is the first page of the current physical block (PBNcurrent), the bad block is judged first. Smart Backup logs bad block marks to a fixed location on the first page of each physical block of the backup partition. Therefore, as shown in FIG. 4, when the bad block determination is performed, the bad block flag of the first page is read to determine whether the PBNcurrent is a bad block. If the PBNcurrent is a bad block, the physical block is directly taken off, and once again. Bad blocks are judged until a non-bad block is found for data writing. When a non-bad block is selected, the smart backup writes the backup data to the LSB page of PBNcurrent, and writes the corresponding memory address into the OOB (free area). If PPNcurrent is the first page, the non-bad block is marked. It also needs to be written to OOB at the same time. In this way, the intelligent backup no longer needs to maintain a mapping table between a static physical address and a memory address, thereby reducing the problem of channel congestion caused by the static mapping table.
智能备份的实例如图5所示,在此例子中,假设一个物理页可以保存四个单位的备份数据,备份分区共有四个物理块,分布于四个通道中。意外掉电发生时,智能备份将内存中数据写入到备份区,由于通道3当前为忙,因此,智能备份将备份数据并行写入到通道0到通道2物理块中的LSB物理页中,同时将对应的内存地址写入到对应物理页的OOB中。当主电源恢复时,智能备份需要将数据从备份分区读取到RAM中,以恢复数据。如图5所示,智能备份并行读取备份分区,由于物理页保存着备份及其对应的内存地址,因此智能备份只需将读取的备份分区数据写入到对应的RAM地址即可。当所有数据恢复完成后,智能备份将擦除备份分区所有物理块,以备下一次备份操作。An example of intelligent backup is shown in Figure 5. In this example, assume that one physical page can hold four units of backup data. The backup partition has four physical blocks distributed in four channels. When an accidental power failure occurs, the intelligent backup writes the data in the memory to the backup area. Since channel 3 is currently busy, the intelligent backup writes the backup data in parallel to the LSB physical page in the channel 0 to channel 2 physical block. At the same time, the corresponding memory address is written into the OOB of the corresponding physical page. When the primary power is restored, Smart Backup needs to read data from the backup partition into RAM to recover the data. As shown in FIG. 5, the intelligent backup reads the backup partition in parallel. Since the physical page stores the backup and its corresponding memory address, the smart backup only needs to write the read backup partition data to the corresponding RAM address. When all data recovery is complete, Smart Backup will erase all physical blocks of the backup partition for the next backup operation.
图6是本发明实施例提供的一种异常断电时固态硬盘数据保护系统,包括:FIG. 6 is a data protection system for a solid state hard disk during abnormal power failure according to an embodiment of the present invention, including:
检测单元1,用于监测是否出现异常断电情况;The detecting unit 1 is configured to monitor whether an abnormal power failure occurs;
计算单元2,用于计算备份电容的释放能量是否满足数据备份的需求;The calculating unit 2 is configured to calculate whether the release energy of the backup capacitor meets the requirement of data backup;
通道选取单元3,用于在判断备份电容的释放能量能够满足数据备份需求,确定一空闲通道,以所述空闲通道为数据备份的写入通道;The channel selection unit 3 is configured to determine a free channel when the release energy of the backup capacitor can meet the data backup requirement, and use the idle channel as the data backup backup channel;
备份单元4,用于通过所述空闲通道进行数据备份。The backup unit 4 is configured to perform data backup through the idle channel.
进一步地,计算单元2包括:Further, the calculation unit 2 includes:
第一计算模块21,用于通过备份电容的电压和电容值计算备份电容的释放能量;The first calculating module 21 is configured to calculate a release energy of the backup capacitor by using a voltage and a capacitance value of the backup capacitor;
比较模块22,用于比较备份电容的释放能量与备份所有数据所需的备份能量;The comparison module 22 is configured to compare the release energy of the backup capacitor with the backup energy required to back up all the data;
能量判断模块23,用于在所述释放能量小于所述备份能量时,结束此次备份,并发送一结束信号至系统;还用于在所述释放能量大于所述备份能量时,则生成一通道选择指令至所述通道选取单元。The energy judging module 23 is configured to end the backup when the release energy is less than the backup energy, and send an end signal to the system; and when the release energy is greater than the backup energy, generate a A channel selection command is sent to the channel selection unit.
进一步地,通道选取单元3包括:Further, the channel selection unit 3 includes:
第二计算模块31,用于根据所述释放能量计算同时能进行数据备份的通道数量,根据通道数量获取对应的通道;a second calculation module 31, configured to calculate, according to the release energy, a number of channels that can simultaneously perform data backup, and obtain a corresponding channel according to the number of channels;
状态检测模块32,用于检测所获取的通道的当前状态;a state detecting module 32, configured to detect a current state of the acquired channel;
通道选取模块33,用于根据状态检测模块32的检测结果选取一空闲通道;以所述空闲通道作为此次数据备份的写入通道。The channel selection module 33 is configured to select an idle channel according to the detection result of the state detection module 32; and use the idle channel as the write channel of the data backup.
进一步地,备份单元4包括:Further, the backup unit 4 includes:
页面确定模块42,用于判断待写入数据的当前物理页是否为LSB页;The page determining module 42 is configured to determine whether the current physical page of the data to be written is an LSB page;
页面查找模块43,用于在判断当前物理页非LSB页时,则向下查找直至查找到一LSB页;The page search module 43 is configured to: when determining that the current physical page is not an LSB page, look down until an LSB page is found;
备份模块44,用于在判断当前物理页为LSB页,将一物理页大小的需备份的数据写入当前物理页的数据区,将相应的RAM地址写入OOB;The backup module 44 is configured to determine that the current physical page is an LSB page, write data of a physical page size to be backed up into a data area of the current physical page, and write the corresponding RAM address into the OOB;
备份确定模块45,用于确认所有数据是否备份完毕,若数据全部备份完毕,则结束此次数据备份;The backup determining module 45 is configured to confirm whether all the data is backed up, and if the data is all backed up, the data backup is ended;
若数据未全部备份,则返回计算单元2。If the data is not all backed up, it returns to calculation unit 2.
进一步地,备份单元4还包括坏块判断模块41,具体用于:Further, the backup unit 4 further includes a bad block determining module 41, specifically for:
首先,判断当前物理页是否为当前物理块的第一页;First, determining whether the current physical page is the first page of the current physical block;
其次,若判断当前物理页为当前物理块的第一页,则读取当前物理页获取坏块标志位;Secondly, if it is determined that the current physical page is the first page of the current physical block, the current physical page is read to obtain the bad block flag bit;
再次,判断当前物理块是否为坏块;若当前物理块非坏块,则通过所述空闲通道进行数据备份;Again, determining whether the current physical block is a bad block; if the current physical block is not a bad block, performing data backup through the idle channel;
最后,若当前物理块为坏块,则寻找下一物理块并重新进行坏块判断;Finally, if the current physical block is a bad block, the next physical block is searched for and the bad block judgment is performed again;
备份模块44具体用于,在判断当前物理页为LSB页时,则将一物理页大小的备份数据写入当前物理页的数据区,将相应的RAM地址写入到OOB中;若判断当前物理页为第一页,则还需将非坏块标记写入OOB中。The backup module 44 is specifically configured to: when determining that the current physical page is an LSB page, write the backup data of a physical page size into the data area of the current physical page, and write the corresponding RAM address into the OOB; The page is the first page, you also need to write non-bad block tags into OOB.
相对于传统基于大电容固态存储系统意外掉电备份方法,智能备份的优势主要体现在以下两点:Compared with the traditional accidental power-down backup method based on large-capacity solid-state storage system, the advantages of intelligent backup are mainly reflected in the following two points:
(1)数据备份时间大大减少。智能备份通过动态通道选择的方式,避免了在某些通道被使用时出现的写入等待的现象,从而提高的备份和速度;同时,智能备份将数据写入编程速度较快的LSB页,进一步提高了备份时的I/O性能;(1) Data backup time is greatly reduced. Intelligent backup uses dynamic channel selection to avoid write waits when certain channels are used, thus improving backup and speed. At the same time, intelligent backup writes data to LSB pages with faster programming speed. Improved I/O performance during backup;
(2)保证了备份过程及备份数据的可靠性。在数据备份过程中,每次写入备份数据前,智能备份会通过当前备份电容的电压值去动态计算得到并行执行写入操作的通道数,避免了备份时可能出现的电容电量不足备份失败的问题;智能备份将所有备份数据全部写入到错误率极低的LSB页中,保证了备份数据的可靠性。(2) Guarantee the reliability of the backup process and backup data. During the data backup process, each time the backup data is written, the smart backup dynamically calculates the number of channels that perform the write operation in parallel through the voltage value of the current backup capacitor, which avoids the capacitor power shortage that may occur during backup. Problem; Smart Backup writes all backup data to the LSB page with very low error rate, ensuring the reliability of the backup data.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. Within the scope.
Claims (10)
- 一种异常断电时固态硬盘数据快速备份的方法,其特征在于,所述方法包括以下步骤: A method for quickly backing up data of a solid state hard disk during abnormal power failure, characterized in that the method comprises the following steps:步骤A,监测是否出现异常断电;Step A, monitoring whether an abnormal power failure occurs;步骤B,若监测到发生异常断电,计算备份电容的释放能量是否满足数据备份的需求;Step B: If an abnormal power failure is detected, calculate whether the release energy of the backup capacitor satisfies the requirement of data backup;步骤C,若判断备份电容的释放能量能够满足数据备份需求,确定一空闲通道,以所述空闲通道为数据备份的写入通道;Step C: If it is determined that the release energy of the backup capacitor can meet the data backup requirement, determine an idle channel, and use the idle channel as a write channel for data backup;步骤D,通过所述空闲通道进行数据备份。In step D, data backup is performed through the idle channel.
- 如权利要求1所述的方法,其特征在于,步骤B具体包括:The method of claim 1 wherein step B comprises:步骤B1,通过备份电容的电压和电容值计算备份电容的释放能量;Step B1, calculating a release energy of the backup capacitor by using a voltage and a capacitance value of the backup capacitor;步骤B2,比较备份电容的释放能量与备份所有数据所需的备份能量;Step B2, comparing the release energy of the backup capacitor with the backup energy required to back up all the data;步骤B3,若所述释放能量小于所述备份能量,则结束此次备份,并发送一结束信号至系统;Step B3, if the release energy is less than the backup energy, ending the backup and sending an end signal to the system;步骤B4,若所述释放能量大于所述备份能量,则执行步骤C。 In step B4, if the release energy is greater than the backup energy, step C is performed.
- 如权利要求1所述的方法,其特征在于,步骤C具体包括:The method of claim 1 wherein step C comprises:步骤C1,根据所述释放能量计算同时能进行数据备份的通道数量,根据通道数量获取对应的通道; Step C1: Calculate the number of channels that can simultaneously perform data backup according to the release energy, and obtain a corresponding channel according to the number of channels;步骤C2,检测所获取的通道的当前状态; Step C2, detecting a current state of the acquired channel;步骤C3,根据步骤C2的检测结果选取一空闲通道;以所述空闲通道作为此次数据备份的写入通道。In step C3, an idle channel is selected according to the detection result of step C2; and the idle channel is used as a write channel for the data backup.
- 如权利要求1所述的方法,其特征在于,步骤D具体包括:The method of claim 1 wherein step D comprises:步骤D1,判断选取的空闲通道中待写入数据的当前物理页是否为LSB页;Step D1: determining whether the current physical page of the data to be written in the selected idle channel is an LSB page;步骤D2,若判断当前物理页非LSB页,则向下查找直至查找到一LSB页;In step D2, if it is determined that the current physical page is not an LSB page, the search is performed until an LSB page is found;步骤D3,若判断当前物理页为LSB页,则将一物理页大小的需备份的数据写入当前物理页的数据区,将相应的RAM地址写入OOB;Step D3, if it is determined that the current physical page is an LSB page, the data to be backed up by a physical page size is written into the data area of the current physical page, and the corresponding RAM address is written into the OOB;步骤D4,确认所有数据是否备份完毕,若数据全部备份完毕,则结束此次数据备份;In step D4, it is confirmed whether all the data is backed up, and if all the data is backed up, the data backup is ended;若数据未全部备份,则返回步骤C。If the data is not all backed up, return to step C.
- 如权利要求4所述的方法,其特征在于,步骤D中,在进行数据备份前还包括进行坏块判断;The method according to claim 4, wherein in step D, performing bad data determination before performing data backup;进行坏块判断的具体步骤包括:The specific steps for bad block judgment include:步骤E1,判断当前物理页是否为当前物理块的第一页;Step E1: determining whether the current physical page is the first page of the current physical block;步骤E2,若判断当前物理页为当前物理块的第一页,则读取当前物理页获取坏块标志位;Step E2: If it is determined that the current physical page is the first page of the current physical block, reading the current physical page to obtain the bad block flag bit;步骤E3,根据坏块标志位获取的坏块标记判断当前物理块是否为坏块;若当前物理块非坏块,则通过所述空闲通道进行数据备份;Step E3: determining, according to the bad block flag obtained by the bad block flag, whether the current physical block is a bad block; if the current physical block is not a bad block, performing data backup through the idle channel;步骤E4,若当前物理块为坏块,则寻找下一物理块并返回步骤E3;Step E4, if the current physical block is a bad block, then look for the next physical block and return to step E3;在步骤D3具体包括: 若当前物理页为LSB页,则将一物理页大小的备份数据写入当前物理页的数据区,将相应的RAM地址写入到OOB中;若当前物理页为第一页,则将非坏块标记写入OOB中。Specifically, in step D3, the following includes: If the current physical page is an LSB page, the backup data of a physical page size is written into the data area of the current physical page, and the corresponding RAM address is written into the OOB; if the current physical page is the first page, it will be non-bad. The block tag is written to the OOB.
- 一种异常断电时固态硬盘数据快速备份的系统,其特征在于,所述系统包括:A system for quickly backing up data of a solid state hard disk during abnormal power failure, characterized in that the system comprises:检测单元,用于监测是否出现异常断电情况;a detecting unit for monitoring whether an abnormal power failure occurs;计算单元,用于监测到发生异常断电,计算备份电容的释放能量是否满足数据备份的需求;The calculation unit is configured to monitor whether an abnormal power failure occurs, and calculate whether the release energy of the backup capacitor satisfies the requirement of data backup;通道选取单元,用于在判断备份电容的释放能量能够满足数据备份需求,确定一空闲通道,以所述空闲通道为数据备份的写入通道;The channel selection unit is configured to determine a free channel when the release energy of the backup capacitor can meet the data backup requirement, and use the idle channel as the data backup backup channel;备份单元,用于通过所述空闲通道进行数据备份。a backup unit, configured to perform data backup through the idle channel.
- 如权利要求6所述的系统,其特征在于,所述计算单元包括:The system of claim 6 wherein said computing unit comprises:第一计算模块,用于通过备份电容的电压和电容值计算备份电容的释放能量;a first calculating module, configured to calculate a release energy of the backup capacitor by using a voltage and a capacitance value of the backup capacitor;比较模块,用于比较备份电容的释放能量与备份所有数据所需的备份能量;Comparison module for comparing the release energy of the backup capacitor with the backup energy required to back up all data;能量判断模块,用于在所述释放能量小于所述备份能量时,结束此次备份,并发送一结束信号至系统;还用于在所述释放能量大于所述备份能量时,则生成一通道选择指令至所述通道选取单元。An energy judging module, configured to end the backup when the release energy is less than the backup energy, and send an end signal to the system; and configured to generate a channel when the release energy is greater than the backup energy Select an instruction to the channel selection unit.
- 如权利要求6所述的系统,其特征在于,所述通道选取单元包括:The system of claim 6 wherein said channel selection unit comprises:第二计算模块,用于根据所述释放能量计算同时能进行数据备份的通道数量,根据通道数量获取对应的通道;a second calculating module, configured to calculate, according to the release energy, a number of channels that can simultaneously perform data backup, and obtain a corresponding channel according to the number of channels;状态检测模块,用于检测所获取的通道的当前状态;a state detecting module, configured to detect a current state of the acquired channel;通道选取模块,用于根据状态检测模块的检测结果选取一空闲通道;以所述空闲通道作为此次数据备份的写入通道。The channel selection module is configured to select an idle channel according to the detection result of the state detection module; and use the idle channel as the write channel of the data backup.
- 如权利要求6所述的系统,其特征在于,备份单元包括:The system of claim 6 wherein the backup unit comprises:页面确定模块,用于判断选取的空闲通道中待写入数据的当前物理页是否为LSB页;a page determining module, configured to determine whether the current physical page of the data to be written in the selected idle channel is an LSB page;页面查找模块,用于在判断当前物理页非LSB页时,则向下查找直至查找到一LSB页;The page search module is configured to search down until an LSB page is found when determining that the current physical page is not an LSB page;备份模块,用于在判断当前物理页为LSB页,将一物理页大小的需备份的数据写入当前物理页的数据区,将相应的RAM地址写入OOB;The backup module is configured to determine that the current physical page is an LSB page, write data of a physical page size to be backed up into a data area of the current physical page, and write the corresponding RAM address into the OOB;备份确定模块,用于确认所有数据是否备份完毕,若数据全部备份完毕,则结束此次数据备份;The backup determination module is configured to confirm whether all the data is backed up, and if the data is completely backed up, the data backup is ended;若数据未全部备份,则返回计算单元。If the data is not fully backed up, return to the calculation unit.
- 如权利要求9所述的系统,其特征在于,所述备份单元还包括坏块判断模块,所述坏块判断模块具体用于:The system of claim 9, wherein the backup unit further comprises a bad block determination module, and the bad block determination module is specifically configured to:首先,判断当前物理页是否为当前物理块的第一页;First, determining whether the current physical page is the first page of the current physical block;其次,若判断当前物理页为当前物理块的第一页,则读取当前物理页获取坏块标志位;Secondly, if it is determined that the current physical page is the first page of the current physical block, the current physical page is read to obtain the bad block flag bit;再次,判断当前物理块是否为坏块;若当前物理块非坏块,则通过所述空闲通道进行数据备份;Again, determining whether the current physical block is a bad block; if the current physical block is not a bad block, performing data backup through the idle channel;最后,若当前物理块为坏块,则寻找下一物理块并重新进行坏块判断;Finally, if the current physical block is a bad block, the next physical block is searched for and the bad block judgment is performed again;所述备份模块具体用于,在判断当前物理页为LSB页时,则将一物理页大小的备份数据写入当前物理页的数据区,将相应的RAM地址写入到OOB中;若当前物理页为第一页,则将非坏块标记写入OOB中。The backup module is specifically configured to: when determining that the current physical page is an LSB page, write the backup data of a physical page size into the data area of the current physical page, and write the corresponding RAM address into the OOB; The page is the first page, and the non-bad block flag is written into OOB.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2015/088675 WO2017035759A1 (en) | 2015-08-31 | 2015-08-31 | Method and system of rapid data backup on a solid state drive upon abnormal power off |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2015/088675 WO2017035759A1 (en) | 2015-08-31 | 2015-08-31 | Method and system of rapid data backup on a solid state drive upon abnormal power off |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017035759A1 true WO2017035759A1 (en) | 2017-03-09 |
Family
ID=58186559
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/088675 WO2017035759A1 (en) | 2015-08-31 | 2015-08-31 | Method and system of rapid data backup on a solid state drive upon abnormal power off |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2017035759A1 (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108664210A (en) * | 2017-03-31 | 2018-10-16 | 北京忆恒创源科技有限公司 | A kind of method and control system, solid storage device of I/O command control |
CN110673998A (en) * | 2019-09-20 | 2020-01-10 | 济南浪潮数据技术有限公司 | Method, device and equipment for positioning SSD (solid State disk) disk-dropping reason |
CN112711381A (en) * | 2020-12-28 | 2021-04-27 | 深圳市合信自动化技术有限公司 | Method for accelerating power failure data storage and PLC |
CN113760333A (en) * | 2021-09-16 | 2021-12-07 | 海宁奕斯伟集成电路设计有限公司 | Software upgrading method and device, electronic equipment and computer readable storage medium |
CN115878033A (en) * | 2022-11-30 | 2023-03-31 | 合肥腾芯微电子有限公司 | Solid state disk and mapping table management method thereof |
CN118567574A (en) * | 2024-07-26 | 2024-08-30 | 成都佰维存储科技有限公司 | SSD power-off reconstruction method and device electronic device and medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949197A (en) * | 2006-11-23 | 2007-04-18 | 北京飞天诚信科技有限公司 | Portable equipment based on non-volatile memory and method of realizing power failure protection |
CN102073561A (en) * | 2011-01-26 | 2011-05-25 | 浪潮电子信息产业股份有限公司 | Method for correcting error of write operation of solid state hard disk |
US20130019076A1 (en) * | 2007-06-01 | 2013-01-17 | Netlist, Inc. | Redundant backup using non-volatile memory |
US20130229880A1 (en) * | 2012-01-12 | 2013-09-05 | Agiga Tech Inc. | Apparatus and method to manage energy capacity of a backup power supply |
CN103324578A (en) * | 2013-06-20 | 2013-09-25 | 深圳市瑞耐斯技术有限公司 | NAND flash memory device and random writing method thereof |
CN104657290A (en) * | 2015-02-09 | 2015-05-27 | 浪潮电子信息产业股份有限公司 | Data protection device and data protection method for RAID (Redundant Array of Inexpensive Disks) card |
CN105138432A (en) * | 2015-08-31 | 2015-12-09 | 深圳市瑞耐斯技术有限公司 | Solid state disk data fast backup method and system used under abnormal power failure |
-
2015
- 2015-08-31 WO PCT/CN2015/088675 patent/WO2017035759A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949197A (en) * | 2006-11-23 | 2007-04-18 | 北京飞天诚信科技有限公司 | Portable equipment based on non-volatile memory and method of realizing power failure protection |
US20130019076A1 (en) * | 2007-06-01 | 2013-01-17 | Netlist, Inc. | Redundant backup using non-volatile memory |
CN102073561A (en) * | 2011-01-26 | 2011-05-25 | 浪潮电子信息产业股份有限公司 | Method for correcting error of write operation of solid state hard disk |
US20130229880A1 (en) * | 2012-01-12 | 2013-09-05 | Agiga Tech Inc. | Apparatus and method to manage energy capacity of a backup power supply |
CN103324578A (en) * | 2013-06-20 | 2013-09-25 | 深圳市瑞耐斯技术有限公司 | NAND flash memory device and random writing method thereof |
CN104657290A (en) * | 2015-02-09 | 2015-05-27 | 浪潮电子信息产业股份有限公司 | Data protection device and data protection method for RAID (Redundant Array of Inexpensive Disks) card |
CN105138432A (en) * | 2015-08-31 | 2015-12-09 | 深圳市瑞耐斯技术有限公司 | Solid state disk data fast backup method and system used under abnormal power failure |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108664210A (en) * | 2017-03-31 | 2018-10-16 | 北京忆恒创源科技有限公司 | A kind of method and control system, solid storage device of I/O command control |
CN108664210B (en) * | 2017-03-31 | 2024-04-05 | 北京忆恒创源科技股份有限公司 | IO command control method, IO command control system and solid-state storage device |
CN110673998A (en) * | 2019-09-20 | 2020-01-10 | 济南浪潮数据技术有限公司 | Method, device and equipment for positioning SSD (solid State disk) disk-dropping reason |
CN112711381A (en) * | 2020-12-28 | 2021-04-27 | 深圳市合信自动化技术有限公司 | Method for accelerating power failure data storage and PLC |
CN113760333A (en) * | 2021-09-16 | 2021-12-07 | 海宁奕斯伟集成电路设计有限公司 | Software upgrading method and device, electronic equipment and computer readable storage medium |
CN115878033A (en) * | 2022-11-30 | 2023-03-31 | 合肥腾芯微电子有限公司 | Solid state disk and mapping table management method thereof |
CN115878033B (en) * | 2022-11-30 | 2023-09-15 | 合肥腾芯微电子有限公司 | Solid state disk and mapping table management method thereof |
CN118567574A (en) * | 2024-07-26 | 2024-08-30 | 成都佰维存储科技有限公司 | SSD power-off reconstruction method and device electronic device and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017035759A1 (en) | Method and system of rapid data backup on a solid state drive upon abnormal power off | |
CN105138432B (en) | The method and system of solid state hard disk fast data backup when a kind of abnormal power-down | |
US20220139455A1 (en) | Solid state drive architectures | |
TWI632457B (en) | Method of wear leveling for data storage device | |
US10289323B2 (en) | Handling thermal shutdown for memory devices | |
US8880775B2 (en) | System and method of garbage collection in a memory device | |
US9720616B2 (en) | Data-retention controller/driver for stand-alone or hosted card reader, solid-state-drive (SSD), or super-enhanced-endurance SSD (SEED) | |
US8478930B1 (en) | Solid state drive power safe wear-leveling | |
US9389952B2 (en) | Green NAND SSD application and driver | |
US20190369892A1 (en) | Method and Apparatus for Facilitating a Trim Process Using Auxiliary Tables | |
US20150331624A1 (en) | Host-controlled flash translation layer snapshot | |
WO2016069188A1 (en) | Processing of un-map commands to enhance performance and endurance of a storage device | |
US20160179403A1 (en) | Storage controller, storage device, storage system, and semiconductor storage device | |
WO2016069192A1 (en) | Tracking intermix of writes and un-map commands across power cycles | |
Guo et al. | Low cost power failure protection for MLC NAND flash storage systems with PRAM/DRAM hybrid buffer | |
JP2010211734A (en) | Storage device using nonvolatile memory | |
TWI823504B (en) | Non-transitory computer-readable medium, storage device and storage method | |
KR20110024832A (en) | Solid state storage system with improved data merging efficiency and method of controlling the same | |
TWI817638B (en) | Conditional update, delayed lookup | |
CN105404468B (en) | Green and non-solid state disk applications and drives therefor | |
JP5649709B2 (en) | MEMORY SYSTEM, NONVOLATILE MEMORY DEVICE, NONVOLATILE MEMORY DEVICE CONTROL METHOD AND PROGRAM | |
US11797228B2 (en) | Efficient handling of background operations for improving sustained performance of host reads and writes | |
CN115756297A (en) | Method and system for preventing reading error and data storage device | |
KR20170048114A (en) | Storage device and method for performing a write operation by storage device | |
TWI850721B (en) | In-memory journal |
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: 15902566 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: 15902566 Country of ref document: EP Kind code of ref document: A1 |