CN110704372B - Data recovery method and device - Google Patents

Data recovery method and device Download PDF

Info

Publication number
CN110704372B
CN110704372B CN201910926172.4A CN201910926172A CN110704372B CN 110704372 B CN110704372 B CN 110704372B CN 201910926172 A CN201910926172 A CN 201910926172A CN 110704372 B CN110704372 B CN 110704372B
Authority
CN
China
Prior art keywords
node
data
parent
attribute
father
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.)
Active
Application number
CN201910926172.4A
Other languages
Chinese (zh)
Other versions
CN110704372A (en
Inventor
钟臻
吴少华
沈长达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information Co Ltd
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 Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201910926172.4A priority Critical patent/CN110704372B/en
Publication of CN110704372A publication Critical patent/CN110704372A/en
Application granted granted Critical
Publication of CN110704372B publication Critical patent/CN110704372B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • 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/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1435Saving, restoring, recovering or retrying at system level using file system or storage system metadata
    • 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/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a data recovery method and a data recovery device. One embodiment of the method comprises: extracting a node head information set from the unallocated data area in the target memory, and determining a node set based on the node head information set; determining a father node set, an attribute node set and a data node set from the node sets; for each father node in the father node set, extracting a father node identifier from the target position of the father node, and filling the father node identifier into the node head information of the father node; determining an attribute node and a data node corresponding to a parent node based on the parent node identifier included by the attribute node in the attribute node set and the parent node identifier included by the data node in the data node set; and recovering the data to be recovered based on the corresponding relation of each node. The method enriches the data recovery mode, is beneficial to the file data recovery on a UBIFS file system, and improves the flexibility of the data recovery.

Description

Data recovery method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a data recovery method and device.
Background
Currently, some file management systems can be applied to various electronic devices to manage disks on the electronic devices. For example, a UBIFS (unordered Block Image File System) File System is widely applied to a File System of an embedded device, and with the development of the technology of the internet of things, a recovery technology for deleting files of the UBIFS File System is a hot spot which is of great interest in the fields of intelligent device security and network information security. At present, the deletion recovery technology based on the UBIFS file system cannot meet the urgent requirements of the computer evidence-taking security field.
Disclosure of Invention
An object of the embodiments of the present application is to provide an improved data recovery method and apparatus, so as to solve the technical problems mentioned in the above background.
In a first aspect, an embodiment of the present application provides a data recovery method, where the method includes: extracting a node head information set from an unallocated data area in a target memory, and determining a node set based on the node head information set; determining a father node set, an attribute node set and a data node set from the node set; for each father node in the father node set, extracting a father node identifier from the target position of the father node, and filling the father node identifier into node head information of the father node; determining an attribute node and a data node corresponding to a parent node based on the parent node identifier included by the attribute node in the attribute node set and the parent node identifier included by the data node in the data node set; and recovering the data to be recovered based on the corresponding relation among the father node, the attribute node and the data node.
In some embodiments, determining the set of nodes based on the set of node header information comprises: and judging the validity of the node corresponding to each node header information, and if the node is a valid node, adding the valid node into the node set.
In some embodiments, extracting the parent node identification from the target location of the parent node comprises: extracting a pre-established initial attribute node from the target position of the father node; the parent node identification of the parent node is extracted from the extracted initial attribute nodes.
In some embodiments, extracting the parent node identification of the parent node from the extracted initial attribute node comprises: the parent node identification of the parent node is determined from the node key information included in the extracted initial attribute node.
In some embodiments, extracting the set of node header information from the unallocated data area in the target memory comprises: and extracting the node head information set from the unallocated data area in the target memory based on a preset node mark value.
In some embodiments, the unallocated data area is determined in advance based on the following steps: constructing an unallocated cluster sector map of the target memory; an unallocated data area is determined based on an unallocated cluster sector map.
In some embodiments, the parent node in the parent node set is used to characterize the directory where the data to be restored is located, the attribute node in the attribute node set is used to characterize the attribute of the data to be restored, and the data node in the data node set includes valid data of the data to be restored.
In a second aspect, an embodiment of the present application provides a data recovery apparatus, including: the extraction module is used for extracting a node head information set from the unallocated data area in the target memory and determining the node set based on the node head information set; the first determining module is used for determining a father node set, an attribute node set and a data node set from the node sets; the second determining module is used for extracting a father node identifier from the target position of each father node in the father node set and filling the father node identifier into the node head information of the father node; determining an attribute node and a data node corresponding to a parent node based on the parent node identifier included by the attribute node in the attribute node set and the parent node identifier included by the data node in the data node set; and the recovery module is used for recovering the data to be recovered based on the corresponding relation among the father node, the attribute node and the data node.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a method as described in any one of the implementations of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The data recovery method and device provided by the embodiment of the application extract the node head information set from the unallocated data area in the target memory, determine the father node set, the attribute node set and the data node set based on the node head information set, extract the father node identification from the target position of each father node, fill the father node identification into the node head information of the father node, determine the corresponding relation among the father node, the attribute node and the data node based on the father node identification, and finally recover the data to be recovered according to the corresponding relation. Therefore, the data recovery mode is enriched, the file data recovery on a UBIFS file system is facilitated, and the flexibility of the data recovery is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a schematic diagram of a UBIFS disk structure according to the present application;
FIG. 2 is a schematic diagram of a structure of a UBIFS B + tree according to the present application;
FIG. 3 is a schematic diagram of a UBIFS node structure according to the present application;
FIG. 4 is a UBIFS node relationship diagram according to the present application;
FIG. 5 is a schematic diagram of a UBIFS node recovery according to the present application;
FIG. 6 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 7 is a flow diagram for one embodiment of a data recovery method according to the present application;
FIG. 8 is a schematic block diagram of one embodiment of a data recovery apparatus according to the present application;
FIG. 9 is a block diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Summary of the application
The embodiment of the present application provides a data recovery method applied to a file system based on an existing file system, and the following briefly describes the technical background of the embodiment of the present application by taking a UBIFS file system as an example.
As shown in FIG. 1, which is a disk structure of a UBIFS file system, the UBIFS file system runs on top of a UBI system, which divides a UBI volume into 6 parts in LEB (logical Erase Block) units. The system comprises a Superblock Area (Superblock Area), a main node Area (master Area), a Journal Area (Journal/log Area), an LEB property Tree Area (LEB Properties Tree Area), an orphan Area (orphan Area) and a main Area. The size of the super block is 4096 bytes before an LEB0 (logical erasure block 0), parameters such as the size of the LEB and the hash type of Key are stored, a main node area and a backup main node area are respectively located in an LEB 1 and an LEB2, the root directory position, the fan-out number and the like of a main area are mainly stored, and the main area stores type node information and file data of a file system.
As shown in fig. 2, the UBIFS File system nodes are managed by using a B + tree, and the nodes of the File system are divided into index nodes (index nodes) and non-index nodes (non-index nodes), and the non-index nodes include File nodes, Directory nodes, extended Attribute nodes and File Data nodes. The B + tree leaf nodes of the UBIFS hold file information, which are active nodes of the file system. The internal nodes of the tree are indexes that are saved to child nodes. The B + tree can be viewed as two parts, with the top holding the index nodes of the tree structure and the bottom being the drug leaf nodes of the actual file data.
As shown in fig. 3, the node structure of the UBIFS is mainly composed of: node Header information (Common Header) + node KEY + other data.
The node header information contains Magic (fixed value: 0x06101831), CRC check value, the serial number of the node, the length of the node, the type of the node and other information. The Node KEY value is different according to different types of nodes, and for Directory nodes (Directory Entry) and File nodes (File Node), the Node has the Node ID number of the Node and also has the ID of the parent Node in the KEY value (for example, the KEY value includes the parent Node ID | Node type | Directory name hash value). Attribute information and file data are stored in attribute nodes and data nodes, and the ID numbers of the file nodes are stored in Key values (for example, the KEY values comprise the ID of the file to which the node belongs | the node type | the block number).
As shown in fig. 4, the NODE ID of the corresponding parent NODE (DENT NODE) is cleared when the file directory or file is deleted. At this time, the attribute NODE (INO NODE) and the DATA NODE (DATA NODE) cannot find the corresponding DENT NODE, so that the purpose of deletion is achieved. Typically, each time a DENT NODE is created, an 8-byte alignment offset is immediately followed by a corresponding initial INO NODE. The INO _ KEY in the INO NODE holds the ID number of its corresponding DENT NODE.
As shown in FIG. 5, each NODE has a common header structure and has a Magic value (fixed value: 0x06101831) and a NODE type identifier. The DENT NODE is determined by searching for a Magic value within the disk unassigned cluster in combination with the NODE type, then offsetting to the end position of this NODE (8 byte aligned) to obtain the INO _ KEY for the initial INO NODE and extracting the parent NODE ID in the INO NODE to populate the DENT NODE. And finally, constructing a directory structure through the extracted parameters such as the parent-child IDs of the nodes and the like so as to achieve the aim of repairing.
Fig. 6 shows an exemplary system architecture 600 to which the offline decryption method of the embodiments of the present application may be applied.
As shown in fig. 6, the system architecture 600 may include a terminal device 601, a network 602, and a server 603. The network 602 serves as a medium for providing communication links between the terminal device 601 and the server 603. Network 602 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
The server 603 may be a server that provides various services, such as a background data processing server that processes a node header information set, a node set, and the like acquired from a disk of the terminal apparatus 601. The background data processing server may process the acquired data such as the node header information set and the node set, and obtain a processing result (e.g., recovered data).
The terminal device 601 may be various electronic devices including a magnetic disk and a preset file system, including but not limited to at least one of the following: portable computers, cell phones, tablet computers, embedded devices, desktop computers, and the like.
It should be noted that the offline decryption method provided in the embodiment of the present disclosure may be executed by the terminal device 601, or may be executed by the server 603, and accordingly, the offline decryption apparatus may be disposed in the terminal device 601, or may be disposed in the server 603.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, intermediate devices, and servers, as desired for implementation. In the case where control of the target storage does not need to be operated remotely, the system architecture described above may include no network, only terminal devices or servers.
With continued reference to FIG. 7, a flow 700 of one embodiment of a method for data recovery according to the present application is shown. The method comprises the following steps:
step 701, extracting a node header information set from an unallocated data area in a target memory, and determining a node set based on the node header information set.
In this embodiment, an execution subject of the data recovery method (e.g., an intermediate device or a terminal device or a server shown in fig. 6) may extract a node header information set from an unallocated data area in the target storage, and determine a node set based on the node header information set. The target memory may be a memory provided in the execution main body, or may be a memory provided in another electronic device communicatively connected to the execution main body.
The unallocated data area may be a memory space in the target memory where valid data is not stored. For example, after a file is deleted, the space occupied by the file before deletion is occupied.
In some optional implementations of this embodiment, the unallocated data area may be determined in advance based on the following steps:
first, a map of unallocated cluster sectors of the target memory is constructed. Then, an unallocated data area is determined based on the unallocated cluster sector map. The unallocated data area is determined by constructing an unallocated cluster sector map, so that the storage space of unallocated data can be accurately positioned, and the efficiency of extracting a node head information set is improved.
The node head information in the node head information set stores basic information of one node. For example, as shown in fig. 3, the node Header information (Common Header) may include information such as a node flag value (i.e., Magic), a check value (e.g., CRC check value), a local node sequence number, a node length, a node type, and the like. The execution body may determine the node set according to a correspondence between the node header information and the node. The nodes in the node set are basic units used by a preset file system (e.g., a UBIFS file system) to manage the target storage. As shown in fig. 3, the node structure of the UBIFS file system mainly consists of node Header information (Common Header) + node KEY information (KEY) + other data. For a file, the file may correspond to a parent node and a plurality of child nodes, wherein the parent node may include directory information of the file, and the like, and the child nodes may include file attribute information, valid data of the file, and the like.
The execution body may extract the node header information set from the unallocated data area in various ways. For example, the node header information may include an identifier for characterizing the node, and the node header information is determined according to the identifier.
In some optional implementations of this embodiment, the execution body may extract the node header information set from the unallocated data area in the target memory based on a preset node flag value. Wherein the node flag value may be included in the node header information. The node marker value may be a preset fixed value, and in the UBIFS file system, the node marker value (i.e., Magic) may be 0x06101831, as an example. By extracting the node header information based on the node marker value, the mode of extracting the node header information set can be simplified, and the efficiency of extracting the node header information is improved.
In some optional implementation manners of this embodiment, after extracting the node header information set, the execution subject may perform validity determination on a node corresponding to each node header information, add the node into the node set if the node is a valid node, and discard the node if the node is not a valid node (for example, the content included in the node is incomplete). Therefore, each node in the finally obtained node set is an effective node.
Step 702, determine a parent node set, an attribute node set and a data node set from the node sets.
In this embodiment, the execution subject may determine a parent node set, an attribute node set, and a data node set from the node sets. Specifically, the execution body may determine the parent node set, the attribute node set, and the data node set according to the node type information included in the node header information. For example, for a node, if the node header information of the node includes information for characterizing a parent node, the node is the parent node.
In this embodiment, the parent nodes in the above-mentioned parent node set may correspond to at least one attribute node and at least one data node. The parent node and corresponding at least one attribute node and at least one data node may be used to characterize a file.
In some optional implementation manners of this embodiment, a parent node in the parent node set is used to characterize a directory where the data to be restored is located, an attribute node in the attribute node set is used to characterize an attribute of the data to be restored, and a data node in the data node set includes valid data of the data to be restored. As shown in fig. 4, the parent NODE (i.e., folder directory/file NODE DENT NODE) may include NODE KEY information (DENT _ KEY), representations of folders/files, etc., information of folder/file names, etc. The attribute NODE (INO NODE) may include NODE KEY information (INO _ KEY), creation time sequence number, file size, access/creation/modification time, and the like. The DATA NODE (DATA NODE) may include NODE KEY information (DATA _ KEY), a size of the DATA segment, a DATA compression method, padding DATA, valid DATA, and the like.
Step 703, for each father node in the father node set, extracting the father node identifier from the target position of the father node, and filling the father node identifier into the node header information of the father node; and determining the attribute node and the data node corresponding to the parent node based on the parent node identification included by the attribute node in the attribute node set and the parent node identification included by the data node in the data node set.
In this embodiment, for each parent node in the parent node set, the execution subject may perform the following steps:
step 7031, a father node identifier is extracted from the target position of the father node, and the father node identifier is filled in the node header information of the father node. Wherein the target location may be a location determined from a pre-specified memory address. For example, in a UBIFS file system, the target location of a parent node may be the location of an 8-byte alignment offset after the parent node's storage space.
In some optional implementations of this embodiment, the execution subject may extract a pre-established initial attribute node from the target location of the parent node. The initial attribute node may be established at the target location at the same time as the parent node is established. By way of example, for each parent node created by the UBIFS file system, an initial attribute node is created at the end of the storage space of the parent node. The executing agent may then extract the parent node identification of the parent node from the extracted initial attribute node. Wherein, the parent node identification can be stored in the preset position of the initial attribute node. According to the optional practice mode, the initial attribute node is extracted from the target position, the father node identification can be quickly and accurately obtained, and the corresponding relation between the father node and each child node can be accurately established.
Alternatively, the parent node identifier may be stored in the node KEY information (e.g., INO _ KEY shown in fig. 4) of the initial attribute node, so that the execution body may determine the parent node identifier of the parent node from the extracted node KEY information included in the initial attribute node. It should be noted that the node key information stores not only the parent node identifier but also the identifier of the node, and the correspondence between the parent node and the child node can be established by the node identifier. According to the optional practice mode, the father node identification is extracted from the node key information included in the initial attribute node, so that the father node identification can be further extracted quickly and accurately, and the data recovery efficiency is improved.
Step 7032, based on the parent node identifier included in the attribute node set and the parent node identifier included in the data node set, the attribute node and the data node corresponding to the parent node are determined.
Specifically, the execution subject may locate the parent node after filling the parent node identifier according to the parent node identifier included in the attribute node and the data node, so as to establish the corresponding relationship between the parent node and the attribute node and between the parent node and the data node.
And step 704, recovering the data to be recovered based on the corresponding relation among the father node, the attribute node and the data node.
In this embodiment, the execution subject may recover the data to be recovered based on the correspondence relationship between the parent node, the attribute node, and the data node. Specifically, the execution main body may construct the nodes into a tree structure as shown in fig. 2 according to the corresponding relationship between the parent node and the attribute node, and the data node, so as to restore the data to be restored to a complete file.
In the method provided by the above embodiment of the present application, a node header information set is extracted from an unallocated data area in a target memory, a parent node set, an attribute node set, and a data node set are determined based on the node header information set, a parent node identifier is extracted from a target position of each parent node, the parent node identifier is filled in node header information of the parent node, a corresponding relationship between the parent node, the attribute node, and the data node is determined based on the parent node identifier, and finally, data to be restored is restored according to the corresponding relationship. Therefore, the data recovery mode is enriched, the file data recovery on a UBIFS file system is facilitated, and the flexibility of the data recovery is improved.
With further reference to fig. 8, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of a data recovery apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 7, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 8, the data recovery apparatus 800 of the present embodiment includes: an extracting module 801, configured to extract a node header information set from an unallocated data area in a target memory, and determine a node set based on the node header information set; a first determining module 802, configured to determine, from a node set, a parent node set, an attribute node set, and a data node set; a second determining module 803, configured to, for each parent node in the parent node set, extract a parent node identifier from a target location of the parent node, and fill the parent node identifier into node header information of the parent node; determining an attribute node and a data node corresponding to a parent node based on the parent node identifier included by the attribute node in the attribute node set and the parent node identifier included by the data node in the data node set; the recovery module 804 is configured to recover the data to be recovered based on the corresponding relationship between the parent node, the attribute node, and the data node.
In this embodiment, the extraction module 801 may extract the node header information set from the unallocated data area in the target memory and determine the node set based on the node header information set. The target memory may be a memory provided in the apparatus 800, or may be a memory provided in another electronic device communicatively connected to the apparatus 800.
The unallocated data area may be a memory space in the target memory where valid data is not stored. For example, after a file is deleted, the space occupied by the file before deletion is occupied.
In this embodiment, the first determining module 802 may determine a parent node set, an attribute node set, and a data node set from among the node sets. Specifically, the first determining module 802 may determine the parent node set, the attribute node set, and the data node set according to the node type information included in the node header information. For example, for a node, if the node header information of the node includes information for characterizing a parent node, the node is the parent node.
In this embodiment, the parent nodes in the above-mentioned parent node set may correspond to at least one attribute node and at least one data node. The parent node and corresponding at least one attribute node and at least one data node may be used to characterize a file.
In this embodiment, for each parent node in the parent node set, the second determining module 803 may perform the following steps:
step 8031, extracting the father node identifier from the target position of the father node, and filling the father node identifier into the node header information of the father node. Wherein the target location may be a location determined from a pre-specified memory address. For example, in a UBIFS file system, the target location of a parent node may be the location of an 8-byte alignment offset after the parent node's storage space.
Step 8032, based on the parent node identifier included in the attribute node set and the parent node identifier included in the data node set, determines the attribute node and the data node corresponding to the parent node.
Specifically, the second determining module 803 may locate the parent node after filling the parent node identifier according to the parent node identifier included in the attribute node and the data node, so as to establish the corresponding relationship between the parent node and the attribute node and the data node.
In this embodiment, the recovery module 804 may recover the data to be recovered based on the correspondence relationship between the parent node, the attribute node, and the data node. Specifically, the recovery module 804 may construct the nodes into a tree structure as shown in fig. 2 according to the corresponding relationship between the parent node and the attribute node, and the data node, so as to recover the data to be recovered into a complete file.
In some optional implementations of this embodiment, the extracting module is further configured to: and judging the validity of the node corresponding to each node header information, and if the node is a valid node, adding the valid node into the node set.
In some optional implementations of this embodiment, the second determining module includes: a first extracting unit configured to extract an initial attribute node established in advance from a target position of the parent node; and the second extraction unit is used for extracting the parent node identification of the parent node from the extracted initial attribute node.
In some optional implementations of this embodiment, the second extracting unit is further configured to: the parent node identification of the parent node is determined from the node key information included in the extracted initial attribute node.
In some optional implementations of this embodiment, the extracting module is further configured to: and extracting the node head information set from the unallocated data area in the target memory based on a preset node mark value.
In some optional implementations of this embodiment, the unallocated data area is determined in advance based on the following steps: building a map of unallocated cluster sectors of the target memory; and determining an unallocated data area based on the unallocated cluster sector map.
In some optional implementation manners of this embodiment, a parent node in the parent node set is used to represent a directory where the data to be restored is located, an attribute node in the attribute node set is used to represent an attribute of the data to be restored, and a data node in the data node set includes valid data of the data to be restored.
The apparatus provided in the foregoing embodiment of the present application extracts a node header information set from an unallocated data area in a target memory, determines a parent node set, an attribute node set, and a data node set based on the node header information set, extracts a parent node identifier from a target position of each parent node, fills the parent node identifier in node header information of the parent node, determines a correspondence relationship between the parent node, the attribute node, and the data node based on the parent node identifier, and recovers data to be recovered according to the correspondence relationship. Therefore, the data recovery mode is enriched, the file data recovery on a UBIFS file system is facilitated, and the flexibility of the data recovery is improved.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable storage medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an extraction module, a first determination module, a second determination module, and a recovery module. Where the names of these modules do not in some cases constitute a limitation on the unit itself, for example, the first determining module may also be described as "a module for determining a parent node set, an attribute node set, and a data node set from the node set".
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: extracting a node head information set from an unallocated data area in a target memory, and determining a node set based on the node head information set; determining a father node set, an attribute node set and a data node set from the node set; for each father node in the father node set, extracting a father node identifier from the target position of the father node, and filling the father node identifier into node head information of the father node; determining an attribute node and a data node corresponding to a parent node based on the parent node identifier included by the attribute node in the attribute node set and the parent node identifier included by the data node in the data node set; and recovering the data to be recovered based on the corresponding relation among the father node, the attribute node and the data node.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (8)

1. A method for data recovery, the method comprising:
extracting a node header information set from an unallocated data area in a target memory, and determining a node set based on the node header information set;
determining a father node set, an attribute node set and a data node set from the node sets;
for each father node in the father node set, extracting a father node identifier from the target position of the father node, and filling the father node identifier into node head information of the father node; determining an attribute node and a data node corresponding to a parent node based on the parent node identifier included by the attribute node in the attribute node set and the parent node identifier included by the data node in the data node set;
restoring the data to be restored based on the corresponding relation among the father node, the attribute node and the data node;
wherein the extracting of the parent node identifier from the target location of the parent node comprises:
extracting a pre-established initial attribute node from the target position of the father node;
extracting the parent node identification of the parent node from the extracted initial attribute node, including: the parent node identification of the parent node is determined from the node key information included in the extracted initial attribute node.
2. The method of claim 1, wherein determining a set of nodes based on the set of node header information comprises:
and judging the validity of the node corresponding to each node header information, and if the node is a valid node, adding the valid node into the node set.
3. The method of claim 1, wherein extracting the set of node header information from the unallocated data area in the target memory comprises:
and extracting the node head information set from the unallocated data area in the target memory based on a preset node mark value.
4. The method of claim 1, wherein the unallocated data area is determined in advance based on the steps of:
building a map of unallocated cluster sectors of the target memory;
and determining an unallocated data area based on the unallocated cluster sector map.
5. The method according to one of claims 1 to 4, wherein a parent node in the parent node set is used to characterize a directory in which the data to be restored is located, an attribute node in the attribute node set is used to characterize an attribute of the data to be restored, and a data node in the data node set includes valid data of the data to be restored.
6. An apparatus for data recovery, the apparatus comprising:
an extraction module for extracting a node header information set from an unallocated data area in a target memory and determining a node set based on the node header information set;
the first determining module is used for determining a father node set, an attribute node set and a data node set from the node sets;
a second determining module, configured to, for each parent node in the parent node set, extract a parent node identifier from a target location of the parent node, and fill the parent node identifier in node header information of the parent node; determining an attribute node and a data node corresponding to a parent node based on the parent node identifier included by the attribute node in the attribute node set and the parent node identifier included by the data node in the data node set;
the recovery module is used for recovering the data to be recovered based on the corresponding relation among the father node, the attribute node and the data node;
wherein the extracting of the parent node identifier from the target location of the parent node comprises:
extracting a pre-established initial attribute node from the target position of the father node;
extracting the parent node identification of the parent node from the extracted initial attribute node, including: the parent node identification of the parent node is determined from the node key information included in the extracted initial attribute node.
7. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201910926172.4A 2019-09-27 2019-09-27 Data recovery method and device Active CN110704372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910926172.4A CN110704372B (en) 2019-09-27 2019-09-27 Data recovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910926172.4A CN110704372B (en) 2019-09-27 2019-09-27 Data recovery method and device

Publications (2)

Publication Number Publication Date
CN110704372A CN110704372A (en) 2020-01-17
CN110704372B true CN110704372B (en) 2022-05-20

Family

ID=69196899

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910926172.4A Active CN110704372B (en) 2019-09-27 2019-09-27 Data recovery method and device

Country Status (1)

Country Link
CN (1) CN110704372B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116700635B (en) * 2023-08-09 2024-01-30 深圳市威科伟业电子科技有限公司 Solid state disk data recovery method and solid state disk

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7650341B1 (en) * 2005-12-23 2010-01-19 Hewlett-Packard Development Company, L.P. Data backup/recovery
CN104199888A (en) * 2014-08-25 2014-12-10 厦门市美亚柏科信息股份有限公司 Data recovery method and device for resilient file system
CN109582500A (en) * 2018-11-26 2019-04-05 万兴科技股份有限公司 Data reconstruction method, device, computer equipment and storage medium
CN109857589A (en) * 2018-12-21 2019-06-07 厦门市美亚柏科信息股份有限公司 A kind of restoration methods, device and storage medium for deleting file

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7650341B1 (en) * 2005-12-23 2010-01-19 Hewlett-Packard Development Company, L.P. Data backup/recovery
CN104199888A (en) * 2014-08-25 2014-12-10 厦门市美亚柏科信息股份有限公司 Data recovery method and device for resilient file system
CN109582500A (en) * 2018-11-26 2019-04-05 万兴科技股份有限公司 Data reconstruction method, device, computer equipment and storage medium
CN109857589A (en) * 2018-12-21 2019-06-07 厦门市美亚柏科信息股份有限公司 A kind of restoration methods, device and storage medium for deleting file

Also Published As

Publication number Publication date
CN110704372A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
CN109254733B (en) Method, device and system for storing data
CN106527958B (en) Method and equipment for writing data and acquiring data for distributed storage system
US20170124103A1 (en) Method and Apparatus for Creating System Disk Snapshot of Virtual Machine
US10210191B2 (en) Accelerated access to objects in an object store implemented utilizing a file storage system
US8938430B2 (en) Intelligent data archiving
JP7157141B2 (en) A Context-Aware Differencing Algorithm for Genome Files
CN107203574A (en) Data management and the polymerization of data analysis
CN112052120B (en) Database deleted data recovery method and device
CN111339042A (en) Data operation processing method and system and scheduling server
CN110704372B (en) Data recovery method and device
CN111930346A (en) Artificial intelligence information processing method and device, electronic equipment and storage medium
US10877992B2 (en) Updating a database
CN112579364B (en) Deleted file deep recovery method and device based on QNX6FS file system
CN111176901B (en) HDFS deleted file recovery method, terminal device and storage medium
CN114756837B (en) Block chain-based digital content tracing method and system
CN111273920A (en) Method and device for writing data into installation package and storage medium
CN113610527B (en) Alliance chain transaction method, device, system, terminal equipment and storage medium
US11243932B2 (en) Method, device, and computer program product for managing index in storage system
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN112380174A (en) XFS file system analysis method containing deleted files, terminal equipment and storage medium
CN113627938B (en) Data deleting method, device and equipment of block chain and storage medium
US11500590B2 (en) Method, device and computer program product for data writing
CN117234683A (en) Data processing system and data processing method based on distributed server
CN114238270A (en) Database operation method and device, computer equipment and readable storage medium
CN107766564B (en) Recording type data compression method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant