A data recovery method, device and electronic equipment

By identifying and dividing the track region group ZG of SMR disks, the problem of data recovery when multiple disks in a cloud storage system are close to the damage threshold is solved, enabling faster recovery task processing and improved storage system reliability.

CN116069561BActive Publication Date: 2026-05-01ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2023-02-08
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In cloud storage systems, when multiple SMR disks are close to their damage threshold, existing technologies fail to effectively schedule them, resulting in some disks not being recovered in time and data on damaged disks being unrecoverable.

Method used

By identifying and dividing track region groups (ZGs), recoverable target ZGs can be identified and independently controlled according to the recovery type, including tail recovery and full recovery, thereby improving the efficiency of recovery tasks and the reliability of the storage system.

Benefits of technology

It enables faster recovery task processing, improves the reliability and space utilization of the storage system, and avoids data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069561B_ABST
    Figure CN116069561B_ABST
Patent Text Reader

Abstract

The application discloses a data recovery method, device and electronic equipment. The method comprises the following steps: firstly, receiving characteristic information corresponding to each zone when writing each data block into each magnetic track zone; then, identifying a magnetic track zone group ZG to which each zone belongs, obtaining each recoverable target ZG, and dividing each target ZG to obtain a recovery type corresponding to each target ZG; finally, performing data recovery on each target ZG according to a recovery strategy corresponding to each recovery type. Through the above method, each recoverable ZG is identified, and each recoverable ZG is divided according to a recovery type, so that independent control of a recovery task can be realized, the recovery task can be processed faster, and the reliability and space utilization of a storage system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

A data recovery method, apparatus and electronic device Technical Field

[0001] This application relates to the field of cloud storage technology, and in particular to a data recovery method, apparatus and electronic device. Background Technology

[0002] In a cloud storage system, when a file is written to a disk, the file is divided into several data blocks according to a preset erasure coding (EC) type. The blocks are located on the storage nodes. When a block in the file is corrupted and needs to be recovered, the metadata management node sends the block to be recovered to the storage node, informing the storage node to recover the block data.

[0003] Shingled Magnetic Recording (SMR) technology partially overlaps adjacent tracks, much like roof tiles, eliminating gaps between tracks. Track overlap addresses the issue of slow disk capacity growth, but at the cost of sacrificing random write capabilities. To solve this problem, SMR disk tracks are typically divided into bands. Each band contains multiple consecutive, overlapping tracks, with a safety gap maintained between bands. The width of this safety gap is only sufficient to ensure that a write operation on the last track in one band will not interfere with or corrupt the data on the first track in the next band. A band is a physical concept in SMR disks; the corresponding logical concept is called a zone.

[0004] In cloud storage systems, the management of SMR disks requires tracking the status of each data block of each file in each zone when files are divided into data blocks and written to each zone of each storage node, and also requires handling any zones that are abnormal.

[0005] To manage SMR disks, the following methods are used: First, the host marks the zone containing the bad sectors on the SMR disk as read-only. Then, it checks if the number of read-only zones exceeds the disk surface area or disk limit. If it does, all zones on that surface or disk are marked as read-only, and no more data is written to them. Simultaneously, data from undamaged sectors in all zones on the disk is copied and recovered. This method allows disks nearing their lifespan to be removed from the system for inspection and repair, thus preventing data loss after disk failure.

[0006] However, the above data recovery method does not perform scheduling processing when a batch of SMR disks are close to the damage threshold. This may result in some SMR disks being in the recovery process while other disks reach the edge of damage but have exceeded the current reuse cycle, leading to failure to recover in time and making it impossible to recover the data on the damaged disks. Summary of the Invention

[0007] This application provides a data recovery method, apparatus, and electronic device that can solve the problem that current data recovery methods, when faced with a batch of SMR disks approaching the damage threshold, do not perform scheduling processing. This may result in some SMR disks being in the recovery process while other disks reach the edge of damage and are not recovered in time, missing the opportunity for recovery and causing the data on the damaged disks to be unrecoverable.

[0008] Firstly, this application provides a data recovery method, the method comprising:

[0009] When writing each data block to each track zone, the feature information corresponding to each zone is received, wherein the feature information includes at least the track zone group ZG to which each zone belongs;

[0010] Identify the track region group ZG to which each Zone belongs to obtain each recoverable target ZG;

[0011] Each target ZG is divided to obtain the recovery type corresponding to each target ZG, wherein the recovery type includes either the tail recovery type queue or the full recovery type queue;

[0012] Data recovery is performed on each target ZG according to the recovery strategy corresponding to each recovery type.

[0013] By using the above method, each recoverable ZG is identified and classified into recovery types, thereby enabling independent control of recovery tasks. This not only allows for faster processing of recovery tasks but also improves the reliability and space utilization of the storage system.

[0014] In one possible design, receiving the feature information corresponding to each Zone includes:

[0015] Receive the feature information corresponding to each Zone, and detect whether there is any abnormal information of each data block in each feature information, wherein the abnormal information includes either data block reduction or data block corruption;

[0016] If so, immediately trigger the identification of the track region group ZG to which each Zone belongs;

[0017] If not, when it is determined that the Zone corresponding to the current feature information is the Zone that last reported the feature information, the identification of the track region group ZG to which each Zone belongs is triggered;

[0018] When the feature information corresponding to each Zone has not been fully received, the magnetic track region group ZG to which each Zone belongs is periodically identified according to a preset period.

[0019] By using the above method, the magnetic track region group (ZG) to which each Zone belongs can be identified from multiple dimensions. This not only improves the identification efficiency but also avoids the problem of missing ZG identification.

[0020] In one possible design, identifying the track region group ZG to which each Zone belongs, and obtaining each recoverable target ZG, includes:

[0021] Traverse the track region group ZG to which each Zone belongs to determine the number of abnormal Zones in each ZG;

[0022] Based on the number of each abnormal Zone, each recoverable target Zone is obtained.

[0023] Using the above method, each recoverable target ZG can be quickly identified based on the number of each abnormal Zone, thereby improving the recovery speed of each recoverable target ZG.

[0024] In one possible design, the step of traversing the track region group (ZG) to which each Zone belongs and determining the number of anomalous Zones in each ZG includes:

[0025] Traverse the track region group (ZG) to which each Zone belongs, and obtain the maximum write data length of each Zone in each ZG;

[0026] The actual written data length of each Zone in each ZG is compared with the maximum written data length, and each Zone in each ZG whose actual written data length is less than the maximum written data length is identified as an abnormal Zone.

[0027] Using the above method, the number of anomalous zones in each ZG can be determined, and then each recoverable target ZG can be quickly identified based on the number of anomalous zones.

[0028] In one possible design, obtaining each recoverable target ZG based on the number of each anomalous Zone includes:

[0029] Determine whether the feature information corresponding to each Zone has been fully received;

[0030] Once all feature information has been fully received, the number of each abnormal zone is detected.

[0031] When the number of each abnormal Zone is equal to zero, each Zone is determined to be a normal Zone.

[0032] When the number of each abnormal Zone is less than or equal to a preset threshold, each Zone is determined to be a recoverable target Zone.

[0033] When the number of each abnormal Zone is greater than the preset threshold and each abnormal Zone has not exceeded the reuse cycle, each ZG is determined to be a recoverable target ZG, and the recovery type corresponding to each ZG is Zone padding with zeros.

[0034] The above method can efficiently identify the recoverable target ZG corresponding to each ZG, thereby improving the execution efficiency of the recovery task.

[0035] In one possible design, determining each ZG as a recoverable target ZG when the number of each abnormal Zone is less than or equal to a preset threshold includes:

[0036] When the number of each abnormal Zone is less than or equal to a preset threshold, the number of damaged Zones in each ZG is determined based on the damage flag information in each feature information.

[0037] When the number of damaged Zones is zero, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be Zone tail recovery.

[0038] When the number of each damaged Zone is greater than zero, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be the Zone damage type.

[0039] The above method can not only efficiently identify the recoverable target ZG corresponding to each ZG, but also efficiently identify the recovery type corresponding to each ZG.

[0040] In one possible design, determining whether the feature information corresponding to each Zone has been fully received includes:

[0041] Determine whether the feature information corresponding to each Zone has been fully received;

[0042] If each feature information is not fully received, determine whether the reception time of each feature information exceeds a preset time.

[0043] If so, then determine the number of anomalous Zones in the ZG to which each Zone with characteristic information belongs;

[0044] When the number of abnormal Zones is less than or equal to the preset threshold, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be the Zone missing type.

[0045] By using the above method, the reception of each feature information is determined based on a preset time. This avoids the problem of the metadata management node misidentifying a Zone when there is a delay in reception due to abnormal conditions, thus improving the accuracy of identification.

[0046] Secondly, this application provides a data recovery apparatus, the apparatus comprising:

[0047] The receiving module is used to receive the feature information corresponding to each zone when writing each data block to each track zone, wherein the feature information includes at least the track region group ZG to which each zone belongs;

[0048] The identification module is used to identify the magnetic track region group ZG to which each Zone belongs, and to obtain each recoverable target ZG;

[0049] The partitioning module is used to partition each target ZG to obtain the recovery type corresponding to each target ZG, wherein the recovery type includes either the tail recovery type queue or the full recovery type queue;

[0050] The recovery module is used to recover data from each target ZG according to the recovery strategy corresponding to each recovery type.

[0051] In one possible design, the receiving module is specifically used for:

[0052] Receive the feature information corresponding to each Zone, and detect whether there is any abnormal information of each data block in each feature information, wherein the abnormal information includes either data block reduction or data block corruption;

[0053] If so, immediately trigger the identification of the track region group ZG to which each Zone belongs;

[0054] If not, when it is determined that the Zone corresponding to the current feature information is the Zone that last reported the feature information, the identification of the track region group ZG to which each Zone belongs is triggered;

[0055] When the feature information corresponding to each Zone has not been fully received, the magnetic track region group ZG to which each Zone belongs is periodically identified according to a preset period.

[0056] In one possible design, the identification module includes:

[0057] The determination unit is used to traverse the track region group (ZG) to which each Zone belongs and determine the number of abnormal Zones in each ZG.

[0058] The acquisition unit is used to obtain each recoverable target ZG based on the number of each abnormal Zone.

[0059] In one possible design, the determining unit is specifically used for:

[0060] Traverse the track region group (ZG) to which each Zone belongs, and obtain the maximum write data length of each Zone in each ZG;

[0061] The actual written data length of each Zone in each ZG is compared with the maximum written data length, and each Zone in each ZG whose actual written data length is less than the maximum written data length is identified as an abnormal Zone.

[0062] In one possible design, the acquisition unit is specifically used for:

[0063] Determine whether the feature information corresponding to each Zone has been fully received;

[0064] Once all feature information has been fully received, the number of each abnormal zone is detected.

[0065] When the number of each abnormal Zone is equal to zero, each Zone is determined to be a normal Zone.

[0066] When the number of each abnormal Zone is less than or equal to a preset threshold, each Zone is determined to be a recoverable target Zone.

[0067] When the number of each abnormal Zone is greater than the preset threshold and each abnormal Zone has not exceeded the reuse cycle, each ZG is determined to be a recoverable target ZG, and the recovery type corresponding to each ZG is Zone padding with zeros.

[0068] In one possible design, the acquisition unit is further used for:

[0069] When the number of each abnormal Zone is less than or equal to a preset threshold, the number of damaged Zones in each ZG is determined based on the damage flag information in each feature information.

[0070] When the number of damaged Zones is zero, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be Zone tail recovery.

[0071] When the number of each damaged Zone is greater than zero, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be the Zone damage type.

[0072] In one possible design, the acquisition unit is further used for:

[0073] Determine whether the feature information corresponding to each Zone has been fully received;

[0074] If each feature information is not fully received, determine whether the reception time of each feature information exceeds a preset time.

[0075] If so, then determine the number of anomalous Zones in the ZG to which each Zone with characteristic information belongs;

[0076] When the number of abnormal Zones is less than or equal to the preset threshold, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be the Zone missing type.

[0077] Thirdly, this application provides an electronic device, comprising:

[0078] Memory, used to store computer programs;

[0079] When the processor executes the computer program stored in the memory, it implements the above-described data recovery method steps.

[0080] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described data recovery method steps.

[0081] Based on the data recovery method provided in this application, by identifying each recoverable ZG and classifying each recoverable ZG by recovery type, independent control of the recovery task can be achieved. This not only enables faster processing of the recovery task but also improves the reliability and space utilization of the storage system.

[0082] The technical effects of each of the second to fourth aspects mentioned above, as well as the technical effects that each aspect may achieve, are described above with reference to the technical effects that can be achieved for the first aspect or the various possible solutions in the first aspect, and will not be repeated here. Attached Figure Description

[0083] Figure 1 is a schematic diagram of a possible application scenario provided in this application;

[0084] Figure 2 is a schematic diagram of a possible structure provided in this application;

[0085] Figure 3 is a flowchart of a data recovery method provided in this application;

[0086] Figure 4 is a schematic diagram of a data recovery device provided in this application;

[0087] Figure 5 is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

[0088] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The specific operational methods in the method embodiments can also be applied to the device embodiments or system embodiments. It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing together, or B existing alone. A connected to B can represent: A and B directly connected, or A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for distinguishing the purpose of description and should not be construed as indicating or implying relative importance or order.

[0089] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0090] To manage SMR disks, the following methods are used: First, the host marks the zone containing the bad sectors on the SMR disk as read-only. Then, it checks if the number of read-only zones exceeds the disk surface area or disk limit. If it does, all zones on that surface or disk are marked as read-only, and no more data is written to them. Simultaneously, data from undamaged sectors in all zones on the disk is copied and recovered. This method allows disks nearing their lifespan to be removed from the system for inspection and repair, thus preventing data loss after disk failure.

[0091] However, the above data recovery method does not perform scheduling processing when a batch of SMR disks are close to the damage threshold. This may result in some SMR disks being in the recovery process while other disks reach the edge of damage and are not recovered in time, missing the opportunity for recovery and making it impossible to recover the data on the damaged disks.

[0092] To address the aforementioned problems, this application provides a data recovery method that identifies recoverable data groups (ZGs) and categorizes them by recovery type. This allows for independent control of recovery tasks, resulting in faster processing and improved storage system reliability and space utilization. The methods and apparatus described in this application are based on the same technical concept. Since the principles underlying the problems solved by the methods and apparatus are similar, embodiments of the apparatus and methods can be referred to interchangeably, and repeated details will not be elaborated further.

[0093] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description of this application is provided in conjunction with the accompanying drawings.

[0094] Figure 1 shows a possible application scenario provided by an embodiment of this application. The application scenario includes: various storage nodes 11 and metadata management nodes 12.

[0095] For example, each storage node 11 is used to report the characteristic information of the track zone to the metadata management node 12 when joining the storage cluster, receiving external data writes, or periodically submitting full reports. The characteristic information of the zone includes at least the zone's location index information, the track region group (ZoneGroup, ZG) to which the zone belongs and its sequence number in the ZG, the actual length of data written to the zone, and the EC type of the ZG to which the zone belongs.

[0096] Metadata management node 12 is used to receive the feature information of each Zone and construct the corresponding ZoneG for each Zone based on the feature information, as shown in Figure 2. A ZoneG includes Zone1, Zone2, Zone3, Zone4 and Zone5, and these 5 Zones are mapped to the SMR disks on storage nodes DN1, DN2, DN3, DN4 and DN5 respectively; record the location of each Zone on each storage node 11; when each storage node 11 experiences disk removal, bad disk, bad sector, node deletion, node offline and timeout, the metadata management node 12 will reset the feature information of the Zones in each Zone cache that have experienced the above situations, and reset the actual data length written to the Zone and the storage node location of the Zone to 0.

[0097] Based on the above application scenarios, the data processing method provided in the embodiments of this application will be described and explained below with reference to the accompanying drawings. As shown in Figure 3, a flowchart of a data recovery method provided by this application is shown, which specifically includes the following steps:

[0098] S31, when writing each data block to each track zone, receive the characteristic information corresponding to each zone;

[0099] In this embodiment, when a file is written to each track zone, it is first divided into N+M data blocks according to a preset erasure coding (EC) type. EC is a data protection method that divides data into several data blocks N and redundant blocks M. The redundant blocks M are expanded, encoded, and stored in different locations, such as disks, storage nodes, or other geographical locations. When the number of abnormal data blocks does not exceed the number of redundant blocks M, the abnormal data blocks can be calculated based on the other normal data blocks. Then, the metadata management node 12 allocates storage nodes to each data block and distributes each data block to each storage node according to the allocation results. Finally, each storage node writes the corresponding data block into its own zone and reports the characteristic information of its own zone.

[0100] For example, during file writing, the file is first divided into three blocks according to the EC type 2+1, resulting in data block 1, data block 2, and data block 3. Data block 3 can also be represented as redundant block 1. Then, the metadata management node 12 allocates two storage nodes to each of these three data blocks: data block 1 and data block 2 are assigned to storage node 1, and data block 3 is assigned to storage node 2. Based on the allocation, data block 1 and data block 2 are sent to storage node 1, and data block 3 is sent to storage node 2. Finally, storage node 1 writes data block 1 to Zone 11 and data block 2 to Zone 12, and reports the characteristic information of Zone 11 and Zone 12. Simultaneously, storage node 2 writes data block 3 to Zone 21 and reports the characteristic information of Zone 21.

[0101] After writing each data block into the Zone of each storage node using the above method, the metadata management node 12 will receive the feature information of each written data block Zone and detect whether there is any abnormal information of each data block in the feature information. The abnormal information includes either data block reduction or data block corruption.

[0102] If any abnormal information is found in any data block, the identification of the track region group (ZG) to which each Zone belongs is immediately triggered. If no abnormal information is found in any data block, the identification of the track region group (ZG) to which each Zone belongs is triggered when it is determined that the Zone corresponding to the current feature information is the Zone that last reported the feature information. Meanwhile, to avoid missed identifications, when the feature information corresponding to each Zone has not been fully received, the track region group (ZG) to which each Zone belongs needs to be periodically identified according to a preset period. This preset period does not need to be very frequent; it can be on the order of 20 minutes or 30 minutes, depending on the situation, and no specific limit is specified here.

[0103] S32, identify the magnetic track region group ZG to which each Zone belongs, and obtain each recoverable target ZG;

[0104] In this embodiment, the function of ZG is as follows: Since only sequential writing and one-time data erasure are supported in a Zone, in order to avoid wasting space in a Zone, it is necessary to reuse Zones that are in the reuse cycle. Combined with the EC type, a batch of Zones perform data block writing and Zone feature information reporting at the same time. Therefore, ZG is designed to manage a group of Zones.

[0105] For example, during file writing, the file is divided according to EC type 2+1, resulting in data block 1, data block 2, and data block 3. Data block 3 can also be represented as redundant block 1. Data block 1 is stored in Zone 11 of storage node 1, data block 2 is stored in Zone 12 of storage node 1, and data block 3 is stored in Zone 21 of storage node 2. Therefore, Zone 11, Zone 12, and Zone 21 constitute a ZG (Zone Group).

[0106] After receiving the feature information of each written data block Zone, the metadata management node 12 identifies the ZoneG to which each Zone belongs, thus obtaining each recoverable target ZoneG. The specific method for identifying the recoverable target ZoneG can be:

[0107] Based on the Zone Group (ZG) to which a Zone belongs in the feature information, we obtain the corresponding ZG for each Zone. By traversing each ZG, we can determine the number of abnormal Zones in each ZG. Specifically, first, we traverse each ZG and obtain the maximum write data length of each Zone in each ZG. Then, we compare the actual write data length of each Zone in each ZG with the maximum write data length, and identify the Zones whose actual write data length is less than the maximum write data length as abnormal Zones.

[0108] Then, based on the number of anomalous zones in each zone, the recoverable target zones can be obtained. Specifically, first, it is determined whether the feature information corresponding to each zone has been fully received. If the feature information has been fully received, the number of anomalous zones in each zone is detected.

[0109] When the number of abnormal zones is zero, each ZG is determined to be a normal ZG. When the number of abnormal zones is less than or equal to a preset threshold, each ZG is determined to be a recoverable target ZG. The preset threshold can be the redundant block M of the EC type corresponding to the ZG; the specific preset threshold depends on the situation and is not specifically limited here. Specifically, firstly, based on the damage flag information in each feature information, the number of damaged zones in each ZG is determined. Then, when the number of damaged zones in each ZG is zero, each ZG is determined to be a recoverable target ZG, and the recovery type corresponding to each ZG is determined to be Zone tail recovery. When the number of damaged zones is greater than zero, each ZG is determined to be a recoverable target ZG, and the recovery type corresponding to each ZG is determined to be Zone damage type.

[0110] If the number of abnormal zones in each zone is greater than the preset threshold but the reuse period has not been exceeded, each zone is identified as a recoverable target zone, and the recovery type corresponding to each zone is zero-padding. If the number of abnormal zones in each zone is greater than the preset threshold and the reuse period has been exceeded, each zone is identified as an unrecoverable zone.

[0111] Furthermore, during the reception of feature information, delays in receiving feature information due to abnormal circumstances may cause the metadata management node 12 to misidentify a Zone. Therefore, if each feature information is not fully received, it is necessary to determine whether the reception time of each feature information exceeds a preset time, for example, if the reception time exceeds 1 hour. If so, the number of abnormal Zones in the ZG to which each Zone containing feature information belongs is determined according to the method described above. If the number of abnormal Zones is less than or equal to a preset threshold, each ZG is determined to be a recoverable target ZG, and the recovery type corresponding to each ZG is determined to be the Zone missing type. If the number of abnormal Zones is greater than the preset threshold, each ZG is determined to be an unrecoverable ZG. If the reception time of each feature information does not exceed the preset time, identification is performed again after a period of time.

[0112] The above methods involve four recovery types: Zone zero-padding, Zone tail recovery, Zone damage type, and Zone missing type. Except for zone zero-padding, the other three recovery types all meet the redundancy recovery requirements of EC, meaning they are recoverable. Zone zero-padding refers to a ZG recovery type where the number of abnormal zones in each ZG exceeds a preset threshold, making EC-based recovery impossible. Zeros are padded to the tail of the abnormal zones to complete the recovery. Zone tail recovery refers to a ZG recovery type where a small portion of the tail length of an abnormal zone is lost due to network jitter or other reasons. In this case, the number of abnormal zones is greater than zero and less than or equal to a preset threshold. Zone damage type refers to a ZG recovery type where an abnormal zone in a ZG has internal block corruption. In this case, the number of abnormal zones is greater than zero and less than or equal to a preset threshold. Zone missing type refers to a ZG recovery type where an abnormal zone in a ZG has a missing zone. In this case, the number of abnormal zones is greater than zero and less than or equal to a preset threshold.

[0113] The above method can not only efficiently identify the recoverable target ZG corresponding to each ZG, but also efficiently identify the recovery type corresponding to each ZG, thereby improving the execution efficiency of the recovery task.

[0114] S33, divide each target ZG into its own parts and obtain the recovery type corresponding to each target ZG;

[0115] After obtaining each target ZG through the above method, in order to schedule the recovery task and improve the processing efficiency of the recovery task, in this embodiment of the application, it is necessary to divide each target ZG to obtain the recovery type corresponding to each target ZG. The recovery type includes either the tail recovery type queue or the full recovery type queue. The tail recovery task includes Zone zero filling and Zone tail recovery type. The full recovery includes Zone damaged type and Zone missing type.

[0116] S34, perform data recovery on each target ZG according to the recovery strategy corresponding to each recovery type.

[0117] After obtaining the various recovery types, data recovery is performed on each target ZG according to the recovery strategy corresponding to each recovery type. Specifically, firstly, each recovery task is generated based on the recovery type. Then, each recovery task is independently controlled based on actual hardware resources, network resources, and business pressure. Under the premise of not affecting each other, each recovery task is distributed to the corresponding storage node for execution. This not only achieves data recovery for each target ZG, but also improves the reliability and space reuse rate of the storage system.

[0118] Based on the above data recovery method, by identifying each recoverable ZG and classifying each recoverable ZG by recovery type, independent control of the recovery task can be achieved. This not only enables faster processing of the recovery task but also improves the reliability and space utilization of the storage system.

[0119] Based on the same inventive concept, this application also provides a data recovery device, as shown in Figure 4, which is a structural schematic diagram of a data recovery device according to this application. The device includes:

[0120] The receiving module 41 is used to receive the feature information corresponding to each zone when writing each data block to each track zone, wherein the feature information includes at least the track region group ZG to which each zone belongs;

[0121] The identification module 42 is used to identify the magnetic track region group ZG to which each Zone belongs, and to obtain each recoverable target ZG;

[0122] The partitioning module 43 is used to partition each target ZG to obtain the recovery type corresponding to each target ZG, wherein the recovery type includes either the tail recovery type queue or the full recovery type queue;

[0123] The recovery module 44 is used to perform data recovery on each target ZG according to the recovery strategy corresponding to each recovery type.

[0124] In one possible design, the receiving module 41 is specifically used for:

[0125] Receive the feature information corresponding to each Zone, and detect whether there is any abnormal information of each data block in each feature information, wherein the abnormal information includes either data block reduction or data block corruption;

[0126] If so, immediately trigger the identification of the track region group ZG to which each Zone belongs;

[0127] If not, when it is determined that the Zone corresponding to the current feature information is the Zone that last reported the feature information, the identification of the track region group ZG to which each Zone belongs is triggered;

[0128] When the feature information corresponding to each Zone has not been fully received, the magnetic track region group ZG to which each Zone belongs is periodically identified according to a preset period.

[0129] In one possible design, the identification module 42 includes:

[0130] The determination unit is used to traverse the track region group (ZG) to which each Zone belongs and determine the number of abnormal Zones in each ZG.

[0131] The acquisition unit is used to obtain each recoverable target ZG based on the number of each abnormal Zone.

[0132] In one possible design, the determining unit is specifically used for:

[0133] Traverse the track region group (ZG) to which each Zone belongs, and obtain the maximum write data length of each Zone in each ZG;

[0134] The actual written data length of each Zone in each ZG is compared with the maximum written data length, and each Zone in each ZG whose actual written data length is less than the maximum written data length is identified as an abnormal Zone.

[0135] In one possible design, the acquisition unit is specifically used for:

[0136] Determine whether the feature information corresponding to each Zone has been fully received;

[0137] Once all feature information has been fully received, the number of each abnormal zone is detected.

[0138] When the number of each abnormal Zone is equal to zero, each Zone is determined to be a normal Zone.

[0139] When the number of each abnormal Zone is less than or equal to a preset threshold, each Zone is determined to be a recoverable target Zone.

[0140] When the number of each abnormal Zone is greater than the preset threshold and each abnormal Zone has not exceeded the reuse cycle, each ZG is determined to be a recoverable target ZG, and the recovery type corresponding to each ZG is Zone padding with zeros.

[0141] In one possible design, the acquisition unit is further used for:

[0142] When the number of each abnormal Zone is less than or equal to a preset threshold, the number of damaged Zones in each ZG is determined based on the damage flag information in each feature information.

[0143] When the number of damaged Zones is zero, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be Zone tail recovery.

[0144] When the number of each damaged Zone is greater than zero, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be the Zone damage type.

[0145] In one possible design, the acquisition unit is further used for:

[0146] Determine whether the feature information corresponding to each Zone has been fully received;

[0147] If each feature information is not fully received, determine whether the reception time of each feature information exceeds a preset time.

[0148] If so, then determine the number of anomalous Zones in the ZG to which each Zone with characteristic information belongs;

[0149] When the number of abnormal Zones is less than or equal to the preset threshold, each Zone is determined to be a recoverable target Zone, and the recovery type corresponding to each Zone is determined to be the Zone missing type.

[0150] Based on the above-mentioned data recovery device, by identifying each recoverable ZG and classifying each recoverable ZG by recovery type, the recovery task can be independently controlled. This not only enables faster processing of recovery tasks but also improves the reliability and space utilization of the storage system.

[0151] Based on the same inventive concept, this application also provides an electronic device that can realize the function of the aforementioned data recovery device. Referring to FIG5, the electronic device includes:

[0152] At least one processor 51 and a memory 52 connected to at least one processor 51 are included. In this embodiment, the specific connection medium between the processor 51 and the memory 52 is not limited. Figure 5 shows an example where the processor 51 and the memory 52 are connected via a bus 50. The bus 50 is represented by a thick line in Figure 5. The connection methods between other components are only illustrative and not intended to be limiting. The bus 50 can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in Figure 5, but this does not mean that there is only one bus or one type of bus. Alternatively, the processor 51 can also be called a controller; the name is not limited.

[0153] In this embodiment, the memory 52 stores instructions executable by at least one processor 51. By executing the instructions stored in the memory 52, the at least one processor 51 can perform the data recovery method described above. The processor 51 can implement the functions of each module in the device shown in FIG4.

[0154] The processor 51 is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 52 and calling data stored in memory 52, the processor can perform various functions and process data, thereby monitoring the device as a whole.

[0155] In one possible design, processor 51 may include one or more processing units. Processor 51 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 51. In some embodiments, processor 51 and memory 52 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.

[0156] Processor 51 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the data recovery method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0157] Memory 52, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 52 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 52 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 52 may also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0158] By designing and programming the processor 51, the code corresponding to the data recovery method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the steps of the data recovery method shown in Figure 3 during operation. How to design and program the processor 51 is a technique well-known to those skilled in the art and will not be elaborated upon here.

[0159] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the data recovery method described above.

[0160] In some possible implementations, various aspects of the data recovery method provided in this application may also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps in the data recovery method according to the various exemplary embodiments of this application described above.

[0161] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0162] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more flowchart illustrations and / or one or more block diagrams.

[0163] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.

[0164] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.

[0165] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data recovery method, characterized in that, The method includes: when writing each data block to each track zone, receiving feature information corresponding to each zone, wherein the feature information includes at least the track region group (ZG) to which each zone belongs; traversing the track region group (ZG) to which each zone belongs, and obtaining the maximum write data length of each zone in each ZG; comparing the actual write data length of each zone in each ZG with the maximum write data length, and identifying each zone whose actual write data length is less than the maximum write data length as an abnormal zone; obtaining each recoverable target ZG based on the number of abnormal zones; dividing each target ZG to obtain the recovery type corresponding to each target ZG, wherein the recovery type includes either a tail recovery type queue or a full recovery type queue; and performing data recovery on each target ZG according to the recovery strategy corresponding to each recovery type.

2. The method as described in claim 1, characterized in that, The step of receiving the feature information corresponding to each Zone includes: receiving the feature information corresponding to each Zone and detecting whether there is any abnormal information of each data block in each feature information, wherein the abnormal information includes either data block reduction or data block corruption; if so, immediately triggering the identification of the track region group ZG to which each Zone belongs; if not, triggering the identification of the track region group ZG to which each Zone belongs when it is determined that the Zone corresponding to the current feature information is the last Zone to report feature information; and periodically identifying the track region group ZG to which each Zone belongs according to a preset period when the feature information corresponding to each Zone has not been fully received.

3. The method as described in claim 1, characterized in that, The step of obtaining each recoverable target ZG based on the number of each abnormal Zone includes: determining whether the feature information corresponding to each Zone has been fully received; when the feature information has been fully received, detecting the number of each abnormal Zone; when the number of each abnormal Zone is equal to zero, determining each ZG as a normal ZG; when the number of each abnormal Zone is less than or equal to a preset threshold, determining each ZG as a recoverable target ZG; when the number of each abnormal Zone is greater than the preset threshold and each abnormal Zone has not exceeded the reuse cycle, determining each ZG as a recoverable target ZG, and the recovery type corresponding to each ZG is Zone padding with zeros.

4. The method as described in claim 3, characterized in that, The step of determining each ZG as a recoverable target ZG when the number of each abnormal Zone is less than or equal to a preset threshold includes: when the number of each abnormal Zone is less than or equal to the preset threshold, determining the number of damaged Zones in each ZG based on the damage flag information in each feature information; when the number of each damaged Zone is equal to zero, determining each ZG as a recoverable target ZG, and determining the recovery type corresponding to each ZG as Zone tail recovery; when the number of each damaged Zone is greater than zero, determining each ZG as a recoverable target ZG, and determining the recovery type corresponding to each ZG as Zone damage type.

5. The method as described in claim 3, characterized in that, The step of determining whether the feature information corresponding to each Zone has been fully received includes: determining whether the feature information corresponding to each Zone has been fully received; if the feature information has not been fully received, determining whether the reception time of the feature information exceeds a preset time; if so, determining the number of abnormal Zones in the ZG to which each Zone containing feature information belongs; if the number of abnormal Zones is less than or equal to the preset threshold, determining that each ZG is a recoverable target ZG, and determining that the recovery type corresponding to each ZG is a Zone missing type.

6. A data recovery device, characterized in that, The apparatus includes: a receiving module, configured to receive feature information corresponding to each Zone when writing each data block to each track zone, wherein the feature information includes at least the track region group (ZG) to which each Zone belongs; an identification module, configured to traverse the track region group (ZG) to which each Zone belongs, obtain the maximum write data length of each Zone in each ZG; compare the actual write data length of each Zone in each ZG with the maximum write data length, and identify each Zone in each ZG whose actual write data length is less than the maximum write data length as an abnormal Zone; obtain each recoverable target ZG based on the number of abnormal Zones; a partitioning module, configured to partition each target ZG to obtain the recovery type corresponding to each target ZG, wherein the recovery type includes either a tail recovery type queue or a full recovery type queue; and a recovery module, configured to perform data recovery on each target ZG according to the recovery strategy corresponding to each recovery type.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a computer program stored in the memory, implements the method steps of any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method steps of any one of claims 1-5.

Citation Information

Patent Citations

  • Data recovery method and device for imbricated magnetic recording disk

    CN112579483A

  • Fast fine-grained recovery method and device based on backup data

    CN112965856A