CN116795295A - Data processing method and device in disk array, storage medium and electronic equipment - Google Patents

Data processing method and device in disk array, storage medium and electronic equipment Download PDF

Info

Publication number
CN116795295A
CN116795295A CN202311030383.2A CN202311030383A CN116795295A CN 116795295 A CN116795295 A CN 116795295A CN 202311030383 A CN202311030383 A CN 202311030383A CN 116795295 A CN116795295 A CN 116795295A
Authority
CN
China
Prior art keywords
target
data
state
data block
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311030383.2A
Other languages
Chinese (zh)
Other versions
CN116795295B (en
Inventor
李幸远
程广亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202311030383.2A priority Critical patent/CN116795295B/en
Publication of CN116795295A publication Critical patent/CN116795295A/en
Application granted granted Critical
Publication of CN116795295B publication Critical patent/CN116795295B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The embodiment of the application provides a data processing method and device in a disk array, a storage medium and electronic equipment, wherein the method is applied to a disk array controller and comprises the following steps: receiving a target operation instruction sent by a host; reading target state information of a target sub-stripe from a data state bitmap based on a target operation instruction, wherein the target sub-stripe is used for storing data in a disk array in blocks, the target state information comprises a data block state and a check block state, the data block state is used for indicating whether a data block in the target sub-stripe is used or not, and the check block state is used for indicating a redundancy state of the target sub-stripe; and responding to the target operation instruction based on the target state information, and executing data processing on the target sub-stripe. The application solves the problem of lower processing efficiency of data in the RAID system in the related technology, thereby achieving the effect of improving the processing efficiency of the RAID system task.

Description

Data processing method and device in disk array, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the field of computers, in particular to a data processing method and device in a disk array, a storage medium and electronic equipment.
Background
As data storage requirements continue to grow, so does the risk of data loss and system failure. In order to protect the security and reliability of data, RAID systems have evolved. The RAID system disperses and stores the data on a plurality of physical disks and adopts a redundant backup technology, thereby improving the fault tolerance and the reliability of the data. Different levels employed by RAID systems have different data redundancy management methods and data storage strategies. For example, RAID 5/6/three checks use different check data generation algorithms, which can respectively resist the situation that 1/2/3 disc magnetic disc fails in a RAID system and ensure that the data integrity is not affected in the situation.
However, the conventional RAID system supports operations such as reading and writing, but the RAID system cannot know which data on the current storage device are valid data written by the host, and which data are invalid data that are not used. When RAID processes data writing, it needs to update data blocks and check blocks in stripes, and it needs to perform data updating. Since the validity of the data in the stripe is not known, invalid data blocks may need to be read and participate in the computation, which reduces the efficiency of the operation. When the RAID system is in consistency synchronization, reconstruction, migration, capacity expansion and consistency verification, all stripe data need to be processed, the data cannot be optimized according to effective rows of the data, and the efficiency is low.
In view of the above technical problems, no effective solution has been proposed in the related art.
Disclosure of Invention
The embodiment of the application provides a data processing method and device in a disk array, a storage medium and electronic equipment, which at least solve the problem of low processing efficiency of data in a RAID system in the related technology.
According to an embodiment of the present application, there is provided a data processing method in a disk array, applied to a disk array controller, including: receiving a target operation instruction sent by a host, wherein the host is connected with the disk array controller, the disk array controller is connected with a disk array, the disk array comprises a plurality of disks, and the disks are used for storing data blocks; reading target state information of a target sub-stripe from a data state bitmap based on the target operation instruction, wherein the target sub-stripe is used for storing data in blocks in the disk array, the target state information comprises a data block state and a check block state, the data block state is used for indicating whether a data block in the target sub-stripe is used or not, and the check block state is used for indicating a redundancy state of the target sub-stripe; and executing data processing on the target sub-band in response to the target operation instruction based on the target state information.
According to another embodiment of the present application, there is provided a data processing apparatus in a disk array, including: the first receiving module is used for receiving a target operation instruction sent by a host, wherein the host is connected with the disk array controller, the disk array controller is connected with a disk array, the disk array comprises a plurality of disks, and the disks are used for storing data blocks; the first reading module is used for reading target state information of a target sub-stripe from a data state bitmap based on the target operation instruction, wherein the target sub-stripe is used for storing data in a block mode in the disk array, the target state information comprises a data block state and a check block state, the data block state is used for indicating whether a data block in the target sub-stripe is used or not, and the check block state is used for indicating a redundancy state of the target sub-stripe; and the first response module is used for responding to the target operation instruction based on the target state information and executing data processing on the target sub-band.
In an exemplary embodiment, the first reading module includes: a first obtaining unit, configured to obtain a start position of a data block and a length of the data block included in the target operation instruction; a first determining unit configured to determine the target subband using the data block start position and the data block length; and the first reading unit is used for reading the target state information of the target sub-band from the data state bitmap.
In an exemplary embodiment, the first response module includes: a second reading unit, configured to read a data block state of a target data block when the target operation instruction is an operation instruction for reading the target data block from the target sub-stripe, where the target data block is a data block of a plurality of data blocks in the target sub-stripe; and the first response unit is used for responding to the target operation instruction and feeding back the information that the target data block is empty to the host when the state value of the data block state of the target data block is a first preset value, wherein the first preset value is used for indicating that the target data block is empty.
In an exemplary embodiment, the first response module includes: a second reading unit, configured to read a data block state of a target data block when the target operation instruction is an operation instruction for reading the target data block from the target sub-stripe, where the target data block is a data block of a plurality of data blocks in the target sub-stripe; a third reading unit, configured to read the check block state when the state value of the data block state of the target data block is a second preset value and the target data block is in an abnormal disk, where the check block state is used to indicate a state of a check block included in the target sub-stripe, and the second preset value is used to indicate that the target data block includes data; a fourth reading unit, configured to read, when the state value of the state of the check block is a third preset value, data in the check block and data in a data block of which the state value in the target subband is the second preset value, where the data blocks of which the state value is the second preset value are all set in a normal disk, and the second preset value is used to indicate that the data blocks include data; and a second response unit, configured to send, in response to the target operation instruction, data in the check block and data in a data block in which the state value in the target sub-stripe is the second preset value to the host.
In an exemplary embodiment, the above apparatus further includes: the second reading module is used for reading the data in the check block and the data in the data block of the normal disk in the target sub-band under the condition that the state value of the check block state is a fourth preset value; and the second response module is used for responding to the target operation instruction and sending the data in the check block and the data in the data block of the normal disk in the target sub-stripe to the host.
In an exemplary embodiment, the first response module includes: a fifth reading unit configured to read the check block state when the target operation instruction is an operation instruction for writing the data into the target sub-stripe, where the check block state is used to indicate a state of a check block included in the target sub-stripe; a sixth reading unit, configured to read a data block state of a target data block when the state value of the check block state is a third preset value, where the target data block is a data block of a plurality of data blocks in the target sub-stripe; a seventh reading unit, configured to read other data blocks in the target sub-stripe when the state value of the state of the target data block is a first preset value, where the other data blocks are data blocks in the target sub-stripe other than the target data block, and the state value of the state of the data block of the other data blocks is a second preset value, where the first preset value is used to indicate that the target data block is empty, and the second preset value is used to indicate that the other data blocks include data; and a third response unit, configured to update the data into the target sub-stripe by using the other data block in response to the target operation instruction.
In an exemplary embodiment, the above apparatus further includes: and the third response module is used for responding to the target operation instruction and updating the data into the target sub-band by utilizing the number of the target data blocks when the state value of the check block state is a fourth preset value.
In an exemplary embodiment, the first response module includes: an eighth reading unit configured to read the check block state when the target operation instruction is an operation instruction for writing the data into the target sub-stripe, where the check block state is used to represent a state of a check block included in the target sub-stripe; a ninth reading unit, configured to read a data block state of the target data block when the target data block is in an abnormal disk and the state value of the check block state is a third preset value; a tenth reading unit, configured to read data in the check block when a state value of a data block state of the target data block is a first preset value, where the first preset value is used to indicate that the target data block is empty; and a fourth response unit for updating the check state of the check block by using the data in the check block and the data in response to the target operation instruction.
In an exemplary embodiment, the above apparatus further includes: a third reading module, configured to read other data blocks in the target sub-stripe when the state value of the state of the target data block is a second preset value, where the other data blocks are data blocks in the target sub-stripe except the target data block, and the state value of the data block state of the other data blocks is a second preset value, where the second preset value is used to indicate that the other data blocks are not null; and the fourth response module is used for responding to the target operation instruction and updating the data into the target sub-band by utilizing the other data blocks.
In an exemplary embodiment, the above apparatus further includes: and the first updating module is used for updating the target sub-stripe by using the data block when the target operation instruction is an operation instruction for writing the target data into the target sub-stripe and the target data block is in an abnormal disk after reading the check block state and the state value of the check block state is a fourth preset value.
In an exemplary embodiment, a fourth reading module is configured to, when the target operation instruction is an operation instruction for writing the target data into the target sub-stripe, read a data block state of the target data block after the check block state is read, where the target sub-stripe includes an abnormal disk and the target data block is in a normal disk; a fifth reading module, configured to read data in the check block when a state value of a data block state of the target data block is a first preset value; and the second updating module is used for updating the verification state of the verification block by utilizing the data in the verification block and the target data.
In an exemplary embodiment, the above apparatus further includes: a sixth reading module, configured to, when the target sub-stripe includes an abnormal disk and the target data block is in a normal disk, read other data blocks in the target sub-stripe when a state value of the target data block state is a second preset value after reading the data block state of the target data block, where the other data blocks are data blocks in the target sub-stripe other than the target data block, and the state value of the data block state of the other data blocks is the second preset value, where the second preset value is used to indicate that the other data blocks are not empty; and a third updating module, configured to update the data into the target sub-band by using the other data blocks.
In an exemplary embodiment, the above apparatus further includes: and a fourth updating module, configured to update the data into the target sub-stripe when the target operation instruction is an operation instruction for writing the target data into the target sub-stripe, after reading the check block state, and when the target sub-stripe includes an abnormal disk, the target data block is in a normal disk, and the state value of the check block state is a fourth preset value.
In an exemplary embodiment, the above apparatus further includes: a seventh reading module, configured to read, after receiving a target operation instruction sent by a host, a data block state of the target data block and a check block state of the target sub-stripe when the target operation instruction is a reconstruction target data block, where the target data block is a data block of a plurality of data blocks in the target sub-stripe; an eighth reading module, configured to read other data blocks in the target sub-stripe when the state value of the data block state of the target data block is a second preset value and the state value of the check block state of the target data block is a third preset value, where the other data blocks are data blocks in the target sub-stripe other than the target data block, the state value of the data block state of the other data blocks is a second preset value, and the second preset value is used to indicate that the other data blocks are not null; and the first writing module is used for calculating a reconstructed target data block by using the data in the other data blocks and the data in the check block of the target data block, and writing the data in the reconstructed target data block into the disk array.
In an exemplary embodiment, the above apparatus further includes: a first determining module, configured to, when the target operation instruction is to reconstruct the target data block, read a data block state and a check block state of the target data block, and then, when a state value of the data block state of the target data block is a second preset value, a state value of the check block state of the target data block is a fourth preset value, and a state value of the data block state included in the target sub-stripe is the first preset value, redetermine the check data block of the target sub-stripe by using the other data blocks; the first modification module is used for modifying the state value of the check state of the redetermined check data block into a third preset value.
In an exemplary embodiment, the above apparatus further includes: a ninth reading module, configured to, when the target operation instruction is to reconstruct the target data block, read a data block state and a check block state of the target data block, and then read all data blocks and check data blocks in the target sub-stripe when a state value of the data block state of the target data block is a second preset value, a state value of the check block state of the target data block is a fourth preset value, and state values of data block states of other data blocks in the target sub-stripe are both the second preset value; and the second writing module is used for calculating a reconstructed target data block by using all the data blocks and the check data blocks in the target sub-band and writing the data in the reconstructed target data block into the disk array.
In an exemplary embodiment, the above apparatus further includes: the first migration module is configured to migrate the target data block to another sub-stripe for storage after receiving a target operation instruction sent by the host, where the target operation instruction is a data block in the target sub-stripe, and the target sub-stripe includes a target data block, and the target data block is a data block in which a state value of a state of the data block in the target sub-stripe is a second preset value; the first calculation module is used for calculating the check data block of the target sub-stripe by using the target data block; and the second modification module is used for modifying the check value of the check data block by using the other data blocks under the condition that the target sub-band comprises the other data blocks with the state values of the data block states being the first preset values.
In an exemplary embodiment, the above apparatus further includes: a tenth reading module, configured to, after receiving a target operation instruction sent by a host, increase a disk in the disk array, and read a data block state and a check block state of the target sub-stripe under a condition that the expanded sub-stripe is obtained; the second migration module is used for migrating the data in the target data block into the expanded sub-stripe when the state value of the data block state of the target data block is a second preset value; and the second determining module is used for determining the verification state of the verification block in the sub-stripe after the expansion by using the data block state of the data block included in the sub-stripe after the expansion.
In an exemplary embodiment, the above apparatus further includes: an eleventh reading module, configured to read a data block state of all data blocks in the target sub-stripe when the target operation instruction is an operation instruction for verifying the target sub-stripe after receiving the target operation instruction sent by the host; the first checking module is used for performing consistency check on the target sub-stripe by using the check block and all the data blocks in the target sub-stripe when the state value of the data block state of the target data block is a second preset value and the state value of the check state of the check block of the target sub-stripe is a fourth preset value; and the second checking module is used for carrying out consistency check on the target sub-stripe by utilizing the data blocks with the state values of the check blocks and the data block states being the second preset value when the state values of the data block states of the target data blocks are the second preset value and the state values of the check blocks of the target sub-stripe are the third preset value.
In an exemplary embodiment, the above apparatus further includes: and a fifth updating module, configured to respond to the target operation instruction based on the target state information, and then update the data block state and the check block state by using the data operation performed on the target sub-stripe after performing the data operation on the target data.
In an exemplary embodiment, the above apparatus further includes: the first obtaining module is configured to obtain states of a plurality of sub-stripes in the disk array before target state information of a target sub-stripe is read from a data state bitmap based on the target operation instruction, where one of the states of the sub-stripes includes a plurality of data block states and a check block state, where the plurality of data block states are used to represent states of a plurality of data blocks in the sub-stripe, and the check block state is used to represent states of check blocks in the sub-stripe; the first generating module is configured to generate the data status bitmap by using the statuses of the plurality of sub-stripes, and buffer the data status bitmap.
In an exemplary embodiment, the above apparatus further includes: and the first storage module is used for generating the data state bitmap by utilizing the states of the plurality of sub-stripes, caching the data state bitmap, and then storing the data state bitmap in a disk in the disk array when the disk array stops working, wherein the disk comprises a preset data area for storing the data state bitmap.
In an exemplary embodiment, the above apparatus further includes: and a twelfth reading module, configured to store the data status bitmap in a disk of the disk array when the disk array stops operating, and then read the data status bitmap from the preset data area when the disk array starts operating.
In an exemplary embodiment, the above apparatus further includes: the first setting module is configured to set, before reading target state information of a target sub-stripe from a data state bitmap based on the target operation instruction, state values of data block states of a plurality of sub-stripes in the disk array to be first preset values and set state values of check block states of the plurality of sub-stripes to be third preset values when an initialization operation is performed on the disk array; a third modifying module, configured to modify a state value of the state of the data block based on an instruction type of the target operation instruction after receiving the target operation instruction sent by the host; and a fourth modification module, configured to modify the state value of the check block state based on the state value of the modified data block state.
According to still another embodiment of the present application, there is provided a disk array system including a host, a disk array controller, and a disk array, where the host is connected to the disk array controller, the disk array controller is connected to the disk array, the disk array includes a plurality of disks, the disks are used to store data blocks, and the disk array controller is used to perform the above steps.
According to a further embodiment of the application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the application, the disk array controller receives the target operation instruction sent by the host, reads the target state information of the target sub-stripe from the data state bitmap based on the target operation instruction, and can determine the validity of the data block according to the data block state and the check block state in the target sub-stripe, so that the valid data block can be processed without paying attention to the invalid data block. Thereby improving the processing efficiency of the RAID system task. Therefore, the problem of low processing efficiency of data in the RAID system in the related art can be solved.
Drawings
FIG. 1 is a block diagram of a hardware architecture of a mobile terminal for a data processing method in a disk array according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of data processing in a disk array according to an embodiment of the application;
FIG. 3 is a basic block diagram of one sub-stripe distribution across disks in a RAID system according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a RAID system according to an embodiment of the present application;
FIG. 5 is a block diagram of a data status bitmap according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a RAID group architecture according to an embodiment of the present application;
FIG. 7 is an overall flow chart of data reading according to an embodiment of the application;
FIG. 8 is a flow chart of writing data according to the present embodiment of the present application;
FIG. 9 is a flow chart of writing data in the case where there is a damaged disk in the present embodiment according to the embodiment of the application;
FIG. 10 is a flow chart of reconstructing a data block according to an embodiment of the present application;
FIG. 11 is a migration flow diagram for a single sub-stripe in accordance with an embodiment of the present application;
fig. 12 is a flow chart of a capacity expansion operation according to an embodiment of the present application;
FIG. 13 is a flow chart of a consistency check operation in accordance with an embodiment of the present application;
FIG. 14 is a block diagram of a data processing apparatus in a disk array according to an embodiment of the present application;
Fig. 15 is a schematic diagram of an electronic device according to an embodiment of the application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The following explanation of the related art in the present application is as follows:
RAID: redundant Array of Independent Disks, redundant array of inexpensive disks. Multiple disk devices are combined into one or more storage array groups for the purpose of improving performance and increasing redundancy to protect data.
Strip: stripe, a stripe is a method of storing data in blocks on multiple hard disks in a RAID system. RAID systems divide data into blocks and then store the blocks in turn on multiple hard disks. The data blocks stored on the same location on different disks are referred to as a stripe.
RMW: the Read-Construct-Write, read-reconstruct-Write, a method for stripe data update in RAID system, reads the updated data and check data in the stripe, then calculates new check data, and then writes the updated data and check data into disk.
RCW: a Read-Modify-Write, a method for stripe data update in RAID system, reads the data disk not updated in the stripe, calculates the check data together with the written data, and writes the updated data and the newly generated check to the disk.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking a mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of a mobile terminal of a data processing method in a disk array according to an embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store computer programs, such as software programs of application software and modules, such as computer programs corresponding to the data processing methods in the disk array in the embodiments of the present application, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, that is, implement the methods described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for processing data in a disk array is provided, and fig. 2 is a flowchart of a method for processing data in a disk array according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S202, receiving a target operation instruction sent by a host, wherein the host is connected with a disk array controller, the disk array controller is connected with a disk array, the disk array comprises a plurality of disks, and the disks are used for storing data blocks;
step S204, reading target state information of a target sub-stripe from a data state bitmap based on a target operation instruction, wherein the target sub-stripe is used for storing data in a disk array in blocks, the target state information comprises a data block state and a check block state, the data block state is used for indicating whether a data block in the target sub-stripe is used or not, and the check block state is used for indicating a redundancy state of the target sub-stripe;
step S206, responding to the target operation instruction based on the target state information, and executing data processing on the target sub-stripe.
The main execution body of the steps may be a disk array controller, but is not limited thereto.
Optionally, the target operation instruction may be an IO operation instruction supported by the RAID system, where the IO operation instruction includes a read, write zero, discard, and other instruction.
Optionally, the data state bitmap records the state of the RAID system storing data on the disk, and the data stored in the RAID system may be divided into two types: the user data block written by the host and the RAID system are used for realizing the check data generated by the data redundancy. While a RAID system is a storage device, the number of accesses can only operate in the smallest unit, where a smallest unit is a block of data. RAID systems store two types of data blocks: a user data block (abbreviated as a data block) and a check data block (abbreviated as a check block), the data block size being the smallest data unit in a RAID system, for example, the data block size being 512B or 4kB. The data blocks in the same location on all disks in a RAID system form a sub-stripe. One sub-stripe includes a plurality of data blocks, and may include 1 or 2 or 3 check blocks according to RAID levels. RAID levels include RAID5, RAID6, RAIDTP, and the like. A sub-stripe is the basic unit of data storage on a physical hard disk in a RAID system. Sub-stripes are one way to store data in blocks on multiple hard disks. RAID systems divide data into blocks and then store the blocks in turn on multiple hard disks. For example, if a file is divided into 4 blocks and a RAID system has 4 hard disks, then a first block will be stored on the first hard disk, a second block will be stored on the second hard disk, and so on. In this way, each block of the file is allocated to a different hard disk for storage, thereby improving the speed of data reading and writing.
Alternatively, the basic structure of a sub-stripe distribution on disks in a RAID system is shown in FIG. 3, for example, a RAID5 system is shown as a 4-block disk, so that a sub-stripe has three bit data blocks, a bit check block. In the case of a RAID6 system, two check data blocks are required, and in the case of a RAID three check system, three check data blocks are required. The size of each data block is referred to as the stripe unit size. The stripe unit size is typically 64kB to 1MB.
Optionally, the RAID system is a storage device belonging to the block device type. The block device can only access through the smallest data unit data block. The size of each data block is typically 512 bytes or 4KB, which is also referred to as the block size or sector size. Access to data is made through Logical Block Addresses (LBAs), which are logical numbers to data on a block device. Each block on the block device is assigned a unique LBA, allowing the host to access a particular block of data.
Alternatively, as shown in fig. 4, the RAID system includes a host, a disk array controller, and a disk array, where the host is connected to the disk array controller, the disk array controller is connected to the disk array, and the disk array includes a plurality of disks, and the disks are used to store data blocks.
The host, the user of the RAID system, may issue the following operation commands to the RAID controller: reading: reading one or more consecutive data blocks in the RAID system; writing: writing one or more consecutive data blocks to the RAID system; and (3) writing zero: one or more consecutive all-zero data blocks are written to the RAID system. The operation has only write commands and innumerable transmission processes; discarding: a command is sent to the RAID system indicating that one or more data blocks are no longer in use. The operation has no data transmission process; start or shut down: the RAID system is started or shut down. The basic unit of the above operations is the smallest unit of data in a RAID system, typically 512B or 4kB.
And the RAID controller is used for executing various IO command operations sent by the host, finishing writing and reading of data on the disk, generating check data according to RAID level and realizing redundancy protection of the data.
And the cache is used for storing temporary data used when the RAID controller runs and caching the data state bitmap.
The disk array comprises a plurality of disks, and the plurality of disks form a RAID group for storing user data and generating check data for redundancy protection by the RAID controller. And also for storing some of the data associated with the operation of the RAID group.
Optionally, before reading the target state information of the target sub-stripe from the data state bitmap based on the target operation instruction, the method further includes: acquiring states of a plurality of sub-stripes in a disk array, wherein the state of one sub-stripe comprises a plurality of data block states and a check block state, wherein the plurality of data block states are used for representing the states of a plurality of data blocks in the sub-stripe, and the check block state is used for representing the states of check blocks in the sub-stripe; a data state bitmap is generated using the states of the plurality of sub-stripes and is cached. In this embodiment, the data status bitmap is stored in the cache when the RAID system is running. For example, the structure of the data status bitmap is as shown in fig. 5, and status bits are set for the data block and the check block, respectively. Wherein, for the data blocks, each data block is provided with a status bit; for the check blocks, only one status bit is set no matter how many check blocks are in one sub-stripe (1, 2 and 3 check blocks are respectively used for RAID5, RAID 6 and RAID three checks). Optionally, each data block status bit records two states: state 1, which is used to indicate that the data block is in an unused state; state 2, which is used to indicate that the data block is in the used state. Each check block status bit records two states: state 1, which is used to represent the check data as the checksum (abbreviated as partial check) of all state 1 data blocks in the sub stripe; state 2, which is used to indicate that the check data is a checksum (simply referred to as a full check) of all data blocks in the sub-stripe.
Optionally, after generating the data state bitmap using the states of the plurality of sub-stripes and caching the data state bitmap, the method further comprises: when the disk array stops working, the data state bitmap is stored in a disk in the disk array, wherein the disk comprises a preset data area for storing the data state bitmap. In this embodiment, when the RAID group is operating normally, the data status bitmap is stored in a cache in the RAID system for use. When a RAID group is closed, the data state bitmap needs to be persisted. For example, a data state bitmap is stored by:
s1, reserving space on each disk when the RAID group is created, and storing a data state bitmap. A RAID group as shown in fig. 6 is made up of N disks, each with a reserved data state bit map area.
S2, determining the number of times of the data state bitmap stored on the plurality of disks according to the level of the RAID group so as to ensure that the data state bitmap can still be read correctly when a bad disk appears in the RAID system. For example, RAID5 stores two data status bitmaps on at least two disks, RAID6 stores three data status bitmaps on at least three disks, and RAID three checks store four data status bitmaps on at least four disks.
And S3, when the RAID system executes the closing operation, writing the data state bitmap in the system cache into a reserved data area on the disk.
S4, when the RAID system is started, reading a data state bitmap from a preset data area reserved on a disk to a system cache for use.
According to the application, the disk array controller receives the target operation instruction sent by the host, reads the target state information of the target sub-stripe from the data state bitmap based on the target operation instruction, and can determine the validity of the data block according to the data block state and the check block state in the target sub-stripe, so that the valid data block can be processed without paying attention to the invalid data block. Thereby improving the processing efficiency of the RAID system task. Therefore, the problem of low processing efficiency of data in the RAID system in the related art can be solved.
In one exemplary embodiment, reading target state information for a target sub-stripe from a data state bitmap based on a target operation instruction includes: acquiring a data block starting position and a data block length included in a target operation instruction; determining a target sub-stripe by using the data block starting position and the data block length; target state information of the target sub-stripe is read from the data state bitmap. In this embodiment, the target sub-band that needs to be operated can be accurately output by searching from the start position of the data block according to the length of the data block.
In one exemplary embodiment, performing data processing on a target sub-stripe in response to a target operation instruction based on target state information includes: when the target operation instruction is an operation instruction for reading a target data block from a target sub-stripe, reading a data block state of the target data block, wherein the target data block is a data block in a plurality of data blocks in the target sub-stripe; and responding to the target operation instruction when the state value of the data block state of the target data block is a first preset value, and feeding back information that the target data block is empty to the host, wherein the first preset value is used for indicating that the target data block is empty. In this embodiment, the null target data block indicates that no data is stored in the target data block, and the read data is null, which is only needed to feed back all zero data to the host. It should be noted that the target data block may be one data block, or may be a plurality of data blocks in the target sub-stripe, and the specific number included may be determined from the start position of the data block and the length of the data block included in the target operation instruction. The way of reading the data in the other data blocks is the same as the way of the target data block.
In one exemplary embodiment, performing data processing on a target sub-stripe in response to a target operation instruction based on target state information includes: when the target operation instruction is an operation instruction for reading a target data block from a target sub-stripe, reading a data block state of the target data block, wherein the target data block is a data block in a plurality of data blocks in the target sub-stripe; reading a check block state when the state value of the data block state of the target data block is a second preset value and the target data block is in an abnormal disk, wherein the check block state is used for indicating the state of a check block included in a target sub-stripe, and the second preset value is used for indicating that the target data block includes data; reading data in the check block and data in a data block with a second preset value in the target sub-stripe under the condition that the state value of the check block state is a third preset value, wherein the data block with the second preset value in the state value is arranged in a normal disk, and the second preset value is used for indicating that the data block comprises data; and responding to the target operation instruction, and sending the data in the check block and the data in the data block with the state value of the second preset value in the target sub-stripe to the host. In this embodiment, if the state value of the data block state of the target data block is the second preset value, it indicates that the target data block includes data, and it needs to be further determined whether the target data block is on an abnormal disk (e.g. a damaged disk), and if the target data block is in the abnormal disk, the state of the check block is further determined, and whether all the data needs to be read according to the state of the check block. The third preset value may be 1, which is used to indicate that the check block is a checksum of all data blocks with states of 1 in the target sub-stripe, and the data block with states of 1 is used to indicate that the data block is empty. When the state value of the check block is 1, only the data block comprising the data is required to be read, and all the data blocks are not required to be read, so that the efficiency of data processing can be improved.
In an exemplary embodiment, the above method further comprises: reading data in the check block and data in a data block of a normal disk in the target sub-stripe under the condition that the state value of the check block state is a fourth preset value; and responding to the target operation instruction, and sending the data in the check block and the data in the data block of the normal disk in the target sub-stripe to the host. In this embodiment, the fourth preset value may be 2, which is used to indicate that the check block is a checksum of all data blocks in the target sub-stripe. When the state value of the check block is 2, all the data blocks in the normal disk need to be read, and all the data blocks do not need to be read, so that the data processing efficiency can be improved.
For example, as shown in fig. 7, an overall flowchart of the data reading of the present embodiment includes the following steps:
s701, reading the state of a target data block in a sub-band (corresponding to the target sub-band in the above description);
s702, judging a state value of a target data block;
s703, returning all zeros to the host when the state value of the target data block is 1;
s704, judging whether the read target data block is on the damaged disk or not under the condition that the state value of the target data block is not 1 (for example, is 2 or other values) and the damaged disk exists in the sub stripe;
S705, under the condition that the target data block is not on the damaged disk, reading the data in the target data block from the disk and returning the data to the host;
s706, reading the state value of the check block under the condition that the target data block is on the damaged disk;
s707, judging the state value of the check block;
s708, reading data in the check block from the disk and reading data in all data blocks in a normal disk with the state value of 2 under the condition that the state value of the check block is 1, wherein the data blocks with the state value of 2 comprise data;
s709, returning the read data to the host;
s710, in the case that the state value of the check block is not 1 (is 2 or other values), reading the data of the check block and the data of the data blocks in all normal disks from the disk, and returning the read data to the host.
In one exemplary embodiment, performing data processing on a target sub-stripe in response to a target operation instruction based on target state information includes: reading a check block state when the target operation instruction is an operation instruction for writing data into the target sub-stripe, wherein the check block state is used for representing the state of a check block included in the target sub-stripe; reading the data block state of a target data block under the condition that the state value of the check block state is a third preset value, wherein the target data block is a data block in a plurality of data blocks in a target sub-stripe; reading other data blocks in the target sub-stripe under the condition that the state value of the state of the target data block is a first preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, and the state value of the state of the data block of the other data blocks is a second preset value, the first preset value is used for indicating that the target data block is empty, and the second preset value is used for indicating that the other data blocks comprise data; in response to the target operation instruction, the data is updated into the target sub-stripe with other data blocks. In this embodiment, when performing an operation of writing data, it is necessary to determine whether a damaged disk exists in the target sub-stripe, and under the condition that there is no damaged disk, a specific operation flow in which a data block can be written is determined by determining a state value of the check block and a state value of the data block, so that the writing efficiency of data can be improved. For example, when the state value of the check block state is a third preset value (for example, 1), and the state value of the data block is also 1, reading the data block with the state value of 2 from the target sub-stripe, and performing RCW calculation on the data block with the state value of 2; reading the data block with the state value of 2 from the target sub-stripe when the state value of the check block state is a fourth preset value (for example, 2) and the state value of the data block is also 2, and executing RCW calculation or RMW calculation on the data block with the state value of 2; in the case where the state value of the check block state is the fourth preset value, the RCW calculation or RMW calculation is performed on the data block. According to the embodiment, the calculation to be executed is determined through the states of the data blocks and the states of the check blocks, and the calculation is not required to be executed on all the data blocks, so that the data processing efficiency can be effectively improved.
For example, as shown in fig. 8, a flowchart of writing data in this embodiment includes the following steps:
s801, reading a state value of a check block in a target sub-stripe;
s802, judging a state value of a check block;
s803, reading the state value of a target data block in the target sub-band under the condition that the state value of the check block is 1;
s804, judging the state value of the target data block;
s805, in the case that the state value of the target data block is 1, reading all data blocks with the state value of 2, executing RCW calculation on all data blocks with the state value of 2, and writing the data blocks into a disk;
s806, when the state value of the target data block is not 1, only reading all data blocks with the state value of 2, executing RCW calculation on all data blocks with the state value of 2, and writing the data blocks into a disk; or performing RMW calculation and writing into a disk;
s807 updates the state values of the data blocks and the state values of the check blocks in the target sub-stripe according to the rules.
S808, under the condition that the state value of the check block is not 1, performing RCW calculation on a target data block in a target sub-stripe, and writing the RCW calculation into a disk; or performing RMW calculation and writing to disk.
In one exemplary embodiment, performing data processing on a target sub-stripe in response to a target operation instruction based on target state information includes: reading a check block state when the target operation instruction is an operation instruction for writing data into the target sub-stripe, wherein the check block state is used for representing the state of a check block included in the target sub-stripe; reading the data block state of the target data block under the condition that the target data block is in an abnormal magnetic disk and the state value of the check block state is a third preset value; reading data in the check block under the condition that a state value of a data block state of the target data block is a first preset value, wherein the first preset value is used for indicating that the target data block is empty; and responding to the target operation instruction, and updating the check state of the check block by using the data in the check block and the data. In this embodiment, in the case where there is a damaged disk, by determining whether the target data block is on the damaged disk, and determining the state of the data block and the state of the check block, the writing operation is performed on the data block, and it is not necessary to perform operations on all the data blocks, so that the writing efficiency of data can be effectively improved.
Optionally, the method further comprises: reading other data blocks in the target sub-stripe under the condition that the state value of the state of the target data block is a second preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, and the state value of the state of the data block of the other data blocks is the second preset value, and the second preset value is used for indicating that the other data blocks are not empty; in response to the target operation instruction, the data is updated into the target sub-stripe with other data blocks.
In an exemplary embodiment, after reading the check block status when the target operation instruction is an operation instruction to write target data into the target sub-stripe, the method further includes: and under the condition that the target data block is in the abnormal disk and the state value of the check block state is a fourth preset value, updating the target sub-stripe by using the data block.
Optionally, after reading the check block state when the target operation instruction is an operation instruction for writing data into the target sub-stripe, the method further includes: reading the data block state of the data block under the condition that the target sub-stripe comprises an abnormal disk and the data block is in a normal disk; reading data in the check block under the condition that the state value of the data block state of the target data block is a first preset value; and updating the verification state of the verification block by using the data in the verification block and the target data.
Optionally, in a case where the target sub-stripe includes an abnormal disk and the target data block is in a normal disk, after reading the data block state of the target data block, the method further includes: reading other data blocks in the target sub-stripe under the condition that the state value of the state of the target data block is a second preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, and the state value of the state of the data block of the other data blocks is the second preset value, and the second preset value is used for indicating that the other data blocks are not empty; the data is updated into the target sub-stripe with other data blocks.
Optionally, after reading the check block state when the target operation instruction is an operation instruction for writing data into the target sub-stripe, the method further includes: and under the condition that the target sub-stripe comprises an abnormal disk, the target data block is in a normal disk and the state value of the check block state is a fourth preset value, updating the data into the target sub-stripe.
For example, as shown in fig. 9, in the case where there is a damaged disk in this embodiment, a flowchart of writing data includes the following steps:
s901, reading a state value of a check block in a target sub-stripe;
S902, judging whether a target data block is on a damaged disk or not;
s903, judging the state value of the check block under the condition that the target data block is not on the damaged disk;
s904, reading the state value of the data block in the target sub-band under the condition that the state value of the check block is 1;
s905, judging the state value of the data block;
s906, under the condition that the state value of the data block is 1, reading data in the check block, recalculating the check block with the data to be written, writing the data to be written and the new check block into a disk, and turning to S908;
s907, when the state value of the data block is not 1, reading the data block with the state value of 2, performing RMW calculation on the data block with the state value of 2, writing the data block into a disk, and turning to S908;
s908, updating the state value of the data block and the state value of the check block in the target sub-band according to the rule;
s909, in the case that the state value of the check block is not 1, performing RMW calculation on the data block in the target sub-stripe, writing the data block into a disk, and turning to S908;
s910, judging the state value of the check block under the condition that the target data block is on the damaged disk;
s911, reading the state of a target data block in a target sub-band under the condition that the state value of the check block is 1;
S912, judging the state value of the target data block;
s913, when the state value of the target data block is 1, reading the data in the check block, recalculating the check block with the data to be written, writing the data to be written and the new check block into the disk, and turning to S908;
s914, when the state value of the target data block is not 1, reading the data block with the state value of 2, executing RMW calculation on the data block with the state value of 2, writing the data block into a disk, and turning to S908;
if the status value of the check block is not 1, the RCW calculation is performed on the data block in the target sub-stripe and written to the disk in S915, and the process proceeds to S908.
In an exemplary embodiment, before reading the target state information of the target sub-stripe from the data state bitmap based on the target operation instruction, the method further includes: when the initialization operation is executed on the disk array, the state values of the data block states of a plurality of sub-stripes in the disk array are all set to be a first preset value, and the state values of the check block states of the plurality of sub-stripes are all set to be a third preset value; after receiving the target operation instruction sent by the host, modifying a state value of the data block state based on an instruction type of the target operation instruction. In this embodiment, in the initialization stage, all the data blocks and the check blocks are set to 1 without writing any data to the disk.
In an exemplary embodiment, after receiving the target operation instruction sent by the host, the method further includes: when the target operation instruction is to reconstruct a target data block, reading a data block state of the target data block and a check block state of a target sub-stripe, wherein the target data block is a data block in a plurality of data blocks in the target sub-stripe; reading other data blocks in the target sub-stripe when the state value of the data block state of the target data block is a second preset value and the state value of the check block state of the target data block is a third preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, the state value of the data block state of the other data blocks is the second preset value, and the second preset value is used for indicating that the other data blocks are not empty; and calculating the reconstructed target data block by using the data in the other data blocks and the data in the check block of the target data block, and writing the data in the reconstructed target data block into the disk array. In this embodiment, by determining the state of the reconstructed data block, recovery processing can be performed on the data, and the efficiency of data processing is increased.
Optionally, when the target operation instruction is to reconstruct the target data block, after reading the data block state and the check block state of the target data block, the method further includes: when the state value of the data block state of the target data block is a second preset value, the state value of the check block state of the target data block is a fourth preset value, and the state value of the data block state included in the target sub-stripe is a first preset value, the check data block of the target sub-stripe is redetermined by utilizing other data blocks; and modifying the state value of the check state of the redetermined check data block into a third preset value. According to the embodiment, the check data block of the target sub-band is redetermined through other data blocks, so that the state of the reconstructed data block can be accurately determined.
Optionally, when the target operation instruction is to reconstruct the target data block, after reading the data block state and the check block state of the target data block, the method further includes: reading all the data blocks and the check data blocks in the target sub-stripe under the condition that the state value of the data block state of the target data block is a second preset value, the state value of the check block state of the target data block is a fourth preset value and the state values of the data block states of other data blocks in the target sub-stripe are all the second preset values; and calculating a reconstructed target data block by using all the data blocks and the check data blocks in the target sub-stripe, and writing the data in the reconstructed target data block into the disk array.
For example, as shown in fig. 10, a flowchart for reconstructing a data block in the present embodiment includes the following steps:
s1001, reading the state of the reconstructed data block and the state of the check block in the target sub-stripe;
s1002, judging the state values of all data blocks in a target sub-band;
s1003, judging the state value of the check block under the condition that the state value of the data block in the target sub-band is not 1;
s1004, when the state value of the check block is 1, reading the data block with the state value of 2 in the target sub-band from the magnetic disk;
s1005, reading data of a check block in a target sub-stripe from a disk;
s1006, calculating a restored data block according to the data of the check block in the target sub-stripe and the data block with the state value of 2 in the target sub-stripe, obtaining a reconstructed data block, and writing the reconstructed data block into a disk;
s1007, judging whether the target sub-stripe comprises a data block with a state value of 1 or not under the condition that the state value of the check block is not 1;
s1008, in the case that the data block with the state value of 1 is included in the target sub-stripe, the data block with the state value of 2 in the target sub-stripe is read from the disk;
s1009, recalculating the check blocks in the target sub-stripe and writing the check blocks into a disk;
S1010, modifying the state value of the check block in the target sub-stripe to be 1;
s1011, in the case that the target sub-stripe does not comprise the data block with the state value of 1, reading all the data blocks in the target sub-stripe from the disk;
s1012, reading data in the check block in the target sub-stripe from the disk;
s1013, using the data in the data blocks in the target sub-stripe and the check blocks in the target sub-stripe read from the disk, calculating the restored data blocks, obtaining the reconstructed data blocks, and writing into the disk.
In an exemplary embodiment, after receiving the target operation instruction sent by the host, the method further includes: under the condition that the target operation instruction is a data block in a migration target sub-stripe and the target sub-stripe comprises a target data block, migrating the target data block to other sub-stripes for storage, wherein the target data block is a data block with a state value of a data block state in the target sub-stripe being a second preset value; calculating a check data block of the target sub-stripe by using the target data block; and in the case that the target sub-band comprises other data blocks with the state values of the data block states being the first preset values, modifying the check values of the check data blocks by using the other data blocks. In this embodiment, the data blocks in the migration target sub-stripe include level migration, where level migration refers to migration between three RAID levels, i.e., RAID5, RAID6, and RAIDTP. The level migration affects only the number of check data blocks. Because all check data blocks in this embodiment correspond to only one check block state, the level migration does not affect the structure of the data state bitmap. When the conventional RAID controller processes level migration, the data blocks are moved according to the change states of the data blocks on the stripes before and after migration, and new check data of the stripes are calculated. In the embodiment, the sub-stripe is taken as the minimum processing unit, and only the effective data is processed according to the sub-stripe state bit information, so that the data moving operation in the level migration process can be reduced.
For example, as shown in fig. 11, a migration flow chart for a single sub-stripe in this embodiment includes the following steps:
s1101, reading the states of all data blocks in the target sub-band;
s1102, judging whether data blocks with the state value of 2 exist in all the data blocks or not;
s1103, in the case where a data block whose status value is 2 exists in all the data blocks, a data block whose status value is 2 is migrated;
s1104, calculating a check block by using the migrated data block, and writing the check block into a disk;
s1105, judging whether a data block with a state value of 1 exists or not;
s1106, in the case that a data block with a state value of 1 exists, modifying the state value of the check block to be 1;
s1107, in the case where there is no data block whose status value is 1, the status value of the modified check block is 2.
In an exemplary embodiment, after receiving the target operation instruction sent by the host, the method further includes: under the condition that a disk is added in a disk array to obtain a sub-stripe after capacity expansion, reading the data block state and the check block state of a target sub-stripe; under the condition that the state value of the data block state of the target data block is a second preset value, migrating the data in the target data block to the sub-stripe after capacity expansion; and determining the verification state of the verification block in the sub-stripe after capacity expansion by using the data block state of the data block included in the sub-stripe after capacity expansion. In this embodiment, the capacity expansion operation needs to add new disk storage data, thus resulting in an increase in the number of data blocks in each sub-stripe, and this capacity expansion operation changes the structure of the data status bitmap. The capacity expansion operation enables the data to be rearranged on the RAID system, and according to the data bit state bitmap, the capacity expansion operation can only move useful data, IO operation in the capacity expansion operation process is reduced, and the capacity expansion operation efficiency is improved.
For example, as shown in fig. 12, a flow chart of the capacity expansion operation in this embodiment includes the following steps:
s1201, reading the state of a data block before capacity expansion;
s1202, judging whether a data block with a state value of 2 exists or not;
s1203, in the case where there is a data block whose state value is 2, migrating all the data blocks whose state value is 2;
s1204, calculating a check block by using the migrated data block, and writing the check block into a disk;
s1205, modifying the state of the sub-stripe data block after capacity expansion, setting the state value of the migrated data block as 2, and setting the state values of other data blocks as 1;
s1206, judging whether a data block with a state value of 1 exists;
s1207, when a data block with a state value of 1 exists, modifying the state value of a check block of the sub-stripe after capacity expansion to be 1;
s1208, in the case where there is no data block whose status value is 1, the status value of the check block of the sub-stripe after capacity expansion is modified to be 2.
In an exemplary embodiment, after receiving the target operation instruction sent by the host, the method further includes: when the target operation instruction is an operation instruction for checking the target sub-stripe, reading the data block states of all data blocks in the target sub-stripe; when the state value of the data block state of the target data block is a second preset value and the state value of the check state of the check block of the target sub-stripe is a fourth preset value, performing consistency check on the target sub-stripe by using the check block and all the data blocks in the target sub-stripe; and under the condition that the state value of the data block state of the target data block is a second preset value and the state value of the check state of the check block of the target sub-stripe is a third preset value, carrying out consistency check on the target sub-stripe by utilizing the data block of which the state value of the check block and the data block state is the second preset value. In this embodiment, according to the data bit status bitmap, the consistency check operation may only check the valid data, so as to reduce the IO operation in the process and improve the efficiency of consistency check.
For example, the consistency check operation takes a single sub-stripe as a minimum unit, as shown in fig. 13, and includes the following steps:
s1301, reading the states of all data blocks in the sub-stripe;
s1302, judging whether a data block with a state value of 2 exists or not;
s1303, when a data block with a state value of 2 exists, judging the state value of the check block;
s1304, in the case that the state value of the check block is 2, reading the check block and all data blocks from the disk to execute consistency check;
s1305, in the case that the state value of the check block is not 2, reading the check block and the data block with the state value of 2 from the disk to execute consistency check;
s1306, returning success or failure according to the actual verification result;
s1307 returns a check success in the case where there is no data block whose status value is 2.
In one exemplary embodiment, after performing a data operation on the target sub-stripe in response to the target operation instruction based on the target state information, the method further comprises: the data block state and the check block state are updated with data operations performed on the target sub-stripe.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiment also provides a data processing device in a disk array, which is used for implementing the foregoing embodiments and preferred implementations, and the description is omitted herein. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 14 is a block diagram of a data processing apparatus in a disk array according to an embodiment of the present application, as shown in FIG. 14, the apparatus including:
a first receiving module 1402, configured to receive a target operation instruction sent by a host, where the host is connected to a disk array controller, the disk array controller is connected to a disk array, and the disk array includes a plurality of disks, and the disks are used for storing data blocks;
a first reading module 1404, configured to read, based on a target operation instruction, target state information of a target sub-stripe from a data state bitmap, where the target sub-stripe is configured to store data in a disk array in blocks, the target state information includes a data block state and a check block state, the data block state is configured to indicate whether a data block in the target sub-stripe is used, and the check block state is configured to indicate a redundancy state of the target sub-stripe;
The first response module 1406 is configured to respond to the target operation instruction based on the target state information, and perform data processing on the target sub-stripe.
In an exemplary embodiment, the first reading module includes:
a first obtaining unit, configured to obtain a start position of a data block and a length of the data block included in the target operation instruction;
a first determining unit configured to determine the target subband using the data block start position and the data block length;
and the first reading unit is used for reading the target state information of the target sub-band from the data state bitmap.
In an exemplary embodiment, the first response module includes:
a second reading unit, configured to read a data block state of a target data block when the target operation instruction is an operation instruction for reading the target data block from the target sub-stripe, where the target data block is a data block of a plurality of data blocks in the target sub-stripe;
and the first response unit is used for responding to the target operation instruction and feeding back the information that the target data block is empty to the host when the state value of the data block state of the target data block is a first preset value, wherein the first preset value is used for indicating that the target data block is empty.
In an exemplary embodiment, the first response module includes:
a second reading unit, configured to read a data block state of a target data block when the target operation instruction is an operation instruction for reading the target data block from the target sub-stripe, where the target data block is a data block of a plurality of data blocks in the target sub-stripe;
a third reading unit, configured to read the check block state when the state value of the data block state of the target data block is a second preset value and the target data block is in an abnormal disk, where the check block state is used to indicate a state of a check block included in the target sub-stripe, and the second preset value is used to indicate that the target data block includes data;
a fourth reading unit, configured to read, when the state value of the state of the check block is a third preset value, data in the check block and data in a data block of which the state value in the target subband is the second preset value, where the data blocks of which the state value is the second preset value are all set in a normal disk, and the second preset value is used to indicate that the data blocks include data;
And a second response unit, configured to send, in response to the target operation instruction, data in the check block and data in a data block in which the state value in the target sub-stripe is the second preset value to the host.
In an exemplary embodiment, the above apparatus further includes:
the second reading module is used for reading the data in the check block and the data in the data block of the normal disk in the target sub-band under the condition that the state value of the check block state is a fourth preset value;
and the second response module is used for responding to the target operation instruction and sending the data in the check block and the data in the data block of the normal disk in the target sub-stripe to the host.
In an exemplary embodiment, the first response module includes:
a fifth reading unit configured to read the check block state when the target operation instruction is an operation instruction for writing the data into the target sub-stripe, where the check block state is used to indicate a state of a check block included in the target sub-stripe;
a sixth reading unit, configured to read a data block state of a target data block when the state value of the check block state is a third preset value, where the target data block is a data block of a plurality of data blocks in the target sub-stripe;
A seventh reading unit, configured to read other data blocks in the target sub-stripe when the state value of the state of the target data block is a first preset value, where the other data blocks are data blocks in the target sub-stripe other than the target data block, and the state value of the state of the data block of the other data blocks is a second preset value, where the first preset value is used to indicate that the target data block is empty, and the second preset value is used to indicate that the other data blocks include data;
and a third response unit, configured to update the data into the target sub-stripe by using the other data block in response to the target operation instruction.
In an exemplary embodiment, the above apparatus further includes:
and the third response module is used for responding to the target operation instruction and updating the data into the target sub-band by utilizing the number of the target data blocks when the state value of the check block state is a fourth preset value.
In an exemplary embodiment, the first response module includes:
an eighth reading unit configured to read the check block state when the target operation instruction is an operation instruction for writing the data into the target sub-stripe, where the check block state is used to represent a state of a check block included in the target sub-stripe;
A ninth reading unit, configured to read a data block state of the target data block when the target data block is in an abnormal disk and the state value of the check block state is a third preset value;
a tenth reading unit, configured to read data in the check block when a state value of a data block state of the target data block is a first preset value, where the first preset value is used to indicate that the target data block is empty;
and a fourth response unit for updating the check state of the check block by using the data in the check block and the data in response to the target operation instruction.
In an exemplary embodiment, the above apparatus further includes:
a third reading module, configured to read other data blocks in the target sub-stripe when the state value of the state of the target data block is a second preset value, where the other data blocks are data blocks in the target sub-stripe except the target data block, and the state value of the data block state of the other data blocks is a second preset value, where the second preset value is used to indicate that the other data blocks are not null;
and the fourth response module is used for responding to the target operation instruction and updating the data into the target sub-band by utilizing the other data blocks.
In an exemplary embodiment, the above apparatus further includes: and the first updating module is used for updating the target sub-stripe by using the data block when the target operation instruction is an operation instruction for writing the target data into the target sub-stripe and the target data block is in an abnormal disk after reading the check block state and the state value of the check block state is a fourth preset value.
In an exemplary embodiment, a fourth reading module is configured to, when the target operation instruction is an operation instruction for writing the target data into the target sub-stripe, read a data block state of the target data block after the check block state is read, where the target sub-stripe includes an abnormal disk and the target data block is in a normal disk;
a fifth reading module, configured to read data in the check block when a state value of a data block state of the target data block is a first preset value;
and the second updating module is used for updating the verification state of the verification block by utilizing the data in the verification block and the target data.
In an exemplary embodiment, the above apparatus further includes: a sixth reading module, configured to, when the target sub-stripe includes an abnormal disk and the target data block is in a normal disk, read other data blocks in the target sub-stripe when a state value of the target data block state is a second preset value after reading the data block state of the target data block, where the other data blocks are data blocks in the target sub-stripe other than the target data block, and the state value of the data block state of the other data blocks is the second preset value, where the second preset value is used to indicate that the other data blocks are not empty;
And a third updating module, configured to update the data into the target sub-band by using the other data blocks.
In an exemplary embodiment, the above apparatus further includes:
and a fourth updating module, configured to update the data into the target sub-stripe when the target operation instruction is an operation instruction for writing the target data into the target sub-stripe, after reading the check block state, and when the target sub-stripe includes an abnormal disk, the target data block is in a normal disk, and the state value of the check block state is a fourth preset value.
In an exemplary embodiment, the above apparatus further includes: a seventh reading module, configured to read, after receiving a target operation instruction sent by a host, a data block state of the target data block and a check block state of the target sub-stripe when the target operation instruction is a reconstruction target data block, where the target data block is a data block of a plurality of data blocks in the target sub-stripe;
an eighth reading module, configured to read other data blocks in the target sub-stripe when the state value of the data block state of the target data block is a second preset value and the state value of the check block state of the target data block is a third preset value, where the other data blocks are data blocks in the target sub-stripe other than the target data block, the state value of the data block state of the other data blocks is a second preset value, and the second preset value is used to indicate that the other data blocks are not null;
And the first writing module is used for calculating a reconstructed target data block by using the data in the other data blocks and the data in the check block of the target data block, and writing the data in the reconstructed target data block into the disk array.
In an exemplary embodiment, the above apparatus further includes:
a first determining module, configured to, when the target operation instruction is to reconstruct the target data block, read a data block state and a check block state of the target data block, and then, when a state value of the data block state of the target data block is a second preset value, a state value of the check block state of the target data block is a fourth preset value, and a state value of the data block state included in the target sub-stripe is the first preset value, redetermine the check data block of the target sub-stripe by using the other data blocks;
the first modification module is used for modifying the state value of the check state of the redetermined check data block into a third preset value.
In an exemplary embodiment, the above apparatus further includes: a ninth reading module, configured to, when the target operation instruction is to reconstruct the target data block, read a data block state and a check block state of the target data block, and then read all data blocks and check data blocks in the target sub-stripe when a state value of the data block state of the target data block is a second preset value, a state value of the check block state of the target data block is a fourth preset value, and state values of data block states of other data blocks in the target sub-stripe are both the second preset value;
And the second writing module is used for calculating a reconstructed target data block by using all the data blocks and the check data blocks in the target sub-band and writing the data in the reconstructed target data block into the disk array.
In an exemplary embodiment, the above apparatus further includes: the first migration module is configured to migrate the target data block to another sub-stripe for storage after receiving a target operation instruction sent by the host, where the target operation instruction is a data block in the target sub-stripe, and the target sub-stripe includes a target data block, and the target data block is a data block in which a state value of a state of the data block in the target sub-stripe is a second preset value;
the first calculation module is used for calculating the check data block of the target sub-stripe by using the target data block;
and the second modification module is used for modifying the check value of the check data block by using the other data blocks under the condition that the target sub-band comprises the other data blocks with the state values of the data block states being the first preset values.
In an exemplary embodiment, the above apparatus further includes: a tenth reading module, configured to, after receiving a target operation instruction sent by a host, increase a disk in the disk array, and read a data block state and a check block state of the target sub-stripe under a condition that the expanded sub-stripe is obtained;
The second migration module is used for migrating the data in the target data block into the expanded sub-stripe when the state value of the data block state of the target data block is a second preset value;
and the second determining module is used for determining the verification state of the verification block in the sub-stripe after the expansion by using the data block state of the data block included in the sub-stripe after the expansion.
In an exemplary embodiment, the above apparatus further includes: an eleventh reading module, configured to read a data block state of all data blocks in the target sub-stripe when the target operation instruction is an operation instruction for verifying the target sub-stripe after receiving the target operation instruction sent by the host;
the first checking module is used for performing consistency check on the target sub-stripe by using the check block and all the data blocks in the target sub-stripe when the state value of the data block state of the target data block is a second preset value and the state value of the check state of the check block of the target sub-stripe is a fourth preset value;
and the second checking module is used for carrying out consistency check on the target sub-stripe by utilizing the data blocks with the state values of the check blocks and the data block states being the second preset value when the state values of the data block states of the target data blocks are the second preset value and the state values of the check blocks of the target sub-stripe are the third preset value.
In an exemplary embodiment, the above apparatus further includes:
and a fifth updating module, configured to respond to the target operation instruction based on the target state information, and then update the data block state and the check block state by using the data operation performed on the target sub-stripe after performing the data operation on the target data.
In an exemplary embodiment, the above apparatus further includes:
the first obtaining module is configured to obtain states of a plurality of sub-stripes in the disk array before target state information of a target sub-stripe is read from a data state bitmap based on the target operation instruction, where one of the states of the sub-stripes includes a plurality of data block states and a check block state, where the plurality of data block states are used to represent states of a plurality of data blocks in the sub-stripe, and the check block state is used to represent states of check blocks in the sub-stripe;
the first generating module is configured to generate the data status bitmap by using the statuses of the plurality of sub-stripes, and buffer the data status bitmap.
In an exemplary embodiment, the above apparatus further includes:
and the first storage module is used for generating the data state bitmap by utilizing the states of the plurality of sub-stripes, caching the data state bitmap, and then storing the data state bitmap in a disk in the disk array when the disk array stops working, wherein the disk comprises a preset data area for storing the data state bitmap.
In an exemplary embodiment, the above apparatus further includes: and a twelfth reading module, configured to store the data status bitmap in a disk of the disk array when the disk array stops operating, and then read the data status bitmap from the preset data area when the disk array starts operating.
In an exemplary embodiment, the above apparatus further includes:
the first setting module is configured to set, before reading target state information of a target sub-stripe from a data state bitmap based on the target operation instruction, state values of data block states of a plurality of sub-stripes in the disk array to be first preset values and set state values of check block states of the plurality of sub-stripes to be third preset values when an initialization operation is performed on the disk array;
and the third modification module is used for modifying the state value of the data block state based on the instruction type of the target operation instruction after receiving the target operation instruction sent by the host.
And a fourth modification module, configured to modify the state value of the check block state based on the state value of the modified data block state.
According to still another embodiment of the present application, there is provided a disk array system including a host, a disk array controller, and a disk array, where the host is connected to the disk array controller, the disk array controller is connected to the disk array, the disk array includes a plurality of disks, the disks are used to store data blocks, and the disk array controller is used to perform the above steps.
An embodiment of the application further provides an electronic device, fig. 15 is a schematic diagram of an electronic device according to an embodiment of the application, as shown in fig. 15, comprising a memory and a processor, the memory storing a computer program, the processor being arranged to run the computer program to perform the steps of any of the method embodiments described above.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (28)

1. A method for processing data in a disk array, the method being applied to a disk array controller and comprising:
receiving a target operation instruction sent by a host, wherein the host is connected with the disk array controller, the disk array controller is connected with a disk array, the disk array comprises a plurality of disks, and the disks are used for storing data blocks;
reading target state information of a target sub-stripe from a data state bitmap based on the target operation instruction, wherein the target sub-stripe is used for storing data in a block mode in the disk array, the target state information comprises a data block state and a check block state, the data block state is used for indicating whether a data block in the target sub-stripe is used or not, and the check block state is used for indicating a redundancy state of the target sub-stripe;
And responding to the target operation instruction based on the target state information, and executing data processing on the target sub-band.
2. The method of claim 1, wherein reading target state information for a target sub-stripe from a data state bitmap based on the target operation instruction comprises:
acquiring a data block starting position and a data block length included in the target operation instruction;
determining the target sub-band by using the data block starting position and the data block length;
and reading the target state information of the target sub-band from the data state bitmap.
3. The method of claim 1, wherein performing data processing on the target sub-stripe in response to the target operation instruction based on the target state information comprises:
reading a data block state of a target data block when the target operation instruction is an operation instruction for reading the target data block from the target sub-stripe, wherein the target data block is a data block in a plurality of data blocks in the target sub-stripe;
and under the condition that the state value of the data block state of the target data block is a first preset value, responding to the target operation instruction, and feeding back information that the target data block is empty to the host, wherein the first preset value is used for indicating that the target data block is empty.
4. The method of claim 1, wherein performing data processing on the target sub-stripe in response to the target operation instruction based on the target state information comprises:
reading a data block state of a target data block when the target operation instruction is an operation instruction for reading the target data block from the target sub-stripe, wherein the target data block is a data block in a plurality of data blocks in the target sub-stripe;
reading the check block state when the state value of the data block state of the target data block is a second preset value and the target data block is in an abnormal disk, wherein the check block state is used for indicating the state of a check block included in the target sub-stripe, and the second preset value is used for indicating that the target data block includes data;
reading data in the check block and data in a data block with a state value of a second preset value in the target sub-band under the condition that the state value of the check block state is a third preset value, wherein the data block with the state value of the second preset value is arranged in a normal disk, and the second preset value is used for indicating that the data block comprises data;
And responding to the target operation instruction, and sending the data in the check block and the data in the data block with the state value of the second preset value in the target sub-band to the host.
5. The method according to claim 4, wherein the method further comprises:
reading data in the check block and data in a data block of a normal disk in the target sub-stripe under the condition that the state value of the check block state is a fourth preset value;
and responding to the target operation instruction, and sending the data in the check block and the data in the data block of the normal disk in the target sub-stripe to the host.
6. The method of claim 1, wherein performing data processing on the target sub-stripe in response to the target operation instruction based on the target state information comprises:
reading the check block state when the target operation instruction is an operation instruction for writing the data into the target sub-stripe, wherein the check block state is used for representing the state of a check block included in the target sub-stripe;
reading the data block state of a target data block under the condition that the state value of the check block state is a third preset value, wherein the target data block is a data block in a plurality of data blocks in the target sub-band;
Reading other data blocks in the target sub-stripe under the condition that the state value of the state of the target data block is a first preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, the state value of the state of the data block of the other data blocks is a second preset value, the first preset value is used for indicating that the target data block is empty, and the second preset value is used for indicating that the other data blocks comprise data;
and responding to the target operation instruction, and updating the data into the target sub-band by utilizing the other data blocks.
7. The method of claim 6, wherein the method further comprises:
and in the case that the state value of the check block state is a fourth preset value, responding to the target operation instruction, and updating the data into the target sub-band by utilizing the number of the target data blocks.
8. The method of claim 1, wherein performing data processing on the target sub-stripe in response to the target operation instruction based on the target state information comprises:
reading the check block state when the target operation instruction is an operation instruction for writing the data into the target sub-stripe, wherein the check block state is used for representing the state of a check block included in the target sub-stripe;
Reading the data block state of the target data block under the condition that the target data block is in an abnormal magnetic disk and the state value of the check block state is a third preset value;
reading data in the check block under the condition that a state value of a data block state of the target data block is a first preset value, wherein the first preset value is used for indicating that the target data block is empty;
and responding to the target operation instruction, and updating the verification state of the verification block by utilizing the data in the verification block and the data.
9. The method of claim 8, wherein the method further comprises:
reading other data blocks in the target sub-stripe when the state value of the target data block state is a second preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, and the state value of the data block state of the other data blocks is the second preset value, and the second preset value is used for indicating that the other data blocks are not empty;
and responding to the target operation instruction, and updating the data into the target sub-band by utilizing the other data blocks.
10. The method of claim 8, wherein, when the target operation instruction is an operation instruction to write the target data into the target sub-stripe, after reading the check block state, the method further comprises:
and under the condition that the target data block is in an abnormal disk and the state value of the check block state is a fourth preset value, updating the target sub-stripe by using the data block.
11. The method of claim 8, wherein after reading the check block status when the target operation instruction is an operation instruction to write the data into the target sub-stripe, the method further comprises:
reading a data block state of the data block under the condition that the target sub-stripe comprises an abnormal disk and the data block is in a normal disk;
reading data in the check block under the condition that the state value of the data block state of the target data block is a first preset value;
and updating the verification state of the verification block by utilizing the data in the verification block and the target data.
12. The method of claim 11, wherein, in the case where the target sub-stripe includes an abnormal disk and the target data block is in a normal disk, after reading the data block state of the target data block, the method further comprises:
Reading other data blocks in the target sub-stripe when the state value of the target data block state is a second preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, and the state value of the data block state of the other data blocks is the second preset value, and the second preset value is used for indicating that the other data blocks are not empty;
and updating the data into the target sub-band by using the other data blocks.
13. The method of claim 8, wherein after reading the check block status when the target operation instruction is an operation instruction to write the data into the target sub-stripe, the method further comprises:
and updating the data into the target sub-stripe under the condition that the target sub-stripe comprises an abnormal disk, the target data block is in a normal disk and the state value of the check block state is a fourth preset value.
14. The method of claim 1, wherein after receiving the target operation instruction sent by the host, the method further comprises:
when the target operation instruction is to reconstruct a target data block, reading a data block state of the target data block and a check block state of the target sub-stripe, wherein the target data block is a data block in a plurality of data blocks in the target sub-stripe;
Reading other data blocks in the target sub-stripe when the state value of the data block state of the target data block is a second preset value and the state value of the check block state of the target data block is a third preset value, wherein the other data blocks are data blocks except the target data block in the target sub-stripe, the state value of the data block state of the other data blocks is a second preset value, and the second preset value is used for indicating that the other data blocks are not null;
and calculating a reconstructed target data block by utilizing the data in the other data blocks and the data in the check block of the target data block, and writing the data in the reconstructed target data block into the disk array.
15. The method of claim 14, wherein the target operation instruction, when reconstructing the target data block, reads a data block state and a check block state of the target data block, the method further comprising:
when the state value of the data block state of the target data block is a second preset value, the state value of the check block state of the target data block is a fourth preset value, and the state value of the data block state included in the target sub-stripe is a first preset value, the check data block of the target sub-stripe is redetermined by utilizing the other data blocks;
And modifying the state value of the check state of the redetermined check data block into a third preset value.
16. The method of claim 14, wherein the target operation instruction, when reconstructing the target data block, reads a data block state and a check block state of the target data block, the method further comprising:
reading all data blocks and check data blocks in the target sub-stripe when the state value of the data block state of the target data block is a second preset value, the state value of the check block state of the target data block is a fourth preset value, and the state values of the data block states of other data blocks in the target sub-stripe are all the second preset values;
and calculating a reconstructed target data block by using all the data blocks and the check data blocks in the target sub-stripe, and writing the data in the reconstructed target data block into the disk array.
17. The method of claim 1, wherein after receiving the target operation instruction sent by the host, the method further comprises:
under the condition that the target operation instruction is to migrate the data block in the target sub-stripe and the target sub-stripe comprises the target data block, migrating the target data block to other sub-stripes for storage, wherein the target data block is a data block with a state value of a data block state in the target sub-stripe being a second preset value;
Calculating a check data block of the target sub-stripe by using the target data block;
and under the condition that the target sub-stripe comprises other data blocks with the state values of the data block states being the first preset values, modifying the check values of the check data blocks by using the other data blocks.
18. The method of claim 1, wherein after receiving the target operation instruction sent by the host, the method further comprises:
under the condition that a disk is added in the disk array to obtain the sub-stripe after capacity expansion, reading the data block state and the check block state of the target sub-stripe;
under the condition that the state value of the data block state of the target data block is a second preset value, migrating the data in the target data block to the expanded sub-stripe;
and determining the verification state of the verification block in the sub-stripe after the expansion by using the data block state of the data block included in the sub-stripe after the expansion.
19. The method of claim 1, wherein after receiving the target operation instruction sent by the host, the method further comprises:
when the target operation instruction is an operation instruction for checking the target sub-stripe, reading the data block states of all data blocks in the target sub-stripe;
When the state value of the data block state of the target data block is a second preset value and the state value of the check state of the check block of the target sub-stripe is a fourth preset value, performing consistency check on the target sub-stripe by using the check block and all the data blocks in the target sub-stripe;
and under the condition that the state value of the data block state of the target data block is a second preset value and the state value of the check state of the check block of the target sub-stripe is a third preset value, carrying out consistency check on the target sub-stripe by utilizing the data block of which the state value of the check block and the data block state is the second preset value.
20. The method of claim 1, wherein after performing a data operation on the target sub-stripe in response to the target operation instruction based on the target state information, the method further comprises:
and updating the data block state and the check block state by using the data operation performed on the target sub-band.
21. The method of claim 1, wherein prior to reading target state information for a target sub-stripe from a data state bitmap based on the target operation instruction, the method further comprises:
Acquiring states of a plurality of sub-stripes in the disk array, wherein the states of one sub-stripe comprise a plurality of data block states and a check block state, the plurality of data block states are used for representing the states of a plurality of data blocks in the sub-stripe, and the check block state is used for representing the states of check blocks in the sub-stripe;
generating the data state bitmap by using the states of the sub-stripes, and caching the data state bitmap.
22. The method of claim 21, wherein after generating the data state bitmap using the states of the plurality of sub-stripes and caching the data state bitmap, the method further comprises:
and when the disk array stops working, storing the data state bitmap into a disk in the disk array, wherein the disk comprises a preset data area for storing the data state bitmap.
23. The method of claim 22, wherein after storing the data state bitmap in a disk in the disk array while the disk array is inactive, the method further comprises:
and when the disk array is started to work, reading the data state bitmap from the preset data area.
24. The method of claim 1, wherein prior to reading target state information for a target sub-stripe from a data state bitmap based on the target operation instruction, the method further comprises:
when the initialization operation is executed on the disk array, setting the state values of the data block states of a plurality of sub-stripes in the disk array as first preset values, and setting the state values of the check block states of a plurality of sub-stripes as third preset values;
after receiving the target operation instruction sent by the host, modifying a state value of the data block state based on an instruction type of the target operation instruction;
modifying the state value of the check block state based on the state value of the modified data block state.
25. A data processing apparatus in a disk array, comprising:
the first receiving module is used for receiving a target operation instruction sent by a host, wherein the host is connected with the disk array controller, the disk array controller is connected with the disk array, the disk array comprises a plurality of disks, and the disks are used for storing data blocks;
the first reading module is used for reading target state information of a target sub-stripe from a data state bitmap based on the target operation instruction, wherein the target sub-stripe is used for storing data in a block mode in the disk array, the target state information comprises a data block state and a check block state, the data block state is used for indicating whether a data block in the target sub-stripe is used or not, and the check block state is used for indicating a redundancy state of the target sub-stripe;
And the first response module is used for responding to the target operation instruction based on the target state information and executing data processing on the target sub-band.
26. A disk array system comprising a host, a disk array controller and a disk array, wherein the host is coupled to the disk array controller, the disk array controller is coupled to a disk array, the disk array comprises a plurality of disks for storing blocks of data, and the disk array controller is configured to perform the steps of the method of any one of claims 1 to 24.
27. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program, when being executed by a processor, implements the steps of the method according to any of the claims 1 to 24.
28. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 24 when the computer program is executed.
CN202311030383.2A 2023-08-16 2023-08-16 Data processing method and device in disk array, storage medium and electronic equipment Active CN116795295B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311030383.2A CN116795295B (en) 2023-08-16 2023-08-16 Data processing method and device in disk array, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311030383.2A CN116795295B (en) 2023-08-16 2023-08-16 Data processing method and device in disk array, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN116795295A true CN116795295A (en) 2023-09-22
CN116795295B CN116795295B (en) 2023-11-17

Family

ID=88043911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311030383.2A Active CN116795295B (en) 2023-08-16 2023-08-16 Data processing method and device in disk array, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116795295B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149094A (en) * 2023-10-30 2023-12-01 苏州元脑智能科技有限公司 Method and device for determining data area state, disk array and storage system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5581690A (en) * 1993-06-29 1996-12-03 Digital Equipment Corporation Method and apparatus for preventing the use of corrupt data in a multiple disk raid organized storage system
CN101546249A (en) * 2008-03-26 2009-09-30 中兴通讯股份有限公司 On-line capacity expansion method for disk arrays
CN101566924A (en) * 2008-04-23 2009-10-28 中兴通讯股份有限公司 Data read-write method of disk array
WO2014010077A1 (en) * 2012-07-13 2014-01-16 富士通株式会社 Disk array control device, disk array control method, and disk array control program
CN105302492A (en) * 2015-11-18 2016-02-03 浙江大华技术股份有限公司 RAID reconstruction method and device
CN107885620A (en) * 2017-11-22 2018-04-06 华中科技大学 A kind of method and system for improving Solid-state disc array Performance And Reliability
CN112783689A (en) * 2021-02-08 2021-05-11 上海交通大学 Partial stripe write optimization method and device based on LRC coding
CN115202575A (en) * 2022-06-22 2022-10-18 联想(北京)有限公司 Data processing method and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5581690A (en) * 1993-06-29 1996-12-03 Digital Equipment Corporation Method and apparatus for preventing the use of corrupt data in a multiple disk raid organized storage system
CN101546249A (en) * 2008-03-26 2009-09-30 中兴通讯股份有限公司 On-line capacity expansion method for disk arrays
CN101566924A (en) * 2008-04-23 2009-10-28 中兴通讯股份有限公司 Data read-write method of disk array
WO2014010077A1 (en) * 2012-07-13 2014-01-16 富士通株式会社 Disk array control device, disk array control method, and disk array control program
CN105302492A (en) * 2015-11-18 2016-02-03 浙江大华技术股份有限公司 RAID reconstruction method and device
CN107885620A (en) * 2017-11-22 2018-04-06 华中科技大学 A kind of method and system for improving Solid-state disc array Performance And Reliability
CN112783689A (en) * 2021-02-08 2021-05-11 上海交通大学 Partial stripe write optimization method and device based on LRC coding
CN115202575A (en) * 2022-06-22 2022-10-18 联想(北京)有限公司 Data processing method and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149094A (en) * 2023-10-30 2023-12-01 苏州元脑智能科技有限公司 Method and device for determining data area state, disk array and storage system
CN117149094B (en) * 2023-10-30 2024-02-09 苏州元脑智能科技有限公司 Method and device for determining data area state, disk array and storage system

Also Published As

Publication number Publication date
CN116795295B (en) 2023-11-17

Similar Documents

Publication Publication Date Title
US10606491B2 (en) Providing redundancy in a virtualized storage system for a computer system
US9910748B2 (en) Rebuilding process for storage array
CN110531940B (en) Video file processing method and device
US10365983B1 (en) Repairing raid systems at per-stripe granularity
US8209587B1 (en) System and method for eliminating zeroing of disk drives in RAID arrays
EP3617867B1 (en) Fragment management method and fragment management apparatus
CN107526535B (en) Method and system for managing storage system
EP2942713A1 (en) Storage system and storage apparatus
CN110096219B (en) Effective capacity of a pool of drive zones generated from a group of drives
CN111433746A (en) Reconstruction assistant using failed storage devices
CN111344679B (en) Method and system for enhancing machine learning of redundant array of independent disks reconstruction
JP2014174992A (en) System, method and computer-readable medium for managing cache store to achieve improved cache ramp-up across system reboots
CN110383251B (en) Storage system, computer-readable recording medium, and method for controlling system
CN116795295B (en) Data processing method and device in disk array, storage medium and electronic equipment
JP4884721B2 (en) Storage system and storage control method that do not require storage device format
JP7472341B2 (en) STORAGE SYSTEM AND METHOD FOR CONTROLLING STORAGE SYSTEM - Patent application
US7346733B2 (en) Storage apparatus, system and method using a plurality of object-based storage devices
CN112513804A (en) Data processing method and device
CN111124262A (en) Management method, apparatus and computer readable medium for Redundant Array of Independent Disks (RAID)
CN116974458A (en) Method, electronic device and computer program product for processing data
CN102789370A (en) Method and device for synchronizing redundant array of independent disks (RAID)
CN111857540A (en) Data access method, device and computer program product
US11487428B2 (en) Storage control apparatus and storage control method
US8418029B2 (en) Storage control device and storage control method
CN116204137B (en) Distributed storage system, control method, device and equipment based on DPU

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant