Data recovery method and storage device

By reading data blocks from an asynchronous backup second device to repair them when the first device is unable to repair the damaged data blocks, the problem of erasure coding technology being unable to repair data blocks when the damage exceeds a threshold is solved, and ultra-long-distance disaster recovery backup is achieved, improving the reliability and performance of the storage system.

CN117667468BActive Publication Date: 2026-03-27CHENGDU HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-24
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing erasure coding technology cannot repair data blocks when the number of corrupted data blocks exceeds a certain limit, and dual-active storage solutions suffer from excessively long data write times in ultra-long-distance disaster recovery backups.

Method used

By reading data blocks from a second asynchronous backup device for repair when the first device is unable to repair the damaged data blocks, the non-real-time nature of asynchronous backup is used to achieve ultra-long-distance disaster recovery backup, and the EC algorithm is combined to repair the data blocks.

Benefits of technology

It breaks through the bottleneck of erasure coding technology, realizes data block repair at any disaster recovery distance, solves the problem of disaster recovery distance limitation in dual-active storage, and improves the reliability and performance of storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667468B_ABST
    Figure CN117667468B_ABST
Patent Text Reader

Abstract

Provided are a data repair method and a storage device. The data repair method is performed by a first device, the first device storing N EC data blocks of a first object and M EC check data blocks of the first object, and the first device further backing up the N EC data blocks of the first object and the M EC check data blocks of the first object to a second device. The method comprises: obtaining a first read request, the first read request being used to read a first data block in the N EC data blocks, in a case where the first data block is determined to be damaged and unable to be repaired, sending a second read request to the second device, the second read request being used to read at least one data block in the N EC data blocks and / or at least one data block in the M EC check data blocks from the second device; and repairing the first data block according to the data block read from the second device. The method can solve the problem of data repair of the first device in an extreme case where the first object cannot be repaired using an EC algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data storage, and particularly relates to a data repair method and a storage device. BACKGROUND

[0002] In a big data environment, the use amount of data is multiplied, and the key of data storage is self-evident. In the field of storage, the reliability of stored data is particularly important. Generally, a storage system usually adopts erasure coding (EC) technology to store data to provide reliable storage services for users.

[0003] The EC technology is to split the data to be stored into N EC data blocks, to generate M EC check data blocks by performing check coding on the N EC data blocks, and to store the N EC data blocks and the M EC check data blocks. In this way, when one of the N EC data blocks and the M EC check data blocks is damaged, the storage system can repair the damaged block according to other undamaged blocks, thereby improving the storage reliability of the storage system. However, in the scheme using the EC technology, when the number of damaged blocks corresponding to one data exceeds a certain number, the storage system cannot repair the damaged blocks. SUMMARY

[0004] The present application provides a data repair method and a storage device. When a first device cannot repair a damaged data block, a backup data block in a second device is read for repair.

[0005] In a first aspect, the present application provides a data repair method. The method is applied to a first device, and the first device stores N EC data blocks of a first object and M EC check data blocks of the first object, wherein the M EC check data blocks of the first object are calculated according to the N EC data blocks of the first object.

[0006] The method comprises: obtaining a first read request, the first read request being used to read a first data block in the N EC data blocks of the first object; in a case where it is determined that the first data block is damaged and cannot be repaired, sending a read request to a second device, the second device backing up the N EC data blocks of the first object and the M EC check data blocks of the first object, the second read request being used to read at least one data block in the N EC data blocks of the first object and / or at least one data block in the M EC check data blocks of the first object from the second device; and repairing the first data block according to the data block read from the second device.

[0007] The above embodiment is applied to a scenario of object storage, specifically, a first device stores object data of a user using an EC technique, and all data blocks corresponding to the object data (including data blocks and check data blocks calculated according to the data blocks) are stored in a second device for backup. In a case where the first device determines that a data block requested by an upper layer is damaged and the first device cannot repair the data block using the EC technique, the first device reads the backup data block from the second device for repair. In this way, the first device can break through the EC technique bottleneck and solve the problem that the data block cannot be repaired using the EC technique.

[0008] In addition, since the first device backs up the data block to the second device asynchronously, the above solution is not limited by a disaster recovery distance and can be applied to any disaster recovery distance scenario, especially a scenario of an ultra-long disaster recovery distance.

[0009] In a possible implementation, the second read request includes an identifier of the first object and a data block identifier, and the second device is configured to send the data block to the first device according to the data block identifier after determining that the identifier of the object stored in the second device includes the identifier of the first object.

[0010] In the above embodiment, the first device and the second device both store objects according to identifiers of the objects. The second device can determine whether the data block of the object requested by the first device is stored in the second device by comparing the identifiers of the objects. For example, if the identifier of the object stored in the second device includes the identifier of the first object, it indicates that the data block of the first object is stored in the second device, and the second device can send the data block to the first device according to the data block identifier in the second read request.

[0011] In a possible implementation, the method further includes: determining a damaged data block of the first object, and determining that the first data block is damaged and cannot be repaired if the damaged data block of the first object includes the first data block and the number of the damaged data blocks of the first object is equal to or greater than a first threshold.

[0012] In the above embodiment, the first device stores objects using an EC technique, and if the number of damaged data blocks of the first object is not less than the first threshold, the first device cannot repair the damaged data blocks using the EC technique.

[0013] In a possible implementation, the first threshold is M.

[0014] In a possible implementation, the identifier of the first object includes a version number and / or a data digest of the first object.

[0015] In the above embodiment, when the identity of the object includes the version number and / or the data digest, the second device can determine whether the second device stores the data block of the object corresponding to the version number and / or the data digest requested by the first device according to the version number and / or the data digest of the first object.

[0016] In a possible implementation, the identity of the first data block includes a logical address of the first data block.

[0017] In the above embodiment, the second device can map the logical address of the first data block to a physical address of the first data block, and read the first data block from the physical address.

[0018] In a second aspect, the present application provides a data repairing apparatus. The data repairing apparatus is applied to a first device, and the first device stores N EC data blocks of a first object and M EC check data blocks of the first object. The data repairing apparatus includes an obtaining module, a determining module, and a repairing module.

[0019] The obtaining module is configured to obtain a first read request, and the first read request is used to read a first data block in the N EC data blocks of the first object.

[0020] The determining module is configured to send a second read request to a second device in a case where the first data block is damaged and cannot be repaired. The second device backs up the N EC data blocks of the first object and the M EC check data blocks of the first object, and the M EC check data blocks of the first object are calculated according to the N EC data blocks of the first object. The second read request is used to read at least one data block in the N EC data blocks of the first object and / or at least one data block in the M EC check data blocks of the first object from the second device.

[0021] The repairing module is configured to repair the first data block according to the data block read from the second device.

[0022] In a possible implementation, the second read request includes an identity of the first object and a data block identity, and the second device is configured to send a data block to the first device according to the data block identity after determining that the identity of the object stored by the second device includes the identity of the first object.

[0023] In a possible implementation, the determining module is further configured to: determine a damaged data block of the first object, and determine that the first data block is damaged and cannot be repaired if the first data block is included in the damaged data block of the first object and the number of the damaged data block of the first object is equal to or greater than a first threshold.

[0024] In a possible implementation, the first threshold is M.

[0025] In a possible implementation, the identification of the first object comprises a version number and / or a data digest of the first object.

[0026] In a possible implementation, the data block identification comprises a data digest and / or a number of the first data block.

[0027] In a third aspect, the present application provides a storage device. The storage device comprises a processor and a memory. The processor is configured to execute a computer program stored in the memory to implement the method in the first aspect and the optional implementation.

[0028] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium comprises instructions which, when executed on a computer, cause the computer to perform the method in the first aspect and the optional implementation.

[0029] In a fifth aspect, the present application provides a computer program product. The computer program product comprises program codes which, when executed on a computer, cause the computer to perform the method in the first aspect and the optional implementation.

[0030] Any of the above-provided apparatuses or storage devices or computer storage media or computer program products are used to execute the above-provided data repair method, and thus can achieve the beneficial effects of the corresponding method provided above, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0031] Figure 1 is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0032] Figure 2 is a structural schematic diagram of a storage system using a dual-active storage scheme provided by an embodiment of the present application;

[0033] Figure 3 is a structural schematic diagram of a storage system using an erasure code storage scheme provided by an embodiment of the present application;

[0034] Figure 4 is a structural schematic diagram of another storage system using an erasure code storage scheme provided by an embodiment of the present application;

[0035] Figure 5 is a flowchart of a data repair method provided by an embodiment of the present application;

[0036] Figure 6 is a structural schematic diagram of a data repair apparatus provided by an embodiment of the present application;

[0037] Figure 7Fig. 1 is a structural schematic diagram of a storage device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the drawings.

[0039] In the description of the embodiments of the present application, the words such as "exemplary", "for example", or "for instance" are used to represent an example, an illustration or an illustration. Any embodiment or design scheme described as "exemplary", "for example" or "for instance" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words such as "exemplary", "for example" or "for instance" are intended to present the relevant concept in a specific manner.

[0040] In the description of the embodiments of the present application, the term "and / or" is only used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, B alone and A and B together. In addition, unless otherwise stated, the term "multiple" means two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals.

[0041] In addition, the terms "first", "second" are only used for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more features. The terms "include", "contain", "have" and their variants mean "include but are not limited to", unless otherwise specifically emphasized.

[0042] Before introducing the embodiments of the present application, the terms appearing in the present application will be explained first.

[0043] Dual-active storage is a data protection technology. Specifically, it refers to storing the same data using two or more storage systems. Two or more storage systems are virtually formed into a storage platform to provide storage services to users.

[0044] Erasure code storage is another data protection technology. Specifically, when storing a piece of data, the storage system divides the data into N data segments, then calculates M check data segments corresponding to the N data segments using an EC algorithm, and finally stores the N data segments and the M check data segments. When one of the N+M data segments corresponding to the data is damaged, the EC algorithm can be used to calculate the damaged data segment according to the remaining data segments.

[0045] Object storage is to store data using a flat address space without hierarchical structure. That is, one or more object data are stored in one storage device in an object storage system. Each object data includes data itself and attribute information of the data. The attribute information includes an identifier of the object data and an address mapping relationship of the object data.

[0046] Figure 1 is a structural schematic diagram of an application scenario provided by an embodiment of the present application. As shown in Figure 1 , an application server 200 provides an application service to a user through a terminal device 100. The user can send a data read / write request to the application server 200 through the terminal device 100, and the application server 200 reads / writes data from / to a storage unit 300 when executing the data read / write request.

[0047] The storage unit 300 can include a storage system. The storage system can include one or more storage devices for storing data. The storage device can include but is not limited to a server or other computing device with storage function for storage. From the storage mode, the storage system can be divided into a centralized storage system and a distributed storage system. When the storage unit 300 is a centralized storage system, the storage devices in the storage unit 300 form a center node, and data is stored in the center node, and all data processing services are deployed on the center node. That is, the data writing and data reading between the terminal device 100 and the storage unit 300 are completed by the center node. When the storage unit 300 is a distributed storage system, data is stored in each storage device in the storage unit 300, and data processing services are also deployed on each storage device. One storage device serves one or more terminal devices. That is, the data writing and data reading between the terminal device 100 and the storage unit 300 are completed by one storage device in the storage unit 300.

[0048] The storage unit 300 can include a storage array. The storage array can include but is not limited to a redundant array of independent disks (RAID).

[0049] The terminal device 100 can include but is not limited to a smart phone, a tablet computer, a notebook computer and the like.

[0050] In the field of storage, storage reliability is a more concerned indicator. Taking the storage unit 300 in Figure 1 as an example, when the data of the user stored therein is damaged or lost, the user experience will be affected and loss will be caused. For enterprise users, it will also involve economic loss.

[0051] In one embodiment, dual-active storage technology can be employed to improve the reliability of the storage unit 300. As shown in FIG. 3, the storage unit 300 employs a structure of two storage arrays, including a storage array 301 and a storage array 302. In a write data scenario, when the application server 200 executes a data write request, the data written by the user request is written into the storage array 301 and the storage array 302 asynchronously or synchronously, and a write completion is returned to the terminal device 100 after the write into both storage arrays is completed. In a read data scenario, when the application server 200 executes a data read request, data is read from one of the two storage arrays, and if the data in the storage array is corrupted, data is read from the other storage array. Figure 2

[0052] In one possible implementation of this embodiment, the storage array 301 can be a plurality of hard disks in the application server, and the storage array 302 can be a plurality of hard disks in a device located remotely from the application server 200 and in communication with the application server 200.

[0053] In another possible implementation of this embodiment, the storage array 301 and the storage array 302 can also be implemented by storage systems. Specifically, the storage array 301 and the storage array 302 can be a centralized storage system or a distributed storage system, and can also be a combination of a centralized storage system and a distributed storage system.

[0054] In one embodiment, a combination of dual-active storage and object storage can also be employed to store data. Specifically, the storage array 301 and / or the storage array 302 employs an object storage manner, thereby improving the storage performance of each storage system.

[0055] Dual-active storage can solve the problem that, in single-end storage, data cannot be provided to users for reading due to data corruption. However, dual-active storage requires that, when the write into multiple storage arrays (or systems) is completed, a write completion is returned. Therefore, to avoid increasing the data write time, Figure 2 The disaster recovery distance between the storage arrays 301 and 302 is subject to certain limitations, and is generally only applicable to short-distance transmission scenarios, for example, the disaster recovery distance is generally set to be within 100 kilometers (km). In scenarios where the disaster recovery distance is required to be more than 100 km, dual-active storage is not applicable due to the large data write time.

[0056] In one embodiment, erasure coding storage technology can also be employed to improve the reliability of the storage unit 300. As shown in FIG. 4, the storage unit 300 employs a structure of two storage arrays, including a storage array 401 and a storage array 402. In a write data scenario, when the application server 200 executes a data write request, the data written by the user request is written into the storage array 401 and the storage array 402 asynchronously or synchronously, and a write completion is returned to the terminal device 100 after the write into both storage arrays is completed. In a read data scenario, when the application server 200 executes a data read request, data is read from one of the two storage arrays, and if the data in the storage array is corrupted, data is read from the other storage array. Figure 1 ​As shown, when writing data, the storage unit 300 splits the data into N EC data blocks, calculates M EC check data blocks corresponding to the N EC data blocks using the EC algorithm, and stores the N EC data blocks and the M EC check data blocks. When one of the N+M data blocks is damaged, the storage unit 300 can use the EC algorithm to recalculate the damaged data block according to other data blocks to repair the damaged data block, thereby improving the reliability of the storage system.

[0057] When the storage unit 300 includes a storage system, the N EC data blocks and the M EC check data blocks corresponding to one data can also be stored in different storage systems. As shown in Figure 3 As shown, the application server 201 is in communication connection with the storage system 303, and the application server 202 is in communication connection with the storage system 304. After the storage system 303 obtains N+M data blocks, it can store part of the data blocks in the storage device in the system itself, and store another part of the data blocks in the storage system 304. For example, as shown in Figure 3 As shown, when the storage system 303 obtains 3 data blocks (data blocks 1-3, dark color) and 2 check data blocks (data blocks 4 and 5, light color) corresponding to one data, the storage system 303 can store data block 1, data block 2, and data block 4 in the storage device of the system itself, and then send data block 3 and data block 5 to the storage system 304 for storage. After receiving data block 3 and data block 5, the storage system 304 stores them in the storage device of the system itself.

[0058] The EC storage technology can repair damaged data blocks, but only when the number of damaged data blocks does not exceed the preset threshold. If the number of damaged data blocks exceeds the threshold, the damaged data blocks cannot be repaired. In addition, Figure 3 The EC storage scheme shown in the figure stores data blocks corresponding to one data in different storage systems, increases the access operation between storage systems, and to some extent occupies the bandwidth of the storage system, reducing the storage performance.

[0059] Based on this, the embodiments of the present application provide a data storage system and a data repair method, which can solve the above-mentioned problems of short disaster recovery distance in dual-active storage and the extreme case that the number of damaged data blocks exceeds the set threshold in EC storage.

[0060] Figure 4 is a structural schematic diagram of a data storage system provided by an embodiment of the present application. As shown in Figure 4 As shown, the data storage system includes a storage system 303 and a storage system 304. The storage system 303 and the storage system 304 back up each other.

[0061] Specifically, when the application server 201 initiates a data write to the storage system 303, the storage system 303 determines N EC data blocks and M EC check data blocks corresponding to the data and stores them in the storage device of the storage system 303, and then sends the N EC data blocks and M EC check data blocks corresponding to the data to the storage system 304 for backup. Referring to Figure 4 The storage system 303 sends the obtained 3 data blocks and 2 check data blocks to the storage system 304 for backup. In this case, the storage system 304 corresponds to the disaster recovery system in the storage system 303.

[0062] In an embodiment, the storage system 303 and the storage system 304 can store the data blocks and the check data blocks corresponding to the data by using an object storage scheme. Taking the storage system 303 as an example, the storage device in the storage system 303 can store the data blocks and the check data blocks corresponding to the data, and the metadata blocks in one object node of the storage device. The metadata blocks corresponding to one data can include the identifier of the data, the identifier of each data block and the identifier of each check data block corresponding to the data, and the logical address of each data block corresponding to the data. The identifier of the data can include the data digest and / or the version number. The identifier of the data block can include the logical address of the data block. One object node in one storage device refers to one storage area in the storage device.

[0063] When the storage system 303 cannot repair the data blocks corresponding to the data by using the EC storage technology, a read request is sent to the storage system 304 to obtain the data blocks corresponding to the data. Then, the data blocks are repaired according to the data blocks obtained from the storage system 304. Since the two storage systems are non-real-time asynchronous backup, there will be a certain data difference between the storage system 303 and the storage system 304. It should be noted that the data repair in the embodiment of the present application needs to be implemented in the case that the damaged data block which cannot be repaired occurs in the storage system 303 and has been backed up to the storage system 304.

[0064] Figure 4 The data storage system shown in the figure can realize disaster recovery backup at an ultra-long distance (more than 100 km) since the storage system 303 asynchronously backs up the data blocks to another storage system, thereby solving the problem of the limitation of the disaster recovery distance in the dual-active storage.

[0065] The data repair method provided in the embodiment of the present application will be described in detail below. Figure 5 The data repair method provided in the embodiment of the present application will be described in detail below.

[0066] Figure 5 is a flowchart of a data repair method provided in the embodiment of the present application. The method is applied to Figure 4The storage system 303 shown can be a centralized storage system or a distributed storage system. The application takes the storage system 303 as a distributed storage system for example. Specifically, Figure 5 The method shown can be performed by one of the storage devices 3031 in the storage system 303. As shown in the figure, Figure 5 The method shown can include steps S501-S503 as follows. The specific introduction of each step is as follows. Figure 5 The specific introduction of each step is as follows.

[0067] Step S501, the storage device 3031 acquires a first read request.

[0068] The application server 201 sends the first read request to the storage device 3031 after receiving the data read initiated by the user through the terminal device. The storage device 3031 receives the first read request from the application server 201. The first read request is used to read the first data block of the first object.

[0069] Step S502, the storage device 3031 sends a second read request to the storage device 3041 in the storage system 304 if it is determined that the first data block is damaged and cannot be repaired.

[0070] The first read request can include the identification of the first data block. Taking the logical address of the first data block as an example, the storage device 3031 converts the logical address of the first data block into a physical address after determining that the application server 201 requests to read the first data block, and reads the first data block from the physical address. If the reading is successful, the first data block is returned to the application server 201. If the reading fails, it indicates that the first data block has been damaged, and the logical addresses of other data blocks recorded in the metadata block corresponding to the first data block are read, and each logical address is converted into a physical address to read the data block from each physical address.

[0071] If the number of data blocks read from each physical address is equal to or greater than the threshold value, the damaged first data block is recalculated according to the data blocks read from each physical address using the EC algorithm to repair the first data block. If the number of data blocks read from each physical address is less than the threshold value, it indicates that the number of damaged data blocks of the first object is equal to or greater than the threshold value, and the first data block cannot be repaired using the EC algorithm.

[0072] The threshold value can be M. Taking Figure 4Taking the three EC data blocks and two EC check data blocks shown as an example, when the threshold is 2, in the case that data block 1, data block 2 and data block 4 are damaged, the storage device 3031 cannot use the EC algorithm to recompute any one of data block 1, data block 2 and data block 4 according to data block 3 and data block 5.

[0073] In the case that the first data block has been damaged and cannot be repaired, the storage device 3031 obtains the identification of the first object from the metadata block of the first object, generates a second read request according to the identification of the first object and the data block identification, and sends the second read request to the storage device 3041 in the storage system 304. The data block identification in the second read request can include the identification of the first data block and / or the identification of other data blocks of the first object except the first data block.

[0074] The data block identification can include the logical address of the data block. For example, the data block identification in the second read request can include the logical address of the first data block and / or the logical address of other data blocks of the first object except the first data block. Figure 4 Taking the data blocks shown as an example, if data block 1 is the first data block and data block 1, data block 2 and data block 4 are damaged, the storage device 3031 can generate a second read request according to one or more of the logical address of data block 1, the logical address of data block 2 and the logical address of data block 4 and send it to the storage device 3041.

[0075] After the storage device 3041 receives the second read request, it determines whether the data of the first object is stored according to the identification of the first object in the second read request and the identification of the stored objects. If the identification of the stored objects includes the identification of the first object, it indicates that the data block of the first object is stored in the storage device 3041, otherwise it indicates that the data block of the first object is not stored in the storage device 3041. Specifically, the storage device 3041 can read the metadata block in each object node and obtain the object identification therein, and then determine whether the identification of the first object is included.

[0076] If the data block of the first object has been stored, the logical address in the second read request is converted into a physical address, and the data block is read from the physical address. If the reading is successful, the read data block is returned to the storage device 3031. If the reading fails, it indicates that the data block requested by the storage device 3031 has been damaged, and a message is sent to the storage device 3031 that the requested data block has been damaged.

[0077] In step S503, the storage device 3031 repairs the first data block using the EC algorithm according to the data block read from the storage device 3041.

[0078] If the data block read by storage device 3031 from storage device 3041 includes the first data block, it can directly replace the first data block stored in its own device with the first data block read from storage device 3041. Specifically, the first data block read from storage device 3041 is written to the area where the corresponding object node is located, and the written physical address is recorded. Then, the mapping relationship between the logical address and physical address of the first data block is updated, and the original mapping relationship is marked as invalid. Afterwards, storage device 3031 can also recalculate other damaged blocks corresponding to the first object in storage device 3031 using the EC algorithm based on the first data block and other data blocks read from storage device 3041.

[0079] For example, with Figure 4 Taking the data block shown as an example, if data block 1 is the first data block, and data blocks 1, 2, and 4 are corrupted, when storage device 3031 sends a second read request to storage device 3041 including the logical address of data block 1, storage device 3031 can directly write data block 1 read from storage device 3041 and return data block 1 to the upper-layer server. Then, based on data block 1 read from storage device 3041 and the uncorrupted data blocks 3 and 5, the EC algorithm is used to recalculate data blocks 2 and 4, thereby repairing all the bad blocks of the first object.

[0080] If the first data block is not included in the data blocks read by storage device 3031 from storage device 3041, the first data block can be recalculated using the EC algorithm based on the read data blocks, and then the other damaged blocks corresponding to the first object in storage device 3031 can be recalculated. For example, with Figure 4 Taking the data block shown as an example, if data block 1 is the first data block, and data blocks 1, 2, and 4 are corrupted, when storage device 3031 sends a second read request to storage device 3041 including the logical address of data block 4, storage device 3031 can write to read data block 4 from storage device 3041. Based on data block 4 read from storage device 3041, the uncorrupted data blocks 3 and 5, data block 1 and data block 2 are recalculated using the EC algorithm. After the recalculated data blocks 1 and 2 are written, the recalculated data block 1 is returned to the upper-layer server.

[0081] Understandably, when storage device 3031 and storage device 3041 send a second read request that includes the logical addresses of all corrupted data blocks, storage device 3031 can directly write the data blocks read from storage device 3041 without having to recalculate using the EC algorithm.

[0082] In the above embodiments, when the storage device 3031 determines that the data block read by the upper-layer server is corrupted and cannot be repaired using the EC algorithm, it reads the data backed up in the storage device of another storage system in advance for EC repair, which can solve the data protection problem in the extreme case where the storage device 3031 cannot repair the data block using the EC algorithm.

[0083] based on Figure 5 The data repair method illustrated in this application also provides a data repair apparatus. This data repair apparatus is used to implement… Figure 5 The steps in the data repair method shown.

[0084] Figure 6 This is a schematic diagram of a data repair device 600 provided in an embodiment of this application. This data repair device 600 can be applied to the aforementioned storage device 3031. Figure 6 As shown, the data repair device 600 may include: an acquisition module 601, a determination module 602, and a repair module 603.

[0085] The acquisition module 601 is used to acquire a first read request, which is used to read the first data block among the N EC data blocks of the first object.

[0086] Specifically, the determining module 602 is used to send a second read request to the storage device 3041 if the first data block is corrupted and cannot be repaired. The storage device 3041 contains N EC data blocks and M EC check data blocks backed up for the first object. The second read request is used to read at least one data block from the N EC data blocks and / or at least one data block from the M EC check data blocks from the storage device 3041.

[0087] The repair module 603 is used to repair the first data block using the EC algorithm based on the data block read from the storage device 3041.

[0088] It should be noted that, Figure 6 The data repair device 600 provided in the illustrated embodiment, when executing the data repair method, is only illustrated by the division of the above-described functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the data repair device provided in the above embodiment and... Figure 5 The data repair method embodiments shown belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0089] Figure 7 This is a schematic diagram of the hardware structure of a storage device 700 provided in an embodiment of this application.

[0090] The storage device 700 can include the storage device 3031 and the storage device 3041 described above. Referring to Figure 7 The storage device 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704, the processor 701, the memory 702, and the communication interface 703 are connected to each other through the bus 704. The processor 701, the memory 702, and the communication interface 703 can also be connected in other ways than the bus 704.

[0091] The memory 702 can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, hard disk, etc.

[0092] The processor 701 can be a general-purpose processor, which can be a processor that performs specific steps and / or operations by reading and executing the contents stored in the memory (such as the memory 702). For example, the general-purpose processor can be a central processing unit (CPU). The processor 701 can include at least one circuit to perform Figure 5 The embodiments shown provide all or part of the steps of the method.

[0093] The communication interface 703 includes an input / output (I / O) interface, a physical interface, and a logical interface, etc. for realizing the interconnection of devices inside the storage device 700, and an interface for realizing the interconnection of the storage device 700 with other devices (such as other storage devices or user devices). The physical interface can be an Ethernet interface, a fiber interface, an ATM interface, etc.

[0094] The bus 704 can be any type, used to realize the communication bus for interconnecting the processor 701, the memory 702, and the communication interface 703, such as a system bus.

[0095] The above devices can be respectively arranged on chips independent of each other, or at least partially or entirely arranged on the same chip. Whether to arrange the devices independently on different chips or to integrate the devices on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation forms of the above devices.

[0096] Figure 7 The storage device 700 shown is merely exemplary, and in actual implementation, the storage device 700 can further include other components, which are not listed herein.

[0097] In the above embodiments, the implementation can be achieved entirely or partially by software, hardware, firmware, or any combination thereof. When implemented by software, the implementation can be achieved entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the above processes or functions described in the embodiments of the present application are entirely or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.

[0098] It can be understood that the various numbers involved in the embodiments of the present application are only distinguished for convenience of description, and are not used to limit the scope of the embodiments of the present application. It should be understood that in the embodiments of the present application, the size of the serial number of the above processes does not mean the order of execution, and the execution order of the processes should be determined according to their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0099] The above detailed description of the specific implementation is further detailed for the purpose of the application, technical solutions and beneficial effects, and it should be understood that the above description is only a specific implementation of the application and is not used to limit the protection scope of the application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the application shall be included in the protection scope of the application.

Claims

1. A data repair method, characterized in that, Applied to a first device, the first device storing N EC data blocks of a first object and M EC check data blocks of the first object, the method includes: Obtain a first read request, the first read request being used to read the first data block among the N EC data blocks; If it is determined that the first data block is corrupt and cannot be repaired, a second read request is sent to a second device, which has backed up the N EC data blocks and the M EC check data blocks. The second read request is used to read at least one data block from the N EC data blocks and / or at least one data block from the M EC check data blocks from the second device. The second read request includes at least one data block identifier, and the data block identified by the at least one data block identifier belongs to the data block of the first object that is corrupt. The number of at least one data block identifiers is less than the number of data blocks of the first object that are corrupt. Repair the first data block based on the data block read from the second device; The method further includes: The data block that has been identified as corrupted in the first object; If the first data block is included in the damaged data blocks of the first object, and the number of damaged data blocks of the first object is equal to or greater than the first threshold, then the first data block is determined to be damaged and cannot be repaired.

2. The method according to claim 1, characterized in that, The second read request includes the identifier of the first object. The second device is used to send a data block to the first device according to the data block identifier after determining that the object identifier stored in the second device includes the identifier of the first object.

3. The method according to claim 1, characterized in that, The value of the first threshold is M.

4. The method according to any one of claims 1-3, characterized in that, The identifier of the first object includes the version number and / or data digest of the first object.

5. The method according to claim 1, characterized in that, The data block identifier includes the logical address of the first data block.

6. A data repair device, characterized in that, Applied to a first device, the first device storing N EC data blocks of a first object and M EC check data blocks of the first object, the device comprising: The acquisition module is used to acquire a first read request, wherein the first read request is used to read the first data block among the N EC data blocks; A determination module is configured to send a second read request to a second device when the first data block is corrupted and cannot be repaired; the second device has backups of the N EC data blocks and the M EC check data blocks; the second read request is configured to read at least one data block from the N EC data blocks and / or at least one data block from the M EC check data blocks from the second device, wherein the second read request includes at least one data block identifier, the data block identified by the at least one data block identifier belongs to the data blocks of the first object that are corrupted, and the number of at least one data block identifiers is less than the number of data blocks of the first object that are corrupted; The repair module is used to repair the first data block based on the data blocks read from the second device; The determining module is further configured to: The data block that has been identified as corrupted in the first object; If the first data block is included in the damaged data blocks of the first object, and the number of damaged data blocks of the first object is equal to or greater than the first threshold, then the first data block is determined to be damaged and cannot be repaired.

7. The apparatus according to claim 6, characterized in that, The second read request includes the identifier of the first object. The second device is used to send a data block to the first device according to the data block identifier after determining that the object identifier stored in the second device includes the identifier of the first object.

8. The apparatus according to claim 6, characterized in that, The value of the first threshold is M.

9. The apparatus according to any one of claims 6-8, characterized in that, The identifier of the first object includes the version number and / or data digest of the first object.

10. The apparatus according to claim 6, characterized in that, The data block identifier includes the data digest and / or number of the first data block.

11. A storage device, characterized in that, The storage device includes a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the method of any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • File restoration method and device

    CN106844094A

  • Data storage method and device, data recovery method and device, server and storage medium

    CN111782152A