WO2022166265A1 - 一种数据恢复方法、装置、设备及介质 - Google Patents

一种数据恢复方法、装置、设备及介质 Download PDF

Info

Publication number
WO2022166265A1
WO2022166265A1 PCT/CN2021/126611 CN2021126611W WO2022166265A1 WO 2022166265 A1 WO2022166265 A1 WO 2022166265A1 CN 2021126611 W CN2021126611 W CN 2021126611W WO 2022166265 A1 WO2022166265 A1 WO 2022166265A1
Authority
WO
WIPO (PCT)
Prior art keywords
block group
physical block
data recovery
physical
mapping relationship
Prior art date
Application number
PCT/CN2021/126611
Other languages
English (en)
French (fr)
Inventor
陈湖广
Original Assignee
湖南国科微电子股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 湖南国科微电子股份有限公司 filed Critical 湖南国科微电子股份有限公司
Publication of WO2022166265A1 publication Critical patent/WO2022166265A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0615Address space extension
    • G06F12/0623Address space extension for memory modules

Definitions

  • the present application relates to the technical field of data recovery, and in particular, to a data recovery method, apparatus, device and medium.
  • the hard drive may be unavailable due to software or hardware reasons, such as the software entering an infinite loop.
  • Manufacturers usually provide methods or tools for recovering full disk data on such disks, migrating data to another disk, and minimizing user losses.
  • the current solution needs to use the previous bad block table on the disk in the process of data recovery. If the bad block table is lost for some reason, the data of the entire disk cannot be recovered.
  • the purpose of the present application is to provide a data recovery method, apparatus, device and medium, which can effectively perform data recovery, thereby avoiding data loss. Its specific plan is as follows:
  • the present application discloses a data recovery method, comprising:
  • the physical block group number of the physical block group is written into each block of the physical block group; wherein, the physical block group is a block with a specific block number on each memory chip group of blocks;
  • the physical block group number is read from each block of the physical block group;
  • Data recovery is performed based on the first physical block group mapping relationship.
  • the method before the reading the physical block group number from each block of the physical block group, the method further includes:
  • the step of reading the physical block group number from each block of the physical block group is triggered.
  • the method before the reading the physical block group number from each block of the physical block group, the method further includes:
  • mapping relationship of the second physical block group cannot be determined based on the bad block table, the step of reading the physical block group number from each block of the physical block group is triggered.
  • the method further includes:
  • the second physical block group mapping relationship is checked by using the first physical block group mapping relationship.
  • writing the physical block group number of the physical block group into each block of the physical block group includes:
  • the physical block group number of the physical block group is written into the preset page of each block of the physical block group.
  • a data recovery device comprising:
  • the physical block group number writing module is used to write the physical block group number of the physical block group into each block of the physical block group when data is written to the physical block group; wherein, the physical block group A block group composed of blocks with a specific block number on each memory chip;
  • the physical block group number reading module is used to read the physical block group number from each block of the physical block group when the data recovery request is obtained;
  • a physical block group mapping relationship building module used to construct a corresponding first physical block group mapping relationship using the read out physical block group number and the block number of each block;
  • a data recovery module configured to perform data recovery based on the first physical block group mapping relationship.
  • the device further includes:
  • the bad block table obtaining module is used to obtain the bad block table of the solid-state hard disk whose data is to be recovered.
  • the device further includes:
  • a physical block group mapping relationship determining module configured to determine a second physical block group mapping relationship based on the bad block table.
  • an electronic device comprising:
  • a processor for executing the computer program to implement the aforementioned data recovery method.
  • the present application discloses a computer-readable storage medium for storing a computer program, which implements the aforementioned data recovery method when the computer program is executed by a processor.
  • the present application when writing data to a physical block group, the present application writes the physical block group number of the physical block group into each block of the physical block group; wherein, the physical block group is a specific block on each memory chip.
  • a block group composed of blocks of block numbers when a data recovery request is obtained, the physical block group number is read from each block of the physical block group, and then the physical block group number and each physical block group number read out are used.
  • the corresponding first physical block group mapping relationship is constructed by the block numbers of the blocks, and finally data recovery is performed based on the first physical block group mapping relationship.
  • the physical block group number when data is written, the physical block group number is written into each block in the physical block group, and when data recovery is performed, the physical block group number can be read from the corresponding block,
  • the corresponding physical block group mapping relationship is constructed by using the read physical block group number and block number, and data recovery is performed based on the constructed physical block group mapping relationship. In this way, data recovery can be performed effectively, thereby avoiding data loss.
  • FIG. 2 is a schematic diagram of a data storage structure provided by the application.
  • FIG. 4 is a schematic structural diagram of a data recovery device disclosed in the application.
  • FIG. 5 is a structural diagram of an electronic device disclosed in this application.
  • the hard drive may be unavailable due to software or hardware reasons, such as the software entering an infinite loop.
  • Manufacturers usually provide methods or tools for recovering full disk data on such disks, migrating data to another disk, and minimizing user losses.
  • the current solution needs to use the previous bad block table on the disk in the process of data recovery. If the bad block table is lost for some reason, the data of the entire disk cannot be recovered. Therefore, the present application discloses a data recovery method, which can effectively perform data recovery, thereby avoiding data loss.
  • an embodiment of the present application discloses a data recovery method, including:
  • Step S11 when writing data to the physical block group, write the physical block group number of the physical block group into each block of the physical block group; wherein, the physical block group is a specific block on each memory chip A block group consisting of blocks with number .
  • SSD i.e. Solid State Disk, solid-state drive
  • DIE is a memory chip, and there may be multiple DIEs in a chip package of NANDFLASH, and each DIE can be accessed independently
  • BLOCK is The smallest unit for erasing on NANDFLASH, usually a DIE contains multiple BLOCKs (blocks), PAGE (page) is the smallest unit for reading and writing on Nandflash, BLOCK consists of multiple PAGEs, and SBLK (physical block group) is the block number from all DIEs.
  • a group consisting of the same physical BLOCK there are cases where some blocks are replaced by other blocks. That is, the physical block group is theoretically composed of blocks with the same block number on each memory chip, but if one of the blocks is a bad block, it can also be replaced by other blocks.
  • each DIE has 100 BLOCKs, numbered 0 to 99; and each BLOCK has 100 PAGEs, numbered 0 to 99.
  • SSDs are usually used as the basic unit of SBLK. All blocks in the SBLK are erased together and data is written in sequence together. Because of the existence of original bad blocks and new bad blocks, if SBLKs are formed according to physical block numbers, there will be many SBLKs that may be unusable as a whole because one physical block is damaged, resulting in a great waste of space. Therefore, the usual practice is to maintain a bad block table, providing a mapping of SBLK to physical blocks. For example, in SBLK70, the physical block numbers obtained by checking the bad block table are 70, 70, 98, and 70, respectively, and the block on the DIE numbered 2 is replaced by 98.
  • the physical block group number of the physical block group may be written into a preset page of each block of the physical block group.
  • the physical block group number of the physical block group may be written into the management data of the preset page of each block of the physical block group.
  • Fig. 2 is a schematic diagram of a data storage structure provided by the application, and Fig. 2 is the logical division of a FLASH PAGE in use.
  • the data in the PAGE is stored according to the method shown in Figure 2.
  • User data is stored in the front, and management data is stored in a small amount of space in the back.
  • an SBLK number field may be added to the management data. This field does not need to be stored in every page. It can be stored in the page specified by each block, for example, the first page of each block.
  • Step S12 When a data recovery request is obtained, read the physical block group number from each block of the physical block group.
  • this embodiment may read the physical block group number of the physical block group from the preset page of each block of the physical block group.
  • Step S13 Using the read physical block group number and the block number of each block to construct a corresponding first physical block group mapping relationship.
  • Step S14 Perform data recovery based on the first physical block group mapping relationship.
  • the physical block group number of the physical block group is written into each block of the physical block group; wherein, the physical block group is each memory chip A block group composed of blocks with a specific block number above, when a data recovery request is obtained, the physical block group number is read from each block of the physical block group, and then the read physical block group number is used. and the block number of each block to construct a corresponding first physical block group mapping relationship, and finally perform data recovery based on the first physical block group mapping relationship.
  • the physical block group number when data is written, the physical block group number is written into each block in the physical block group, and when data recovery is performed, the physical block group number can be read from the corresponding block,
  • the corresponding physical block group mapping relationship is constructed by using the read physical block group number and block number, and data recovery is performed based on the constructed physical block group mapping relationship. In this way, data recovery can be performed effectively, thereby avoiding data loss.
  • the application scenarios of the embodiments of the present application may include data recovery when the solid-state disk is in use due to software or hardware reasons and the hard disk is unavailable, and data recovery in the full-disk reconstruction service when the disk is powered on.
  • an embodiment of the present application discloses a specific data recovery method, including:
  • Step S21 When writing data to the physical block group, write the physical block group number of the physical block group into each block of the physical block group; wherein, the physical block group is a specific block on each memory chip A block group consisting of blocks with number .
  • Step S22 when the data recovery request is obtained, obtain the bad block table of the solid-state hard disk whose data is to be recovered.
  • Step S23 Determine the mapping relationship of the second physical block group based on the bad block table.
  • Step S24 If the mapping relationship of the second physical block group cannot be determined based on the bad block table, or the bad block table cannot be obtained, read the physical block from each block of the physical block group Group No.
  • Step S25 Using the read physical block group number and the block number of each block to construct a corresponding first physical block group mapping relationship.
  • the bad block table may be obtained first, and if the bad block table cannot be obtained or the obtained bad block table is damaged, and the corresponding physical block group mapping relationship cannot be determined based on the bad block table, then the corresponding physical block group mapping relationship cannot be determined based on the bad block table.
  • the physical block group number is read from each block of the physical block group, and then a corresponding physical block group mapping relationship is constructed.
  • Step S26 Perform data recovery based on the first physical block group mapping relationship.
  • the method further includes: using the first physical block group mapping relationship for the second physical block group mapping relationship The physical block group mapping relationship is verified.
  • the physical block group number of the physical block group can be written into each block of the physical block group, and when data is restored, each block of the physical block group can be retrieved from the physical block group.
  • Read the physical block group number in the middle use the read physical block group number and the block number of each block to construct a corresponding mapping relationship, and then check the bad block table based on the constructed mapping relationship to check the bad block. For the correctness of the table, specifically, the mapping relationship constructed based on the read physical block group number can be compared with the mapping relationship determined based on the bad block table. If they are consistent, the verification is passed and the bad block table is accurate.
  • an embodiment of the present application discloses a data recovery apparatus, including:
  • the physical block group number writing module 11 is used to write the physical block group number of the physical block group into each block of the physical block group when data is written to the physical block group; wherein, the physical block The group is a block group composed of blocks with a specific block number on each memory chip;
  • the physical block group number reading module 12 is used to read the physical block group number from each block of the physical block group when the data recovery request is obtained;
  • the physical block group mapping relationship building module 13 is used to construct the corresponding first physical block group mapping relationship by utilizing the read physical block group number and the block number of each block;
  • the data recovery module 14 is configured to perform data recovery based on the first physical block group mapping relationship.
  • the physical block group number of the physical block group is written into each block of the physical block group; wherein, the physical block group is each memory chip A block group composed of blocks with a specific block number above, when a data recovery request is obtained, the physical block group number is read from each block of the physical block group, and then the read physical block group number is used. and the block number of each block to construct a corresponding first physical block group mapping relationship, and finally perform data recovery based on the first physical block group mapping relationship.
  • the physical block group number when data is written, the physical block group number is written into each block in the physical block group, and when data recovery is performed, the physical block group number can be read from the corresponding block,
  • the corresponding physical block group mapping relationship is constructed by using the read physical block group number and block number, and data recovery is performed based on the constructed physical block group mapping relationship. In this way, data recovery can be performed effectively, thereby avoiding data loss.
  • the physical block group number writing module 11 is specifically configured to write the physical block group number of the physical block group into a preset page of each block of the physical block group.
  • the device also includes:
  • the bad block table obtaining module is used to obtain the bad block table of the solid-state hard disk whose data is to be recovered.
  • the device also includes:
  • a physical block group mapping relationship determining module configured to determine a second physical block group mapping relationship based on the bad block table.
  • the device is specifically used for the bad block table obtaining module to be unable to obtain the bad block table of the solid-state hard disk of the data to be restored, or the physical block group mapping relationship determination module to be unable to determine the second physical block based on the bad block table.
  • the group mapping relationship is to start the physical block group number reading module 12 to read the physical block group number from each block of the physical block group, and start the physical block group mapping relationship building module 13 to read the physical block group number.
  • the obtained physical block group number and the block number of each block construct a corresponding first physical block group mapping relationship.
  • an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store a computer program; the processor 21 is used to execute the A computer program to implement the following steps:
  • the physical block group number of the physical block group is written into each block of the physical block group; wherein, the physical block group is a block with a specific block number on each memory chip
  • a data recovery request is obtained, read the physical block group number from each block of the physical block group; use the read physical block group number and the block number of each block constructing a corresponding first physical block group mapping relationship; and performing data recovery based on the first physical block group mapping relationship.
  • the physical block group number of the physical block group is written into each block of the physical block group; wherein, the physical block group is each memory chip A block group composed of blocks with a specific block number above, when a data recovery request is obtained, the physical block group number is read from each block of the physical block group, and then the read physical block group number is used. and the block number of each block to construct a corresponding first physical block group mapping relationship, and finally perform data recovery based on the first physical block group mapping relationship.
  • the physical block group number when data is written, the physical block group number is written into each block in the physical block group, and when data recovery is performed, the physical block group number can be read from the corresponding block,
  • the corresponding physical block group mapping relationship is constructed by using the read physical block group number and block number, and data recovery is performed based on the constructed physical block group mapping relationship. In this way, data recovery can be performed effectively, thereby avoiding data loss.
  • the memory 22, as a carrier for resource storage may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be short-term storage or permanent storage.
  • the electronic device 20 further includes a power supply 23, a communication interface 24, an input and output interface 25, and a communication bus 26; wherein, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the The communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, which is not specifically limited here; the The input and output interface 25 is used for acquiring external input data or outputting data to the external world, and its specific interface type can be selected according to specific application needs, which is not specifically limited here.
  • embodiments of the present application also disclose a computer-readable storage medium for storing a computer program, wherein the computer program implements the data recovery method disclosed in the foregoing embodiments when the computer program is executed by a processor.
  • the steps of a method or algorithm described in conjunction with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two.
  • the software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.

Landscapes

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

Abstract

一种数据恢复方法、装置、设备及介质,包括:在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;物理块组为各存储芯片上特定块号的块组成的块组;当获取到数据恢复请求,从物理块组的每个块中读取物理块组号;利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系;基于所述第一物理块组映射关系进行数据恢复。这样,在数据写入时,将物理块组号写入物理块组的每个块,在进行数据恢复时,从相应的块中读取物理块组号,利用读取出的物理块组号和块号构建对应的物理块组映射关系,基于构建出的物理块组映射关系进行数据恢复,能够有效的进行数据恢复,从而避免数据丢失。

Description

一种数据恢复方法、装置、设备及介质
本申请要求于2021年02月02日提交中国专利局、申请号为202110142692.3、发明名称为“一种数据恢复方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据恢复技术领域,特别涉及一种数据恢复方法、装置、设备及介质。
背景技术
固态硬盘在使用过程中,可能因为软件或者硬件的原因,导致硬盘不可用,比如软件上进入死循环。厂家通常提供了方法或者工具,用于对这类盘进行全盘数据的恢复,将数据迁移到另外的盘上面,尽量减少用户的损失。目前的解决方案在进行数据恢复的过程中需要利用到盘上之前的坏块表,如果该坏块表因为某些原因丢失,那么整个盘的数据就无法进行恢复。
发明内容
有鉴于此,本申请的目的在于提供一种数据恢复方法、装置、设备及介质,能够有效的进行数据恢复,从而避免数据丢失。其具体方案如下:
第一方面,本申请公开了一种数据恢复方法,包括:
在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组;
当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号;
利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系;
基于所述第一物理块组映射关系进行数据恢复。
可选的,所述从所述物理块组的每个块中读取所述物理块组号之前,还包括:
获取待恢复数据的固态硬盘的坏块表;
若无法获取到所述坏块表,则触发所述从所述物理块组的每个块中读取所述物理块组号的步骤。
可选的,所述从所述物理块组的每个块中读取所述物理块组号之前,还包括:
获取待恢复数据的固态硬盘的坏块表;
基于所述坏块表确定第二物理块组映射关系;
若无法基于所述坏块表确定所述第二物理块组映射关系,则触发所述从所述物理块组的每个块中读取所述物理块组号的步骤。
可选的,若成功基于所述坏块表确定所述第二物理块组映射关系,所述方法还包括:
利用所述第一物理块组映射关系对所述第二物理块组映射关系进行校验。
可选的,所述将该物理块组的物理块组号写入该物理块组的每个块中,包括:
将该物理块组的物理块组号写入该物理块组的每个块的预设页中。
第二方面,本申请公开了一种数据恢复装置,包括:
物理块组号写入模块,用于在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组;
物理块组号读取模块,用于当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号;
物理块组映射关系构建模块,用于利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系;
数据恢复模块,用于基于所述第一物理块组映射关系进行数据恢复。
可选的,所述装置还包括:
坏块表获取模块,用于获取待恢复数据的固态硬盘的坏块表。
可选的,所述装置还包括:
物理块组映射关系确定模块,用于基于所述坏块表确定第二物理块组映射关系。
第三方面、本申请公开了一种电子设备,包括:
存储器,用于保存计算机程序;
处理器,用于执行所述计算机程序,以实现前述的数据恢复方法。
第四方面,本申请公开了一种计算机可读存储介质,用于保存计算机程序,所述计算机程序被处理器执行时实现前述的数据恢复方法。
可见,本申请在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组,当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号,然后利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系,最后基于所述第一物理块组映射关系进行数据恢复。也即,本申请实施例在数据写入时,将物理块组号写入物理块组中的每个块中,在进行数据恢复时,即可从相应的块中读取物理块组号,利用读取出的物理块组号和块号构建对应的物理块组映射关系,基于构建出的物理块组映射关系进行数据恢复,这样,能够有效的进行数据恢复,从而避免数据丢失。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请公开的一种数据恢复方法流程图;
图2为本申请提供的一种数据存储结构示意图;
图3为本申请公开的一种具体的数据恢复方法流程图;
图4为本申请公开的一种数据恢复装置结构示意图;
图5为本申请公开的一种电子设备结构图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
固态硬盘在使用过程中,可能因为软件或者硬件的原因,导致硬盘不可用,比如软件上进入死循环。厂家通常提供了方法或者工具,用于对这类盘进行全盘数据的恢复,将数据迁移到另外的盘上面,尽量减少用户的损失。目前的解决方案在进行数据恢复的过程中需要利用到盘上之前的坏块表,如果该坏块表因为某些原因丢失,那么整个盘的数据就无法进行恢复。为此,本申请公开了一种数据恢复方法,能够有效的进行数据恢复,从而避免数据丢失。
参见图1所示,本申请实施例公开了一种数据恢复方法,包括:
步骤S11:在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组。
需要指出的是,SSD(即Solid State Disk,固态硬盘),通常使用NANDFLASH作为存储介质,DIE为一个存储芯片,一个NANDFLASH的芯片封装可能存在多个DIE,各个DIE之间可独立访问,BLOCK为NANDFLASH上擦除最小单元,通常一个DIE含有多个BLOCK(块),PAGE(页)为Nandflash上读写最小单元,BLOCK由多个PAGE组成,SBLK(物理块组)为由所有DIE上块号相同的物理BLOCK组成的一个组,存在部分块被替换为其他块的情况。也即,物理块组理论上是各存储芯片上块号相同的块组成,但如果其中的某一块是坏块,也可以被其他块替代。
例如,假设固态硬盘有4个DIE,编号0~3;每个DIE有100个BLOCK,编号0~99;每个BLOCK有100个PAGE,编号0~99。
为便于管理和提升性能,固态硬盘通常以SBLK作为基本单位进行使 用,SBLK中所有块一起擦除,一起按顺序写入数据。因为有原始坏块和新增坏块的存在,如果按照物理块编号组成SBLK,就会有很多SBLK可能因为有一个物理BLOCK损坏而整体不能用,导致空间的极大浪费。因此通常的做法是维护坏块表,提供SBLK到物理块的映射。比如SBLK70,通过查坏块表得到物理块号分别是70、70、98、70,编号为2的DIE上的块被替换成了98。通过维护坏块表,即使后续有新的坏块产生,也不至于导致整个SBLK不可用,极大节省了空间。在进行数据恢复的时候,首先找到坏块表,得到各个SBLK的映射关系,然后从盘上读取各个SBLK的数据,对这些SBLK的数据按照数据写入顺序进行排序,然后按照顺序恢复整个盘的数据。
在具体的实施方式中,可以将该物理块组的物理块组号写入该物理块组的每个块的预设页中。
具体的,可以将该物理块组的物理块组号写入该物理块组的每个块的预设页的管理数据中。
例如,参见图2所示,图2为本申请提供的一种数据存储结构示意图,图2为一个FLASH PAGE在使用时的逻辑划分。PAGE中数据按照图2所示方式进行存放,前面存放用户数据,后面少量空间存放管理数据。本申请实施例可以在管理数据中增加SBLK号字段。该字段不需要每个page中都存放。可以在每个块指定的页中存放,例如,每个块的第一页中。
步骤S12:当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号。
也即,在具体的实施方式中,本实施例可以从该物理块组的每个块的预设页中读取该物理块组的物理块组号。
步骤S13:利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系。
步骤S14:基于所述第一物理块组映射关系进行数据恢复。
也即,本实施例在进行数据恢复时,扫描所有块获取SBLK号,然后将SBLK号相同的物理块视为属于同一个SBLK,通过该方式构建SBLK映射关系,在得到SBLK映射关系之后便可以读取每个SBLK的数据,然后对所 有SBLK进行排序、恢复数据表项等后续工作,在数据恢复完成后,主机可读取数据进行备份。
可见,本申请实施例在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组,当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号,然后利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系,最后基于所述第一物理块组映射关系进行数据恢复。也即,本申请实施例在数据写入时,将物理块组号写入物理块组中的每个块中,在进行数据恢复时,即可从相应的块中读取物理块组号,利用读取出的物理块组号和块号构建对应的物理块组映射关系,基于构建出的物理块组映射关系进行数据恢复,这样,能够有效的进行数据恢复,从而避免数据丢失。
需要指出的是,本申请实施例的应用场景可以包括固态硬盘在使用时软件或硬件原因导致的硬盘不可用的情况的数据恢复,以及盘上电的全盘重建业务中的数据恢复。
参见图3所示,本申请实施例公开了一种具体的数据恢复方法,包括:
步骤S21:在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组。
步骤S22:当获取到数据恢复请求,获取待恢复数据的固态硬盘的坏块表。
步骤S23:基于所述坏块表确定第二物理块组映射关系。
步骤S24:若无法基于所述坏块表确定所述第二物理块组映射关系,或无法获取到所述坏块表,则从所述物理块组的每个块中读取所述物理块组号。
步骤S25:利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系。
也即,在具体的实施方式中,本实施例可以先获取坏块表,如果获取 不到或者获取到的坏块表损坏,无法基于坏块表确定对应的物理块组映射关系,则从所述物理块组的每个块中读取所述物理块组号,然后构建对应的物理块组映射关系。
步骤S26:基于所述第一物理块组映射关系进行数据恢复。
另外,在一些具体的实施例中,若成功基于所述坏块表确定所述第二物理块组映射关系,所述方法还包括:利用所述第一物理块组映射关系对所述第二物理块组映射关系进行校验。
也即,可以在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中,在数据恢复时,从物理块组的每个块中读取物理块组号,利用读取出的所述物理块组号以及每个块的块号构建对应的映射关系,然后基于构建出的映射关系对坏块表进行校验,检验坏块表的正确性,具体的,可以比较基于读取出的物理块组号构建的映射关系与基于坏块表确定的映射关系,若一致,则校验通过,坏块表准确。
参见图4所示,本申请实施例公开了一种数据恢复装置,包括:
物理块组号写入模块11,用于在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组;
物理块组号读取模块12,用于当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号;
物理块组映射关系构建模块13,用于利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系;
数据恢复模块14,用于基于所述第一物理块组映射关系进行数据恢复。
可见,本申请实施例在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组,当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号,然后利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系,最后基于所述第一物理块组映射关系进行数据恢复。也即,本申请实施例在数据写入时,将物理 块组号写入物理块组中的每个块中,在进行数据恢复时,即可从相应的块中读取物理块组号,利用读取出的物理块组号和块号构建对应的物理块组映射关系,基于构建出的物理块组映射关系进行数据恢复,这样,能够有效的进行数据恢复,从而避免数据丢失。
其中,所述物理块组号写入模块11,具体用于将该物理块组的物理块组号写入该物理块组的每个块的预设页中。
其中,所述装置还包括:
坏块表获取模块,用于获取待恢复数据的固态硬盘的坏块表。
进一步的,所述装置还包括:
物理块组映射关系确定模块,用于基于所述坏块表确定第二物理块组映射关系。
相应的,所述装置具体用于在坏块表获取模块无法获取待恢复数据的固态硬盘的坏块表,或所述物理块组映射关系确定模块无法基于所述坏块表确定第二物理块组映射关系是,启动所述物理块组号读取模块12从所述物理块组的每个块中读取所述物理块组号,以及启动物理块组映射关系构建模块13,利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系。
参见图5所述,本申请实施例公开了一种电子设备20,包括处理器21和存储器22;其中,所述存储器22,用于保存计算机程序;所述处理器21,用于执行所述计算机程序,以实现以下步骤:
在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组;当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号;利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系;基于所述第一物理块组映射关系进行数据恢复。
可见,本申请实施例在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组,当获取到数据恢复请求,从所述物理块组 的每个块中读取所述物理块组号,然后利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系,最后基于所述第一物理块组映射关系进行数据恢复。也即,本申请实施例在数据写入时,将物理块组号写入物理块组中的每个块中,在进行数据恢复时,即可从相应的块中读取物理块组号,利用读取出的物理块组号和块号构建对应的物理块组映射关系,基于构建出的物理块组映射关系进行数据恢复,这样,能够有效的进行数据恢复,从而避免数据丢失。
关于上述步骤的具体过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。
并且,所述存储器22作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,存储方式可以是短暂存储或者永久存储。
另外,所述电子设备20还包括电源23、通信接口24、输入输出接口25和通信总线26;其中,所述电源23用于为所述电子设备20上的各硬件设备提供工作电压;所述通信接口24能够为所述电子设备20创建与外界设备之间的数据传输通道,其所遵循的通信协议是能够适用于本申请技术方案的任意通信协议,在此不对其进行具体限定;所述输入输出接口25,用于获取外界输入数据或向外界输出数据,其具体的接口类型可以根据具体应用需要进行选取,在此不进行具体限定。
进一步的,本申请实施例还公开了一种计算机可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述实施例公开的数据恢复方法。
关于上述数据恢复方法的具体过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上对本申请所提供的一种数据恢复方法、装置、设备及介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (10)

  1. 一种数据恢复方法,其特征在于,包括:
    在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组;
    当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号;
    利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系;
    基于所述第一物理块组映射关系进行数据恢复。
  2. 根据权利要求1所述的数据恢复方法,其特征在于,所述从所述物理块组的每个块中读取所述物理块组号之前,还包括:
    获取待恢复数据的固态硬盘的坏块表;
    若无法获取到所述坏块表,则触发所述从所述物理块组的每个块中读取所述物理块组号的步骤。
  3. 根据权利要求1所述的数据恢复方法,其特征在于,所述从所述物理块组的每个块中读取所述物理块组号之前,还包括:
    获取待恢复数据的固态硬盘的坏块表;
    基于所述坏块表确定第二物理块组映射关系;
    若无法基于所述坏块表确定所述第二物理块组映射关系,则触发所述从所述物理块组的每个块中读取所述物理块组号的步骤。
  4. 根据权利要求3所述的数据恢复方法,其特征在于,若成功基于所述坏块表确定所述第二物理块组映射关系,所述方法还包括:
    利用所述第一物理块组映射关系对所述第二物理块组映射关系进行校验。
  5. 根据权利要求1至4所述的数据恢复方法,其特征在于,所述将该物理块组的物理块组号写入该物理块组的每个块中,包括:
    将该物理块组的物理块组号写入该物理块组的每个块的预设页中。
  6. 一种数据恢复装置,其特征在于,包括:
    物理块组号写入模块,用于在对物理块组进行数据写入时,将该物理块组的物理块组号写入该物理块组的每个块中;其中,所述物理块组为各存储芯片上特定块号的块组成的块组;
    物理块组号读取模块,用于当获取到数据恢复请求,从所述物理块组的每个块中读取所述物理块组号;
    物理块组映射关系构建模块,用于利用读取出的所述物理块组号以及每个块的块号构建对应的第一物理块组映射关系;
    数据恢复模块,用于基于所述第一物理块组映射关系进行数据恢复。
  7. 根据权利要求6所述的数据恢复装置,其特征在于,所述装置还包括:
    坏块表获取模块,用于获取待恢复数据的固态硬盘的坏块表。
  8. 根据权利要求7所述的数据恢复装置,其特征在于,所述装置还包括:
    物理块组映射关系确定模块,用于基于所述坏块表确定第二物理块组映射关系。
  9. 一种电子设备,其特征在于,包括:
    存储器,用于保存计算机程序;
    处理器,用于执行所述计算机程序,以实现如权利要求1至5任一项所述的数据恢复方法。
  10. 一种计算机可读存储介质,其特征在于,用于保存计算机程序,所述计算机程序被处理器执行时实现如权利要求1至5任一项所述的数据恢复方法。
PCT/CN2021/126611 2021-02-02 2021-10-27 一种数据恢复方法、装置、设备及介质 WO2022166265A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110142692.3A CN112948173A (zh) 2021-02-02 2021-02-02 一种数据恢复方法、装置、设备及介质
CN202110142692.3 2021-02-02

Publications (1)

Publication Number Publication Date
WO2022166265A1 true WO2022166265A1 (zh) 2022-08-11

Family

ID=76241502

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/126611 WO2022166265A1 (zh) 2021-02-02 2021-10-27 一种数据恢复方法、装置、设备及介质

Country Status (2)

Country Link
CN (1) CN112948173A (zh)
WO (1) WO2022166265A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948173A (zh) * 2021-02-02 2021-06-11 湖南国科微电子股份有限公司 一种数据恢复方法、装置、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866956A (zh) * 2012-09-14 2013-01-09 上海宝存信息科技有限公司 基于固态存储介质的数据实时跟踪存储系统及方法
CN109992197A (zh) * 2017-12-29 2019-07-09 苏州迈瑞微电子有限公司 一种数据读写方法、装置、电子设备和存储介质
US20190294539A1 (en) * 2018-03-23 2019-09-26 Toshiba Memory Corporation Memory system and method of controlling memory system
CN110297606A (zh) * 2019-06-28 2019-10-01 深圳忆联信息系统有限公司 基于固态硬盘的坏块管理方法、装置和计算机设备
CN112948173A (zh) * 2021-02-02 2021-06-11 湖南国科微电子股份有限公司 一种数据恢复方法、装置、设备及介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011055407A1 (en) * 2009-11-04 2011-05-12 Hitachi, Ltd. Flash memory module
CN104657285B (zh) * 2013-11-16 2020-05-05 上海芯豪微电子有限公司 一种数据缓存系统和方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866956A (zh) * 2012-09-14 2013-01-09 上海宝存信息科技有限公司 基于固态存储介质的数据实时跟踪存储系统及方法
CN109992197A (zh) * 2017-12-29 2019-07-09 苏州迈瑞微电子有限公司 一种数据读写方法、装置、电子设备和存储介质
US20190294539A1 (en) * 2018-03-23 2019-09-26 Toshiba Memory Corporation Memory system and method of controlling memory system
CN110297606A (zh) * 2019-06-28 2019-10-01 深圳忆联信息系统有限公司 基于固态硬盘的坏块管理方法、装置和计算机设备
CN112948173A (zh) * 2021-02-02 2021-06-11 湖南国科微电子股份有限公司 一种数据恢复方法、装置、设备及介质

Also Published As

Publication number Publication date
CN112948173A (zh) 2021-06-11

Similar Documents

Publication Publication Date Title
CN110659217B (zh) 一种固态硬盘的垃圾回收方法、装置、设备及存储介质
US10467044B2 (en) Transaction processing method and apparatus, and computer system
CN107967122B (zh) 一种块设备的数据写入方法、装置及介质
CN111045956B (zh) 一种基于多核cpu的固态硬盘垃圾回收方法以及装置
WO2016041401A1 (zh) 向缓存中写入数据的方法及装置
CN109522154B (zh) 数据恢复方法及相关设备与系统
KR20110089728A (ko) 솔리드 스테이트 드라이브의 에러 제어 방법
US10922234B2 (en) Method and system for online recovery of logical-to-physical mapping table affected by noise sources in a solid state drive
US20190317872A1 (en) Database cluster architecture based on dual port solid state disk
US20150120774A1 (en) Modified b+ tree node searching method and apparatus
WO2015010646A1 (zh) 混合内存的数据访问方法、模块、处理器及终端设备
WO2021219122A1 (zh) 一种数据恢复方法、系统及存储介质
WO2021027340A1 (zh) 一种键值kv的存储方法、装置及存储设备
US20240086332A1 (en) Data processing method and system, device, and medium
TW201913380A (zh) 資料儲存裝置以及其操作方法
CN111666046B (zh) 一种数据存储方法、装置及设备
WO2022166265A1 (zh) 一种数据恢复方法、装置、设备及介质
CN111752482A (zh) 一种全闪存分布式存储系统中写数据的方法及系统
WO2022037016A1 (zh) 一种树结构数据的存储方法、系统及相关装置
WO2024077863A1 (zh) 一种全闪存储系统的恢复方法及相关装置
CN109324929B (zh) 一种快照创建方法、装置、设备及可读存储介质
CN112463880A (zh) 一种区块链数据存储方法及相关装置
KR101643278B1 (ko) 데이터베이스 시스템에서 스토리지 서버 관리 방법, 장치 및 컴퓨터 판독가능 매체에 저장된 컴퓨터-프로그램
CN113467997A (zh) 一种数据恢复方法、装置、移动设备和存储介质
CN109783024B (zh) 数据存储处理方法及装置

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: 21924262

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: 21924262

Country of ref document: EP

Kind code of ref document: A1