CN106294026A - Mapping table restoration methods after a kind of solid-state disk powered-off fault and system thereof - Google Patents
Mapping table restoration methods after a kind of solid-state disk powered-off fault and system thereof Download PDFInfo
- Publication number
- CN106294026A CN106294026A CN201610694744.7A CN201610694744A CN106294026A CN 106294026 A CN106294026 A CN 106294026A CN 201610694744 A CN201610694744 A CN 201610694744A CN 106294026 A CN106294026 A CN 106294026A
- Authority
- CN
- China
- Prior art keywords
- page
- odd
- snapshot fragment
- flash memory
- mapping table
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
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
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup 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
本发明公开了一种固态盘异常掉电后的映射表恢复方法及其系统,将快照片段页按照存储的逻辑页修改数据的页码奇偶性分为奇数快照片段页和偶数快照片段页并分别存储于闪存内的奇数通道与偶数通道内;当固态盘进行掉电恢复时,从闪存内读取异常掉电时存储的映射信息及闪存在异常掉电之前最后一次存储的映射表;映射信息包括最后一次存储的映射表的位置信息及在最后一次存储的映射表开始刷写至闪存的时刻之后存入闪存的快照片段页的起止地址;N个CPU根据起止地址分别读取并依据奇数快照片段页以及偶数快照片段页对最后一次存储的映射表进行更新操作,N为偶数。本发明能够增强掉电恢复时的并行处理程度,进而缩短掉电恢复的时间。
The invention discloses a method and system for restoring a mapping table after abnormal power failure of a solid-state disk. Snapshot fragment pages are divided into odd-numbered snapshot fragment pages and even-numbered snapshot fragment pages according to the page number parity of stored logical pages and modified data, and are stored separately. In the odd channel and the even channel in the flash memory; when the solid state disk recovers from power failure, read the mapping information stored in the abnormal power failure and the mapping table last stored in the flash memory before the abnormal power failure; the mapping information includes The location information of the last stored mapping table and the start and end addresses of the snapshot segment pages stored in the flash memory after the last stored mapping table starts to be written to the flash memory; Pages and even-numbered snapshot fragment pages update the last stored mapping table, and N is an even number. The invention can enhance the degree of parallel processing during power-off recovery, thereby shortening the power-off recovery time.
Description
技术领域technical field
本发明涉及快照技术领域,特别是涉及一种固态盘异常掉电后的映射表恢复方法及其系统。The invention relates to the technical field of snapshots, in particular to a method and system for restoring a mapping table after a solid state disk is powered off abnormally.
背景技术Background technique
随着NAND闪存工艺的进步,固态盘(固态盘内包括多个闪存芯片)容量越来越大,固态盘的元数据,尤其是映射表也越来越大,为避免由于固态盘异常掉电而导致映射表失去许多重要数据,目前普遍采用增加电容延长掉电时间,同时使用快照技术将存有更改的映射信息的快照片段保存到闪存上的方法。With the advancement of NAND flash memory technology, the capacity of solid-state disks (including multiple flash memory chips in solid-state disks) is getting larger and larger, and the metadata of solid-state disks, especially the mapping table, is also getting larger and larger. As a result, the mapping table loses a lot of important data. At present, it is generally used to increase the capacitor to prolong the power-down time, and at the same time use the snapshot technology to save the snapshot segment with the changed mapping information to the flash memory.
其中,快照技术是指对逻辑页到物理页的映射表信息做快照。固态盘的正常工作流程为:当内存接收到更新的映射信息后,根据该映射信息生成快照片段存储于快照片段页(物理页)中,并更新内存中的映射表内容;当快照片段页容量满时,将这个快照片段页刷写入闪存中,当刷写入闪存内的快照片段页的数量达到预设阈值后,将内存中的映射表刷写入闪存内。Wherein, the snapshot technology refers to taking a snapshot of information in a mapping table from a logical page to a physical page. The normal working process of the solid-state disk is: when the memory receives the updated mapping information, generate a snapshot segment based on the mapping information and store it in the snapshot segment page (physical page), and update the mapping table content in the memory; when the snapshot segment page capacity When it is full, the snapshot segment page is flushed into the flash memory, and when the number of snapshot segment pages flushed into the flash memory reaches a preset threshold, the mapping table in the memory is flushed into the flash memory.
但是,目前在对映射表进行掉电恢复时,往往由于待恢复的数据较多而导致恢复时间较长的问题出现,可靠性较低。However, at present, when the power-off recovery is performed on the mapping table, the problem of long recovery time often occurs due to the large amount of data to be recovered, and the reliability is low.
因此,如何提供一种掉电恢复时间短的固态盘异常掉电后的映射表恢复方法及其系统是本领域技术人员目前需要解决的问题。Therefore, how to provide a method and system for restoring a mapping table after an abnormal power failure of a solid state disk with a short power failure recovery time is a problem to be solved by those skilled in the art at present.
发明内容Contents of the invention
本发明的目的是提供一种固态盘异常掉电后的映射表恢复方法及其系统,能够增强掉电恢复时的并行处理程度,进而缩短掉电恢复的时间,提高固态盘的可靠性。The object of the present invention is to provide a method and system for restoring a mapping table after an abnormal power failure of a solid state disk, which can enhance the degree of parallel processing during power failure recovery, shorten the power failure recovery time, and improve the reliability of the solid state disk.
为解决上述技术问题,本发明提供了一种固态盘异常掉电后的映射表恢复方法,所述固态盘的闪存内包括用于存储奇数快照片段页的奇数通道以及用于存储偶数快照片段页的偶数通道,所述奇数快照片段页内存有奇数逻辑页修改数据,所述偶数快照片段页内存有偶数逻辑页修改数据;所述方法包括:In order to solve the above-mentioned technical problems, the present invention provides a method for restoring a mapping table after an abnormal power failure of a solid-state disk. The flash memory of the solid-state disk includes odd-numbered channels for storing odd-numbered snapshot fragment pages and for storing The even-numbered channels, the odd-numbered snapshot fragment pages have odd-numbered logical page modification data in memory, and the even-numbered snapshot fragment pages have even-numbered logical page modification data in memory; the method includes:
当所述固态盘进行掉电恢复时,从所述闪存内读取异常掉电时存储的映射信息以及所述闪存在异常掉电之前最后一次存储的映射表;其中,所述映射信息包括所述最后一次存储的映射表的位置信息以及在所述最后一次存储的映射表开始刷写至所述闪存的时刻之后存入所述闪存的快照片段页的起止地址;When the solid state disk recovers from power failure, read the mapping information stored during abnormal power failure and the mapping table last stored in the flash memory before abnormal power failure from the flash memory; wherein, the mapping information includes the The location information of the last stored mapping table and the start and end addresses of the snapshot segment pages stored in the flash memory after the moment when the last stored mapping table starts to be written to the flash memory;
N个CPU根据所述起止地址分别读取奇数快照片段页以及偶数快照片段页;并根据读取得到的奇数快照片段页以及偶数快照片段页对所述最后一次存储的映射表进行更新操作,N为偶数。N CPUs respectively read odd-numbered snapshot fragment pages and even-numbered snapshot fragment pages according to the start and end addresses; and update the last stored mapping table according to the read odd-numbered snapshot fragment pages and even-numbered snapshot fragment pages, N is an even number.
优选地,所述根据读取得到的所述奇数快照片段页以及所述偶数快照片段页对所述最后一次存储的映射表进行更新操作的过程具体为:Preferably, the process of updating the last stored mapping table according to the odd-numbered snapshot fragment pages and the even-numbered snapshot fragment pages obtained by reading is specifically:
按照存入所述闪存的时间由晚至早的顺序读取相应通道内的快照片段页;Read the snapshot fragment pages in the corresponding channel in the order of the time stored in the flash memory from late to early;
判断当前读取的快照片段页中对应的逻辑页数据在此次更新过程中是否已进行过修改,若是,忽略此次对所述逻辑页数据的修改,若否,按照所述当前读取的快照片段页对所述逻辑页数据进行修改。Determine whether the corresponding logical page data in the currently read snapshot fragment page has been modified during this update process, if so, ignore the modification of the logical page data this time, if not, follow the currently read The snapshot segment page modifies the logical page data.
优选地,所述奇数快照片段页存入所述奇数通道以及所述偶数快照片段页存入所述偶数通道的过程具体为:Preferably, the process of storing the odd-numbered snapshot fragment page into the odd-numbered channel and the even-numbered snapshot fragment page into the even-numbered channel is specifically:
当接收逻辑页修改数据后,若所述逻辑页修改数据的页码为奇数,将所述逻辑页修改数据作为奇数逻辑页修改数据,并生成相应的奇数快照片段;若所述逻辑页修改数据的页码为偶数,将所述逻辑页修改数据作为偶数逻辑页修改数据,并生成相应的偶数快照片段;After receiving the logical page modification data, if the page number of the logical page modification data is an odd number, use the logical page modification data as the odd logical page modification data, and generate a corresponding odd snapshot segment; if the logical page modification data The page number is an even number, using the logical page modification data as the even logical page modification data, and generating corresponding even snapshot fragments;
将生成的所述奇数快照片段或所述偶数快照片段分别存储至对应的物理页内;storing the generated odd-numbered snapshot fragments or the even-numbered snapshot fragments in corresponding physical pages;
当存储所述所述奇数快照片段的物理页存满后,将所述物理页作为奇数快照片段页刷写至所述闪存内的一个奇数通道内;When the physical page storing the odd-numbered snapshot fragments is full, write the physical page as an odd-numbered snapshot fragment page into an odd-numbered channel in the flash memory;
当存储所述所述偶数快照片段的物理页存满后,将所述物理页作为偶数快照片段页刷写至所述闪存内的一个偶数通道内;When the physical page storing the even-numbered snapshot fragments is full, write the physical page as an even-numbered snapshot fragment page into an even-numbered channel in the flash memory;
当所述固态盘出现异常掉电时,将当前尚未刷写至所述闪存的奇数快照片段页以及偶数快照片段页分别刷写至对应的奇数通道和偶数通道内。When the solid-state disk is abnormally powered off, the odd-numbered snapshot segment pages and the even-numbered snapshot segment pages that have not yet been written to the flash memory are written into corresponding odd-numbered channels and even-numbered channels respectively.
优选地,所述从所述闪存内读取异常掉电时存储的映射信息的过程具体为:Preferably, the process of reading the mapping information stored during abnormal power failure from the flash memory is specifically:
从所述闪存内读取元数据信息;read metadata information from the flash memory;
获取所述元数据信息内记录的异常掉电时的所述映射信息。Acquiring the mapping information recorded in the metadata information during abnormal power failure.
优选地,所述奇数通道与所述偶数通道均为2个。Preferably, there are two odd-numbered channels and two even-numbered channels.
优选地,N为2,一个所述CPU根据所述起止地址读取奇数快照片段页,并根据读取得到的奇数快照片段页对所述最后一次存储的映射表进行更新操作;另一个所述CPU根据所述起止地址读取偶数快照片段页,并根据读取得到的偶数快照片段页对所述最后一次存储的映射表进行更新操作。Preferably, N is 2, and one of the CPUs reads odd-numbered snapshot fragment pages according to the start and end addresses, and performs an update operation on the last stored mapping table according to the read odd-numbered snapshot fragment pages; The CPU reads even-numbered snapshot fragment pages according to the start and end addresses, and performs an update operation on the last stored mapping table according to the read even-numbered snapshot fragment pages.
为解决上述技术问题,本发明还提供了一种固态盘异常掉电后的映射表恢复系统,所述固态盘的闪存内包括用于存储奇数快照片段页的奇数通道以及用于存储偶数快照片段页的偶数通道,所述奇数快照片段页内存有奇数逻辑页修改数据,所述偶数快照片段页内存有偶数逻辑页修改数据;所述系统包括:In order to solve the above-mentioned technical problems, the present invention also provides a system for recovering the mapping table after abnormal power failure of the solid-state disk. For the even channel of the page, the odd logical page modification data is stored in the odd snapshot segment page, and the even logical page modification data is stored in the even snapshot segment page; the system includes:
读取模块,用于当所述固态盘进行掉电恢复时,从所述闪存内读取异常掉电时存储的映射信息以及所述闪存在异常掉电之前最后一次存储的映射表;其中,所述映射信息包括所述最后一次存储的映射表的位置信息以及在所述最后一次存储的映射表开始刷写至所述闪存的时刻之后存入所述闪存的快照片段页的起止地址;The reading module is used to read the mapping information stored during abnormal power failure and the mapping table last stored by the flash memory before the abnormal power failure from the flash memory when the solid state disk is recovering from power failure; wherein, The mapping information includes the location information of the last stored mapping table and the start and end addresses of the snapshot segment pages stored in the flash memory after the moment when the last stored mapping table starts to be written to the flash memory;
N个CPU,用于根据所述起止地址分别读取奇数快照片段页以及偶数快照片段页;并根据读取得到的奇数快照片段页以及偶数快照片段页对所述最后一次存储的映射表进行更新操作,N为偶数。N CPUs are used to respectively read the odd-numbered snapshot fragment pages and the even-numbered snapshot fragment pages according to the start and end addresses; and update the last stored mapping table according to the read odd-numbered snapshot fragment pages and even-numbered snapshot fragment pages operation, N is an even number.
本发明提供了一种固态盘异常掉电后的映射表恢复方法及其系统,将快照片段页分为奇数快照片段页以及偶数快照片段页,分别存储奇数逻辑页修改数据以及偶数逻辑页修改数据;且奇数快照片段页以及偶数快照片段页分别存储于闪存内的奇数通道以及偶数通道内;当固态盘进行掉电恢复时,可以采用多个CPU来分别读取奇数快照片段页以及偶数快照片段页并对映射表进行更新。可见,本发明通过奇偶分离的方式增强了掉电恢复时的并行处理程度,进而缩短了掉电恢复的时间,提高了固态盘的可靠性。The invention provides a method and system for restoring a mapping table after an abnormal power failure of a solid-state disk. The snapshot segment pages are divided into odd-numbered snapshot segment pages and even-numbered snapshot segment pages, and respectively store odd-numbered logical page modification data and even-numbered logical page modification data. ; and the odd-numbered snapshot segment pages and the even-numbered snapshot segment pages are stored in the odd-numbered channels and the even-numbered channels of the flash memory respectively; when the solid state disk recovers from power failure, multiple CPUs can be used to read the odd-numbered snapshot segment pages and the even-numbered snapshot segments respectively page and update the mapping table. It can be seen that the present invention enhances the degree of parallel processing during power-off recovery by means of parity separation, thereby shortening the power-off recovery time and improving the reliability of the solid-state disk.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对现有技术和实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the prior art and the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本发明提供的一种固态盘异常掉电后的映射表恢复方法的过程的流程图;Fig. 1 is the flow chart of the process of the mapping table recovery method after a kind of solid-state disk abnormal power failure provided by the present invention;
图2为本发明提供的一种固态盘异常掉电后的映射表恢复系统的结构示意图。FIG. 2 is a schematic structural diagram of a system for restoring a mapping table after an abnormal power failure of a solid state disk provided by the present invention.
具体实施方式detailed description
本发明的核心是提供一种固态盘异常掉电后的映射表恢复方法及其系统,能够增强掉电恢复时的并行处理程度,进而缩短掉电恢复的时间,提高固态盘的可靠性。The core of the present invention is to provide a method and system for restoring a mapping table after an abnormal power failure of a solid-state disk, which can enhance the degree of parallel processing during power-failure recovery, further shorten the time for power-failure recovery, and improve the reliability of the solid-state disk.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本发明提供了一种固态盘异常掉电后的映射表恢复方法,固态盘的闪存内包括用于存储奇数快照片段页的奇数通道以及用于存储偶数快照片段页的偶数通道,奇数快照片段页内存有奇数逻辑页修改数据,偶数快照片段页内存有偶数逻辑页修改数据;参见图1所示,图1为本发明提供的一种固态盘异常掉电后的映射表恢复方法的过程的流程图;该方法包括:The invention provides a method for restoring a mapping table after an abnormal power failure of a solid-state disk. The flash memory of the solid-state disk includes odd-numbered channels for storing odd-numbered snapshot fragment pages and even-numbered channels for storing even-numbered snapshot fragment pages, and odd-numbered snapshot fragment pages. There are odd logical page modification data in the internal memory, and even logical page modification data in the even snapshot fragment page memory; see Figure 1, which is a flow chart of the process of a method for restoring the mapping table after an abnormal power failure of a solid state disk provided by the present invention Figure; the method includes:
步骤s101:当固态盘进行掉电恢复时,从闪存内读取异常掉电时存储的映射信息以及闪存在异常掉电之前最后一次存储的映射表;其中,映射信息包括最后一次存储的映射表的位置信息以及在最后一次存储的映射表开始刷写至闪存的时刻之后存入闪存的快照片段页的起止地址;Step s101: When the solid state disk is recovering from power failure, read the mapping information stored during abnormal power failure and the last stored mapping table before the abnormal power failure from the flash memory; wherein, the mapping information includes the last stored mapping table location information and the start and end addresses of the snapshot segment pages stored in the flash memory after the last time the stored mapping table starts to be written to the flash memory;
步骤s102:N个CPU根据起止地址分别读取奇数快照片段页以及偶数快照片段页;并根据读取得到的奇数快照片段页以及偶数快照片段页对最后一次存储的映射表进行更新操作,N为偶数。Step s102: N CPUs respectively read odd-numbered snapshot fragment pages and even-numbered snapshot fragment pages according to the start and end addresses; and update the last stored mapping table according to the read odd-numbered snapshot fragment pages and even-numbered snapshot fragment pages, where N is even.
需要注意的是,偶数个CPU分别读取奇数通道以及偶数通道内的快照片段页。It should be noted that even CPUs read snapshot fragment pages in odd channels and even channels respectively.
可以理解的是,在快照技术中,当刷写入闪存内的快照片段页的数量达到预设阈值后,会将内存中的映射表刷写入闪存内,而此时若出现异常掉电情况,很大可能此时刷写入闪存内的快照片段页数量未达到预设阈值(例如每刷写20页存一次映射表,但异常断电时可能只存了10页快照片段页),这种情况下,闪存内存储的是上一次的映射表,而与这10页快照片段页内信息对应的映射表尚未存入闪存而是仍然位于内存内,掉电后则丢失,需要在上电后根据这10页快照片段页对映射表进行更新。故为避免无用操作,在异常掉电时需要记录这部分数量未达到预设阈值的快照片段页的起止地址,供恢复时根据该起止地址找出这部分快照片段页。It is understandable that in the snapshot technology, when the number of snapshot fragment pages flushed into the flash memory reaches the preset threshold, the mapping table in the memory will be flushed into the flash memory, and if an abnormal power failure occurs at this time , it is very likely that the number of snapshot fragment pages flashed into the flash memory at this time does not reach the preset threshold (for example, the mapping table is saved every 20 pages are flushed, but only 10 snapshot fragment pages may be stored when the power is abnormally cut off), which means In this case, the last mapping table is stored in the flash memory, and the mapping table corresponding to the information in the 10 pages of snapshot fragments has not been stored in the flash memory but is still in the memory, and will be lost after power-off. Afterwards, the mapping table is updated according to the 10 snapshot fragment pages. Therefore, in order to avoid useless operations, it is necessary to record the start and end addresses of the snapshot segment pages whose number does not reach the preset threshold during abnormal power failure, so as to find these snapshot segment pages according to the start and end addresses during recovery.
作为优选地,根据读取得到的奇数快照片段页以及偶数快照片段页对最后一次存储的映射表进行更新操作的过程具体为:Preferably, the process of updating the last stored mapping table according to the read odd-numbered snapshot fragment pages and even-numbered snapshot fragment pages is specifically as follows:
按照存入闪存的时间由晚至早的顺序读取相应通道内的快照片段页;Read the snapshot fragment pages in the corresponding channel in the order of the time stored in the flash memory from the latest to the earliest;
判断当前读取的快照片段页中对应的逻辑页数据在此次更新过程中是否已进行过修改,若是,忽略此次对逻辑页数据的修改,若否,按照当前读取的快照片段页对逻辑页数据进行修改。Determine whether the corresponding logical page data in the currently read snapshot fragment page has been modified during this update process, if so, ignore the modification of the logical page data this time, if not, follow the currently read snapshot fragment page to Logical page data is modified.
可以理解的是,采用上述操作,可以尽可能减少不必要的修改写操作,缩短上电后映射表的恢复时间,提高固态盘的可靠性。It can be understood that, by adopting the above operations, unnecessary modification and writing operations can be reduced as much as possible, the recovery time of the mapping table after power-on can be shortened, and the reliability of the solid-state disk can be improved.
具体的,奇数快照片段页存入奇数通道以及偶数快照片段页存入偶数通道的过程具体为:Specifically, the process of storing odd-numbered snapshot fragment pages into odd-numbered channels and even-numbered snapshot fragment pages into even-numbered channels is as follows:
当接收逻辑页修改数据后,若逻辑页修改数据的页码为奇数,将逻辑页修改数据作为奇数逻辑页修改数据,并生成相应的奇数快照片段;若逻辑页修改数据的页码为偶数,将逻辑页修改数据作为偶数逻辑页修改数据,并生成相应的偶数快照片段;After receiving the logical page modification data, if the page number of the logical page modification data is odd, treat the logical page modification data as odd logical page modification data, and generate corresponding odd snapshot fragments; if the page number of the logical page modification data is even, convert the logical page modification data to Page modification data is used as even logical page modification data, and corresponding even snapshot fragments are generated;
将生成的奇数快照片段或偶数快照片段分别存储至对应的物理页内;Store the generated odd-numbered snapshot fragments or even-numbered snapshot fragments in corresponding physical pages respectively;
当存储奇数快照片段的物理页存满后,将物理页作为奇数快照片段页刷写至闪存内的一个奇数通道内;When the physical page storing the odd-numbered snapshot fragments is full, the physical page is written to an odd-numbered channel in the flash memory as an odd-numbered snapshot fragment page;
当存储偶数快照片段的物理页存满后,将物理页作为偶数快照片段页刷写至闪存内的一个偶数通道内;When the physical page storing even-numbered snapshot fragments is full, write the physical page as an even-numbered snapshot fragment page to an even channel in the flash memory;
当固态盘出现异常掉电时,将当前尚未刷写至闪存的奇数快照片段页以及偶数快照片段页分别刷写至对应的奇数通道和偶数通道内。When the solid-state disk is abnormally powered off, the odd-numbered snapshot segment pages and the even-numbered snapshot segment pages that have not yet been written to the flash memory are written to the corresponding odd-numbered channels and even-numbered channels respectively.
作为优选地,从闪存内读取异常掉电时存储的映射信息的过程具体为:As preferably, the process of reading the mapping information stored during abnormal power failure from the flash memory is specifically:
从闪存内读取元数据信息;Read metadata information from flash memory;
获取元数据信息内记录的异常掉电时的映射信息。Obtain the mapping information recorded in the metadata information during abnormal power failure.
作为优选地,奇数通道与偶数通道均为2个。Preferably, there are two odd-numbered channels and two even-numbered channels.
作为优选地,N为2,一个CPU根据起止地址读取奇数快照片段页,并根据读取得到的奇数快照片段页对最后一次存储的映射表进行更新操作;另一个CPU根据起止地址读取偶数快照片段页,并根据读取得到的偶数快照片段页对最后一次存储的映射表进行更新操作。Preferably, N is 2, one CPU reads the odd-numbered snapshot fragment pages according to the start and end addresses, and updates the last stored mapping table according to the read odd-numbered snapshot fragment pages; the other CPU reads the even-numbered snapshot fragment pages according to the start and end addresses Snapshot fragment pages, and update the last stored mapping table according to the read even-numbered snapshot fragment pages.
可以理解的是,在不分奇偶时,内存中设置快照片段页的数量至少为两个,当一个快照片段页存满后写入闪存时,由于需要一定的时间,为避免这段时间内有新的快照片段产生,故还需要有另外一个快照片段页作为替换。故当分奇偶时,内存中至少要设置4个快照片段页,两个作为奇数快照片段页,两个作为偶数快照片段页。对应的,奇数通道和偶数通道分别至少有1个。对应的,CPU的个数至少为两个,分别处理奇数通道和偶数通道内的快照片段页,提高并行处理的能力,减少异常掉电后的恢复时间。It is understandable that when there is no distinction between parity and parity, the number of snapshot fragment pages in the memory is at least two. When a snapshot fragment page is full and written to flash memory, it will take a certain amount of time. A new snapshot segment is generated, so another snapshot segment page is required as a replacement. Therefore, when dividing parity, at least 4 snapshot fragment pages must be set in the memory, two as odd snapshot fragment pages, and two as even snapshot fragment pages. Correspondingly, there are at least one odd-numbered channel and even-numbered channel respectively. Correspondingly, there are at least two CPUs, which process the snapshot fragment pages in the odd-numbered channel and the even-numbered channel respectively, so as to improve the parallel processing capability and reduce the recovery time after abnormal power failure.
进一步的,当奇数通道与偶数通道均为多个时,CPU可对应的设置多于2个,进一步减少恢复时间。当然,CPU的设置个数根据通道个数以及实际情况决定,本发明对此不作限定。Further, when there are multiple odd-numbered channels and even-numbered channels, more than two CPUs can be set correspondingly, further reducing recovery time. Of course, the set number of CPUs is determined according to the number of channels and actual conditions, which is not limited in the present invention.
本发明提供了一种固态盘异常掉电后的映射表恢复方法,将快照片段页分为奇数快照片段页以及偶数快照片段页,分别存储奇数逻辑页修改数据以及偶数逻辑页修改数据;且奇数快照片段页以及偶数快照片段页分别存储于闪存内的奇数通道以及偶数通道内;当固态盘进行掉电恢复时,可以采用多个CPU来分别读取奇数快照片段页以及偶数快照片段页并对映射表进行更新。可见,本发明通过奇偶分离的方式增强了掉电恢复时的并行处理程度,进而缩短了掉电恢复的时间,提高了固态盘的可靠性。The invention provides a method for restoring a mapping table after an abnormal power failure of a solid-state disk. The snapshot segment pages are divided into odd-numbered snapshot segment pages and even-numbered snapshot segment pages, and respectively store odd-numbered logical page modification data and even-numbered logical page modification data; and odd-numbered Snapshot fragment pages and even-numbered snapshot fragment pages are stored in the odd-numbered and even-numbered channels of the flash memory respectively; when the SSD recovers from power failure, multiple CPUs can be used to read the odd-numbered snapshot fragment pages and the even-numbered snapshot fragment pages respectively and The mapping table is updated. It can be seen that the present invention enhances the degree of parallel processing during power-off recovery by means of parity separation, thereby shortening the power-off recovery time and improving the reliability of the solid-state disk.
本发明还提供了一种固态盘异常掉电后的映射表恢复系统,固态盘的闪存内包括用于存储奇数快照片段页的奇数通道以及用于存储偶数快照片段页的偶数通道,奇数快照片段页内存有奇数逻辑页修改数据,偶数快照片段页内存有偶数逻辑页修改数据;参见图2所示,图2为本发明提供的一种固态盘异常掉电后的映射表恢复系统的结构示意图。该系统包括:The present invention also provides a system for restoring the mapping table after abnormal power failure of the solid-state disk. The flash memory of the solid-state disk includes odd-numbered channels for storing odd-numbered snapshot fragment pages and even-numbered channels for storing even-numbered snapshot fragment pages. There are odd logical page modification data in the page memory, and even logical page modification data in the even snapshot fragment page memory; see Fig. 2, Fig. 2 is a schematic structural diagram of a mapping table recovery system after an abnormal power failure of a solid-state disk provided by the present invention . The system includes:
读取模块11,用于当固态盘进行掉电恢复时,从闪存内读取异常掉电时存储的映射信息以及闪存在异常掉电之前最后一次存储的映射表;其中,映射信息包括最后一次存储的映射表的位置信息以及在最后一次存储的映射表开始刷写至闪存的时刻之后存入闪存的快照片段页的起止地址;The reading module 11 is used to read the mapping information stored during abnormal power failure and the mapping table stored in the flash memory for the last time before abnormal power failure from the flash memory when the solid state disk is restored from power failure; wherein, the mapping information includes the last The location information of the stored mapping table and the start and end addresses of the snapshot segment pages stored in the flash memory after the last time the stored mapping table starts to be written to the flash memory;
N个CPU12,用于根据起止地址分别读取奇数快照片段页以及偶数快照片段页;并根据读取得到的奇数快照片段页以及偶数快照片段页对最后一次存储的映射表进行更新操作,N为偶数。N CPUs 12 are used to read odd snapshot fragment pages and even snapshot fragment pages respectively according to the start and end addresses; and update the last stored mapping table according to the read odd snapshot fragment pages and even snapshot fragment pages, where N is even.
需要注意的是,偶数个CPU12分别读取奇数通道以及偶数通道内的快照片段页。It should be noted that the even number of CPUs 12 respectively read the snapshot segment pages in the odd numbered channel and the even numbered channel.
本发明提供了一种固态盘异常掉电后的映射表恢复系统,将快照片段页分为奇数快照片段页以及偶数快照片段页,分别存储奇数逻辑页修改数据以及偶数逻辑页修改数据;且奇数快照片段页以及偶数快照片段页分别存储于闪存内的奇数通道以及偶数通道内;当固态盘进行掉电恢复时,可以采用多个CPU来分别读取奇数快照片段页以及偶数快照片段页并对映射表进行更新。可见,本发明通过奇偶分离的方式增强了掉电恢复时的并行处理程度,进而缩短了掉电恢复的时间,提高了固态盘的可靠性。The invention provides a mapping table recovery system after abnormal power failure of a solid state disk, which divides snapshot fragment pages into odd snapshot fragment pages and even snapshot fragment pages, and stores odd logical page modification data and even logical page modification data respectively; Snapshot fragment pages and even-numbered snapshot fragment pages are stored in the odd-numbered and even-numbered channels of the flash memory respectively; when the SSD recovers from power failure, multiple CPUs can be used to read the odd-numbered snapshot fragment pages and the even-numbered snapshot fragment pages respectively and The mapping table is updated. It can be seen that the present invention enhances the degree of parallel processing during power-off recovery by means of parity separation, thereby shortening the power-off recovery time and improving the reliability of the solid-state disk.
需要说明的是,在本说明书中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this specification, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or device comprising a set of elements includes not only those elements , but also includes other elements not expressly listed, or also includes elements inherent in such process, method, article or equipment. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其他实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610694744.7A CN106294026A (en) | 2016-08-19 | 2016-08-19 | Mapping table restoration methods after a kind of solid-state disk powered-off fault and system thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610694744.7A CN106294026A (en) | 2016-08-19 | 2016-08-19 | Mapping table restoration methods after a kind of solid-state disk powered-off fault and system thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106294026A true CN106294026A (en) | 2017-01-04 |
Family
ID=57661793
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610694744.7A Pending CN106294026A (en) | 2016-08-19 | 2016-08-19 | Mapping table restoration methods after a kind of solid-state disk powered-off fault and system thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106294026A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107168647A (en) * | 2017-04-17 | 2017-09-15 | 武汉永力科技股份有限公司 | FLASH data read-write methods and system |
CN108804033A (en) * | 2018-05-18 | 2018-11-13 | 记忆科技(深圳)有限公司 | Scan full hard disk method, apparatus, computer equipment and the medium continued again based on power-off |
CN110281865A (en) * | 2019-06-29 | 2019-09-27 | 潍柴动力股份有限公司 | A kind of vehicle control device and date storage method |
WO2019227465A1 (en) * | 2018-06-01 | 2019-12-05 | Microsoft Technology Licensing, Llc. | Erasure coding with overlapped local reconstruction codes |
CN111104061A (en) * | 2019-11-21 | 2020-05-05 | 深圳忆联信息系统有限公司 | Method and device for avoiding data loss of solid storage equipment due to abnormal power failure, computer equipment and storage medium |
CN111125008A (en) * | 2019-12-20 | 2020-05-08 | 浪潮电子信息产业股份有限公司 | Dynamic repairing method and system of abnormal inode and related components |
CN111462870A (en) * | 2020-05-14 | 2020-07-28 | 沈阳先进医疗设备技术孵化中心有限公司 | Data processing system and method |
CN111949220A (en) * | 2020-09-03 | 2020-11-17 | 合肥沛睿微电子股份有限公司 | Abnormal power failure recovery method for storage device and storage device |
CN112988467A (en) * | 2021-04-19 | 2021-06-18 | 深圳市安信达存储技术有限公司 | Solid state disk, data recovery method thereof and terminal equipment |
CN113296694A (en) * | 2020-11-13 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Power-on reconstruction method and device and solid state disk |
CN118426815A (en) * | 2024-07-02 | 2024-08-02 | 合肥康芯威存储技术有限公司 | Storage device and control method thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101093459A (en) * | 2007-07-18 | 2007-12-26 | 华为技术有限公司 | Method and device for protecting snapshot |
CN102043727A (en) * | 2009-10-10 | 2011-05-04 | 成都市华为赛门铁克科技有限公司 | Method and device for recovering solid-state hard disc mapping table |
CN102298555A (en) * | 2011-08-22 | 2011-12-28 | 宜兴市华星特种陶瓷科技有限公司 | Modular flash management system based on Not AND (NAND) technology |
US20150046625A1 (en) * | 2012-11-20 | 2015-02-12 | Thstyme Bermuda Limited | Solid state drive architectures |
-
2016
- 2016-08-19 CN CN201610694744.7A patent/CN106294026A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101093459A (en) * | 2007-07-18 | 2007-12-26 | 华为技术有限公司 | Method and device for protecting snapshot |
CN102043727A (en) * | 2009-10-10 | 2011-05-04 | 成都市华为赛门铁克科技有限公司 | Method and device for recovering solid-state hard disc mapping table |
CN102298555A (en) * | 2011-08-22 | 2011-12-28 | 宜兴市华星特种陶瓷科技有限公司 | Modular flash management system based on Not AND (NAND) technology |
US20150046625A1 (en) * | 2012-11-20 | 2015-02-12 | Thstyme Bermuda Limited | Solid state drive architectures |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107168647B (en) * | 2017-04-17 | 2020-10-23 | 武汉永力科技股份有限公司 | FLASH data read-write method and system |
CN107168647A (en) * | 2017-04-17 | 2017-09-15 | 武汉永力科技股份有限公司 | FLASH data read-write methods and system |
CN108804033A (en) * | 2018-05-18 | 2018-11-13 | 记忆科技(深圳)有限公司 | Scan full hard disk method, apparatus, computer equipment and the medium continued again based on power-off |
CN108804033B (en) * | 2018-05-18 | 2021-04-20 | 记忆科技(深圳)有限公司 | Full-disk scanning method and device based on power-off continuation, computer equipment and medium |
US11748009B2 (en) | 2018-06-01 | 2023-09-05 | Microsoft Technology Licensing, Llc | Erasure coding with overlapped local reconstruction codes |
WO2019227465A1 (en) * | 2018-06-01 | 2019-12-05 | Microsoft Technology Licensing, Llc. | Erasure coding with overlapped local reconstruction codes |
CN110281865B (en) * | 2019-06-29 | 2021-01-19 | 潍柴动力股份有限公司 | Vehicle controller and data storage method |
CN110281865A (en) * | 2019-06-29 | 2019-09-27 | 潍柴动力股份有限公司 | A kind of vehicle control device and date storage method |
CN111104061A (en) * | 2019-11-21 | 2020-05-05 | 深圳忆联信息系统有限公司 | Method and device for avoiding data loss of solid storage equipment due to abnormal power failure, computer equipment and storage medium |
CN111125008A (en) * | 2019-12-20 | 2020-05-08 | 浪潮电子信息产业股份有限公司 | Dynamic repairing method and system of abnormal inode and related components |
CN111125008B (en) * | 2019-12-20 | 2022-04-22 | 浪潮电子信息产业股份有限公司 | Dynamic repairing method and system of abnormal inode and related components |
US11650875B2 (en) | 2019-12-20 | 2023-05-16 | Inspur Electronic Information Industry Co., Ltd. | Abnormal inode dynamic repair method and system, and related component |
CN111462870A (en) * | 2020-05-14 | 2020-07-28 | 沈阳先进医疗设备技术孵化中心有限公司 | Data processing system and method |
CN111949220A (en) * | 2020-09-03 | 2020-11-17 | 合肥沛睿微电子股份有限公司 | Abnormal power failure recovery method for storage device and storage device |
CN111949220B (en) * | 2020-09-03 | 2023-12-08 | 合肥沛睿微电子股份有限公司 | Abnormal power-off recovery method of storage device and storage device |
CN113296694A (en) * | 2020-11-13 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Power-on reconstruction method and device and solid state disk |
CN112988467A (en) * | 2021-04-19 | 2021-06-18 | 深圳市安信达存储技术有限公司 | Solid state disk, data recovery method thereof and terminal equipment |
CN118426815A (en) * | 2024-07-02 | 2024-08-02 | 合肥康芯威存储技术有限公司 | Storage device and control method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106294026A (en) | Mapping table restoration methods after a kind of solid-state disk powered-off fault and system thereof | |
US10101930B2 (en) | System and method for supporting atomic writes in a flash translation layer | |
US11301379B2 (en) | Access request processing method and apparatus, and computer device | |
US8838936B1 (en) | System and method for efficient flash translation layer | |
US20150331624A1 (en) | Host-controlled flash translation layer snapshot | |
KR101301828B1 (en) | Method and apparatus for power-off recovery in flash memory-based solid state drive | |
KR101870521B1 (en) | Methods and systems for improving storage journaling | |
KR101910759B1 (en) | Transaction processing method, apparatus and computer system | |
US11030092B2 (en) | Access request processing method and apparatus, and computer system | |
TWI856880B (en) | Non-transitory computer-readable medium, storage device and storage method | |
CN101625897B (en) | Data writing method, storage system and controller for flash memory | |
CN105468544B (en) | Method and device for realizing power-down prevention file system and power-down prevention file system | |
US20150074336A1 (en) | Memory system, controller and method of controlling memory system | |
CN108874574B (en) | Garbage recycling method and related device | |
CN107544912B (en) | Log recording method, loading method and device | |
TW202318209A (en) | Conditional update, delayed lookup | |
TWI850721B (en) | In-memory journal | |
US11188511B2 (en) | Offloading file-indexing to memory card firmware | |
CN107544866B (en) | Log updating method and device | |
CN109542359B (en) | Data reconstruction method, device, equipment and computer readable storage medium | |
US20170153830A1 (en) | Data recovery device, data storage device and control method thereof | |
CN117215968A (en) | Method and system for reducing on time of solid state device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170104 |
|
RJ01 | Rejection of invention patent application after publication |