Disk detection method and device, electronic equipment and machine-readable storage medium

文档序号:1006018 发布日期:2020-10-23 浏览:13次 中文

阅读说明:本技术 磁盘检测方法、装置、电子设备及机器可读存储介质 (Disk detection method and device, electronic equipment and machine-readable storage medium ) 是由 *** 于 2019-04-12 设计创作,主要内容包括:本申请提供一种磁盘检测方法、装置、电子设备及机器可读存储介质。在本申请中,基于预设的RAID算法,计算获得第一数据,其中,所述第一数据包括读错误扇区对应故障条块保存的数据;向所述故障条块写入所述第一数据,若所述第一数据写入成功,则向所述故障条块下发读命令,获得第二数据;基于预设的数据一致性算法,判断所述第二数据与所述第一数据是否一致,若一致,则确定所述读错误扇区对应的磁盘为已修复。通过上述方法,基于对存在读错误扇区进行数据回写,触发磁盘的坏扇区重映射机制;以及,对读错误扇区回写的数据再读取,并执行数据一致性校验,进一步确保了读错误扇区得到真正修复,从而提高了RAID的可靠性,保证了数据的可靠性。(The application provides a disk detection method, a disk detection device, an electronic device and a machine-readable storage medium. In the method, first data are obtained through calculation based on a preset RAID algorithm, wherein the first data comprise data stored in fault bars corresponding to error reading sectors; writing the first data into the fault strip block, and issuing a read command to the fault strip block to obtain second data if the first data is successfully written; and judging whether the second data is consistent with the first data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the error reading sector is repaired. By the method, a bad sector remapping mechanism of the magnetic disk is triggered based on data write-back of the sector with the read error; and the data written back by the sector with the read error is read again, and the consistency check of the data is carried out, so that the sector with the read error is further ensured to be really repaired, the reliability of the RAID is improved, and the reliability of the data is ensured.)

1. A disk detection method is applied to a storage device, the storage device is preconfigured with at least one redundant RAID array, the RAID array comprises a plurality of disks, and the method comprises the following steps:

calculating to obtain first data based on a preset RAID algorithm, wherein the first data comprises data stored in fault strips corresponding to error reading sectors;

writing the first data into the fault strip block, and issuing a read command to the fault strip block to obtain second data if the first data is successfully written;

and judging whether the second data is consistent with the first data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the error reading sector is repaired.

2. The method of claim 1, wherein the first data further comprises data stored for a stripe block corresponding to the read error sector for an adjacent sector, and wherein the writing the first data to the failed stripe block further comprises:

and writing the data which is stored in the first data and corresponds to the adjacent sector as the read error sector into the adjacent sector corresponding stripe.

3. The method of claim 2, wherein issuing a read command to the failing chunk to obtain second data further comprises:

and issuing a read command to the adjacent sector corresponding stripe block to obtain second data, wherein the second data further comprises data read from the adjacent sector corresponding stripe block.

4. The method of claim 1 or 3, further comprising:

and if the second data is inconsistent with the first data, determining that the disk is in failure.

5. The method of claim 1, wherein the data consistency algorithm is an exclusive or algorithm.

6. The method of claim 5, wherein the XOR algorithm is based on a hardware implementation.

7. A disk detection apparatus, applied to a storage device, wherein the storage device is preconfigured with at least one redundant RAID array, and the RAID array includes a plurality of disks, the apparatus includes:

the calculation module is used for calculating and obtaining first data based on a preset RAID algorithm, wherein the first data comprises data stored in fault strips corresponding to error reading sectors;

the read-write module writes the first data into the fault strip block, and if the first data is successfully written, a read command is issued to the fault strip block to obtain second data;

and the detection module is used for judging whether the second data is consistent with the first data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the error reading sector is repaired.

8. The apparatus of claim 7, wherein the first data further comprises data stored for a stripe corresponding to the read error sector for an adjacent sector, and the read/write module further:

and writing the data which is stored in the first data and corresponds to the adjacent sector as the read error sector into the adjacent sector corresponding stripe.

9. The apparatus of claim 8, wherein the issuing of the read command to the faulty stripe obtains second data, and the read/write module further:

and issuing a read command to the adjacent sector corresponding stripe block to obtain second data, wherein the second data further comprises data read from the adjacent sector corresponding stripe block.

10. The apparatus of claim 7 or 9, wherein the detection module is further to:

and if the second data is inconsistent with the first data, determining that the disk is in failure.

11. The apparatus of claim 7, wherein the data consistency algorithm is an exclusive or algorithm.

12. The apparatus of claim 11, wherein the exclusive or algorithm is based on a hardware implementation.

13. An electronic device is characterized by comprising a communication interface, a processor, a memory, a nonvolatile storage and a bus, wherein the communication interface, the processor, the memory and the nonvolatile storage are connected with one another through the bus;

the non-volatile storage having stored therein machine-readable instructions, the processor performing the method of any of claims 1 to 6 by calling the machine-readable instructions.

14. A machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, carry out the method of any of claims 1 to 6.

Technical Field

The present application relates to the field of storage technologies, and in particular, to a disk detection method and apparatus, an electronic device, and a machine-readable storage medium.

Background

With the development of information technology, more and more data is stored in a disk, and in order to improve the reliability of the data in the disk, RAID (Redundant array of Independent Disks) technology is generally used to perform redundancy protection on the data in the disk.

RAID is a storage technology that combines multiple independent physical disks in different ways to form an array of disks, and RAID-based arrays can provide higher storage performance than individual disks. RAID technology may have a variety of implementation policies, where commonly used RAID policies include RAID0, RAID1, RAID5, RAID6, RAID10, and the like.

However, a situation that a disk surface is scratched due to sudden shock or mechanical failure, or a disk surface is dusted due to other factors inevitably occurs, and when a plurality of continuous disks in a RAID array have disk media errors, a RAID reconstruction rate is low, which may cause a redundant protection mechanism of the RAID array for data to fail, resulting in data loss. Therefore, the reliability of data can be effectively improved by finding the problem of the disk medium in time and repairing the disk with the medium error.

Disclosure of Invention

The application provides a disk detection method, which is applied to a storage device, wherein the storage device is preconfigured with at least one redundant RAID array, the RAID array comprises a plurality of disks, and the method comprises the following steps:

calculating to obtain first data based on a preset RAID algorithm, wherein the first data comprises data stored in fault strips corresponding to error reading sectors;

writing the first data into the fault strip block, and issuing a read command to the fault strip block to obtain second data if the first data is successfully written;

and judging whether the second data is consistent with the first data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the error reading sector is repaired.

Optionally, the first data further includes data stored in a stripe block corresponding to the read-error sector as an adjacent sector, and the writing of the first data into the failed stripe block further includes:

and writing the data which is stored in the first data and corresponds to the adjacent sector as the read error sector into the adjacent sector corresponding stripe.

Optionally, the issuing a read command to the fault block to obtain second data further includes:

and issuing a read command to the adjacent sector corresponding stripe block to obtain second data, wherein the second data further comprises data read from the adjacent sector corresponding stripe block.

Optionally, the method further includes:

and if the second data is inconsistent with the first data, determining that the disk is in failure.

Optionally, the data consistency algorithm is an exclusive or algorithm.

Optionally, the xor algorithm is implemented based on hardware.

The present application further provides a disk detection apparatus, the apparatus is applied to a storage device, the storage device is preconfigured with at least one redundant RAID array, the RAID array includes a plurality of disks, the apparatus includes:

the calculation module is used for calculating and obtaining first data based on a preset RAID algorithm, wherein the first data comprises data stored in fault strips corresponding to error reading sectors;

the read-write module writes the first data into the fault strip block, and if the first data is successfully written, a read command is issued to the fault strip block to obtain second data;

and the detection module is used for judging whether the second data is consistent with the first data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the error reading sector is repaired.

Optionally, the first data further includes data stored in a stripe block corresponding to the read-error sector as an adjacent sector, and the read-write module further:

and writing the data which is stored in the first data and corresponds to the adjacent sector as the read error sector into the adjacent sector corresponding stripe.

Optionally, the issuing a read command to the fault block to obtain second data, where the read-write module further:

and issuing a read command to the adjacent sector corresponding stripe block to obtain second data, wherein the second data further comprises data read from the adjacent sector corresponding stripe block.

Optionally, the detection module further:

and if the second data is inconsistent with the first data, determining that the disk is in failure.

Optionally, the data consistency algorithm is an exclusive or algorithm.

Optionally, the xor algorithm is implemented based on hardware.

The application also provides an electronic device, which comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the nonvolatile storage are connected with each other through the bus;

the non-volatile storage stores machine-readable instructions that are invoked by the processor to perform the method described above.

The present application also provides a machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, implement the above-described method.

Through the embodiment, the bad sector remapping mechanism of the disk is triggered based on data write-back of the sector with the read error; and the data written back by the sector with the read error is read again, and the consistency check of the data is carried out, so that the sector with the read error is further ensured to be really repaired, the reliability of the RAID is improved, and the reliability of the data is ensured.

Drawings

FIG. 1 is a flow chart of a disk inspection method provided by an exemplary embodiment;

FIG. 2 is a hardware block diagram of an electronic device provided by an exemplary embodiment;

FIG. 3 is a block diagram of a disk sensing device according to an exemplary embodiment.

Detailed Description

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.

In order to make those skilled in the art better understand the technical solution in the embodiment of the present application, a brief description will be given below of the related art of disk detection according to the embodiment of the present application.

For ease of understanding, the basic concepts related to RAID in this specification are introduced below. RAID technology combines multiple independent physical disks in different ways to form a virtual disk. By adopting the RAID technology, parallel reading and writing of data can be realized, the data access rate is improved, meanwhile, the RAID technology applies technologies such as mirroring and parity check to carry out redundancy protection on the data, and the reliability of the data is greatly improved.

A RAID array may comprise a plurality of member disks, and the data in the RAID array is organized in stripes and stripes. The method comprises the steps that a strip block is the minimum unit of a RAID array management storage space, when the RAID array is established, the storage space of member disks included in the RAID array is divided into blocks with equal size and adjacent addresses according to the size of a preset strip block, and the blocks with the equal size and the adjacent addresses are called strip blocks; the stripe is a set of stripe blocks related to positions on a plurality of member disks of the RAID array, the RAID implementation mode is different according to different RAID levels, the number of the member disks in the RAID array is different, the states of the member disks are different, RAID algorithms are different, and the RAID redundancy of data in the stripe blocks is also different.

In the RAID technology, the processing of a read/write command by a RAID array is processed according to strips, after the RAID array receives the read/write command sent by upper software, the strips to be operated are determined based on the address carried in the read/write command, then the read/write command is split into the read/write command aiming at the corresponding strips of one or more member disks in the strips based on factors such as RAID level, RAID algorithm, member disk state and the like, and the split read/write command is sent to the corresponding member disks for execution. Subsequently, the member disk executes the received read/write command and returns the execution result to the RAID array.

For ease of understanding, the following disk bad sector remapping mechanism is introduced. In general, when a disk leaves a factory, a disk manufacturer reserves a part of sectors in the disk, the part of sectors is invisible to a user of the disk, the disk can use the part of sectors as spare sectors, when a write error occurs in the disk, the disk can automatically map a bad sector with the write error to the spare sectors, that is, an address pointing to the bad sector is replaced with an address pointing to the spare sector, and subsequently, the disk can write data into the mapped spare sectors again, and the bad sectors are not accessed any more subsequently. Based on the above-described bad sector remapping mechanism of the disk, the upper layer software does not sense that the disk has a write error, so that the disk is considered to be normal, and subsequently, the upper layer software can sense that the disk has a write error until the spare sector of the disk is used up, so that the disk fault is determined.

In some scenarios, the common causes of disk failures are mainly classified into two categories: mechanical failure, media error; wherein, once the magnetic disk has mechanical failure, the magnetic disk is basically unavailable and has irreparable property. Media errors are divided into two cases: physical media real damage, disk FW (FirmWare) software BUG induced media errors.

When the physical medium constituting the disk is really damaged, the disk can utilize the disk bad sector remapping mechanism to realize medium remapping, so that the bad sector is repaired.

For the media error caused by the disk FW software BUG, which is caused by the mapping algorithm BUG of the FW software, the media error has the following expression effects: the data written to a disk sector is inconsistent with the data read from the disk sector; or data may be written to the sector but errors may be reported when read from the sector. Thus, the type of error has a deep concealment, unpredictability, irreparability. If the error occurs and the storage device is not identified in time, the data reliability of the RAID array where the bad sector is located will be greatly affected.

Based on the above scenario, in the existing scheme, for a media error caused by disk FW software BUG, the above disk bad sector remapping mechanism cannot ensure that the bad sector is completely repaired, thereby affecting that data of the corresponding RAID array is unreliable.

The present application is directed to provide a technical solution for performing data write-back on a sector with a read error, and performing re-verification on the write-back data read.

When the method is realized, data stored by a fault strip block corresponding to a read error sector is calculated and obtained based on a preset RAID algorithm; writing the data into the fault strip block, and issuing a read command to the fault strip block to obtain write-back data if the data is successfully written; and judging whether the read-back data is consistent with the data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the read error sector is repaired.

In the scheme, a bad sector remapping mechanism of the magnetic disk is triggered based on data write-back of the sector with the read error; and the data written back by the sector with the read error is read again, and the consistency check of the data is carried out, so that the sector with the read error is further ensured to be really repaired, the reliability of the RAID is improved, and the reliability of the data is ensured.

The present application is described below with reference to specific embodiments and specific application scenarios.

Referring to fig. 1, fig. 1 is a flowchart of a disk detection method provided in an embodiment of the present application, where the method is applied to a storage device, the storage device is preconfigured with at least one redundant RAID array, the RAID array includes a plurality of disks, and the method performs the following steps:

102, calculating to obtain first data based on a preset RAID algorithm, wherein the first data comprises data stored in a fault strip corresponding to a read error sector.

And 104, writing the first data into the fault strip block, and issuing a read command to the fault strip block to obtain second data if the first data is successfully written.

And 106, judging whether the second data is consistent with the first data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the error reading sector is repaired.

The following describes the technical solution related to the present application in detail by specific embodiments and in combination with "read error sector monitoring", "data write back", and consistency check of write back data ":

1) read error sector monitoring

In this specification, the RAID array refers to an array managed by a storage device and having redundancy, and the RAID array includes a plurality of member disks.

For example: the RAID type is an array of RAID5, which can allow one disk to fail and still ensure reliable data and redundancy. Another example is: an array with RAID type 10 may allow half of the number of failed disks while still ensuring data reliability and redundancy.

In the present specification, the RAID algorithm refers to an algorithm used for a RAID type corresponding to the RAID array.

In this specification, after receiving a read/write command for the RAID array, a storage device determines a stripe to be operated based on an address carried in the read/write command, then splits the read/write command into read/write commands for corresponding stripe blocks of one or more member disks in the stripe based on factors such as a RAID type, a RAID algorithm, a member disk state, and the like, and sends the split read/write commands to the corresponding member disks for execution. When the member disk executes the received read/write command, if a to-be-read/write stripe in a member disk fails, the member disk may return an execution result indicating that the read/write command is erroneous to the storage device, where the execution result at least includes a read/write error sector.

In this specification, the read error sector refers to one or more disk sectors corresponding to a data read error when the member disk executes a received read command.

In this specification, the faulty stripe is a stripe that is calculated and determined by the storage device based on a RAID algorithm corresponding to a RAID type after the faulty sector is obtained.

In this specification, the storage device performs monitoring for a read command of the RAID array; obtaining the sector with the read error and the corresponding fault bar; and recovering the data stored in the fault strip block based on a RAID algorithm corresponding to the RAID type and other strip blocks of the fault strip block in the same strip. Specifically, for how to recover data by a RAID algorithm corresponding to different RAID types, those skilled in the art may refer to relevant descriptions in the prior art, which are not described in detail in this application.

In this specification, the first data includes data stored in the storage device corresponding to the faulty stripe, which is obtained by calculation using a RAID algorithm.

2) Data write back

In this specification, the storage device writes the first data to the defective bank.

In another embodiment shown in the present specification, the first data further includes data stored in a stripe block corresponding to the read error sector as an adjacent sector; wherein the adjacent sectors may be set in the storage device.

For example: the storage device may be preset with a sector offset, which may be in units of capacity or in units of number of sectors, and based on the adjacent sector offset, the read error sector may be bidirectionally offset, and the range of the adjacent sector may be obtained. After obtaining the adjacent sectors, the storage device calculates and determines the strips corresponding to the adjacent sectors, referred to as "adjacent strips" for short, based on a RAID algorithm corresponding to a RAID type; and reading out the data stored in the adjacent blocks as a part of the first data.

In this specification, a storage device writes the first data including data stored in a defective block into the defective block; if the writing is successful, the disk can be considered to have the remaining spare sectors, and in the process of writing the first data into the fault stripe, the remapping of the bad sectors of the disk is triggered, namely the disk is automatically repaired, and the disk is still usable; if the first data write fails, it may be determined that the disk is unavailable based on the disk bad sector remapping mechanism that the spare sector does not exist in the disk.

In another embodiment shown in the present specification, the storage device writes the first data including data stored in a defective stripe and data stored in the adjacent stripe into the defective stripe and the adjacent stripe, respectively; if the writing is successful, the disk can be considered to have the remaining spare sectors, and in the process of writing the first data into the fault stripe, the remapping of the bad sectors of the disk is triggered, namely the disk is automatically repaired, and the disk is still usable; if the first data write fails, it may be determined that the spare sector does not exist in the disk based on the disk bad sector remapping mechanism, so that it may be determined that the disk is unavailable, that is, the disk is determined to be a failure.

In this specification, after the first data (including only data stored in correspondence with the faulty stripe) is successfully written, the storage device issues a read command to the faulty stripe to obtain second data, where the second data includes data read from the faulty stripe.

Note that, since the first data is successfully written, if the read error sector corresponding to the faulty stripe has a fault, the following are: the physical medium is really damaged; and the disk is provided with a spare sector correspondingly, and the fault strip block is actually repaired really based on the disk bad sector remapping mechanism. However, if the read error sector corresponding to the above-mentioned failed stripe block has a failure: media errors caused by disk FW software BUG; although the first data may be successfully written, when the read command is issued again from the defective block, the read data may be erroneous or may not be read.

In another embodiment, after the first data (including the data stored in the faulty stripe and the data stored in the adjacent stripe) is successfully written, the storage device issues a read command to the faulty stripe and the adjacent stripe to obtain the second data, where the second data includes the data read from the faulty stripe and the data read from the adjacent stripe.

It should be noted that, in a case that the second data is available, the read command corresponding to the second data may be returned normally, and if the read command of the second data cannot be returned normally, the second data acquisition fails; the read error sector corresponding to the failed stripe is completely damaged, and the storage device may determine that the disk is unavailable, that is, that the disk is failed.

In this specification, the above-mentioned second data is also simply referred to as "write-back data".

Because the disk medium is generally a region rather than a plurality of sectors when damaged, based on the above-mentioned "data write-back" process, data write-back is performed on the faulty stripe and the adjacent stripe, and is not limited to the data of the faulty stripe corresponding to the read-error sector, but the data write-back is performed on the data of the adjacent stripe corresponding to the adjacent sector of the faulty sector, so that the faulty sector and the potential faulty sector can be repaired as much as possible by a disk bad sector remapping mechanism.

3) Consistency check of write back data

In this specification, after the second data, that is, "write-back data" is read by the storage device, the second data may be further compared with the first data to analyze whether the second data and the first data are consistent, and the above process is also referred to as "consistency check of write-back data".

In this specification, the storage device determines whether the second data is consistent with the first data based on a preset data consistency algorithm, and if so, determines that the disk corresponding to the read error sector is repaired.

The storage device may perform data comparison based on software when performing "consistency check of write-back data".

For example: the storage device may read data corresponding to the same offset position from the second data and the first data in a fixed byte length manner, and compare the data one by one.

In another embodiment, the data consistency algorithm is an xor algorithm, the storage device may perform an xor operation on the second data and the first data according to bit bits based on the xor algorithm, and if a final result corresponding to the xor operation is zero, the second data is indicated to be consistent with the first data; otherwise, indicating that the second data is inconsistent with the first data.

In this specification, the storage device may perform a soft operation on the above-described xor algorithm based on a CPU integrated thereon.

In another embodiment, the storage device may acquire a hardware module of the storage device, and if a corresponding RAID hardware supporting an exclusive-or operation exists in the hardware module, the storage device may execute a hard operation of the exclusive-or algorithm based on the RAID hardware.

For example: if the storage device has hardware supporting the RAID5 algorithm, the exclusive or operation may be performed based on the hardware of the RAID5 algorithm, thereby improving the operation efficiency.

In this specification, the storage device determines whether the second data is consistent with the first data based on a preset data consistency algorithm, and in another illustrated embodiment, if the second data is not consistent with the first data, it determines that the disk corresponding to the read-error sector is a failure.

Based on the above process of "consistency check of write-back data", the storage device can effectively find a media error caused by the disk FW software BUG, and ensure that the data read from the repaired faulty stripe block corresponding to the read-error sector and the adjacent stripe block corresponding to the adjacent sector is valid.

In the technical scheme, a bad sector remapping mechanism of a magnetic disk is triggered based on data write-back of a sector with read errors; and the data written back by the sector with the read error is read again, and the consistency check of the data is carried out, so that the sector with the read error is further ensured to be really repaired, the reliability of the RAID is improved, and the reliability of the data is ensured.

Corresponding to the method embodiment, the application also provides an embodiment of a disk detection device.

Corresponding to the method embodiment, the present specification further provides an embodiment of a disk detection apparatus. The embodiment of the disk detection device in the specification can be applied to electronic equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. In terms of hardware, as shown in fig. 2, the hardware structure diagram of the electronic device in which the disk detection apparatus of this specification is located is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 2, the electronic device in which the apparatus is located in the embodiment may also include other hardware according to the actual function of the electronic device, which is not described again.

Fig. 3 is a block diagram of a disk sensing device according to an exemplary embodiment of the present disclosure.

Referring to fig. 3, the disk detection apparatus 30 may be applied in the electronic device shown in fig. 2, where the apparatus is applied to a storage device, the storage device is preconfigured with at least one redundant RAID array, the RAID array includes a plurality of disks, and the apparatus includes:

the calculation module 301 calculates to obtain first data based on a preset RAID algorithm, where the first data includes data stored in a fault stripe corresponding to a read-error sector;

the read-write module 302 writes the first data into the fault stripe, and if the first data is successfully written, issues a read command to the fault stripe to obtain second data;

the detection module 303 determines whether the second data is consistent with the first data based on a preset data consistency algorithm, and if so, determines that the disk corresponding to the sector with the read error is repaired.

In this embodiment, the first data further includes data stored in a stripe block corresponding to the sector with the read error as an adjacent sector, and the read/write module 302 further:

and writing the data which is stored in the first data and corresponds to the adjacent sector as the read error sector into the adjacent sector corresponding stripe.

In this embodiment, the issuing a read command to the fault block to obtain second data, where the read-write module 302 further:

and issuing a read command to the adjacent sector corresponding stripe block to obtain second data, wherein the second data further comprises data read from the adjacent sector corresponding stripe block.

In this embodiment, the detecting module 303 further:

and if the second data is inconsistent with the first data, determining that the disk is in failure.

In this embodiment, the data consistency algorithm is an exclusive or algorithm.

In this embodiment, the exclusive or algorithm is based on a hardware implementation.

For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.

The apparatuses, modules or modules illustrated in the above embodiments may be implemented by a computer chip or an entity, or by an article with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.

Corresponding to the method embodiment, the present specification also provides an embodiment of an electronic device. The electronic device can be applied to a storage device, the storage device is preconfigured with at least one redundant RAID array, and the RAID array comprises a plurality of disks; the electronic device includes: a processor and a memory for storing machine executable instructions; wherein the processor and the memory are typically interconnected by an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.

In this embodiment, the processor is caused to:

calculating to obtain first data based on a preset RAID algorithm, wherein the first data comprises data stored in fault strips corresponding to error reading sectors;

writing the first data into the fault strip block, and issuing a read command to the fault strip block to obtain second data if the first data is successfully written;

and judging whether the second data is consistent with the first data or not based on a preset data consistency algorithm, and if so, determining that the disk corresponding to the error reading sector is repaired.

In this embodiment, the first data further includes data stored for a stripe corresponding to the read error sector for an adjacent sector, and the processor is caused to:

and writing the data which is stored in the first data and corresponds to the adjacent sector as the read error sector into the adjacent sector corresponding stripe.

In this embodiment, the processor is caused to:

and issuing a read command to the adjacent sector corresponding stripe block to obtain second data, wherein the second data further comprises data read from the adjacent sector corresponding stripe block.

In this embodiment, the processor is caused to:

and if the second data is inconsistent with the first data, determining that the disk is in failure.

Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.

It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:闪存Nand Flash的动态测试方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!