Damaged target recovery method and device, electronic equipment, nonvolatile storage medium and computer program product

By analyzing the free file directory entry data in the exfat file system, effective partition information is constructed, and the problem of unsuccessful partition restoration of damaged storage devices in the existing technology is solved, achieving high accuracy and high efficiency restoration effects.

CN119440917APending Publication Date: 2025-02-14CHENGDU YIWO TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411557031.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art is difficult to accurately restore damaged storage device partitions, especially when DBR and backup DBR are overwritten, resulting in unsuccessful data recovery.

Method used

By analyzing the free file directory entry data in the extended file allocation table (exfat) file system, effective partition information is built, so as to select the most suitable restoration area for restoration of damaged targets.

Benefits of technology

It improves the accuracy and efficiency of the damaged targets, and can successfully restore the damaged targets when the normal analysis of file system information is invalid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440917A_ABST
    Figure CN119440917A_ABST
Patent Text Reader

Abstract

The invention discloses a damaged target recovery method, a damaged target recovery device, electronic equipment, a nonvolatile storage medium and a computer program product, which are applied to the technical field of storage. And obtaining free file directory entry data and subsequent free file directory entry data from the disk sector data. The method comprises the following steps: analyzing folder information of current file directory entry data and subsequent file directory entry data to obtain initial position information and cluster occupied space values of a plurality of candidate recovery areas, classifying the file directory entry data, and classifying the candidate recovery area containing the most file directory entry data into a cluster occupied space value; and the target recovery area is used for recovering the damaged target. According to the invention, the problem of unsuccessful target recovery in related technologies can be solved, and the damaged target recovery accuracy and recovery efficiency are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a damaged target recovery method, device, electronic device, non-volatile storage medium and computer program product. Background Art

[0002] With the rapid development of big data, cloud technology, and artificial intelligence technology, more and more electronic data is generated in daily work and life, and the requirements for the security and stability of storage devices and electronic data are becoming higher and higher.

[0003] Inevitably, electronic data will be deleted by mistake or damaged for other reasons, and storage devices will also be damaged for some reasons, which will cause user data to be unable to be used normally. Related technologies use exFAT (Extended File Allocation Table File System) to locate deleted file data or folder data through DBR (Dos Boot Record) and partition information recorded in the backup DBR. Once the DBR and backup DBR are overwritten by other data, the data cannot be successfully recovered. Even if it is recovered, it is wrong data.

[0004] In view of this, achieving accurate restoration of damaged targets is a technical problem that needs to be solved by those skilled in the art. It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0005] The present application provides a damaged target recovery method, device, electronic device, non-volatile storage medium and computer program product, which can recover the damaged target and effectively improve the accuracy and efficiency of damaged target recovery.

[0006] In order to solve the above technical problems, this application provides the following technical solutions:

[0007] On one hand, the present application provides a damaged target recovery method, comprising:

[0008] Based on the file system characteristics of the extended file allocation table, obtain the free current file directory entry data from the disk sector data, and obtain the free subsequent file directory entry data after the corresponding acquisition time of the current file directory entry data;

[0009] By analyzing the folder information of the current file directory entry data and each subsequent file directory entry data, the starting position information and cluster occupied space values ​​of multiple candidate recovery areas are obtained;

[0010] The file directory entry data are classified by making the starting position information and cluster occupied space values ​​the same, and the candidate recovery area containing the most file directory entry data is selected from each candidate recovery area as the target recovery area to restore the damaged target through the target recovery area.

[0011] Exemplarily, the obtaining of the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data includes:

[0012] Determine the file set of the file directory entry data to which it belongs according to the data structure of the current file directory entry data;

[0013] Analyze the folder information of the file directory entry data file set and the file set information of the subsequent file directory entry data file set to determine the starting position information and cluster occupied space values ​​of multiple candidate recovery areas; wherein the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set with at least one subsequent file directory entry.

[0014] Exemplarily, the analyzing the information of each folder of the file directory entry data file set and the file set information of the subsequent file directory entry data file set includes:

[0015] Obtaining the file start cluster number and the number of sectors of each cluster contained in the information of each folder of the file directory entry data file set;

[0016] Obtaining the file sector number contained in the file set information of the subsequent file directory entry data file set;

[0017] Based on the number of reserved clusters in the system, the starting cluster number of each file, the number of sectors in each cluster and the file sector number, the starting position information and cluster occupied space value of multiple candidate recovery areas are obtained.

[0018] Exemplarily, the obtaining of the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data includes:

[0019] Determine the file directory entry data file set to which the current file directory entry data belongs according to the data structure of the current file directory entry data, and determine the cluster occupied space value of the file directory entry data file set;

[0020] Selecting the first target file directory entry data file set having a folder and the smallest starting sector number from the file directory entry data file set and the subsequent file directory entry data file set; the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set having at least one subsequent file directory entry;

[0021] According to the folder information of the file directory entry data file set adjacent to the target file directory entry data folder, the starting position information of the current candidate recovery area is determined, and the cluster occupied space value is used as the cluster occupied space value of the current candidate recovery area; wherein the subsequent file directory entry data file set includes each subsequent file directory entry data.

[0022] Exemplarily, the obtaining of the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data includes:

[0023] Sort the file directory entry data file set and subsequent file directory entry data file sets according to the starting sector number, and determine the first target file directory entry data file set with a folder;

[0024] Determine from the file directory entry data file set and the subsequent file directory entry data file set a second target file directory entry data file set whose starting sector number is adjacent to and immediately next to the starting sector number of the first target file directory entry data file set;

[0025] Based on the number of clusters reserved by the system, the starting position information of multiple candidate recovery areas is obtained according to the starting cluster number of the first folder of the first target file directory entry data file set, the starting sector number of the second target file directory entry data file set and the cluster occupied space value; wherein, the first folder is the folder with the smallest cluster number in the first target file directory entry data file.

[0026] Exemplarily, the damaged target is a target partition, and selecting a candidate recovery area containing the most file directory entry data from each candidate recovery area as the target recovery area includes:

[0027] Obtain the starting position of the root area of ​​the target recovery area;

[0028] The partition boot sector of the target partition is reconstructed according to the cluster occupied space value, the starting position information and the starting position of the root area of ​​the target recovery area.

[0029] On the other hand, the present application provides a damaged target recovery device, comprising:

[0030] A free data acquisition module, used to acquire free current file directory entry data from disk sector data based on the file system characteristics of the extended file allocation table, and acquire free subsequent file directory entry data after the acquisition time corresponding to the current file directory entry data;

[0031] A candidate recovery area determination module, configured to obtain the starting position information and cluster occupied space values ​​of a plurality of candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data;

[0032] The effective recovery area determination module is used to classify the data of each file directory entry in a method of making the starting position information and the cluster occupied space value the same, and select the candidate recovery area containing the most file directory entry data from each candidate recovery area as the target recovery area, so as to restore the damaged target through the target recovery area.

[0033] The present application also provides an electronic device, comprising a processor, wherein the processor is used to implement the steps of the damaged target recovery method as described in any of the preceding items when executing a computer program stored in a memory.

[0034] The present application also provides a non-volatile storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the damaged target recovery method as described in any of the preceding items are implemented.

[0035] Finally, the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the damaged target recovery method as described in any of the preceding items.

[0036] The advantage of the technical solution provided by the present application is that when normal analysis of file system information is invalid, only free file directory entry information can be obtained, and these free file target entry information also have no clues pointing to their storage location. By analyzing the current file directory entry information and subsequent file directory entry information, a valid partition information can be constructed, and the damaged target can be restored through this valid partition, thereby effectively improving the accuracy and efficiency of restoring the damaged target.

[0037] In addition, the present application also provides corresponding implementation devices, electronic devices, non-volatile storage media and computer program products for the damaged target recovery method, which further makes the method more practical, and the devices, electronic devices, non-volatile storage media and computer program products have corresponding advantages.

[0038] The technical features mentioned above, the technical features to be mentioned below, and the technical features shown separately in the drawings can be combined with each other arbitrarily, as long as the combined technical features are not contradictory. All feasible feature combinations are technical contents clearly recorded in this application. Any of the multiple sub-features contained in the same sentence can be applied independently, and does not have to be applied together with other sub-features.

[0039] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] FIG1 is a schematic diagram of a process flow of a damaged target recovery method provided by the present application;

[0042] FIG2 is a schematic diagram of sector data of an exemplary application scenario provided by the present application;

[0043] FIG3 is a structural diagram of a specific implementation of a damaged target recovery device provided by the present application;

[0044] FIG. 4 is a structural diagram of a specific implementation of the electronic device provided in this application. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The terms "including" and "having" and any variations thereof in the specification and the above-mentioned drawings are intended to cover non-exclusive inclusions. The term "exemplary" means "used as an example, embodiment or illustrative". Any embodiment described herein as "exemplary" is not necessarily to be interpreted as being superior or better than other embodiments.

[0046] Related technologies usually use exFAT partitions to recover lost data. This method uses the partition information recorded in the DBR and backup DBR to locate deleted file data or folder data. However, if the DBR and backup DBR are overwritten by other data, there will be no valid partition information on the disk to locate the location of these deleted files or folders, resulting in unsuccessful data recovery.

[0047] In view of this, the present application obtains free file directory entry information, and can construct a valid partition information by analyzing the current file directory entry information and the subsequent file directory entry information, and accurately restore the damaged target through this valid partition. After introducing the technical solution of the present application, various non-limiting implementation methods of the present application are described in detail below. In order to better illustrate the present application, numerous specific details are given in the specific implementation methods below. Those skilled in the art should understand that the present application can also be implemented without these specific details. In other examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present application.

[0048] First, please refer to FIG. 1 , which is a flow chart of a damaged target recovery method provided by the present application. The damaged target of the present invention can be a partition of a storage device, such as a disk partition, an exfat partition, a DBR, a backup DBR, or data, including but not limited to data in an exfat partition, data in a DBR, data in a backup DBR, a root cluster, a fat (File Allocation Table), a cluster bitmap, and an uppercase alphabet table. When a partition is damaged or the above data is lost, the normal analysis of the file system information is invalid, and only the free FDT information is obtained. The process of realizing the recovery of the damaged target includes the following:

[0049] S101: Based on the file system characteristics of the extended file allocation table, obtain free current file directory entry data from disk sector data, and obtain free subsequent file directory entry data after the corresponding acquisition time of the current file directory entry data.

[0050] In this embodiment, the file system characteristics of exfat are used to determine the storage location of FDT (File Directory Entry) in the file system. The exfat file system includes DBR and its reserved sectors, FAT, cluster bitmap files, uppercase character files, and user data areas. The location of the FAT table can be determined based on the relevant information of the DBR. FDT is usually used to store file directory entries under the root directory. These directory entries contain attribute information of files or subdirectories, such as file name, size, creation date, etc. In FAT16 and FAT32, FDT is usually located after the FAT table, immediately following the reserved sectors and FAT sectors, so that FDT data can be determined. In other words, by analyzing the disk sector data and then combining it with the file system characteristics of exfat, it can be determined which sectors are FDT data sectors. If these sectors are FDT data sectors, they are recorded, that is, the FDT data is obtained. The file system needs clues to locate a file and determine which sector of the disk the file's data is located in. If the clue is lost, it is free data, that is, free FDT data refers to FDT data that has no clues pointing to the FDT record. For the sake of distinction, this step defines the first acquired FDT data as the current file directory entry data. After acquiring the current FDT data, the subsequent acquired free FDT data is defined as the subsequent file directory entry data, that is, the subsequent FDT data. For the convenience of subsequent data analysis and processing, the subsequent file directory entry data can be further classified into a file set. FDT data is a file record of a certain file, which is an item. The file set is a sector that records many such file records, that is, it contains multiple items.

[0051] S102: Obtaining the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data.

[0052] In this embodiment, the storage space of the hard disk is composed of many small The sector unit is too small to be managed, so the operating system combines adjacent sectors into a larger unit, namely a cluster, and then manages the cluster. File data is divided and stored on the disk according to the size of the cluster. Therefore, in order to recover the damaged target, it is necessary to first build a valid recovery area, which is uniquely determined by the starting position information and the cluster occupied space value. The cluster occupied space value is also the cluster size, which refers to the number of sectors contained in each cluster. For example, each cluster can include 2, 4, 8, 16, 32 or 64 sectors. After the previous step obtains the data of the current file directory entry and each subsequent file directory entry, analyze the data structure indicated by the FDT data, such as the name, offset, size and description, as well as the file information recorded by the FDT. The file information is also the folder information. The folder information includes but is not limited to the starting cluster number of the folder, the size of the folder, and the creation, modification, and access time of the file. By analyzing these free FDT data, multiple recovery areas and the starting position information and cluster occupied space value of each recovery area can be determined. Since these recovery areas are not completely valid recovery areas, they can be defined as candidate recovery areas for ease of description.

[0053] S103: Classify the file directory entry data by making the starting position information and the cluster occupied space value the same, and select the candidate recovery area containing the most file directory entry data from each candidate recovery area as the target recovery area, so as to restore the damaged target through the target recovery area.

[0054] When all the FDT data found through the above steps, that is, the current FDT data and subsequent FDT data obtained in step S101, are classified into file sets for ease of management, then the partition information of the FDT file set can be calculated, such as the partition data area sector starting position and partition cluster size in the partition information, so that a series of partition data area sector starting position information and cluster size can be obtained. In order to determine the partition with the highest accuracy of restoring the damaged target, that is, to obtain the most effective partition, all the acquired candidate recovery areas can be matched one by one, and the data area sector starting position and cluster size of the candidate recovery area inferred from all FDT data or FDT file sets can be bound. In other words, the partition of the data area starting position and cluster size of the above-mentioned candidate recovery area can be determined by the FDT file set. For example, the FDT data or FDT file set with the same data area starting sector number and the same cluster size can be used for classification, and the candidate recovery area with the most matched FDT data or FDT file sets among all candidate recovery areas can be classified. This candidate recovery area is the most effective partition. For the convenience of description, it is defined as the target recovery area. If the damaged target is data, then when the target recovery area is determined, data can be directly restored according to the target recovery area. If the damaged target is a target partition, the starting position of the root area of ​​the target recovery area is obtained; the partition boot sector of the target partition is reconstructed according to the cluster occupied space value, starting position information and root area starting position of the target recovery area. In other words, if the target partition needs to be repaired, the information recorded in the DBR of the target partition needs to be reconstructed, such as the cluster size of the target partition, the starting sector number of the target partition, and the starting position of the data area of ​​the target partition. Among them, the cluster size of the target partition can be represented by the cluster occupied space value of the target recovery area, the starting sector number of the target partition can be represented by the starting position information of the target recovery area, and the starting position of the root area of ​​the partition can be obtained by manually analyzing the sector data.

[0055] In the technical solution provided in the present application, when normal analysis of file system information is invalid, only free file directory entry information can be obtained. These free file target entry information also have no clues pointing to their storage locations. By analyzing the current file directory entry information and subsequent file directory entry information, a valid partition information can be constructed. Through this valid partition, the damaged target can be restored, thereby effectively improving the accuracy and efficiency of restoring the damaged target.

[0056] It should be noted that there is no strict order of execution between the steps in the present application. As long as they comply with the logical order, these steps can be executed simultaneously or in a preset order. Figure 1 is only a schematic diagram and does not mean that this is the only execution order.

[0057] In the above embodiment, there is no limitation on how to determine the starting position information and the cluster occupied space value of the candidate recovery area. The present invention also provides multiple implementation methods, which may include the following:

[0058] As a method for determining the starting position information and cluster occupied space value of a candidate recovery area, the file directory entry data file set to which it belongs can be determined based on the data structure of the current file directory entry data; the folder information of the file directory entry data file set and the file set information of the subsequent file directory entry data file set are analyzed to determine the starting position information and cluster occupied space values ​​of multiple candidate recovery areas.

[0059] In this embodiment, after obtaining FDT data from the sector storing FDT data, the FDT data structure is analyzed, such as offset, description, etc. If it is determined that the analyzed sector contains FDT file records, it indicates that the sector is a file set that records all FDT file records. The file set refers to a collection of all FDT records, that is, the FDT file set to which it belongs can be determined through its data structure, and some information of the file can also be obtained, such as the folder starting cluster, the size of the folder, the creation, modification, and access time of the folder. For ease of processing, the subsequent free FDT data can be collected into the subsequent free FDT file set, and the file set contains the item of folder, that is, the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set with at least one subsequent file directory entry. Among them, the folder information includes but is not limited to the starting cluster number of the folder, the size of the folder, the creation, modification, and access time of the file; the file set information includes the starting sector number of the file set, how many sectors in the file set record FDT data, and how many sectors are empty sector data. Exemplarily, the file starting cluster number and the number of sectors in each cluster contained in the folder information of the file directory entry data file set can be obtained; the starting sector number of the file set contained in the file set information of the subsequent file directory entry data file set can be obtained; based on the number of clusters reserved by the system, according to the starting cluster number of each file, the number of sectors in each cluster and the file sector number, the starting position information and cluster occupied space value of multiple candidate recovery areas are obtained.

[0060] As a more efficient way, if the system reserves 2 clusters, and user data starts from the reserved cluster, the first partition information calculation formula can be stored in advance, and the first partition information calculation formula can be expressed as: Area+(Clu-2)*SecPerClu = Sec, where Area is the starting position information of the data area, for example, it can be expressed by the starting sector number, Clu is the starting cluster number of the file, SecPerClu is the number of sectors per cluster of the partition, and Sec is the sector number of the file. Among them, one variable is Area, and one variable element is SecPerClu. Clu can be obtained by analyzing the cluster number of the FDT file set to which the free current FDT data belongs, and Sec can be obtained by recording the sector number of the subsequent FDT file set of the subsequent free FDT data. The two-dimensional linear equation group obtained by the two sets of data can obtain Area and SecPerClu.

[0061] Taking the FAT32 file system as an example, by analyzing the sector data corresponding to the starting cluster number of a folder's FDT, the sector number corresponding to the current folder FDT is obtained, and the starting cluster number and starting sector number of the current folder recorded in its FDT are analyzed. For example, by analyzing the first folder, the starting cluster of the current FDT is 5, and the starting sector of the current FDT is 8216, so X+(5-2)*Y=8216 can be obtained; by analyzing the second folder, the starting cluster of the current FDT is 63302, and the starting sector of the current FDT is 514592, so X+(63302-2)*Y=514592 can be obtained. According to these two formulas, X=8192, Y=8 can be obtained, that is, the data area of ​​a candidate recovery area is 8192, and the number of sectors per cluster is 8 sectors.

[0062] In order to make the technical solution of this embodiment more clear to those skilled in the art, this embodiment also provides an illustrative embodiment, which may include the following contents:

[0063] A1: Get the free FDT data based on the characteristic information of exfat file.

[0064] A2: Analyze the data structure of the free FDT data to determine the FDT data set to which it belongs, record the starting sector number of the FDT file set, obtain the folder information stored in the FDT file set, and record the folder information in order from small to large by cluster size.

[0065] A3: Obtain the subsequent free FDT data and collect it into the subsequent free FDT file set.

[0066] A5: Record the free FDT file set information starting from the current free FDT data to the subsequent free FDT file set information in sequence.

[0067] A6: Call Area+(Clu-2)*SecPerClu = Sec to calculate the data starting position information and cluster size of the candidate recovery area.

[0068] As another method for determining the starting position information and cluster occupied space value of a candidate recovery area, the file directory entry data file set to which the current file directory entry data belongs is determined according to the data structure of the current file directory entry data, and the cluster occupied space value of the file directory entry data file set is determined; the first target file directory entry data file set with a folder and the smallest starting sector number is selected from the file directory entry data file set and the subsequent file directory entry data file set; the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set with at least one subsequent file directory entry; the starting position information of the current candidate recovery area is determined according to the folder information of the file directory entry data file set adjacent to the target file directory entry data folder, and the cluster occupied space value is used as the cluster occupied space value of the current candidate recovery area; wherein, the subsequent file directory entry data file set includes each subsequent file directory entry data.

[0069] In this embodiment, in order to quickly find the first target file directory entry data file set with a folder and the smallest starting sector number, the file directory entry data file set and subsequent file directory entry data file sets can be sorted in order from small to large according to the starting sector number, and the file directory entry data file set can be checked in order to see if there is a folder. Of course, the file directory entry data file set and subsequent file directory entry data file sets can also be sorted in order from large to small according to the starting sector number, and the file directory entry data file set can be checked in order to see if there is a folder, so as to quickly determine the first first target file directory entry data file set with a folder. From the file directory entry data file set and subsequent file directory entry data file sets, a second target file directory entry data file set with a starting sector number adjacent to the starting sector number of the first target file directory entry data file set and the next one to it is determined; based on the number of reserved clusters in the system, the starting position information of multiple candidate recovery areas is obtained according to the starting cluster number of the first folder of the first target file directory entry data file set, the starting sector number of the second target file directory entry data file set, and the cluster occupied space value. The first folder is the folder with the smallest cluster number in the first target file directory entry data file.

[0070] As a more efficient way, if the system reserves 2 clusters and user data all starts after the reserved clusters, the second partition information calculation formula can be stored in advance. The second partition information calculation formula can be expressed as: X+(a-2)*C=b, where X is the starting position information of the candidate recovery area, a is the starting cluster number of the first folder of the first target file directory entry data file set, C is the cluster occupied space value, and b is the starting sector number of the second target file directory entry data file set. Taking the sector data shown in Figure 2 as an example, the starting sector of the current FDT file set is 17031, which contains 3 folders, namely: System Volume Infomation, ext4, $RECYCLE.BIN, and the starting clusters of each folder are: 0x20A, 0x20C, 0x1FE6, and their corresponding decimal values ​​are: 522, 524, 8166; the cluster size C of the FDT file set is 1 sector per cluster, and the starting sector of the following FDT file set is 17032. Correspondingly, we can get X+(522-2)*1=17032, and then we can calculate X=16512.

[0071] In order to make the technical solution of this embodiment more clear to those skilled in the art, this embodiment also provides an illustrative embodiment, which may include the following contents:

[0072] B1: Analyze the characteristic information of exfat file and obtain the free FDT data.

[0073] B2: Determine the FDT file set to which it belongs by analyzing the free FDT data, record the starting sector number of the FDT file set, obtain the folder information stored in the FDT file set, and record the folder information in order of cluster size from small to large. Because the file system stores the FDT data of the folder in a cluster-aligned manner, after analyzing the file set, the cluster size C of the FDT file set can be obtained, and the cluster size occupied by the FDT file set can be recorded.

[0074] B3: Acquire the subsequent free FDT data and collect them into the subsequent free FDT file set.

[0075] B4: Record the free FDT file set information starting from the current free FDT data to the subsequent free FDT file set information in sequence.

[0076] B5: Sort all the FDT file sets on the obtained disk, for example, sort them in ascending order of the starting sector numbers of the FDT file sets.

[0077] B6: Traverse all ordered DFT file sets and find the first FDT file set A with folders. Step B2 sorts the folders from small to large, so the first folder has the smallest cluster number a. The starting cluster number a of the first folder can be taken out, and then traverse from the current FDT file set to determine the FDT file set B that follows FDT file set A, and obtain the starting sector number b of the file set recorded in FDT file set B.

[0078] B7: Call the second partition information calculation relationship to determine the starting position information of each candidate recovery area.

[0079] B8: Through the above process, the partition data area sector starting position and partition cluster size in the partition information can be calculated for all FDT file sets found during the scanning process. In this way, a series of partition data area sector starting positions and cluster sizes can be obtained. By matching all the obtained partitions one by one, the FDT file sets with the same data area starting sector number and cluster size of the candidate recovery areas calculated from all FDT sets are classified, and the candidate recovery area with the most matching FDT file sets in all partitions is classified. Then the candidate recovery area becomes the target recovery area.

[0080] The present application also provides a corresponding device for the damaged target recovery method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The damaged target recovery device provided by the present application is introduced below. The device is used to implement the damaged target recovery method provided by the present application. In this embodiment, the damaged target recovery device may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the damaged target recovery method disclosed in Example 1. The program module referred to in this application refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the damaged target recovery device in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment. The damaged target recovery device described below and the damaged target recovery method described above can be referenced to each other.

[0081] From the perspective of functional modules, please refer to FIG. 3 , which is a structural diagram of a damaged target recovery device provided by the present application in a specific implementation manner. The device may include:

[0082] The free data acquisition module 301 is used to acquire the free current file directory entry data from the disk sector data based on the file system characteristics of the extended file allocation table, and acquire the free subsequent file directory entry data after the corresponding acquisition time of the current file directory entry data.

[0083] The candidate recovery area determination module 302 is used to obtain the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data.

[0084] The effective recovery area determination module 303 is used to classify the data of each file directory entry by making the starting position information and the cluster occupied space value the same, and select the candidate recovery area containing the most file directory entry data from each candidate recovery area as the target recovery area, so as to restore the damaged target through the target recovery area.

[0085] Optionally, in some implementations of this embodiment, the candidate recovery area determination module 302 may be further used to:

[0086] According to the data structure of the current file directory entry data, determine the file directory entry data file set to which it belongs;

[0087] Analyze the folder information of the file directory entry data file set and the file set information of the subsequent file directory entry data file set to determine the starting position information and cluster occupied space values ​​of multiple candidate recovery areas; wherein the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set with at least one subsequent file directory entry.

[0088] As an exemplary implementation of the above embodiment, the candidate recovery area determination module 302 may be further used to:

[0089] Obtain the file start cluster number and the number of sectors in each cluster contained in the information of each folder of the file directory entry data file set;

[0090] Obtain the file sector number contained in the file set information of the subsequent file directory entry data file set;

[0091] Based on the number of reserved clusters in the system, the starting cluster number of each file, the number of sectors in each cluster and the file sector number, the starting position information and cluster occupied space value of multiple candidate recovery areas are obtained.

[0092] Optionally, in some other implementations of this embodiment, the candidate recovery area determination module 302 may be further used to:

[0093] According to the data structure of the current file directory entry data, determine the file directory entry data file set to which it belongs, and determine the cluster occupied space value of the file directory entry data file set;

[0094] Selecting the first target file directory entry data file set having a folder and the smallest starting sector number from the file directory entry data file set and the subsequent file directory entry data file set; the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set having at least one subsequent file directory entry;

[0095] According to the folder information of the file directory entry data file set adjacent to the target file directory entry data folder, the starting position information of the current candidate recovery area is determined, and the cluster occupied space value is used as the cluster occupied space value of the current candidate recovery area; wherein, the subsequent file directory entry data file set includes each subsequent file directory entry data.

[0096] As an exemplary implementation of the above embodiment, the candidate recovery area determination module 302 may be further used to:

[0097] Sort the file directory entry data file set and subsequent file directory entry data file sets according to the starting sector number, and determine the first target file directory entry data file set with a folder;

[0098] Determine from the file directory entry data file set and the subsequent file directory entry data file set that the starting sector number is adjacent to the starting sector number of the first target file directory entry data file set and is the second target file directory entry data file set immediately next to the starting sector number of the first target file directory entry data file set;

[0099] Based on the number of clusters reserved by the system, the starting position information of multiple candidate recovery areas is obtained according to the starting cluster number of the first folder of the first target file directory entry data file set, the starting sector number of the second target file directory entry data file set and the cluster occupied space value; the first folder is the folder with the smallest cluster number in the first target file directory entry data file.

[0100] Optionally, in some other implementations of this embodiment, the effective recovery area determination module 303 may be further used to:

[0101] Get the starting position of the root area of ​​the target recovery area;

[0102] The partition boot sector of the target partition is reconstructed according to the cluster occupied space value, the starting position information and the starting position of the root area of ​​the target recovery area.

[0103] The functions of the functional modules of the damaged target recovery device described in the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0104] The damaged target recovery device mentioned above is described from the perspective of functional modules. Furthermore, the present application also provides an electronic device, which is described from the perspective of hardware. FIG4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application under one implementation. As shown in FIG4 , the electronic device includes a memory 40 for storing a computer program; a processor 41 for implementing the steps of the damaged target recovery method mentioned in any of the above embodiments when executing the computer program.

[0105] Among them, the processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 41 may also be a controller, a microcontroller, a microprocessor or other data processing chip. The processor 41 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 41 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 41 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 41 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0106] The memory 40 may include one or more computer-readable storage media, which may be non-transitory. The memory 40 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the memory 40 may be an internal storage unit of an electronic device, such as a hard disk of a server. In other embodiments, the memory 40 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. Further, the memory 40 may also include both an internal storage unit of an electronic device and an external storage device. The memory 40 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the damaged target recovery method, but also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 40 is at least used to store the following computer program 401, wherein, after the computer program is loaded and executed by the processor 41, the relevant steps of the damaged target recovery method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, and the storage method may be temporary storage or permanent storage. The operating system 402 may include Windows, Unix, Linux, etc. The data 403 may include but is not limited to data corresponding to the damaged target recovery result.

[0107] In some embodiments, the electronic device may further include a display screen 42, an input / output interface 43, a communication interface 44 or a network interface, a power supply 45 and a communication bus 46. Among them, the display screen 42 and the input / output interface 43, such as a keyboard, belong to the user interface, and the optional user interface may also include a standard wired interface, a wireless interface, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 44 may optionally include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, etc., which is generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 46 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, FIG4 shows only one thick line, but this does not mean that there is only one bus or one type of bus.

[0108] Those skilled in the art will appreciate that the structure shown in FIG. 4 does not limit the electronic device and may include more or fewer components than shown in the figure, for example, may also include a sensor 47 for implementing various functions.

[0109] It is understandable that if the damaged target recovery method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes but is not limited to: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes. Based on this, the present invention also provides a non-volatile storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of recovering the damaged target described in any of the above embodiments are performed.

[0110] It is understandable that if the damaged target recovery method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, the computer software product does not need to be stored in a physical storage medium. For example, it can be directly transmitted to a computer or other device with information processing capabilities through a wired network or a wireless network to perform all or part of the steps of the methods of each embodiment of the present invention. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product. Based on this, the present invention also provides a computer program product that stores a computer program. When the computer program is executed by a processor, the steps of recovering the damaged target described in any of the above embodiments are performed.

[0111] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the hardware disclosed in the embodiments, including devices and electronic devices, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.

[0112] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0113] The above is a detailed introduction to a damaged target recovery method, device, electronic device, non-volatile storage medium and computer program product provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. It should be pointed out that based on the embodiments in the present application, for ordinary technicians in this technical field, all other embodiments obtained without creative work are within the scope of protection of the present application. Without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. A damaged target recovery method, characterized in that: include: Based on the file system characteristics of the extended file allocation table, obtain the free current file directory entry data from the disk sector data, and obtain the free subsequent file directory entry data after the corresponding acquisition time of the current file directory entry data; By analyzing the folder information of the current file directory entry data and each subsequent file directory entry data, the starting position information and cluster occupied space values ​​of multiple candidate recovery areas are obtained; The file directory entry data are classified by making the starting position information and cluster occupied space values ​​the same, and the candidate recovery area containing the most file directory entry data is selected from each candidate recovery area as the target recovery area to restore the damaged target through the target recovery area.

2. The damaged target restoration method according to claim 1, characterized in that: The method of obtaining the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data includes: Determine the file set of the file directory entry data to which it belongs according to the data structure of the current file directory entry data; Analyze the folder information of the file directory entry data file set and the file set information of the subsequent file directory entry data file set to determine the starting position information and cluster occupied space values ​​of multiple candidate recovery areas; wherein the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set with at least one subsequent file directory entry.

3. The damaged target restoration method according to claim 2, characterized in that: The analyzing the information of each folder of the file directory entry data file set and the file set information of the subsequent file directory entry data file set includes: Obtaining the file start cluster number and the number of sectors of each cluster contained in the information of each folder of the file directory entry data file set; Obtaining the file sector number contained in the file set information of the subsequent file directory entry data file set; Based on the number of reserved clusters in the system, the starting cluster number of each file, the number of sectors in each cluster and the file sector number, the starting position information and cluster occupied space value of multiple candidate recovery areas are obtained.

4. The damaged target restoration method according to claim 1, characterized in that: The method of obtaining the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data includes: Determine the file directory entry data file set to which the current file directory entry data belongs according to the data structure of the current file directory entry data, and determine the cluster occupied space value of the file directory entry data file set; Selecting the first target file directory entry data file set having a folder and the smallest starting sector number from the file directory entry data file set and the subsequent file directory entry data file set; the subsequent file directory entry data file set includes each subsequent file directory entry data and a file set having at least one subsequent file directory entry; According to the folder information of the file directory entry data file set adjacent to the target file directory entry data folder, the starting position information of the current candidate recovery area is determined, and the cluster occupied space value is used as the cluster occupied space value of the current candidate recovery area; wherein the subsequent file directory entry data file set includes each subsequent file directory entry data.

5. The damaged target restoration method according to claim 4, characterized in that: The method of obtaining the starting position information and cluster occupied space values ​​of multiple candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data includes: Sort the file directory entry data file set and subsequent file directory entry data file sets according to the starting sector number, and determine the first target file directory entry data file set with a folder; Determine from the file directory entry data file set and the subsequent file directory entry data file set a second target file directory entry data file set whose starting sector number is adjacent to and immediately next to the starting sector number of the first target file directory entry data file set; Based on the number of clusters reserved by the system, the starting position information of multiple candidate recovery areas is obtained according to the starting cluster number of the first folder of the first target file directory entry data file set, the starting sector number of the second target file directory entry data file set and the cluster occupied space value; wherein, the first folder is the folder with the smallest cluster number in the first target file directory entry data file.

6. The damaged target restoration method according to any one of claims 1 to 5, characterized in that: The damaged target is a target partition, and the step of selecting a candidate recovery area containing the most file directory entry data from each candidate recovery area as the target recovery area includes: Obtain the starting position of the root area of ​​the target recovery area; The partition boot sector of the target partition is reconstructed according to the cluster occupied space value, the starting position information and the starting position of the root area of ​​the target recovery area.

7. A damaged target recovery device, characterized in that: include: A free data acquisition module, used to acquire free current file directory entry data from disk sector data based on the file system characteristics of the extended file allocation table, and acquire free subsequent file directory entry data after the acquisition time corresponding to the current file directory entry data; A candidate recovery area determination module, configured to obtain the starting position information and cluster occupied space values ​​of a plurality of candidate recovery areas by analyzing the folder information of the current file directory entry data and each subsequent file directory entry data; The effective recovery area determination module is used to classify the data of each file directory entry in a method of making the starting position information and the cluster occupied space value the same, and select the candidate recovery area containing the most file directory entry data from each candidate recovery area as the target recovery area, so as to restore the damaged target through the target recovery area.

8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor is used to implement the steps of the damaged target recovery method as claimed in any one of claims 1 to 6 when executing the computer program stored in the memory.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the damaged target recovery method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the damaged target recovery method described in any one of claims 1 to 6 are implemented.