Disk data processing method and device, storage medium and electronic device

By generating and storing multiple check values ​​for target data blocks in the disk array, the problem of low fault tolerance processing efficiency in the prior art is solved, and efficient data recovery is achieved when the data block is damaged.

CN119536664BActive Publication Date: 2025-04-29INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510103385.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-04-29
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

In the prior art, the fault tolerance processing efficiency of disk data is low, and all data blocks need to be checked or additional verification values ​​are added, resulting in an increase in processing complexity.

Method used

Multiple verification storage of data is realized by obtaining at least two verification values ​​generated by different verification methods for the target data block and writing them to the corresponding verification positions in the disk array.

Benefits of technology

When the disk data block is damaged, data recovery is achieved through data blocks and verification values ​​on other disks, which reduces processing complexity and improves fault-tolerant processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536664B_ABST
    Figure CN119536664B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for processing disk data, a storage medium and an electronic device. The method includes: obtaining a data processing request for processing data in a target disk in a disk array; when the data processing request indicates writing data, determining the block storage address of the target data block to be processed in the target disk, and writing the target data block to the block storage address; obtaining at least two verification values ​​generated for the target data block according to different verification methods, wherein the different verification methods are verification processing based on disk data in different parts of the disk address associated with the block storage address in the disk array; and writing at least two verification values ​​into their respective corresponding verification positions in the disk array. The present application can solve the problem of low efficiency of fault-tolerant processing in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and in particular, to a disk data processing method and device, a storage medium, and an electronic device. Background Art

[0002] As the amount of data stored in storage systems continues to increase, the requirements for data reliability, storage efficiency and storage cost during the data storage process are becoming increasingly higher.

[0003] At present, data storage through disk arrays has been widely used in the field of data processing. In disk arrays, the stored data can improve data reliability through fault-tolerant coding and fault-tolerant storage technology, wherein data fault tolerance is achieved through redundant data copies, and data verification is achieved through data check blocks. However, among the various fault-tolerant methods provided in the relevant technology, it is often necessary to verify all data blocks or add additional check values ​​for verification, which greatly increases the complexity of processing disk data. In other words, the fault-tolerant processing method for disk data provided by the prior art has the problem of low fault-tolerant processing efficiency.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a method and device for processing disk data, a storage medium, and an electronic device, so as to at least solve the problem of low fault-tolerant processing efficiency in the fault-tolerant processing method for disk data provided by the prior art.

[0006] According to one aspect of an embodiment of the present application, a method for processing disk data is provided, comprising: obtaining a data processing request for processing data in a target disk in a disk array; when the data processing request indicates writing data, determining a block storage address of a target data block to be processed in the target disk, and writing the target data block to the block storage address; obtaining at least two verification values ​​generated for the target data block according to different verification methods, wherein the different verification methods are verification processing based on disk data in different parts of disk addresses associated with the block storage address in the disk array; and writing the at least two verification values ​​into their respective corresponding verification positions in the disk array.

[0007] Optionally, obtaining at least two check values ​​generated for the target data block according to different check methods includes: determining the respective check rules of each check method, and the partial disk address associated with the block storage address under the check method; when the check rule indicates the generation of a virtual check data row, generating a check value using the virtual check data row and the disk data in the partial disk address.

[0008] Optionally, after obtaining a data processing request for processing data in a target disk in a disk array, the method includes: if the data processing request indicates recovery of data, recovering a target data block in a block storage address based on at least two check values.

[0009] Optionally, after writing at least two check values ​​into their respective corresponding check positions in the disk array, the method includes: when the data processing request indicates reading data, determining the block storage address of the target data block to be processed currently in the target disk; and when the block storage address has been damaged, restoring the target data block in the block storage address based on the at least two check values.

[0010] Optionally, recovering the target data block in the block storage address based on at least two check values ​​includes: obtaining a check mode indication parameter obtained by performing a modulo calculation on a preset parameter using a currently counted check count; when the check mode indication parameter satisfies a parameter condition matching a first check mode, obtaining a first disk data block set in the disk array that is checked using the first check mode, and recovering the target data block in the block storage address based on the first disk data block set, wherein data blocks that are checked using the first check mode but are damaged have been eliminated from the first disk data block set; when the check mode indication parameter satisfies a parameter condition matching a second check mode, obtaining a second disk data block set in the disk array that is checked using the second check mode but are damaged, and recovering the target data block in the block storage address based on the second disk data block set, wherein data blocks that are checked using the second check mode but are damaged have been eliminated from the second disk data block set.

[0011] Optionally, after restoring the target data block in the block storage address based on at least two check values, the method further includes: adding one to the currently counted check count to obtain an updated check count.

[0012] Optionally, recovering the target data block in the block storage address based on at least two check values ​​includes: generating a first intermediate check value using the target data row where the block storage address is located in the target disk; obtaining difference data between the target disk and the reference disk in the disk array; generating a second intermediate check value using the target data row and the difference data; generating three intermediate check values ​​using the first disk data block set corresponding to the first check method; generating a fourth intermediate check value using the second disk data block set corresponding to the second check method; performing weighted summation of the first intermediate check value, the second intermediate check value, the third intermediate check value and the fourth intermediate check value to obtain candidate row check data for recovering the target data row; when obtaining multiple candidate row check data obtained after recovering multiple data rows respectively, performing XOR calculation on the multiple candidate row check data to obtain recovery pre-check data; and constructing the recovered target data block using the recovery pre-check data.

[0013] Optionally, before obtaining the difference data between the target disk and the reference disk in the disk array, the method further includes: determining a target position of the target disk in the disk array; and determining a reference disk from disks adjacent to the target disk position and located on both sides of the target disk.

[0014] Optionally, in the case where the reference disk is two disks, the acquired difference data includes: first difference data between the first reference disk and the target disk, and second difference data between the second reference disk and the target disk, and performing XOR calculation on multiple candidate row data to obtain recovery pre-verification data includes: constructing a recovery equation group using the first difference data and the second difference data; solving the recovery equation group to obtain a recovery control coefficient; and performing XOR calculation on multiple candidate row verification data using the recovery control coefficient to obtain recovery pre-verification data.

[0015] Optionally, using the pre-recovery verification data to construct the recovered target data block includes: when it is determined to adopt the first verification method, constructing the recovered target data block based on the pre-recovery verification data and the first disk data block set; when it is determined to adopt the second verification method, constructing the recovered target data block based on the pre-recovery verification data and the second disk data block set.

[0016] Optionally, when the preset parameter is 2, after obtaining the check mode indication parameter after obtaining the currently statistical check count and performing a modulo calculation on the preset parameter, it also includes: when the check mode indication parameter is zero, determining to use a first check mode for data recovery, wherein the first check mode is a check in the diagonal direction; when the check mode indication parameter is non-zero, determining to use a second check mode for data recovery, wherein the second check mode is a check in the anti-diagonal direction.

[0017] According to another aspect of an embodiment of the present application, a disk data processing device is provided, comprising: a first acquisition unit, used to acquire a data processing request for processing data in a target disk in a disk array; a determination unit, used to determine the block storage address of a target data block to be processed in the target disk when the data processing request indicates writing data, and write the target data block to the block storage address; a second acquisition unit, used to acquire at least two verification values ​​generated for the target data block according to different verification methods, wherein the different verification methods are verification processing based on disk data in different parts of disk addresses associated with the block storage address in the disk array; and a writing unit, used to write the at least two verification values ​​into their respective corresponding verification positions in the disk array.

[0018] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned disk data processing method when running.

[0019] According to another aspect of the embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above disk data processing method.

[0020] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the disk data processing method through the computer program.

[0021] Through the above implementation of the present application, a data processing request for processing data in a target disk in a disk array can be first obtained; then, when the data processing request indicates writing data, the block storage address of the target data block to be processed in the target disk is determined, and the target data block is written to the block storage address; then, at least two check values ​​generated for the target data block according to different check methods are obtained, wherein the different check methods are based on the disk data in the disk addresses of different parts associated with the block storage address in the disk array for check processing; and at least two check values ​​are further written into their respective corresponding check positions in the disk array. Thus, at least two check values ​​are stored on different disks respectively, and then, when a data block of a disk is damaged and needs to be restored, data recovery can be achieved through data blocks and check values ​​on other disks without reading all check values ​​of all data blocks, so that the processing complexity of disk data is reduced, thereby solving the problem of low fault tolerance processing efficiency existing in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0023] Figure 1 It is a hardware structure block diagram of a server device of a disk data processing method according to an embodiment of the present application;

[0024] Figure 2 is a flow chart of a method for processing disk data according to an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of a method for processing disk data according to an embodiment of the present application;

[0026] Figure 4 is a flow chart of another method for processing disk data according to an embodiment of the present application;

[0027] Figure 5 is a structural schematic diagram of a disk data processing device according to an embodiment of the present application;

[0028] Figure 6 It is a structural schematic diagram of a disk data processing electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a data processing method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for adjusting a read voltage in a memory in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a 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 a memory remotely arranged relative to the processor 102, and these remote memories may be connected to a server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0035] As an optional implementation, Figure 2 As shown, the above disk data processing method includes:

[0036] S202, obtaining a data processing request for processing data in a target disk in a disk array;

[0037] S204, when the data processing request indicates writing data, determining the block storage address of the target data block to be processed currently in the target disk, and writing the target data block into the block storage address;

[0038] S206, obtaining at least two check values ​​generated for the target data block according to different check modes, wherein the different check modes are based on disk data in different parts of disk addresses associated with the block storage address in the disk array for check processing;

[0039] S208, writing at least two check values ​​into their corresponding check positions in the disk array respectively.

[0040] It should be noted that, in the above steps S202 to S208, the above step S202 is first executed to enable the system to receive a request from the user to process data in a specific disk (i.e., the target disk) in the disk array. The above data processing request may be any form of data operation, including but not limited to reading, writing, restoring, deleting or updating data, which is not specifically limited here. The above disk array may be a RAID array (Redundant Array of Independent Disks), etc., which is not specifically limited here.

[0041] It is worth noting that when the above data processing request indicates writing data, the system will determine the block storage address and write data. Specifically, for the operation of determining the block storage address, the system first needs to determine the specific storage location of the target data block in the target disk, that is, the block storage address. This process can be achieved through address mapping. For example, in the case where the above disk array is a RAID array, the actual disk address is calculated based on the mapping relationship between the user address and the RAID address. It should be noted that the above user address is a storage address provided to the user and can be used by the user, the RAID address is the address assigned by the system to each data block in the RAID disk array, and the disk address is the underlying address of the data block in the physical disk.

[0042] Further, after the writing of the target data block is completed through the above step S204, the above step S206 is executed to generate at least two check values. It can be understood that the above check values ​​are used to ensure the integrity and fault tolerance of the data. It should be noted that the above different check methods refer to different check mechanisms based on the disk array, such as horizontal check, diagonal check (upper right to lower left) check and anti-diagonal check (upper left to lower right). Furthermore, in the case where the above different check methods are horizontal check, diagonal check and anti-diagonal check, respectively, the check values ​​corresponding to at least two of the three check methods are obtained.

[0043] It should be noted that the above-mentioned horizontal check, diagonal check and anti-diagonal check are operations between data blocks in a table representing the arrangement of different data blocks in different disks in a disk array. For details, see the following Table 1.

[0044]

[0045] Table 1

[0046] Data columns 0 to 4 in Table 1 correspond to five physical disks, each of which has 16 data blocks (rows 0 to 15) and one virtual data block (a data block that does not participate in the check). The above p, q, and r are horizontal check, diagonal check, and anti-diagonal check, respectively. p:q:r in each data block represents the number of rows in the check data table that describes the arrangement of the check data, and the check values ​​obtained by the horizontal check, diagonal check, and anti-diagonal check in which the data participates. For details, see Table 2 below.

[0047]

[0048] Table 2

[0049] For example, p:q:r in the data block corresponding to data column 0 and row 0 in Table 1 is 0:0:0, which means that the check values ​​obtained by the horizontal check, diagonal check and anti-diagonal check in which the data block corresponding to data column 0 and row 0 participates are respectively stored in the 0th row of column p, the 0th row of column q and the 0th row of column r in Table 2.

[0050] It is worth noting that the above-mentioned diagonal check data and non-diagonal check data do not have a one-to-one correspondence with a single diagonal or anti-diagonal line. Figure 3 As shown, Figure 3 Take the data corresponding to row 3 in the anti-diagonal check data as an example. The data is generated by the XOR operation of the grayscale data blocks in data column 0, data column 2, data column 3 and data column 4, and data column 2, data column 3 and data column 4 constitute a reverse diagonal line, and data column 0 itself constitutes an independent anti-diagonal line. For the above Table 1, in each data block "p:q:r", the data blocks with the same "q" value are XORed to generate the corresponding diagonal check data. Similarly, the data blocks with the same "r" value are XORed to generate the corresponding diagonal check data.

[0051] Specifically, in the above step S206, obtaining at least two check values ​​generated for the target data block according to different check methods includes:

[0052] S206-1, determining the verification rules of each verification mode and the disk address of the part associated with the block storage address under the verification mode;

[0053] S206-2: When the verification rule indicates to generate a virtual verification data row, a verification value is generated using the virtual verification data row and disk data in a portion of the disk addresses.

[0054] For the above step S206-1, the above verification method can be the horizontal verification, diagonal verification and anti-diagonal verification mentioned above. It should be noted that the disk address of the part associated with the block storage address refers to the set of disk positions participating in the calculation of a specific verification method. For example, when calculating the diagonal verification value, the system will determine all disk addresses located on the diagonal with the target data block, and the data blocks at these addresses will participate in the generation of the diagonal verification value. Similarly, when calculating the anti-diagonal verification value, all disk addresses located on the anti-diagonal with the target data block will be determined to generate the anti-diagonal verification value.

[0055] It should be noted that the above-mentioned virtual check data row is a row that does not exist in the user address space. The check value is generated by using the virtual check data row and the disk data in part of the disk address. Specifically, the virtual data block in the virtual check data row is regarded as storing the value zero, and the virtual data block in the virtual check data row is involved in the diagonal check and anti-diagonal check process.

[0056] Further, after executing the above step S206, the above step S208 is executed to write at least two check values ​​into their respective corresponding check positions in the disk array. It should be noted that the check value generated by the above step S206 will be written into a specific position in the disk array. The above specific position is determined according to the data distribution strategy and the check calculation rule.

[0057] For example, assume that the check value obtained at this time is the check value obtained by the horizontal check, diagonal check and anti-diagonal check of the data block corresponding to the data column 0 and row 0 in Table 1. In this case, the above three check values ​​are respectively stored in the disk positions corresponding to the 0th row of column p, the 0th row of column q and the 0th row of column r in Table 2 in the above disk array.

[0058] Through the above implementation of the present application, a data processing request for processing data in a target disk in a disk array can be first obtained; then, when the data processing request indicates writing data, the block storage address of the target data block to be processed in the target disk is determined, and the target data block is written to the block storage address; then, at least two check values ​​generated for the target data block according to different check methods are obtained, wherein the different check methods are based on the disk data in the disk addresses of different parts associated with the block storage address in the disk array for check processing; and at least two check values ​​are further written into their respective corresponding check positions in the disk array. Thus, at least two check values ​​are stored on different disks respectively, and then, when a data block of a disk is damaged and needs to be restored, data recovery can be achieved through data blocks and check values ​​on other disks without reading all check values ​​of all data blocks, so that the processing complexity of disk data is reduced, thereby solving the problem of low fault tolerance processing efficiency in the prior art.

[0059] As an optional implementation manner, after writing the at least two check values ​​into their corresponding check positions in the disk array, the method further includes:

[0060] S1, when the data processing request indicates reading data, determining the block storage address of the target data block to be processed in the target disk;

[0061] S2: When the block storage address is damaged, restore the target data block in the block storage address based on at least two check values.

[0062] It should be noted that in the above step S1, when the data processing request indicates to read data, the block storage address of the target data block to be processed currently in the target disk is determined. Specifically, when the system receives a request to read data, it will parse the request and identify the data (target data block) that the user wants to read in the data processing request. Next, the specific storage location of the target data block in the target disk (i.e., the disk requested to read data) will be determined according to the data distribution strategy and address mapping rules of the disk array, i.e., the block storage address. For example, assuming that the target data block to be processed currently is the data block corresponding to data column 0 and row 0 in Table 1, the storage address of the data block in the corresponding disk is used as the above block storage address.

[0063] Then, the above step S2 is performed, and in the case where the block storage address has been damaged, the target data block in the block storage address is restored based on at least two check values. It should be noted that if it is found that the block storage address where the target data block is located has been damaged (for example, disk sector error, disk failure, etc.) when reading data, so that data cannot be directly read from the above target disk, the data recovery process will be started at this time. The lost data block is restored using at least two check values ​​previously generated and stored in the array.

[0064] Through the above implementation, first, when the data processing request indicates to read data, the block storage address of the target data block to be processed in the target disk is determined; and then, when the block storage address is damaged, the target data block in the block storage address is restored based on at least two check values. Thus, when the data is damaged, data recovery can be performed based on at least two check values ​​when reading the data.

[0065] In an optional implementation manner, after obtaining a data processing request for processing data in a target disk in a disk array, the method includes:

[0066] S1, when the data processing request indicates to restore data, restore the target data block in the block storage address based on at least two check values.

[0067] It can be understood that, when the data processing request indicates to restore data, the target data block in the block storage address is directly restored based on at least two check values.

[0068] Specifically, the above-mentioned recovery of the target data block in the block storage address based on at least two check values ​​includes:

[0069] S1, obtain the verification mode indication parameter obtained by performing modulo calculation on the preset parameter by obtaining the currently counted verification count;

[0070] S2, when the verification mode indication parameter satisfies the parameter condition matching the first verification mode, obtaining a first disk data block set in the disk array that is verified by the first verification mode, and restoring the target data block in the block storage address based on the first disk data block set, wherein the first disk data block set has been eliminated from the first disk data block set.

[0071] S3, when the verification method indication parameter satisfies the parameter condition matching the second verification method, obtain a second disk data block set in the disk array that is verified using the second verification method, and restore the target data block in the block storage address based on the second disk data block set, wherein the data blocks that are verified using the second verification method but are damaged have been eliminated from the second disk data block set.

[0072] It should be noted that, for the above step S1, a modulo calculation will first be performed based on a statistical check count to determine the check method to be used subsequently. The generation process of the above check count is to first determine the check value corresponding to the current data block to be recovered, and after completing the data recovery of the data block to be recovered, add 1 to the check count.

[0073] Then, the pre-calculated check count is used to perform a modulo calculation on the preset parameter, and the result of the modulo calculation is the check method indication parameter. It can be understood that different preset parameters will produce different modulo results. Specifically, the preset parameter is T, which means that there are T possible results of the modulo calculation, that is, there are T check methods.

[0074] For example, when the preset parameter is 2, the result of the modulo operation has two possible values ​​of 0 or 1. When the preset parameter is 3, the result of the modulo operation has three possible values ​​of 0, 1, and 2.

[0075] Furthermore, the verification method is determined according to the value of the result of the modulo operation. For example, in an optional embodiment, when the verification method indication parameter is zero, it is determined to adopt the first verification method for data recovery, wherein the first verification method is a verification in the diagonal direction; when the verification method indication parameter is non-zero, it is determined to adopt the second verification method for data recovery, wherein the second verification method is a verification in the anti-diagonal direction.

[0076] For example, when the result of the above modulo operation is 0, it is considered that the verification method indication parameter satisfies the parameter condition matching the first verification method, and then the above step S2 is executed to obtain the first disk data block set in the disk array that is verified using the first verification method, and the target data block in the block storage address is restored based on the first disk data block set. The above first verification method can be a diagonal verification, which is not specifically limited here.

[0077] For another example, when the value result is not 0, it is determined that the verification mode indication parameter satisfies the parameter condition matching the second verification mode. At this time, the above step S3 is executed to obtain a second disk data block set in the disk array that is verified using the second verification mode, and the target data block in the block storage address is restored based on the second disk data block set. The above second verification mode can be an anti-diagonal verification, which is not specifically limited here.

[0078] It is worth noting that, as mentioned above, the preset parameter with a value of T corresponds to T possible values ​​of the modulo operation. Therefore, a verification method can be assigned to each possible value. For example, when the value of T is 3, the above verification method indicates that the parameter has three possible values ​​of 0, 1, and 2. If the above verification method indicates that the parameter value is 0, it is considered that the verification method indicates that the parameter meets the parameter conditions that match the first verification method. At this time, the first verification method is used to recover the data block to be recovered. If the above verification method indicates that the parameter value is 1, it is considered that the verification method indicates that the parameter meets the parameter conditions that match the second verification method. At this time, the second verification method is used to recover the data block to be recovered. If the above verification method indicates that the parameter value is 2, it is considered that the verification method indicates that the parameter meets the parameter conditions that match the third verification method. At this time, the third verification method is used to recover the data block to be recovered.

[0079] Through this implementation, the verification mode indication parameter is first obtained by taking the modulus of the preset parameter based on the current statistical verification count; then, the subsequent operation is determined according to the value of the verification mode indication parameter, thereby realizing dynamic selection of the verification mode and avoiding the inefficiency problem caused by the prior art of using all data verification modes simultaneously to perform data recovery when a disk fails.

[0080] As an optional implementation, after restoring the target data block in the block storage address based on at least two check values, the method further includes:

[0081] S1, add one to the currently counted check count to obtain an updated check count.

[0082] As mentioned above, the generation process of the above-mentioned check count is to first determine the check value corresponding to the current data block to be recovered, and after completing the data recovery of the data block to be recovered through the corresponding check value, add 1 to the check count to obtain the updated statistical check count, so that it can change dynamically according to the check count, and then realize the dynamic determination of the check method according to the modulo result of the check count.

[0083] As an optional implementation, the above-mentioned recovering the target data block in the block storage address based on at least two check values ​​includes:

[0084] S1, generating a first intermediate check value using the target data row where the block storage address is located in the target disk;

[0085] S2, obtaining difference data between the target disk and the reference disk in the disk array;

[0086] S3, generating a second intermediate check value using the target data row and the difference data;

[0087] S4, generating three intermediate check values ​​using the first disk data block set corresponding to the first check method;

[0088] S5, generating a fourth intermediate check value by using the second disk data block set corresponding to the second check method;

[0089] S6, performing weighted summation on the first intermediate check value, the second intermediate check value, the third intermediate check value, and the fourth intermediate check value to obtain candidate row check data for restoring the target data row;

[0090] S7, when multiple candidate row verification data are obtained after restoring multiple data rows respectively, performing XOR calculation on the multiple candidate row verification data to obtain restored pre-verification data;

[0091] S8, constructing a recovered target data block using the pre-recovery verification data.

[0092] It can be understood that the above steps S1 to S5 are the process of generating the first intermediate check value, the second intermediate check value, the third intermediate check value and the fourth intermediate check value, and the above steps S6 to S8 are the process of further recovering the data block to be recovered based on the generated four intermediate check values.

[0093] Specifically, the above steps S1 to S5 may conform to the following formulas 1 to 4:

[0094] Formula 1:

[0095]

[0096] Formula 2:

[0097]

[0098] Formula 3:

[0099]

[0100] Formula 4:

[0101]

[0102] Among them, in the above formulas 1 to 4, the above C1 to C4 are respectively the first intermediate check value, the second intermediate check value, the third intermediate check value and the fourth intermediate check value. The above P, Q, and R are respectively the P column, Q column, and R column in the check table, such as the P column, Q column, and R column in Table 2 above. The parameters in the above P, Q, and R represent the number of rows in the column, and j is the target data row. A is a data block, and the first parameter in A is the number of columns of the target disk in the disk array table. For example, when i is 0, it means that the target disk is disk 0, corresponding to data column 0 in Table 1 above. For example, in Table 1 above, A[0, 2] represents the data block corresponding to data column 0 and row 2. The above x, y, and z are respectively the number of columns corresponding to the damaged disk.

[0103] It should be noted that in the above formulas 1 to 4, the above x, y, and z are restricted to increasing values ​​in sequence. For example, if the disks corresponding to the data columns 0, 2, and 3 in the above Table 1 are damaged, the values ​​of the above x, y, and z are 0, 2, and 3 respectively. The above target disk is the disk corresponding to y, and the above reference disk is the disk corresponding to x and y.

[0104] In the above formula 2, g and h are the above difference data. Specifically, the above g is y minus x, and the above h is z minus y. For example, when the values ​​of x, y, and z are 0, 2, and 3 respectively, the value of g is 2 (2 minus 0), and the value of h is 1 (3 minus 2).

[0105] In the above formula 3, , F is the total number of rows in the disk array table. For example, F in Table 1 is 17 (rows 0 to 16), and mod is the remainder calculation. In the above formula 4, The meanings of other variables have been explained above and will not be repeated here.

[0106] Then, when the first intermediate check value (C1), the second intermediate check value (C2), the third intermediate check value (C3) and the fourth intermediate check value (C4) are obtained through the above formulas 1 to 4, the above steps S6 to S8 are continued to be performed. Specifically, C1 to C2 are first weighted and summed. For example, C1 to C2 are weighted by modulo 2 average, see formula 5:

[0107] Formula 5:

[0108]

[0109] in, The candidate row verification data is obtained, and then, when multiple candidate row verification data are obtained after multiple data rows are restored, the multiple candidate row verification data are XORed to obtain the restored pre-verification data, specifically including:

[0110] S8-1, constructing a restoration equation group using the first difference data and the second difference data;

[0111] S8-2, solving the recovery equations to obtain the recovery control coefficient;

[0112] S8-3, using the recovery control coefficient to perform XOR calculation on multiple candidate row check data to obtain recovery pre-check data.

[0113] It should be noted that the recovery equation group in the above step S8-1 refers to formulas 6 to 9:

[0114] Formula 6:

[0115]

[0116] Formula 7:

[0117]

[0118] Formula 8:

[0119]

[0120] Formula 9:

[0121]

[0122] It should be noted that m1 to m4 are the objects to be solved for the above-mentioned recovery equation group, wherein, after m1 to m4 are solved by the above-mentioned formulas 6 to 9, the minimum value among m1 to m4 is taken as the above-mentioned recovery control coefficient. It can be understood that the right values ​​of the above-mentioned formulas 6 to 8 are all 0 (mod F), that is, the right values ​​of the above-mentioned formulas 6 to 8 are the same. Since the left values ​​of the above-mentioned formulas 6 to 8 are different, m1, m2, and m3 with different values ​​can be solved.

[0123] In the above formulas 6 to 9, g is the first difference data, h is the second difference data, and the determination method of g and h is referred to the description of formula 2 above, which will not be repeated here. It is worth noting that if the above recovery control coefficient is m3 or m4, the values ​​of the first difference data (g) and the second difference data (h) are exchanged.

[0124] Then, the restoration control coefficient is used to perform XOR calculation on multiple candidate row check data to obtain the restored pre-check data. For the specific process, see formula 10:

[0125] Formula 10:

[0126]

[0127] It should be noted that the above T is a plurality of candidate row verification data obtained after the plurality of data rows are restored respectively, and the parameter in T represents the row number corresponding to the candidate row verification data. Taking Table 1 as an example, for example, T[5] represents the candidate row verification data corresponding to the target disk in row 5 in Table 1. B[j] is the pre-recovery verification data.

[0128] Through the above implementation, before recovering the target disk, a plurality of candidate row verification data are first calculated, so that in the subsequent calculation process, data on the target disk can be recovered through the plurality of candidate row verification data.

[0129] As an optional implementation, after performing XOR calculation on a plurality of candidate row check data using the recovery control coefficient to obtain the recovery pre-check data, the method further includes:

[0130] S1, when it is determined to adopt the first verification method, constructing a target data block after recovery based on the pre-recovery verification data and the first disk data block set;

[0131] S2: When it is determined to adopt the second verification method, a target data block after recovery is constructed based on the pre-recovery verification data and the second disk data block set.

[0132] It should be noted that the target data blocks in the above steps S1 to S2 are data blocks in the reference disk. Specifically, the target disk is first restored according to the pre-restore verification data. The restoration process is shown in Formulas 11 to 13:

[0133] Formula 11:

[0134]

[0135] Formula 12:

[0136]

[0137] Formula 13:

[0138]

[0139] Among them, A[y, k] represents the k-th row data block in the target disk, and A[y, r] represents the r-th row data block in the target disk. Taking Table 1 as an example, A[1, 3] represents the data block corresponding to column 1 and row 3 (the fourth row) in Table 1. The determination process of k and r is shown in equations 11 and 12. It is worth noting that when the recovery control coefficient is m1 or m3, the flag value is 1, otherwise the flag value is 0. The meanings of other variables have been explained above and will not be repeated here.

[0140] Furthermore, after completing data recovery for each data block to be recovered in the target disk, the data blocks in the reference disk are further recovered by adopting different verification methods. Specifically, when a target data block in a reference disk can be recovered using normal data blocks in other disks through a certain verification method, this method is determined as the adopted verification method.

[0141] For example, assuming that the first verification method is a diagonal verification method and the second verification method is an anti-diagonal verification method, in this case, further assuming that the reference disk is the disk corresponding to data column 0 and data column 3 in Table 1 above, at this time, for the target data block corresponding to data column 3 and row 13 (the data block corresponding to 13:16:10 in Table 1), in the diagonal direction (from lower left to upper right) passing through the data block, the data in another reference disk (the disk corresponding to data column 0) is not involved, that is, for the data block corresponding to 13:16:10, the data blocks of other disks in its diagonal direction, the corresponding diagonal verification values, and the data blocks in a virtual row (16:16:16) are used. As mentioned above, the data blocks in the virtual row are regarded as storing the value 0. It should be noted that, “1 3:16:10" represents that the horizontal check value, diagonal check value, and anti-diagonal check value of the data block are respectively stored in the positions corresponding to column p and row 13, column q and row 16, and column r and row 10 in Table 2, that is, the data corresponding to column q and row 16 in Table 2 is the diagonal check value of the target data block corresponding to data column 3 and row 13 (the data block corresponding to 13:16:10 in Table 1). Further, at this time, it is determined that the adopted check method is the first check method, and an exclusive OR operation (modulo 2 addition) is performed on the other data blocks in the diagonal direction of the data block corresponding to 13:16:10 in Table 1 (including the data block 16:16:16 in the virtual row) and the data in the block corresponding to column q and row 16 in Table 2, and the result obtained is the correct data of the data block corresponding to 13:16:10 in Table 1.

[0142] Through the above implementation, when it is determined to adopt the first verification method, the recovered target data block is constructed based on the pre-recovery verification data and the first disk data block set; when it is determined to adopt the second verification method, the recovered target data block is constructed based on the pre-recovery verification data and the second disk data block set. Thus, it is realized that a data block can be recovered according to only one verification method, and it is not necessary to use the verification values ​​generated by multiple verification methods to recover data for a data block, thereby improving the efficiency of data recovery.

[0143] To facilitate the reader's understanding, the following is an explanation of the complete disk data recovery process in combination with Tables 1 to 2 above:

[0144] As shown in Table 1 above, in a disk array consisting of five disks, each disk corresponds to a data column in Table 1 above, and each disk can be divided into data blocks corresponding to 16 rows (row 0 to row 15). In addition, Table 1 above also includes a virtual row, which does not contain user address space and does not store user data. The specific data corresponding to p:q:r of each data block in Table 1 above represents the row number corresponding to the horizontal check value, diagonal check value, and anti-diagonal check value of the data block in the p column, q column, and r column in Table 2 above.

[0145] It should be noted that the number of rows of the three check values ​​of each data block in Table 1 above in Table 2 can be calculated by formulas 14 to 16:

[0146] Formula 14:

[0147]

[0148] Formula 15:

[0149]

[0150] Formula 16:

[0151]

[0152] Among them, the above formulas 14 to 16 are respectively calculation formulas for determining the row numbers corresponding to the horizontal check value, diagonal check value, and anti-diagonal check value of a data block in Table 1 in the p column, q column, and r column in the above Table 2. In addition, it should be noted that i is the instance number of the data block in Table 1, j is the row number of the data block, and F is the total number of rows in Table 1 (17).

[0153] It is worth noting that the data block in Table 1 corresponding to each check value in Table 2 can be determined by the following formulas 17 to 19 respectively:

[0154] Formula 17:

[0155]

[0156] Formula 18:

[0157]

[0158] Formula 19:

[0159]

[0160] Among them, i is the column number of the data block to be determined in Table 1, and j is the row number corresponding to the check data in Table 2. For example, in Table 2, the data block in disk 2 (data column 2 in Table 1) corresponding to the horizontal check data (column p) in row 0 is the data block corresponding to data column 2 and row 2 (j=2) in Table 1.

[0161] For another example, in Table 2, the data block in disk 2 (data column 2 in Table 1) corresponding to the diagonal check data (column q) in row 0 is the data block corresponding to data column 2, row 2 ((2-0) mod 17=2) in Table 1.

[0162] For another example, in Table 2, the data block in disk 2 (data column 2 in Table 1) corresponding to the diagonal check data (column r) in row 0 is the data block corresponding to data column 2, row 2 ((2+0) mod 17=2) in Table 1.

[0163] It is worth noting that the above Table 2 records the spatial distribution of 16 horizontal verification data, 17 diagonal verification data, and 17 anti-diagonal verification data.

[0164] Furthermore, when the user reads data, the address of the data block on the disk is first calculated according to the correspondence between the user address and the RAID address, and the read data is returned to the user. If the address of the data block on the disk is found to be damaged after the address is calculated, the data block needs to be calculated through the check block. For example, the method of using multiple check data for checking at the same time in the prior art can be replaced by alternately checking the diagonal check data and the anti-diagonal check data to reduce the amount of data reading and calculation, and improve the calculation efficiency. The specific steps are as follows:

[0165] First, find the diagonal check data (or anti-diagonal check data) corresponding to the data block a to be recovered in Table 1 in Table 2 above, read all data blocks except data block a corresponding to the diagonal check data (or anti-diagonal check data) in Table 1, perform XOR operation (modulo 2 addition) on all data blocks except data block a and the corresponding diagonal check data (or anti-diagonal check data), and the result is the correct data of data block a. After the recovery of the data block is completed, add 1 to the check count. It should be noted that if the result of dividing the check count by 2 is 0, the diagonal check data is selected, otherwise the non-diagonal check data is selected.

[0166] It is worth noting that when at most three disks in the disk array consisting of five disks corresponding to Table 1 above are damaged, Figure 4 Steps S302 to S314 in the above are used for recovery.

[0167] S302, determine the disk arrangement. Assuming that the failed disks are the disks corresponding to data column 0, data column 2, and data column 3 in Table 1, respectively, then assign the data column numbers to variables x, y, and z in ascending order. At this time, x is 0, y is 2, and z is 3.

[0168] S304, determine the intermediate variables g and h. As mentioned above, g=yx, h=zy, when x, y, z are 0, 1, 2 respectively, g and h are both 1.

[0169] S306, determining the intermediate check values ​​C1 to C4. The specific process is shown in the above formulas 1 to 4, which will not be described here.

[0170] S308, determining the reference data block T[j]. Specifically, T[j] may be obtained by performing an XOR operation on C1 to C4 in the above formula 5.

[0171] S310, simplify the reference data block T[j]. The result of the simplification is the above B[j]. For the specific simplification process, please refer to the above formula 10 and related instructions, which will not be repeated here.

[0172] S312, restore the data in column y. After obtaining and generating B[j], the data in column y and row k are obtained through the mathematical operations of formulas 11 to 13. It can be understood that in multiple iterations, all rows in the data column y can be restored by selecting different j.

[0173] S314, restore the data in columns x and z. When data recovery is completed in data column y (data column 2), further restore each data block in data column x (data column 0) and data column z (data column 3). Specifically, iteratively determine the data blocks to be restored in each data column 0 and data column 3 that can be restored by a kind of check data and data blocks that do not need to be restored (including data blocks that have been restored), and restore the data blocks using the determined check data and other data blocks that do not need to be restored. Data blocks to be restored that cannot be restored by a kind of check data and data blocks that do not need to be restored will not be restored in this round of iteration. All data blocks to be restored in data column x and data column z can be restored through multiple iterations.

[0174] The following example illustrates the recovery process of a data block to be recovered in the data of columns x and z. As mentioned above, for the target data block corresponding to data column 3 (column z) and row 13 (the data block corresponding to 13:16:10 in Table 1), the data in column x is not involved in the diagonal direction (from lower left to upper right) passing through the data block. That is, for the data block corresponding to 13:16:10, the data blocks of other disks in the diagonal direction, the corresponding diagonal check values, and the data blocks in a virtual row (16:16:16) are used. As mentioned above, the data blocks in the virtual row are regarded as storing the value 0. It should be noted that "13:16:10" represents the horizontal check value, diagonal check value, and anti-diagonal check value of the data block, which are stored in the positions corresponding to column p and row 13; column q and row 16; column r and row 10 in Table 2, respectively. That is, column q and row 16 in Table 2 correspond to The data is the diagonal check value of the target data block corresponding to data column 3 and row 13 (the data block corresponding to 13:16:10 in Table 1). Furthermore, at this time, it is determined that the verification method adopted is the first verification method, and the other data blocks in the diagonal direction of the data block corresponding to 13:16:10 in Table 1 (including the data block 16:16:16 in the virtual row) are XORed (modulo 2 addition) with the data in column q and row 16 in Table 2. The result obtained is the correct data of the data block corresponding to 13:16:10 in Table 1.

[0175] Furthermore, after determining the data in the data block 13:16:10, the data in the data block corresponding to column x (data column 0) in row 13 can be restored through the horizontal check data. Specifically, the data blocks corresponding to the other data columns in row 13 except data column 0 (data columns 2 and 3 correspond to the restored data blocks) are XORed with the horizontal check data corresponding to row 13 (data corresponding to column p and row 13 in Table 2), and the result is the data corresponding to column 0 (column x) and row 13. Through multiple iterations, all the data blocks to be restored in data columns x and z can be restored.

[0176] Through the above implementation, when there is a data block that needs to be recovered, data recovery in a data block can be achieved based on one of the horizontal check data, diagonal check data, and anti-diagonal check data, thereby avoiding the use of all check data to recover data for a check block, reducing the complexity of the data recovery process, and thus solving the problem of low fault-tolerant processing efficiency in the prior art.

[0177] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0178] According to another aspect of the embodiment of the present application, a disk data processing device for implementing the above disk data processing method is also provided. Figure 5 As shown, the device includes: a first acquisition unit 402, used to acquire a data processing request for processing data in a target disk in a disk array; a determination unit 404, used to determine the block storage address of the target data block to be processed in the target disk when the data processing request indicates writing data, and write the target data block into the block storage address; a second acquisition unit 406, used to acquire at least two verification values ​​generated for the target data block according to different verification methods, wherein the different verification methods are based on verification processing of disk data in different parts of disk addresses associated with the block storage address in the disk array; and a writing unit 408, used to write the at least two verification values ​​into their corresponding verification positions in the disk array.

[0179] Through the above device, a data processing request for processing data in a target disk in a disk array can be first obtained; then, when the data processing request indicates writing data, the block storage address of the target data block to be processed in the target disk is determined, and the target data block is written into the block storage address; then, at least two check values ​​generated for the target data block according to different check methods are obtained, wherein the different check methods are based on the disk data in the disk addresses of different parts associated with the block storage address in the disk array for check processing; and at least two check values ​​are further written into their respective corresponding check positions in the disk array. Thus, at least two check values ​​are stored on different disks respectively, and then, when a data block of a disk is damaged and needs to be restored, data recovery can be achieved through data blocks and check values ​​on other disks without reading all check values ​​of all data blocks, so that the processing complexity of disk data is reduced, thereby solving the problem of low fault tolerance processing efficiency existing in the prior art.

[0180] In an exemplary embodiment, the second acquisition unit 406 includes: a determination module for determining the verification rules of each verification mode and the partial disk address associated with the block storage address under the verification mode; a generation module for generating a verification value using the virtual verification data row and the disk data in the partial disk address when the verification rule indicates the generation of a virtual verification data row.

[0181] In an exemplary embodiment, the apparatus further includes a first recovery unit, configured to recover a target data block in a block storage address based on at least two check values ​​when the data processing request indicates recovery of data.

[0182] In an exemplary embodiment, the above-mentioned device also includes a second recovery unit, which is used to determine the block storage address of the target data block currently to be processed in the target disk when the data processing request indicates to read data; when the block storage address has been damaged, restore the target data block in the block storage address based on at least two check values.

[0183] In an exemplary embodiment, the above-mentioned device also includes a reference recovery unit, which is used to obtain a verification mode indication parameter obtained by performing a modulo calculation on a preset parameter using a currently statistical verification count; when the verification mode indication parameter meets the parameter condition matching the first verification mode, a first disk data block set in the disk array that is verified using the first verification mode is obtained, and a target data block in the block storage address is recovered based on the first disk data block set, wherein the first disk data block set has been eliminated from the data block set that has been verified using the first verification mode but has been damaged; when the verification mode indication parameter meets the parameter condition matching the second verification mode, a second disk data block set in the disk array that is verified using the second verification mode is obtained, and a target data block in the block storage address is recovered based on the second disk data block set, wherein the data block that has been verified using the second verification mode but has been damaged has been eliminated from the second disk data block set.

[0184] In an exemplary embodiment, the apparatus further includes a check count updating unit configured to add one to the currently counted check count to obtain an updated check count.

[0185] In an exemplary embodiment, the reference recovery unit is also used to: generate a first intermediate check value using the target data row where the block storage address is located in the target disk; obtain difference data between the target disk and the reference disk in the disk array; generate a second intermediate check value using the target data row and the difference data; generate three intermediate check values ​​using the first disk data block set corresponding to the first check method; generate a fourth intermediate check value using the second disk data block set corresponding to the second check method; perform weighted summation of the first intermediate check value, the second intermediate check value, the third intermediate check value and the fourth intermediate check value to obtain candidate row check data for recovering the target data row; when multiple candidate row check data are obtained after recovering multiple data rows respectively, perform XOR calculation on the multiple candidate row check data to obtain recovery pre-check data; and construct the recovered target data block using the recovery pre-check data.

[0186] In an exemplary embodiment, the apparatus further includes a reference disk determining unit for determining a target position of the target disk in the disk array; and determining a reference disk from disks adjacent to the target disk position and located on both sides of the target disk.

[0187] In an exemplary embodiment, the above-mentioned device also includes a recovery pre-check data generation unit, which is used to construct a recovery equation group using the first difference data and the second difference data; solve the recovery equation group to obtain a recovery control coefficient; and use the recovery control coefficient to perform an XOR calculation on multiple candidate row check data to obtain recovery pre-check data.

[0188] In an exemplary embodiment, the above-mentioned device also includes a target data block recovery unit, which is used to construct a recovered target data block based on the pre-recovery verification data and the first disk data block set when it is determined to adopt the first verification method; and to construct a recovered target data block based on the pre-recovery verification data and the second disk data block set when it is determined to adopt the second verification method.

[0189] In an exemplary embodiment, the above-mentioned device also includes a selection unit, which is used to, when a preset parameter is 2 and the verification mode indication parameter is zero, determine to use a first verification mode for data recovery, wherein the first verification mode is a verification in a diagonal direction; and when the verification mode indication parameter is non-zero, determine to use a second verification mode for data recovery, wherein the second verification mode is a verification in an anti-diagonal direction.

[0190] According to another aspect of the embodiment of the present application, an electronic device for implementing the above disk data processing method is also provided. The electronic device may be Figure 1The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a mobile phone or a computer as an example. Figure 6 As shown, the electronic device includes a memory 502 and a processor 504. The memory 502 stores a computer program, and the processor 504 is configured to execute the steps in any of the above method embodiments through the computer program.

[0191] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0192] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0193] S1, obtaining a data processing request for processing data in a target disk in a disk array;

[0194] S2, when the data processing request indicates writing data, determining the block storage address of the target data block to be processed in the target disk, and writing the target data block into the block storage address;

[0195] S3, obtaining at least two check values ​​generated for the target data block according to different check methods, wherein the different check methods are based on disk data in different parts of disk addresses associated with the block storage address in the disk array for check processing;

[0196] S4, writing at least two check values ​​into their corresponding check positions in the disk array respectively.

[0197] Alternatively, a person skilled in the art may understand that: Figure 6 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 6 Different configurations shown.

[0198] Among them, the memory 502 can be used to store software programs and modules, such as program instructions / modules corresponding to the disk data processing method and device in the embodiment of the present application. The processor 504 executes various functional applications and data processing by running the software programs and modules stored in the memory 502, that is, the above-mentioned disk data processing method is realized. The memory 502 includes the first acquisition unit 402, the determination unit 404, the second acquisition unit 406, and the writing unit 408 in the above-mentioned disk data processing device. The memory 502 may include a high-speed random access memory, and may also include a 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 502 may further include a memory remotely arranged relative to the processor 504, and these remote memories can be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. This example will not be repeated.

[0199] Optionally, the transmission device 506 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 506 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 506 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0200] In addition, the electronic device further includes: a display 508 for displaying the target page; and a connection bus 510 for connecting various module components in the electronic device.

[0201] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a point-to-point network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the point-to-point network.

[0202] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing disk data, characterized in that: include: Obtaining a data processing request for processing data in a target disk in a disk array; In the case where the data processing request indicates writing data, determining a block storage address of a target data block to be processed currently in the target disk, and writing the target data block into the block storage address; Obtaining at least two check values ​​generated for the target data block according to different check modes, wherein the different check modes are based on disk data in different parts of disk addresses associated with the block storage address in the disk array for check processing; Writing the at least two check values ​​into their corresponding check positions in the disk array respectively; In the case where the data processing request indicates that the data is to be recovered, the target data block in the block storage address is recovered based on the at least two check values, including: obtaining a check mode indication parameter obtained by performing a modulo calculation on a preset parameter using a currently counted check count; in the case where the check mode indication parameter satisfies a parameter condition matching a first check mode, obtaining a first disk data block set in the disk array that is checked using the first check mode, and recovering the target data block in the block storage address based on the first disk data block set, wherein data blocks that are checked using the first check mode but are damaged have been eliminated from the first disk data block set; in the case where the check mode indication parameter satisfies a parameter condition matching a second check mode, obtaining a second disk data block set in the disk array that is checked using the second check mode, and recovering the target data block in the block storage address based on the second disk data block set, wherein data blocks that are checked using the second check mode but are damaged have been eliminated from the second disk data block set.

2. The method according to claim 1, characterized in that The obtaining of at least two check values ​​generated for the target data block according to different check modes comprises: Determining a respective verification rule for each of the verification modes and a portion of a disk address associated with the block storage address under the verification mode; In the case where the check rule indicates to generate a virtual check data row, the check value is generated using the virtual check data row and the disk data in the portion of the disk addresses.

3. The method according to claim 1, characterized in that After the at least two check values ​​are respectively written into the corresponding check positions in the disk array, the method further comprises: In a case where the data processing request indicates reading data, determining a block storage address of a target data block to be processed currently in the target disk; In the case that the block storage address has been damaged, the target data block in the block storage address is restored based on the at least two check values.

4. The method according to claim 1, characterized in that After the target data block in the block storage address is restored based on the at least two check values, the method further includes: The currently counted check count is incremented by one to obtain an updated check count.

5. The method according to claim 1, characterized in that The recovering the target data block in the block storage address based on the at least two check values ​​comprises: Generate a first intermediate check value using the target data row where the block storage address is located in the target disk; Acquire difference data between the target disk and a reference disk in the disk array; generating a second intermediate check value using the target data row and the difference data; Generate a third intermediate check value by using the first disk data block set corresponding to the first check method; Generate a fourth intermediate check value using the second disk data block set corresponding to the second check method; Performing a weighted summation on the first intermediate check value, the second intermediate check value, the third intermediate check value, and the fourth intermediate check value to obtain candidate row check data for restoring the target data row; When a plurality of candidate row verification data are obtained after restoring the plurality of data rows respectively, performing an XOR calculation on the plurality of candidate row verification data to obtain restoration pre-verification data; The restored target data block is constructed using the restored pre-check data.

6. The method according to claim 5, characterized in that Before obtaining the difference data between the target disk and the reference disk in the disk array, the method further includes: Determine a target position of the target disk in the disk array; The reference disk is determined from disks adjacent to the target disk and located on both sides of the target disk.

7. The method according to claim 6, characterized in that In the case where the reference disk is two disks, the acquired difference data includes: first difference data between the first reference disk and the target disk, and second difference data between the second reference disk and the target disk. The performing XOR calculation on the plurality of candidate row check data to obtain the restored pre-check data comprises: constructing a restoration equation group using the first difference data and the second difference data; Solving the recovery equations to obtain a recovery control coefficient; The restoration control coefficient is used to perform an XOR calculation on the plurality of candidate row check data to obtain the restoration pre-check data.

8. The method according to claim 7, characterized in that After performing XOR calculation on the plurality of candidate row check data using the recovery control coefficient to obtain the recovery pre-check data, the method includes: In the case where it is determined to adopt the first verification method, constructing the target data block after recovery based on the pre-recovery verification data and the first disk data block set; When it is determined to adopt the second verification method, the target data block after recovery is constructed based on the pre-recovery verification data and the second disk data block set.

9. The method according to claim 1, characterized in that: When the preset parameter is 2, After obtaining the verification mode indication parameter by performing modulo calculation on the preset parameter based on the currently counted verification count, the method further includes: When the verification mode indication parameter is zero, determining to use the first verification mode for data recovery, wherein the first verification mode is a verification in a diagonal direction; When the verification mode indication parameter is non-zero, it is determined to adopt the second verification mode for data recovery, wherein the second verification mode is a verification in an anti-diagonal direction.

10. A disk data processing device, characterized in that: include: A first acquisition unit, used to acquire a data processing request for processing data in a target disk in the disk array; A determination unit, configured to determine a block storage address of a target data block to be processed currently in the target disk, and write the target data block into the block storage address, when the data processing request indicates writing data; A second acquisition unit, configured to acquire at least two check values ​​generated for the target data block according to different check modes, wherein the different check modes are based on disk data in different parts of disk addresses associated with the block storage address in the disk array for check processing; A writing unit, used for writing the at least two check values ​​into their corresponding check positions in the disk array respectively; A first recovery unit, used to recover the target data block in the block storage address based on the at least two check values ​​when the data processing request indicates that the data is to be recovered, including: a reference recovery unit, used to obtain a check mode indication parameter obtained by performing a modulo calculation on a preset parameter using a currently counted check count; when the check mode indication parameter satisfies a parameter condition matching a first check mode, obtain a first disk data block set in the disk array that is checked using the first check mode, and recover the target data block in the block storage address based on the first disk data block set, wherein the first disk data block set has eliminated data blocks that are checked using the first check mode but are damaged; when the check mode indication parameter satisfies a parameter condition matching a second check mode, obtain a second disk data block set in the disk array that is checked using the second check mode, and recover the target data block in the block storage address based on the second disk data block set, wherein the second disk data block set has eliminated data blocks that are checked using the second check mode but are damaged.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 9 when executed by a processor.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 9 are implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Three-disk fault-tolerant storage method, device and equipment, storage medium and disk array

    CN117407209A

  • Data storage method and device, medium and product

    CN118779146A