Method for controlling a disk array and electronic device

By receiving verification requests from the disk array, using the target stripe data and verification data, the mapping relationship is obtained to locate the damaged data, which solves the problem of low verification accuracy of the disk array and achieves more accurate data verification and repair.

CN120929347BActive Publication Date: 2026-01-27LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511456921.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-01-27
Estimated Expiration
2045-10-13

AI Technical Summary

Technical Problem

In existing technologies, disk arrays have low verification accuracy and cannot provide accurate verification results.

Method used

By receiving verification requests from the disk array, the target stripe is verified based on the data of the target stripe and the verification data. The target mapping relationship of the damaged stripe is obtained, the damaged data is located, and the correspondence between the data block identifier and the reference data is used to achieve more accurate data verification.

Benefits of technology

It improves the verification accuracy of disk arrays, enabling more accurate location and repair of damaged data, thus enhancing data integrity and verification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929347B_ABST
    Figure CN120929347B_ABST
Patent Text Reader

Abstract

The application discloses a kind of control method of disk array and electronic equipment, it is related to computer technical field, method includes: receiving check request;According to the target data stored in target strip of target disk array and the check data of target data stored in target strip, target strip is checked, and damaged strip is obtained, wherein, target strip is the strip of multiple strips included in target disk array and stores data;According to target data block included in damaged strip, target mapping relationship corresponding to damaged strip is acquired from first mapping relationship, wherein, first mapping relationship records the data block identification and reference data with corresponding relationship;According to target data and target mapping relationship, damaged data on damaged strip is located from target data and check data, by the application, it solves the technical problem that the check precision of disk array is lower, achieves the technical effect that the check precision of disk array is mentioned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a control method and electronic device for a disk array. Background Technology

[0002] Disk arrays can effectively improve storage performance and reliability by combining multiple disks. Verification mechanisms effectively ensure data integrity and are a key feature of disk arrays. Related technologies verify the storage performance of a disk array by reading its entire area and comparing the data within with the verification data. However, this verification method cannot provide accurate results and has low precision for disk array verification. Summary of the Invention

[0003] This application provides a control method and electronic device for a disk array, which at least solves the problem of low verification accuracy of disk arrays in related technologies.

[0004] This application provides a control method for a disk array, including: receiving a verification request for a target disk array, wherein the verification request is used to request verification of data stored in the target disk array;

[0005] The target stripe is verified based on the target data stored in the target stripe in the target disk array and the verification data of the target data stored in the target stripe, and the damaged stripe is obtained. The target stripe is the stripe that stores data among the multiple stripes included in the target disk array, and the damaged stripe is the stripe in the target stripe that has been damaged.

[0006] Based on the target data blocks included in the damaged stripe, the target mapping relationship corresponding to the damaged stripe is obtained from the first mapping relationship of the target disk array. The first mapping relationship records the data block identifier and reference data with corresponding relationship. The data block identifier is used to identify the data block in the target disk array that stores data, and the reference data is used to identify the data stored in the corresponding data block.

[0007] Based on the target data and target mapping relationship, the damaged data on the damaged strip is located from the target data and verification data. The damaged data is the data that has been corrupted in the data stored in the damaged strip.

[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described disk array control methods.

[0009] This application receives a verification request from a target disk array, verifies the target stripe based on the target data stored in the target stripe of the target disk array and the verification data of the target data stored in the target stripe, and obtains the damaged stripe. Based on the target data blocks included in the damaged stripe, the target mapping relationship corresponding to the damaged stripe is obtained from the first mapping relationship of the target disk array. Since the first mapping relationship records the corresponding data block identifier and reference data, the data block identifier is used to identify the data block in the target disk array that stores data, and the reference data is used to identify the data stored in the corresponding data block. Therefore, the damaged data on the damaged stripe can be located from the target data and the verification data based on the target data and the target mapping relationship. The solution provided by this application can obtain more accurate data verification results. Therefore, it can solve the technical problem of low verification accuracy of disk arrays in related technologies and achieve the technical effect of improving the verification accuracy of disk arrays. Attached Figure Description

[0010] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a hardware structure block diagram of the disk array control method according to an embodiment of this application;

[0012] Figure 2 This is a flowchart of a disk array control method according to an embodiment of this application;

[0013] Figure 3 This is a flowchart of a writing method for writing data to a disk array according to an embodiment of this application;

[0014] Figure 4 This is a flowchart of a disk array inspection method according to an embodiment of this application;

[0015] Figure 5 This is a structural block diagram of a disk array control device according to an embodiment of this application. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0017] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0018] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] The specific application environment architecture or specific hardware architecture on which the execution of the disk array control method depends is described here.

[0020] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of the disk array control method according to an embodiment of this application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the image. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), microprocessor (MCU), or programmable logic device (FPGA), etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0021] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the disk array control method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0022] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0023] The embodiments of this application provide a control method for a disk array. The method is described in detail below in conjunction with the execution flow of the control method for a disk array.

[0024] The following explains the technical terms used in this application:

[0025] Disk Array: A disk array is a system that combines multiple physical disk drives into a single logical storage unit to improve data storage performance and reliability. By using RAID (Redundant Array of Independent Disks) technology, disk arrays can provide various functions such as data redundancy, performance enhancement, and fault tolerance.

[0026] Striping: Striping is a key concept in data distribution within a disk array. In a RAID system, a stripe refers to a sequence of data blocks spanning multiple disk drives. When data is written to the disk array, it is divided into smaller blocks, which are distributed across different disks in the array according to a striping strategy. Striping can significantly improve read and write speeds because it allows data to be read from or written to multiple disks simultaneously, reducing I / O latency.

[0027] Data Block: A data block, often abbreviated as DB or Block, is the basic unit for reading and writing in a storage system. In a disk array, all data is stored and processed in the form of data blocks. Each data block typically contains a fixed size of data, such as 4KB (kilobyte), 8KB, or 16KB. In addition to the actual data, a data block may also contain metadata, such as checksum information, to ensure data integrity and consistency. In disk array operations, a stripe is composed of multiple data blocks distributed across different disks in the array, forming a stripe. A disk array combines multiple disks using strategies such as striping to form a logically larger storage unit, thereby improving the efficiency and reliability of data processing.

[0028] This embodiment provides a method for controlling a disk array. Figure 2 This is a flowchart of a disk array control method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0029] Step S202: Receive a verification request from the target disk array, wherein the verification request is used to request verification of the data stored in the target disk array;

[0030] Step S204: Verify the target stripe according to the target data stored in the target stripe in the target disk array and the verification data of the target data stored in the target stripe to obtain the damaged stripe. The target stripe is the stripe that stores data among the multiple stripes included in the target disk array, and the damaged stripe is the stripe in the target stripe that has been damaged.

[0031] Step S206: Based on the target data blocks included in the damaged stripe, obtain the target mapping relationship corresponding to the damaged stripe from the first mapping relationship of the target disk array. The first mapping relationship records the data block identifier and reference data with corresponding relationship. The data block identifier is used to identify the data block in the target disk array that stores data, and the reference data is used to identify the data stored in the corresponding data block.

[0032] Step S208: Based on the target data and target mapping relationship, locate the damaged data on the damaged strip from the target data and verification data. The damaged data is the data that has been corrupted in the data stored in the damaged strip.

[0033] Through the above steps, a verification request from the target disk array is received. The target stripe is verified based on the target data stored in the target stripe of the target disk array and the verification data of the target data stored in the target stripe, resulting in a damaged stripe. Based on the target data blocks included in the damaged stripe, the target mapping relationship corresponding to the damaged stripe is obtained from the first mapping relationship of the target disk array. Since the first mapping relationship records the corresponding data block identifiers and reference data, the data block identifiers are used to identify the data blocks in the target disk array that store data, and the reference data is used to identify the data stored in the corresponding data blocks. Therefore, the damaged data on the damaged stripe can be located from the target data and the verification data based on the target data and the target mapping relationship. The solution provided in this application can obtain more accurate data verification results. Therefore, it can solve the technical problem of low verification accuracy of disk arrays in related technologies and achieve the technical effect of improving the verification accuracy of disk arrays.

[0034] In the embodiment provided in step S202, verification requests for the target disk array may be initiated periodically, or the verification request may be manually triggered by the user or administrator through a command line or graphical interface, or the potential performance of the target disk array may be monitored, and a verification request may be sent when a potential performance degradation of the target disk array is detected.

[0035] Optionally, in this embodiment, the verification request may be used, but is not limited to, to request verification of the data stored in the target disk array, that is, to request to check whether the data stored in the target disk array is complete and error-free.

[0036] Optionally, in this embodiment, the data stored in the target disk array may include, but is not limited to, the data requested by the user, and may be referred to as target data. In addition, the data stored in the target disk array may also include, but is not limited to, the metadata of the target data, such as the verification data of the target data.

[0037] In the embodiment provided in step S204, the target stripe may be, but is not limited to, a stripe in which data is stored among multiple stripes included in the target disk array, and may be, but is not limited to, traversing each stripe in the target disk array to read the data stored in each stripe.

[0038] Optionally, in this embodiment, the target stripe can be selected from the multiple stripes included in the target disk array first, and then only the target stripe can be read in the subsequent verification process, thus avoiding the full disk scan operation and improving the verification efficiency of the disk array.

[0039] Optionally, in this embodiment, when storing data in the target disk array, it may, but is not limited to, only store the data that the user needs in the current situation, deleting historically needed but currently unnecessary data from the target disk array, or, when storage resources are sufficient, avoiding unnecessary operations, adjusting the validity of some data from valid to invalid when some data changes from needed to unnecessary. Through the above operations, unnecessary operations on the disk array can be avoided, improving the control efficiency of the disk array.

[0040] Optionally, in this embodiment, given sufficient resources, since invalid data has essentially been discarded by the user, data verification can, but is not limited to, verifying only valid data. In this case, the target stripe can, but is not limited to, the stripe containing valid data among the multiple stripes included in the target disk array.

[0041] Optionally, in this embodiment, the target stripe may, but is not limited to, store the target data and its parity data. For example, for a disk array comprising four disks, including disk A, disk B, disk C, and disk D, disk D may, but is not limited to, be dedicated to storing redundant parity data. For a data segment "123456789" to be written to the disk array, this data may, but is not limited to, be divided into three parts: "123", "456", and "789", and the three data blocks may be written to a portion of disk A, disk B, and disk C respectively. The parity value may, but is not limited to, be calculated using an XOR (Exclusive OR) operation. The parity data may, but is not limited to, be XORed with the data block "123" on disk A, the data block "456" on disk B, and the data block "789" on disk C to obtain the parity data "252", and the result is stored on disk D at the location corresponding to these data blocks. Now, the “123” (target data) on disk A, the “456” (target data) on disk B, the “789” (target data) on disk C, and the “252” (checksum data) on disk D form a target stripe.

[0042] Optionally, in this embodiment, verifying the target strip based on the target data and the verification data of the target data may include, but is not limited to: calculating new verification data of the target data using the target data extracted from the target strip in the same way as calculating the verification data; comparing the new verification data with the verification data extracted from the target strip; if there is no difference between the two (which may include, but is not limited to, the values ​​of the two data being equal or the difference between the values ​​of the two data being less than or equal to a preset verification difference threshold), then the target strip is considered to be undamaged; if there is a difference between the two (which may include, but is not limited to, the values ​​of the two data being unequal or the difference between the values ​​of the two data being greater than a preset verification difference threshold), then the target strip is considered to be damaged, that is, the target strip is determined to be a damaged strip.

[0043] Optionally, in this embodiment, after identifying the damaged stripe in the above manner, it can be determined that the data stored in the damaged stripe is corrupted, but it is impossible to determine whether the corrupted data is the target data or the verification data of the target data.

[0044] In the embodiment provided in step S206, the target mapping relationship corresponding to the damaged stripe can be obtained from the first mapping relationship of the target disk array based on the target data blocks included in the damaged stripe, in order to prepare for further locating the damaged data in the damaged stripe.

[0045] Optionally, in this embodiment, the first mapping relationship may, but is not limited to, recording data block identifiers and reference data with corresponding relationships. The data block identifier may, but is not limited to, be used to identify data blocks in the target disk array that store data. Therefore, the first mapping relationship including the aforementioned data identifier may, but is not limited to, be obtained as the target mapping relationship based on the data identifier corresponding to the target data block included in the damaged stripe.

[0046] Optionally, in this embodiment, the first mapping relationship of the target disk array can also be stored in the memory of the target disk array in the form of stripes with corresponding relationships and the first mapping relationship. It can be, but is not limited to, directly searching for damaged stripes in memory and obtaining the first mapping relationship corresponding to the damaged stripes as the target mapping relationship.

[0047] Optionally, in this embodiment, the reference data may be used, but is not limited to, to identify the data stored in the corresponding data block. For example, a reference function may be called, and the target data may be substituted into the reference function to obtain the reference data. However, it should be noted that different data substituted into the reference function will yield different results, while the same data substituted into the reference function will yield the same result.

[0048] In the embodiment provided in step S208, the damaged data on the damaged strip can be located based on the target mapping relationship and the target data, after the target mapping relationship is extracted, which is equivalent to extracting the undamaged data imprint from another angle.

[0049] Optionally, in this embodiment, locating the damaged data on the damaged stripe from the target data and the verification data based on the target data and the target mapping relationship may include, but is not limited to: when the data block identifiers with corresponding relationships recorded in the first mapping relationship and the reference data also include the data block identifiers of the data blocks storing the verification data, substituting the verification data into the reference function to obtain calculated reference data, wherein the reference function is a function that generates the reference data; comparing the difference value between the reference data corresponding to the verification data and the calculated reference data; if the difference value is less than or equal to a preset difference threshold, determining the damaged data as target data; if the difference value is greater than the preset difference threshold, determining the damaged data as verification data.

[0050] As an optional implementation, in addition to applying the first mapping relationship, a global mapping relationship can also be applied, but is not limited to. After verifying the target strip based on the target data and the verification data of the target data stored in the target strip and obtaining the damaged strip, the verification data of the other strips in the target strip (excluding the damaged strip) are concatenated in a first order to obtain other verification data, and the target data of the other strips are concatenated in a second order to obtain other target data. The first order is the arrangement order of the verification data from each other strip in the other verification data, and the second order is the arrangement order of the target data from each other strip in the other target data. The first order and the second order are different. For example (the following numbers are just examples), for other stripes 1, which include target data 123, target data 456, target data 789 and check data 001, for other stripes 2, which include target data 213, target data 546, target data 879 and check data 002, and for other stripes 3, which include target data 321, target data 654, target data 987 and check data 003, the aforementioned splicing operation can be performed to obtain other check data 001002003 and other target data 123456789321654987213546879. It is possible, but not limited to, substituting other verification data into the reference function to obtain global verification reference data, and substituting other target data into the reference function to obtain global reference data; establishing a correspondence between the data block identifier set and the global reference data to obtain the first global mapping relationship, and establishing a correspondence between the data block identifier set and the global verification reference data to obtain the second global mapping relationship, wherein the data block identifier set records the data block identifiers of the data blocks included in other stripes. It is possible, but not limited to, upon receiving a verification request from the target disk array in the next instance, not to directly perform stripe-by-strip verification for other stripes, but to first verify other stripes from an overall perspective based on the first and second global mapping relationships, and then to perform stripe-by-strip verification if the overall verification fails. Specifically, it is possible, but not limited to, concatenating the target data and verification data corresponding to each data block identifier in the data block identifier set in the first order, recalculating the global reference data and global verification reference data, and comparing them with the global reference data in the saved first and second global mapping relationships. If the comparison is consistent (i.e., the recalculated global reference data is consistent with the saved global reference data, and the recalculated global verification reference data is also consistent with the saved global verification reference data), then the verification of other stripes is completed. If the comparison is inconsistent (i.e., the recalculated global reference data is inconsistent with the saved global reference data, or the recalculated global verification reference data is inconsistent with the saved global verification reference data), then each of the other stripes is verified one by one in the aforementioned manner.After all the verifications of the target disk array are completed, the first and second global mapping relationships are updated again according to the aforementioned method based on whether each stripe is damaged, for use in the next verification.

[0051] Based on the above, preliminary verification through global mapping relationships can quickly check the integrity of most data, reducing the need for repeated verification of known intact data and thus significantly shortening verification time. It avoids frequent reads of a large number of good stripes, reducing the number of disk I / O (Input / Output) operations and helping to maintain high disk array performance. Even with relaxed verification of stripes without data corruption, overall data consistency is not sacrificed, as potentially corrupted parts will still be meticulously verified eventually. This strategy of combining global mapping relationships with stripe-by-strip verification significantly improves the verification efficiency and performance of the disk array while ensuring data integrity.

[0052] As an optional implementation, after locating the damaged data on the damaged stripe from the target data and verification data based on the target data and target mapping relationship, the damaged data can be repaired by means of, but not limited to, the following methods:

[0053] When the damaged data is verification data, the target data is substituted into the objective function to obtain candidate verification data, where the objective function is the function that generates the verification data; the damaged data is then updated using the candidate verification data.

[0054] If the damaged data is the target data, substitute the verification data into the inverse function of the target function to obtain the candidate target data; verify the candidate target data according to the target reference data corresponding to the data block identifier of the data block where the target data is located; if the candidate target data passes the verification, use the candidate target data to update the damaged data.

[0055] Optionally, in this embodiment, the candidate target data can be determined to pass the verification if the difference between the candidate reference data and the target reference data is less than or equal to the target threshold. The candidate reference data is the data obtained by substituting the candidate target data into the reference function, and the reference function is the function that generates the reference data.

[0056] Optionally, in this embodiment, certain errors or faults may prevent the target data or parity data from being read from the target disk array. In cases where the target data cannot be read, the unreadable target data can be recovered using the parity data and other readable target data. Alternatively, in cases where the parity data cannot be read, the parity data can be recalculated. If both target data and parity data cannot be read simultaneously, the stripe is marked as a damaged stripe, the first mapping relationship corresponding to the damaged stripe is found, and a damaged mark is added to it. During subsequent write operations, the damaged stripe can be repaired by rewriting data or reusing data blocks.

[0057] As an optional implementation, the location of damaged data on damaged strips from target data and verification data can be achieved, but is not limited to, by the following methods: detecting whether there is a difference between the target reference data corresponding to the target data found from the target mapping relationship and the target calculated data of the target data, wherein the target calculated data is used to identify the target data; if no difference is detected between the target reference data and the target calculated data, the verification data on the damaged strip is determined to be damaged data; if a difference is detected between the target reference data and the target calculated data, the target data on the damaged strip is determined to be damaged data.

[0058] Optionally, in this embodiment, it is possible, but not limited to, to determine whether the damaged data is the target data itself or the verification data by comparing the target reference data found in the target mapping relationship with the target calculated data calculated from the current target data, provided that the damaged strip has been located.

[0059] The above methods enable accurate differentiation and location of damaged data, making it possible to accurately recover damaged data and improving the verification accuracy of the target disk array.

[0060] As an optional implementation, the difference between the target reference data corresponding to the target data found in the target mapping relationship and the target calculated data of the target data can be detected in the following ways, but not limited to: finding the target reference data corresponding to the target address of the target data in the target mapping relationship, and substituting the target data into the reference function to obtain the target calculated data, wherein the data block identifier of the target data includes the target address, and the reference function is a function that generates the reference data; comparing the difference value between the target reference data and the target calculated data; if the difference value is less than or equal to a target threshold, determining that there is no difference between the target reference data and the target calculated data; if the difference value is greater than the target threshold, determining that there is a difference between the target reference data and the target calculated data.

[0061] Optionally, in this embodiment, the data block address of the target data block can be used as the data block identifier of the target data block, and the reference data corresponding to the target data can be found from the target mapping relationship based on the target address of the target data.

[0062] Optionally, in this embodiment, the reference function may be, but is not limited to, a function that generates reference data, and the reference function may be, but is not limited to, a hash function.

[0063] As an optional implementation, the target mapping relationship corresponding to the damaged stripe can be obtained from the first mapping relationship of the target disk array based on the target data block included in the damaged stripe in the following manner: detecting the data block address of the target data block to obtain the target address, wherein the data block identifier includes the data block address; searching for the target mapping relationship including the target address from the first mapping relationship stored in the memory database of the target disk array.

[0064] Optionally, in this embodiment, the data block address of the target data block can be used as the data block identifier of the target data block, but is not limited to this.

[0065] Optionally, in this embodiment, the first mapping relationship may be stored in the memory of the target disk array, but is not limited to being stored in the memory database of the target disk array. By storing the first mapping relationship in the memory of the target disk array, the speed of obtaining the first mapping relationship can be improved. On the other hand, it also allows the first mapping relationship, target data, and verification data to be stored in different locations, avoiding the mapping relationship itself being affected in the event of hardware failure or data corruption, thereby ensuring the reliability of the data location and recovery mechanism.

[0066] As an optional implementation, before obtaining the target mapping relationship corresponding to the damaged stripe from the first mapping relationship of the target disk array based on the target data blocks included in the damaged stripe, the first mapping relationship can be created in the following ways, but not limited to: obtaining the data to be stored in the target disk array, wherein the target data and the verification data are obtained by storing the data to be stored in the target disk array; substituting the data to be stored into the reference function to obtain reference data, and allocating data block addresses for the data to be stored, wherein the data block address is used to indicate the data block to be stored, and the data block identifier includes the data block address; storing the corresponding data block address and the reference data into the memory database of the target disk array to obtain the first mapping relationship.

[0067] Optionally, in this embodiment, a first mapping relationship of the data can be established at the same time as the data is written, but not limited to this.

[0068] Optionally, in this embodiment, the data block address can be selected as the data block identifier, but is not limited to this.

[0069] Optionally, in this embodiment, the data to be stored may undergo a transformation process before being written, typically by dividing the data into fixed-size blocks (e.g., 4KB). Then, each data block (i.e., each piece of data to be stored) is substituted into a reference function to generate corresponding reference data. Simultaneously, a specific data block address may be assigned to each data block (i.e., each piece of data to be stored), and this address is a pointer to the physical storage location, ensuring that the exact location of the data block in the disk array is recorded. After this, a mapping relationship between the data block address and the corresponding reference data may be established in a memory database, forming a first mapping relationship.

[0070] By doing the above, we can ensure that a reliable mapping relationship between data block identifiers and reference data is established when data is written, which provides a solid foundation for subsequent data management and verification.

[0071] As an optional implementation, the target stripe can be verified based on the target data stored in the target stripe of the target disk array and the check data of the target data stored in the target stripe, to obtain the damaged stripe: a reference stripe is selected from multiple stripes, and the data block identifiers of the included data blocks are recorded in a first mapping relationship; the target stripe is determined from the reference stripe according to a second mapping relationship, wherein the second mapping relationship records a corresponding reference count and the first mapping relationship, the reference count is used to indicate the validity of the data stored in the data block indicated by the data block identifier included in the corresponding first mapping relationship, the data blocks included in the target stripe include the data block corresponding to the first reference count, the first reference count is used to indicate the validity of the data stored in the data block indicated by the data block identifier included in the corresponding first mapping relationship, and the reference count includes the first reference count; the target stripe is verified based on the target data and the check data to obtain the damaged stripe.

[0072] Optionally, in this embodiment, the data stored in the target disk array may include, but is not limited to, valid data and invalid data. Valid data refers to data that the user needs and therefore has been stored in the target disk array. Invalid data may include, but is not limited to, data that the user has abandoned but has not yet been deleted due to sufficient storage resources. Reference counting may be used to indicate the validity of the data, but is not limited to, using reference counting.

[0073] Optionally, in this embodiment, the first reference count may be used, but is not limited to, to indicate that the data stored in the data block indicated by the data block identifier included in the corresponding first mapping relationship is valid, and the second reference count may be used, but is not limited to, to indicate that the data stored in the data block indicated by the data block identifier included in the corresponding first mapping relationship is invalid.

[0074] Optionally, in this embodiment, the first reference count may be, but is not limited to, 1, and the second reference count may be, but is not limited to, 0.

[0075] By using reference counting to track the validity of data, the verification process becomes more intelligent and efficient, avoiding the verification of idle or expired data areas and saving operational resources.

[0076] As an optional implementation, the target stripe can be determined from the reference stripe according to the second mapping relationship in the following manner, but not limited to: matching the reference mapping relationship corresponding to the first reference count from the second mapping relationship; adjusting the flag value of the flag bit of the reference stripe in which the data block indicated by the data block identifier included in the reference mapping relationship is located to the target flag value to obtain the target stripe, wherein the flag value is used to indicate whether the corresponding stripe needs to be verified, and the target flag value is used to indicate that the corresponding stripe needs to be verified.

[0077] Optionally, in this embodiment, it is possible, but not limited to, setting a flag bit that corresponds one-to-one with each stripe, and the flag value of each flag bit can be used, but not limited to, to indicate whether the stripe corresponding to the flag bit needs to be verified.

[0078] Optionally, in this embodiment, the target marker value may be used, but is not limited to, to indicate the corresponding strip to be verified. The target marker value may be, but is not limited to, 1. Correspondingly, a reference marker value may be set, and the marker value may include, but is not limited to, the target marker value and the reference marker value. The reference marker value may be, but is not limited to, 0.

[0079] Optionally, in this embodiment, after executing the disk array control method of this application, that is, after completing a verification operation on the data stored in the target disk array, all the flag values ​​in all the flag bits can be adjusted to the reference flag values, so as to ensure that unnecessary verification operations will not occur due to incorrect flag values ​​in the next verification.

[0080] By dynamically marking the stripes to be verified, the storage area can be precisely controlled, improving verification accuracy and effectiveness while reducing unnecessary resource consumption.

[0081] As an optional implementation, before determining the target strip from the reference strip according to the second mapping relationship, the first and second mapping relationships can be adaptively generated and adjusted, but are not limited to:

[0082] The process involves: acquiring reference data to be stored in the in-memory database; searching for the reference data in the in-memory database; if the reference data is found, adjusting the reference count corresponding to the first mapping relationship in the in-memory database that includes the reference data to the first reference count; if the reference data is not found, allocating a candidate data block from the free data blocks for the candidate data identified by the reference data, where the free data blocks are data blocks that do not currently store valid data; searching for the candidate data block identifier in the in-memory database; if the candidate data block identifier is found, deleting the mapping relationship containing the candidate data block identifier from the first and second mapping relationships, storing the candidate mapping relationship in the first mapping relationship, and storing the alternative mapping relationship in the second mapping relationship, where the candidate mapping relationship records the candidate data block identifier and reference data with corresponding relationships, and the alternative mapping relationship records the first reference count and candidate mapping relationship with corresponding relationships; if the candidate data block identifier is not found, storing the candidate mapping relationship in the first mapping relationship and the alternative mapping relationship in the second mapping relationship.

[0083] Optionally, in this embodiment, when a data block is written to the disk array and its reference data (such as a hash value) is generated, an attempt may be made to search for an existing corresponding reference data entry in the memory database. In the memory database, by querying identifiers such as hash values, it can be determined whether the data block already exists and its status. If reference data corresponding to the currently stored data block is found in the memory database, the reference count of the data block in the first mapping relationship may be updated to the first reference count, which may indicate the validity and usage frequency of the data block. If the reference data does not exist in the memory database, a process for creating a new entry may be initiated, firstly selecting a candidate data block from the free data blocks to store the candidate data (new data block). For the new data block, a candidate mapping relationship may be created, recording the correspondence between the candidate data block identifier and the reference data. If a candidate data block identifier already exists in the memory database, the existing entry will be deleted to avoid data redundancy. Corresponding to the candidate mapping relationship, a new alternative mapping relationship may be generated, recording the correspondence between the first reference count and the candidate mapping relationship. This update process is to maintain the reference count information of the data block and ensure that the usage status of the data block is correctly tracked. If no candidate data block identifier is found in the memory database, then the candidate mapping relationship and alternative mapping relationship can be directly stored in the first mapping relationship and the second mapping relationship respectively, which ensures that the storage and identification of the new data block are recorded in a timely and complete manner.

[0084] By updating the first mapping relationship and reference count in the in-memory database, the status of data blocks can be tracked meticulously, including their existence in storage, usage frequency, and whether they are newly added data blocks. This helps in making more reasonable storage and verification decisions. For existing data block identifiers, duplicate storage is avoided, thereby reducing data redundancy in the in-memory database and saving storage space. Storing candidate and alternative mapping relationships in the corresponding databases ensures the validity of data blocks and the up-to-date status of reference count information, reducing unnecessary data retrieval and verification work and improving the overall efficiency of the system. Through this process, the reference count and mapping relationship of each data block can be ensured to be accurate, which is crucial for timely detection and repair of data corruption, enhancing data integrity and security.

[0085] As an optional implementation, the second mapping relationship can be adjusted in the following ways, but is not limited to: obtaining a deletion request for candidate data, wherein the deletion request is used to request the deletion of candidate data stored in the target disk array; substituting the candidate data into a reference function to obtain candidate computation data, wherein the candidate computation data is used to identify the candidate data; searching for an optional mapping relationship that includes the candidate computation data in the second mapping relationship stored in the memory database; adjusting the reference count in the optional mapping relationship to a second reference count, wherein the reference count includes a second reference count, the second reference count being used to indicate that the data stored in the data block identified by the corresponding first mapping relationship is invalid; and sending a completion notification of the deletion request, wherein the completion notification is used to indicate that the deletion operation on the candidate data has been completed.

[0086] The above content provides a secure and efficient data deletion mechanism that reflects changes in data status by updating the reference count. This helps maintain the accuracy of the mapping between data block identifiers and reference data, while simplifying the data management process and enhancing the flexibility of target disk array management.

[0087] Optionally, in the embodiments, Figure 3 This is a flowchart illustrating a method for writing data to a disk array according to an embodiment of this application. Figure 3 As shown, when writing data (e.g., upon receiving a write request), the data to be written is split into segments of a fixed length (e.g., 4KB). The hash value (i.e., the aforementioned reference data) of the data segments of the fixed length (i.e., data blocks) is calculated. The data is written to the array module, which allocates free space for the written data, calculates check data based on the written data, and writes the data (i.e., the aforementioned target data) and check data to the storage medium (i.e., the aforementioned target disk array). Once the data and check data are successfully written, the array address where the data was written is associated with the hash value of the data, that is, the hash-array address (i.e., the aforementioned first mapping relationship) is stored as a key-value pair in the memory database.

[0088] It is important to note that when writing data, if the hash calculated from the data can be found in the hash-array address database, the array address is checked to see if it is normal (not damaged). For normal array addresses, there is no need to write data to the array module again; only the reference count of that hash-array address needs to be incremented (i.e., the reference count is adjusted to the first reference count). When data has already been written to that location, meaning that the current data write has replaced the old data, the hash-array address corresponding to the old data needs to be deleted. When the reference count is 0 (i.e., the second reference count), the record of the hash-array address can be deleted, or the record can be retained in preparation for the possibility of writing data corresponding to that hash in the future.

[0089] Additionally, when a user rewrites a region, the data in that region is replaced, and the old data no longer needs to be recorded as corrupted, i.e., the hash-array address is invalid, and the entry corresponding to the hash-array address is deleted. When a user writes data that is not in the same region, but the calculated hash is equal to the currently corrupted hash, the array address where the data is written can replace the current array address, and the hash-array address is updated to the new address, and the data corruption can also be repaired.

[0090] As an optional implementation, this application proposes a method for detecting, managing, and repairing silent array errors based on hash detection. On the basis of the original inspection module, a hash-array address mapping module is added. This module provides a more accurate inspection area and data verification method, as well as a simpler and faster error recording method.

[0091] Figure 4 This is a flowchart of a disk array inspection method according to an embodiment of this application. Figure 4 As shown, the array module can, but is not limited to, periodically inspect the internal storage media (i.e., verify the data stored in the target disk array). During the inspection, it is first necessary to find the area where data has been written. The inspection engine reads the hash-array address (i.e., the first mapping relationship mentioned above) in the memory database and marks the array stripes. The inspection engine allocates 1 bit of memory space (i.e., the aforementioned mark bit) to each stripe of the array to mark whether the array stripe has data. This value is initially 0 (i.e., the aforementioned reference mark value). The inspection engine reads the hash-array address and marks it according to the mapping relationship between the array address and the array stripe. It reads all the array addresses and modifies the bit value of the corresponding stripe to 1 (i.e., the aforementioned target mark value). When all the hash-array addresses have been read, all the array stripes that have been written can be obtained. These stripes are the areas that need to be inspected (i.e., the target stripes).

[0092] Based on the marked stripes containing data (i.e., the aforementioned target stripes), the array inspection engine reads the data (i.e., the aforementioned target data) and check data of the stripes to be inspected from the array's storage media. It compares the stripe data and check data for consistency. If they match, it indicates that the stripe is error-free; if they do not match, it indicates that the storage media has a data error (i.e., the check reveals a damaged stripe). The array inspection engine calculates a hash for the inconsistent stripe data and compares it with the hash corresponding to the array address obtained by subtracting the array address from the hash. If they match, it indicates that the data is correct, meaning that the storage media storing the check data has a silent error. The check data for this stripe is updated by recalculating the check data to repair the error. If they do not match, it indicates that an error in the storage media storing the data caused the data error. The data is recalculated using the check data and verified using the hash to repair the data error.

[0093] When data cannot be read, repair is performed by calculating the damaged data using the verification data and the undamaged data; when the verification data cannot be read, repair is performed by calculating the verification data using the data; when both the data and the verification data cannot be read, the area is marked as damaged; find the entry corresponding to the hash-array address and add the damaged mark to the array address data in the entry.

[0094] The above improvements can enhance inspection efficiency, compress the scanning range, detect only stripes already written, and decouple processing time from storage capacity; improve error handling accuracy, clearly distinguish between data and verification errors using hash verification, increase repair accuracy and automate the process, automatically trigger the rebuild process after silent error detection, and reduce the need for manual intervention; and optimize storage and performance, reducing I / O load.

[0095] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0096] Embodiments of this application also provide a control device for a disk array. Figure 5 This is a structural block diagram of a disk array control device according to an embodiment of this application, such as... Figure 5 As shown, the control device includes:

[0097] The receiving module 502 is used to receive a verification request from the target disk array, wherein the verification request is used to request verification of the data stored in the target disk array;

[0098] The verification module 504 is used to verify the target stripe based on the target data stored in the target stripe in the target disk array and the verification data of the target data stored in the target stripe, and to obtain the damaged stripe. The target stripe is the stripe that stores data among the multiple stripes included in the target disk array, and the damaged stripe is the stripe in the target stripe that has been damaged.

[0099] The first acquisition module 506 is used to acquire the target mapping relationship corresponding to the damaged stripe from the first mapping relationship of the target disk array based on the target data block included in the damaged stripe. The first mapping relationship records the data block identifier and reference data with corresponding relationship. The data block identifier is used to identify the data block in the target disk array that stores data, and the reference data is used to identify the data stored in the corresponding data block.

[0100] The positioning module 508 is used to locate the damaged data on the damaged strip from the target data and the verification data according to the target data and the target mapping relationship. The damaged data is the data that has been damaged in the data stored in the damaged strip.

[0101] The above device receives a verification request from the target disk array, verifies the target stripe based on the target data stored in the target stripe and the verification data of the target data stored in the target stripe, and obtains the damaged stripe. Based on the target data blocks included in the damaged stripe, the target mapping relationship corresponding to the damaged stripe is obtained from the first mapping relationship of the target disk array. Since the first mapping relationship records the corresponding data block identifier and reference data, the data block identifier is used to identify the data block in the target disk array that stores data, and the reference data is used to identify the data stored in the corresponding data block. Therefore, the damaged data on the damaged stripe can be located from the target data and the verification data based on the target data and the target mapping relationship. The solution provided in this application can obtain more accurate data verification results. Therefore, it can solve the technical problem of low verification accuracy of disk arrays in related technologies and achieve the technical effect of improving the verification accuracy of disk arrays.

[0102] In some embodiments, the positioning module includes: a first detection unit, configured to detect whether there is a difference between the target reference data corresponding to the target data found from the target mapping relationship and the target calculated data of the target data, wherein the target calculated data is used to identify the target data; a first determination unit, configured to determine the verification data on the damaged strip as damaged data when no difference is detected between the target reference data and the target calculated data; and a second determination unit, configured to determine the target data on the damaged strip as damaged data when a difference is detected between the target reference data and the target calculated data.

[0103] In some embodiments, the first detection unit is further configured to: find the target reference data corresponding to the target address of the target data from the target mapping relationship, and substitute the target data into the reference function to obtain the target calculated data, wherein the data block identifier of the target data includes the target address, and the reference function is a function that generates the reference data; compare the difference value between the target reference data and the target calculated data; if the difference value is less than or equal to a target threshold, determine that there is no difference between the target reference data and the target calculated data; if the difference value is greater than the target threshold, determine that there is a difference between the target reference data and the target calculated data.

[0104] In some embodiments, the first acquisition module includes: a second detection unit, configured to detect the data block address of the target data block and obtain the target address, wherein the data block identifier includes the data block address; and a first search unit, configured to search for a target mapping relationship including the target address from the first mapping relationship stored in the memory database of the target disk array.

[0105] In some embodiments, the aforementioned control device further includes: a second acquisition module, configured to acquire data to be stored in the target disk array, wherein the target data and verification data are obtained by storing the data to be stored in the target disk array; an input module, configured to substitute the data to be stored into a reference function to obtain reference data, and allocate data block addresses for the data to be stored, wherein the data block address is used to indicate the data block of the data to be stored, and the data block identifier includes the data block address; and a storage module, configured to store the corresponding data block addresses and reference data into the memory database of the target disk array to obtain a first mapping relationship.

[0106] In some embodiments, the verification module includes: a filtering unit, configured to filter from multiple stripes a reference strip whose data block identifiers are recorded in a first mapping relationship; a third determining unit, configured to determine a target strip from the reference strips according to a second mapping relationship, wherein the second mapping relationship records a corresponding reference count and a first mapping relationship, the reference count is used to indicate the validity of the data stored in the data block indicated by the data block identifier included in the corresponding first mapping relationship, the data blocks included in the target strip include the data block corresponding to the first reference count, the first reference count is used to indicate the validity of the data stored in the data block indicated by the data block identifier included in the corresponding first mapping relationship, and the reference count includes the first reference count; and a verification unit, configured to verify the target strip according to the target data and verification data to obtain a damaged strip.

[0107] In some embodiments, the third determining unit is further configured to: match a corresponding reference mapping relationship for the first reference count from the second mapping relationship; adjust the flag value of the flag bit of the reference strip where the data block indicated by the data block identifier included in the reference mapping relationship is located to the target flag value to obtain the target strip, wherein the flag value is used to indicate whether the corresponding strip needs to be verified, and the target flag value is used to indicate that the corresponding strip needs to be verified.

[0108] In some embodiments, the verification module further includes: a first acquisition unit, configured to acquire reference data to be stored in the memory database; a second search unit, configured to search for the reference data in the memory database; a first adjustment unit, configured to adjust the reference count corresponding to the first mapping relationship including the reference data in the memory database to the first reference count if the reference data is found; an allocation unit, configured to allocate a candidate data block from the free data block for the candidate data identified by the reference data if the reference data is not found, wherein the free data block is a data block that does not currently store valid data; and a third search unit, configured to search for the candidate data block in the memory database. The system includes a data block identifier selection unit; a deletion unit, configured to delete the mapping relationship containing the candidate data block identifier from the first mapping relationship and the second mapping relationship when a candidate data block identifier is found, and store the candidate mapping relationship in the first mapping relationship and store the alternative mapping relationship in the second mapping relationship, wherein the candidate mapping relationship records the candidate data block identifier and reference data with corresponding relationships, and the alternative mapping relationship records the first reference count and candidate mapping relationship with corresponding relationships; and a storage unit, configured to store the candidate mapping relationship in the first mapping relationship and store the alternative mapping relationship in the second mapping relationship when no candidate data block identifier is found.

[0109] In some embodiments, the verification module further includes: a second acquisition unit, configured to acquire a deletion request for candidate data, wherein the deletion request is used to request the deletion of candidate data stored in the target disk array; a substitution unit, configured to substitute the candidate data into a reference function to obtain candidate computation data, wherein the candidate computation data is used to identify candidate data; a fourth search unit, configured to search for an optional mapping relationship including the candidate computation data in the second mapping relationship stored in the memory database; a second adjustment unit, configured to adjust the reference count in the optional mapping relationship to a second reference count, wherein the reference count includes a second reference count, the second reference count being used to indicate that the data stored in the data block identified by the corresponding first mapping relationship is invalid; and a sending unit, configured to send a completion notification of the deletion request, wherein the completion notification is used to indicate that the deletion operation on the candidate data has been completed.

[0110] For a description of the features in the embodiment corresponding to the control device of the disk array, please refer to the relevant description of the embodiment corresponding to the control method of the disk array, which will not be repeated here.

[0111] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above-described embodiments of the disk array control method.

[0112] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the disk array control method.

[0113] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0114] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described disk array control method embodiments.

[0115] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described disk array control method embodiments.

[0116] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0117] The control method and electronic device for a disk array provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for controlling a disk array, characterized in that, include: Receive a verification request for the target disk array, wherein the verification request is used to request verification of the data stored in the target disk array; The target stripe is verified based on the target data stored in the target stripe in the target disk array and the verification data of the target data stored in the target stripe to obtain the damaged stripe. The target stripe is the stripe that stores data among the multiple stripes included in the target disk array, and the damaged stripe is the stripe that has been damaged among the target stripes. Based on the data block identifier corresponding to the target data block included in the damaged stripe, the target mapping relationship corresponding to the damaged stripe is obtained from the first mapping relationship of the target disk array. The first mapping relationship records the data block identifier and reference data with corresponding relationship. The data block identifier is used to identify the data block in the target disk array that stores data, and the reference data is used to identify the data stored in the corresponding data block. Based on the target data and the target mapping relationship, the damaged data on the damaged strip is located from the target data and the verification data, wherein the damaged data is the data that has been corrupted in the data stored in the damaged strip.

2. The control method for a disk array according to claim 1, characterized in that, The step of locating the damaged data on the damaged stripe from the target data and the verification data based on the target data and the target mapping relationship includes: Detect whether there is a difference between the target reference data corresponding to the target data found from the target mapping relationship and the target calculated data of the target data, wherein the target calculated data is used to identify the target data; If no difference is detected between the target reference data and the target calculated data, the verification data on the damaged strip is identified as the damaged data; If a difference is detected between the target reference data and the target calculated data, the target data on the damaged strip is identified as the damaged data.

3. The control method for a disk array according to claim 2, characterized in that, The detection of whether there is a difference between the target reference data corresponding to the target data found from the target mapping relationship and the target calculated data of the target data includes: The target reference data corresponding to the target address of the target data is found from the target mapping relationship, and the target data is substituted into the reference function to obtain the target calculation data. The data block identifier of the target data includes the target address, and the reference function is a function that generates the reference data. Compare the difference between the target reference data and the target calculated data; If the difference value is less than or equal to the target threshold, it is determined that there is no difference between the target reference data and the target calculated data; If the difference value is greater than the target threshold, it is determined that there is a difference between the target reference data and the target calculated data.

4. The control method for a disk array according to claim 1, characterized in that, The step of obtaining the target mapping relationship corresponding to the damaged stripe from the first mapping relationship of the target disk array based on the data block identifier corresponding to the target data block included in the damaged stripe includes: The target address is obtained by detecting the data block address of the target data block, wherein the data block identifier includes the data block address; The target mapping relationship containing the target address is searched from the first mapping relationship stored in the memory database of the target disk array.

5. The control method for a disk array according to claim 1, characterized in that, Before obtaining the target mapping relationship corresponding to the damaged stripe from the first mapping relationship of the target disk array based on the data block identifier corresponding to the target data block included in the damaged stripe, the method further includes: Obtain the data to be stored in the target disk array, wherein the target data and the verification data are obtained by storing the data to be stored in the target disk array; The data to be stored is substituted into the reference function to obtain the reference data, and a data block address is allocated to the data to be stored, wherein the data block address is used to indicate the data block where the data to be stored is stored, and the data block identifier includes the data block address; The corresponding data block addresses and reference data are stored in the memory database of the target disk array to obtain the first mapping relationship.

6. The control method for a disk array according to claim 1, characterized in that, The step of verifying the target stripe based on the target data stored in the target stripe in the target disk array and the check data of the target data stored in the target stripe to obtain the damaged stripe includes: The data block identifiers of the included data blocks selected from multiple stripes are recorded in the reference strips of the first mapping relationship; The target strip is determined from the reference strip according to the second mapping relationship, wherein the second mapping relationship records a reference count and a first mapping relationship with a corresponding relationship, the reference count is used to indicate the validity of the data stored in the data block identifier of the data block included in the corresponding first mapping relationship, the data blocks included in the target strip include the data block corresponding to the first reference count, the first reference count is used to indicate the validity of the data stored in the data block identifier of the data block included in the corresponding first mapping relationship, and the reference count includes the first reference count; The target band is verified based on the target data and the verification data to obtain the damaged band.

7. The control method for a disk array according to claim 6, characterized in that, Determining the target strip from the reference strip according to the second mapping relationship includes: Match the corresponding reference mapping relationship for the first reference count from the second mapping relationship; The flag value of the flag bit of the reference strip where the data block indicated by the data block identifier included in the reference mapping relationship is located is adjusted to the target flag value to obtain the target strip, wherein the flag value is used to indicate whether the corresponding strip needs to be verified, and the target flag value is used to indicate that the corresponding strip needs to be verified.

8. The control method for a disk array according to claim 6, characterized in that, Before determining the target strip from the reference strip according to the second mapping relationship, the method further includes: Obtain the reference data to be stored in the in-memory database; Search the reference data in the memory database; If the reference data is found, the reference count corresponding to the first mapping relationship including the reference data in the memory database is adjusted to the first reference count; If the reference data is not found, a candidate data block is allocated from the free data block for the candidate data identified by the reference data, wherein the free data block is a data block that does not store valid data at the current time; Search the memory database for the candidate data block identifier; If the candidate data block identifier is found, the mapping relationship that includes the candidate data block identifier is deleted from the first mapping relationship and the second mapping relationship, and the candidate mapping relationship is stored in the first mapping relationship, and the alternative mapping relationship is stored in the second mapping relationship. The candidate mapping relationship records the candidate data block identifier and the reference data that have a corresponding relationship, and the alternative mapping relationship records the first reference count and the candidate mapping relationship that have a corresponding relationship. If the candidate data block identifier is not found, the candidate mapping relationship is stored in the first mapping relationship, and the alternative mapping relationship is stored in the second mapping relationship.

9. The control method for a disk array according to claim 8, characterized in that, The method further includes: Obtain a deletion request for alternative data, wherein the deletion request is used to request the deletion of the alternative data stored in the target disk array; Substituting the candidate data into the reference function yields candidate calculation data, wherein the candidate calculation data is used to identify the candidate data; Search for an optional mapping relationship that includes the candidate computational data in the second mapping relationship stored in the memory database; The reference count in the optional mapping relationship is adjusted to a second reference count, wherein the reference count includes the second reference count, and the second reference count is used to indicate that the data stored in the data block indicated by the data block identifier included in the corresponding first mapping relationship is invalid; Send a completion notification for the deletion request, wherein the completion notification indicates that the deletion operation on the candidate data has been completed.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the control method for the disk array as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Disk bad block processing method based on soft RAID (redundant array of independent disks)

    CN102508724A

  • A method, device, equipment and medium for locating bad data blocks

    CN119763644A