CN115543215B - Data writing operation and data reading operation method and device - Google Patents

Data writing operation and data reading operation method and device Download PDF

Info

Publication number
CN115543215B
CN115543215B CN202211498264.5A CN202211498264A CN115543215B CN 115543215 B CN115543215 B CN 115543215B CN 202211498264 A CN202211498264 A CN 202211498264A CN 115543215 B CN115543215 B CN 115543215B
Authority
CN
China
Prior art keywords
data
block
failed
check
blocks
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.)
Active
Application number
CN202211498264.5A
Other languages
Chinese (zh)
Other versions
CN115543215A (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 CN202211498264.5A priority Critical patent/CN115543215B/en
Publication of CN115543215A publication Critical patent/CN115543215A/en
Application granted granted Critical
Publication of CN115543215B publication Critical patent/CN115543215B/en
Priority to PCT/CN2023/114975 priority patent/WO2024113986A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • 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

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The application relates to a data writing operation method, a data reading operation method, a data writing operation device, a data reading and writing operation system, computer equipment and a storage medium. The method comprises the following steps: when a block to be subjected to data writing operation in the stripe is one, starting monitoring the data writing operation duration of the block, and defining the block as a target block; when the data write operation duration of the target block exceeds the preset data write operation duration, acquiring the block attribute of the target block; based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the total number of the blocks in the stripe, of which the data write operation fails; when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation.

Description

Data writing operation and data reading operation method and device
Technical Field
The present application relates to the field of magnetic disk and information storage technologies, and in particular, to a data write operation method, a data read operation method, a data write operation device, a data read/write operation system, a computer device, and a storage medium.
Background
In a storage system based on redundant arrays of independent disks, data of logical blocks in a logical storage space is compressed and stored in a physical storage space, the physical storage space is divided into a plurality of stripes, each stripe includes a plurality of partitions, specifically, a data block and a check block, the data block is used for storing the compressed data of the logical block, the check block is used for storing check information for the data stored in the data block, and one data block may store the data in one or more logical blocks.
In an actual application scenario, during the data writing operation performed on the partition in the stripe, a case of data writing operation failure is often encountered. Based on the prior technical scheme, once the data writing operation of the blocks in the band is monitored to fail, the data writing of the data in the current band is immediately stopped; or, repeating and continuously executing the data writing operation on the block until the data writing operation of the block is successful. The data writing operation method based on the data writing operation method can occupy a large amount of storage system resources, and can cause low data writing operation efficiency.
Therefore, it is urgently needed to provide a data writing operation, a data reading operation method, a data reading operation device, a data reading and writing operation system, a computer device, and a storage medium, which can effectively solve the above technical problems.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a data writing operation, a data reading operation method, a data reading operation device, a data reading/writing operation system, a computer device, and a storage medium, which can improve the efficiency of data writing operation and the accuracy of data reading of a storage system.
In one aspect, a data write operation method is provided, and the method is applied to data write operation of a block in a stripe, and includes:
when a block to be subjected to data writing operation in the stripe is one, starting monitoring the data writing operation duration of the block, and defining the block as a target block;
when the data writing operation duration of the target block exceeds the preset data writing operation duration, acquiring the block attribute of the target block;
based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the total number of the blocks in the stripe, of which the data write operation fails;
when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation.
In one embodiment, the obtaining, based on the block attribute of the target block and according to a preset total number calculation rule of the blocks in which the data write operation fails, the total number of the blocks in the stripe in which the data write operation fails includes: dividing the target block into a data block or a check block based on the block attribute of the target block; when the target block is a data block, acquiring the total number of check blocks in which data write operation in the stripe fails; and when the target block is a check block, acquiring the check block in which the data write operation in the stripe except the target block fails, and the total number of the data blocks in the stripe in which the data write operation fails and the blocks to be checked are checked.
In one embodiment, when the total number of blocks in the stripe in which the write operation fails is less than a preset value, terminating the data write operation includes: when the target block is a data block and the total number of check blocks in the stripe, which fail in data write operation, is less than 2, terminating the data write operation; and when the target block is a check block, and the total number of the check blocks which fail in the data writing operation except the target block in the stripe and the data writing operation in the stripe fails and the data blocks to be checked by the check block is less than 2, terminating the data writing operation.
In one embodiment, when a block to be subjected to a data write operation in the stripe is one, the method includes: acquiring the number of pointer variables in a preset pointer variable linked list; and when the number of the pointer variables in the preset pointer variable linked list is one, the number of the blocks to be subjected to the data writing operation in the strip is one.
In one embodiment, the method further comprises: generating the preset pointer variable linked list; generating the preset pointer variable linked list, including: responding to a data write operation request, acquiring a target data block and a check block of a stripe where the target data block is located; acquiring a block information structure of the target data block and the check block; based on the block information structure, acquiring a logic address of a storage data write operation timeout structure, wherein the block information structure comprises a data write operation timeout structure; declaring a logic address of the data writing operation timeout structure body and generating a pointer variable; and generating the preset pointer variable linked list based on the pointer variable.
In one embodiment, after responding to the data write operation request, the method further comprises: executing data writing operation on the target data block; performing a data write operation on the target data block includes: acquiring a target data block and data to be written in the target data block; and executing data writing operation based on the target data block and the data to be written, and writing the data to be written into the target data block.
In one embodiment, after the data write operation, the method further comprises: performing data writing operation on the check block of the stripe where the target data block is located; performing a data write operation on the parity block of the stripe in which the target data block is located, including: acquiring current data of the target data block and data to be written in the target data block; performing exclusive-or operation on the current data and the data to be written to obtain an intermediate check value; acquiring current data of a check block of a stripe where the target data block is located; performing exclusive-or processing on the current data of the check block and the intermediate check value to obtain data to be written in the check block, wherein the check block comprises a first check block and a second check block; and executing data writing operation based on the data to be written of the check block, and writing the data to be written into the check block.
In one embodiment, after performing a data write operation on the target data block and/or after performing a data write operation on a parity block of a stripe where the target data block is located, the method further includes: when the data write operation is completed, acquiring the number of pointer variables in the pointer variable linked list, wherein the data write operation completion comprises data write operation failure and data write operation success; and if the number of the pointer variables is not less than 2, deleting the pointer variables corresponding to the target data block or the check block from the preset pointer variable linked list, and updating the pointer variable linked list.
In one embodiment, the method further comprises: acquiring the data write operation state of the blocks in the stripe; acquiring the data writing operation duration of the blocks; and when the data writing operation duration of the block does not exceed the preset data writing operation duration, updating the writing operation early completion state in the block information structure of the block to be true.
In one embodiment, when the data write operation status of the block is obtained, the method further includes: when the data writing operation duration of the block exceeds the preset data writing operation duration, judging whether at least one verification block with successful data writing operation exists in the strip where the block is located; if yes, updating the write operation early completion state in the block information structure of the block to be true; and if the current block does not exist, updating the checking state of the block to be checked in the block information structure body of the block to be true.
In one embodiment, the method further comprises: when the data writing operation of the check block is successful, traversing the data block of the strip where the check block is located, wherein the number of the check blocks is at least one; judging whether a data block with a true check state of a block to be checked exists in the strip; and if the data block exists, acquiring the data to be written in the data block based on the check block, and performing data writing operation on the data block.
In one embodiment, based on the check block, data to be written into the data block is obtained, and after data write operation is performed on the data block, the method further includes: and updating the write operation early completion state in the block information structure of the data block to be true.
In one embodiment, the method further comprises: initializing the state attribute of a block structure of a block in a strip; initializing a block structure state attribute of a block in a stripe, comprising: acquiring a partitioned structural body of the partitions in the strip, wherein the partitioned structural body of the partitions comprises the steps of completing write operation in advance and overtime check and write operation of a block to be checked; and initializing the write operation advanced completion state of the blocks and the checking state of the block to be checked to be false.
In one embodiment, the method comprises: monitoring the data writing operation rate of the blocks in the strip; monitoring a data write operation rate of a partition in the stripe, including: generating a block write operation success counter in advance; initializing the count value of the block write operation success counter to be 0; and when the early completion state of the write operation in the block information structure for updating the blocks is true, adding 1 to the count value of the block write operation success counter.
In one embodiment, monitoring the data writing operation rate of the blocks in the stripe further comprises: responding to the data writing request operation, starting the counting time monitoring of the block writing operation success counter until the counting value of the block writing operation success counter is equal to a first preset value; acquiring the counting duration of the block write operation success counter; and when the counting duration of the block write operation success counter is not greater than a second preset value, judging that the data write operation rate of the stripe blocks is normal.
In another aspect, a data read operation method is provided, where the method is used to perform a read operation on data of a partition in a stripe, where the data of the partition in the stripe is written based on the data write operation method, the partition includes a parity block and a data block, the parity block includes a first parity block and a second parity block, and the method includes: acquiring a block in which data write operation fails in the stripe, and defining the block as a failed block, wherein the number of the failed blocks is at most two; reconstructing the data of the failed blocks according to a preset failed block data calculation rule; and after the data reconstruction of the failed sub-block is completed, executing data reading operation on the failed sub-block.
In one embodiment, reconstructing data of a failed block according to a preset failed block data calculation rule includes: acquiring the distribution condition of the partition types of the failed partitions; the distribution condition of the partition types of the failed partitions comprises the following steps: the number of the failed blocks is one, and the failed blocks comprise failed data blocks or failed check blocks; and the number of the failed blocks is two, the failed blocks comprise two failed data blocks, or the failed blocks comprise one failed data block and one failed check block.
In one embodiment, when the failed block includes a parity block, the method further includes: acquiring the block type of the check block; when the blocking type of the check block is a first check block, defining the first check block as a first failed check block; and when the blocking type of the failed blocking is a second check block, defining the second check block as a second failed check block.
In one embodiment, when the number of failed blocks is one and the failed blocks are failed check blocks, the method further includes: when the block type of the failed block is a first failed check block, performing exclusive-or operation on the data of each data block in the stripe to reconstruct the data of the first failed check block: and when the block type of the failed block is a second failed check block, performing exclusive-or operation on the data of each data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
In one embodiment, when the number of failed blocks is one and the failed blocks are failed data blocks, the method further includes: performing exclusive or operation on the data of the data blocks except the failed data block in the stripe to obtain a first operation value; and performing exclusive-nor operation on the first operation value and the data of the first check block in the strip to reconstruct the data of the failed data block.
In one embodiment, when the number of failed blocks is two, and the failed blocks are two failed data blocks, the method includes: performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a first operation value; performing an exclusive-or operation on the first operation value and the data of the first check block in the strip to obtain a second operation value, wherein the second operation value is an exclusive-or operation result of the data of the two failed data blocks; performing exclusive-or operation on the first operation value and data of a first check block in the strip to obtain a third operation value; performing an exclusive-or operation on the third operation value and the data of the second check block in the strip to obtain a fourth operation value, wherein the fourth operation value is an exclusive-or operation result of the data of the two failed data blocks; reconstructing data of the failed data block based on the third and fourth operation values.
In one embodiment, when the number of failed blocks is two, and the failed blocks are one failed data block and one failed check block, the method further includes: when the failed check block is a first failed check block, performing exclusive-or operation on data of data blocks in the stripe except the failed data block to obtain a fifth operation value, wherein the fifth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; performing an exclusive-or operation on the fifth operation value and the data of the second check block based on the fifth operation value to obtain a sixth operation value, wherein the sixth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; reconstructing data of the failed data block and the first failed check block based on the fifth operation value and the sixth operation value.
In one embodiment, when the number of failed blocks is two, and the failed blocks are one failed data block and one failed check block, the method further includes: when the failed check block is a second failed check block, performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a seventh operation value; performing an exclusive-nor operation on the seventh operation value and the data of the first check block based on the seventh operation value to reconstruct the data of the failed data block; and performing exclusive-or operation on the data of the data block including the failed data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
In still another aspect, there is provided a data write operation apparatus for data write operation of a partition in a stripe, the apparatus including:
the monitoring starting unit is used for starting the monitoring of the data writing operation duration of the block when the block to be subjected to the data writing operation in the strip is one, and defining the block as a target block;
a first obtaining unit, configured to obtain a block attribute of the target block when a data write operation duration of the target block exceeds a preset data write operation duration; the data writing operation failure block counting module is further used for obtaining the total number of the blocks with data writing operation failure in the strip according to a preset data writing operation failure block counting rule based on the block attribute of the target block;
the write operation unit is used for terminating the data write operation when the total number of the blocks in which the data write operation in the strip fails is less than a preset value; otherwise, continuing to execute the data writing operation.
In another aspect, a data read operation apparatus is provided, where the data read operation apparatus is configured to perform a read operation on data partitioned in a stripe, and the data partitioned in the stripe is written based on the data write operation apparatus, and the apparatus includes:
a second obtaining unit, configured to obtain a chunk in the stripe where a data write operation fails, and define the chunk as a failed chunk, where the failed chunk is at most two;
the reconstruction unit is used for reconstructing the data of the failed sub-blocks according to a preset failed sub-block data calculation rule;
and the read operation unit is used for executing data read operation on the failed blocks after the reconstruction of the data of the failed blocks is completed.
In another aspect, a data read/write operation system is provided, which includes a data read operation device and a data write operation device.
In another aspect, a computer device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
when a block to be subjected to data writing operation in the stripe is one, starting monitoring the data writing operation duration of the block, and defining the block as a target block;
when the data writing operation duration of the target block exceeds the preset data writing operation duration, acquiring the block attribute of the target block;
based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the total number of the blocks in the stripe, of which the data write operation fails;
when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation.
In yet another aspect, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, performs the steps of:
when a block to be subjected to data writing operation in the stripe is one, starting monitoring the data writing operation duration of the block, and defining the block as a target block;
when the data writing operation duration of the target block exceeds the preset data writing operation duration, acquiring the block attribute of the target block;
based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the data write operation failure block total number in the strip;
when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation.
The data writing operation method, the data reading operation device, the data reading and writing operation system, the computer device and the storage medium are applied to data writing operation of blocks in a stripe, and the method comprises the following steps: when a block to be subjected to data writing operation in the stripe is one, starting monitoring the data writing operation duration of the block, and defining the block as a target block; when the data writing operation duration of the target block exceeds the preset data writing operation duration, acquiring the block attribute of the target block; based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the total number of the blocks in the stripe, of which the data write operation fails; when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation. The method comprises the steps of executing data writing operation on blocks in a strip based on the data writing operation method, determining whether the current data writing operation can be terminated or not based on the block attribute and the total number of the blocks of the data writing operation failure blocks, and terminating the data writing operation when a preset data writing operation termination condition is met; on the premise of not reducing the accuracy of the partitioned data, the efficiency of data writing operation of the storage system can be improved, and the storage performance of the system can be effectively improved;
further, a data read operation method of performing a data read operation on data written into a block based on the above data write operation method, the method includes: acquiring a block in which data write operation fails in the stripe, and defining the block as a failed block, wherein the number of the failed blocks is at most two; reconstructing the data of the failed blocks according to a preset failed block data calculation rule; and after the data reconstruction of the failed sub-block is completed, executing data reading operation on the failed sub-block. Reconstructing the data of the failed sub-blocks according to a preset data reading operation method and then executing data reading operation corresponding to the sub-block attributes and the total number of the sub-blocks of the failed sub-blocks; on one hand, the accuracy of the reconstructed data can be ensured, and on the other hand, the efficiency of data reading operation can be improved.
Drawings
FIG. 1 is a diagram of an exemplary implementation of a data write operation and a data read operation;
FIG. 2 is a flow diagram illustrating a method for data write operations in one embodiment;
FIG. 3 is a flow diagram illustrating a method for data read operations in one embodiment;
FIG. 4 is a block diagram showing the structure of a data write operation apparatus according to an embodiment;
FIG. 5 is a block diagram of an embodiment of a data read operation device;
FIG. 6 is a block diagram of an embodiment of a data read/write operating system;
FIG. 7 is a diagram of the internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The data write operation method is applied to data write operation of blocks of a RAID6 disk array; the data writing operation method can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. A user inputs a data write operation request through the terminal 102, and the server 104 receives the data write operation request sent by the terminal 102 and performs data write operation on blocks in a stripe. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers. Taking the application of the method to the server 104 in fig. 1 as an example, the method is shown in fig. 2, and the method includes:
when the block to be subjected to data writing operation in the stripe is one, starting data writing operation duration monitoring on the block, and defining the block as a target block;
when the data write operation duration of the target block exceeds the preset data write operation duration, acquiring the block attribute of the target block;
based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the total number of the blocks in the stripe, of which the data write operation fails;
when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation.
Specifically, when a block to be subjected to a data write operation in the stripe is one, the block is defined as a target block and is marked as lastipk.
It is to be understood that there may be concurrent operations of multiple threads during the execution of a data write operation on a RAID6 disk array partition; that is, the data write operation of the data block, the first parity block and the second parity block in the RAID6 disk array is not necessarily completed in order. When data writing operation is further performed on the blocks, data to be written in the data blocks are generated in advance, data of the first check block and data of the second check block can be generated based on the data to be written in the data blocks, data writing operation is performed on the blocks after the data are generated, and data writing operation is performed on the blocks in the data writing operation process because multithreading concurrent writing operation is involved, the data are not necessarily written in the sequence of data writing operation of the first data block and the second check block.
In one embodiment, the obtaining, based on the partition attribute of the target partition and according to a preset data write operation failure partition total number calculation rule, the total number of partitions in which the data write operation in the stripe fails includes: dividing the target blocks into data blocks or check blocks based on the block attributes of the target blocks; when the target block is a data block, acquiring the total number of check blocks in which data write operation in the stripe fails; and when the target block is a check block, acquiring the check block in the stripe, except for the target block, of which the data write operation fails, and the total number of data blocks in the stripe, of which the data write operation fails and the blocks to be checked are to be checked. And the check block which fails in the data writing operation except the target block is 0 or 1. Specifically, when the target block is a data block, acquiring the total number of check blocks in the stripe, where the data write operation fails, and recording the total number as faildnems; and when the target block is a check block, acquiring the check block in which the data writing operation in the band except the target block fails, and recording the total number of the data blocks in the band, which are subjected to the data writing operation failure and are checked by the block to be checked, as failednums.
In one embodiment, when the total number of blocks in the stripe in which the write operation fails is less than a preset value, terminating the data write operation includes: when the target block is a data block and the total number of check blocks in the stripe, which fail in data write operation, is less than 2, terminating the data write operation; and when the target block is a check block, and the total number of the check blocks which fail in the data writing operation except the target block in the stripe and the data writing operation in the stripe fails and the data blocks to be checked by the check block is less than 2, terminating the data writing operation.
That is, when the target partition is a data block and failednums < 2, the data write operation on the lastipk may be terminated; when the target block is a parity block and faildnems < 2, the data write operation to lastipk may be terminated. It should be understood that the failednums is an integer not less than 0. It should be understood that the reason for ensuring that the data write operation to lastipk is terminated only when failednums < 2 is to ensure that the number of the partitions in a stripe where the data write operation fails cannot exceed 2 at most, so as to ensure that the data of the partitions in the stripe where the data write operation fails can be reconstructed from the data of other partitions in the stripe, thereby ensuring the accuracy of the data.
When the target block is a check block, and the total number of the check blocks in the stripe, which have failed in data write operation except the target block, and the data blocks in the stripe, which have failed in data write operation and are to be checked by the check block, is less than 2, the data write operation is terminated, including two cases; one of the cases is that the number of the parity chunks and the number of the data chunks are both one, and the other case is that the number of the parity chunks is 0 and the number of the data chunks is 1.
In one embodiment, when a block to be used for executing a data write operation in the stripe is one, the method includes: acquiring the number of pointer variables in a preset pointer variable linked list; and when the number of the pointer variables in the preset pointer variable linked list is one, the number of the blocks to be subjected to the data writing operation in the strip is one.
In one embodiment, the method further comprises: generating the preset pointer variable linked list; generating the preset pointer variable linked list, including: responding to a data write operation request, acquiring a target data block and a check block of a stripe where the target data block is located; acquiring a block information structure of the target data block and the check block; based on the block information structure, acquiring a logic address of a storage data write operation timeout structure, wherein the block information structure comprises a data write operation timeout structure; declaring a logic address of the data writing operation timeout structure body and generating a pointer variable; and generating the preset pointer variable linked list based on the pointer variable.
In one embodiment, after responding to the data writing operation request, the method further comprises: executing data writing operation on the target data block; performing a data write operation on the target data block includes: acquiring a target data block and data to be written in the target data block; and executing data writing operation based on the target data block and the data to be written, and writing the data to be written into the target data block.
In one embodiment, after the data write operation, the method further comprises: performing data writing operation on the check block of the stripe where the target data block is located; performing a data write operation on the parity block of the stripe where the target data block is located, including: acquiring current data of the target data block and data to be written in the target data block; performing exclusive-or operation on the current data and the data to be written to obtain an intermediate check value; acquiring current data of a check block of a stripe where the target data block is located; performing exclusive-or processing on the current data of the check block and the intermediate check value to obtain data to be written in the check block, wherein the check block comprises a first check block and a second check block; and executing data writing operation based on the data to be written of the check block, and writing the data to be written into the check block.
In one embodiment, after performing a data write operation on the target data block and/or after performing a data write operation on a parity block of a stripe where the target data block is located, the method further includes: when the data write operation is completed, acquiring the number of pointer variables in the pointer variable linked list, wherein the data write operation completion comprises data write operation failure and data write operation success; and if the number of the pointer variables is not less than 2, deleting the pointer variables corresponding to the target data block or the check block from the preset pointer variable linked list, and updating the pointer variable linked list.
In one embodiment, the method further comprises: acquiring the data write operation state of the blocks in the stripe; acquiring the data writing operation duration of the blocks; and when the data writing operation duration of the block does not exceed the preset data writing operation duration, updating the writing operation early completion state in the block information structure of the block to be true.
In one embodiment, when the data write operation status of the block is obtained, the method further includes: when the data writing operation duration of the block exceeds the preset data writing operation duration, judging whether at least one verification block with successful data writing operation exists in the stripe where the block is located; if yes, updating the write operation early completion state in the block information structure of the block to be true; and if the current block does not exist, updating the check state of the block to be checked in the block information structure body of the block to be true.
In one embodiment, the method further comprises: when the data writing operation of the check block is successful, traversing the data block of the strip where the check block is located, wherein the number of the check blocks is at least one; judging whether a data block with a true check state of a block to be checked exists in the strip; and if so, acquiring the data to be written in the data block based on the check block, and executing data writing operation on the data block.
Specifically, if a data block with a true check state of a block to be checked exists in a stripe, acquiring data to be written in the data block based on the check block, and performing a data write operation on the data block, where the data write operation includes: acquiring the number of data blocks of which the check state of the block to be checked is true; and the number of the data blocks of which the check states of the blocks to be checked are true is at most two.
In one embodiment, when the number of data blocks of which the check state of the block to be checked is true is one, acquiring data to be written in the data block based on the check block, and performing a data write operation on the data block includes: performing exclusive-or operation on data of data blocks except the data block in the stripe to obtain a first operation value; and performing an exclusive nor operation on the first operation value and the data of the first check block in the strip to obtain the data of the data block.
In one embodiment, when the number of the data blocks of which the check status of the block to be checked is true is two, acquiring data to be written in the data block based on the check block, and performing a data write operation on the data block includes: performing exclusive-or operation on data of data blocks except the data block in the stripe to obtain a first operation value; performing an exclusive-or operation on the first operation value and the data of the first check block in the strip to obtain a second operation value, wherein the second operation value is an exclusive-or operation result of the data of the two failed data blocks; performing exclusive or operation on the first operation value and data of a first check block in the strip to obtain a third operation value; performing an exclusive-or operation on the third operation value and data of a second check block in the strip to obtain a fourth operation value, wherein the fourth operation value is an exclusive-or operation result of the data of the two failed data blocks; and obtaining the data of the data block based on the third operation value and the fourth operation value.
In one embodiment, based on the check block, data to be written into the data block is obtained, and after data write operation is performed on the data block, the method further includes: and updating the write operation early completion state in the block information structure of the data block to be true.
In one embodiment, the method further comprises: initializing the state attribute of a block structure of a block in a strip; initializing a block structure state attribute of a block in a stripe, comprising: acquiring a block structure of blocks in the strip, wherein the block structure of the blocks comprises that write operation is completed in advance, and the check of the blocks to be checked and the write operation are overtime; and initializing the write operation advanced completion state of the blocks and the checking state of the block to be checked to be false.
In one embodiment, the method comprises: monitoring the data writing operation rate of the blocks in the strip; monitoring a data write operation rate of a partition in the stripe, including: generating a block write operation success counter in advance; initializing the count value of the block write operation success counter to be 0; and when the write operation early completion state in the block information structure body for updating the blocks is true, adding 1 to the count value of the block write operation success counter.
In one embodiment, monitoring the data writing operation rate of the blocks in the stripe further comprises: responding to the data writing request operation, and starting the counting time length monitoring of the block writing operation success counter until the counting value of the block writing operation success counter is equal to a first preset value; acquiring the counting time length of the block write operation success counter; and when the counting duration of the block write operation success counter is not greater than a second preset value, judging that the data write operation rate of the stripe blocks is normal.
In an embodiment, the present application further provides a data read operation method, where the method implements a read operation on data written to a partition in a stripe based on the data write operation, where the partition includes a parity block and a data block; the data reading operation method can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The user receives a data read operation request sent by the client through the terminal 102 and sends the data read operation request to the server 104 through the network, and the server 104 responds to the data read operation request to execute data read operation. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by multiple servers. Taking the application of the method to the server 104 in fig. 1 as an example, the method is shown in fig. 3, and the method includes:
acquiring a block in which data write operation fails in the stripe, and defining the block as a failed block, wherein the number of the failed blocks is at most two; reconstructing the data of the failed blocks according to a preset failed block data calculation rule; and after the data reconstruction of the failed sub-block is completed, executing data reading operation on the failed sub-block.
In one embodiment, reconstructing data of a failed block according to a preset failed block data calculation rule includes: acquiring the distribution condition of the partition types of the failed partitions; the distribution condition of the partition types of the failed partitions comprises the following steps: the number of the failed blocks is one, and the failed blocks comprise failed data blocks or failed check blocks; and the number of the failed blocks is two, the failed blocks comprise two failed data blocks, or the failed blocks comprise one failed data block and one failed check block.
In one embodiment, when the failed block includes a parity block, the method further includes: acquiring the block type of the check block; when the blocking type of the check block is a first check block, defining the first check block as a first failed check block; and when the blocking type of the failed blocking is a second check block, defining the second check block as a second failed check block.
In one embodiment, when the number of failed blocks is one and the failed blocks are failed check blocks, the method further includes: when the block type of the failed block is a first failed check block, performing exclusive-or operation on the data of each data block in the stripe to reconstruct the data of the first failed check block: and when the block type of the failed block is a second failed check block, performing exclusive-or operation on the data of each data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
In one embodiment, when the number of failed blocks is one, and the failed blocks are failed data blocks, the method further includes: performing exclusive or operation on the data of the data blocks except the failed data block in the stripe to obtain a first operation value; and performing an exclusive-nor operation on the first operation value and the data of the first check block in the strip to reconstruct the data of the failed data block.
In one embodiment, when the number of failed blocks is two, and the failed blocks are two failed data blocks, the method includes: performing exclusive or operation on the data of the data blocks except the failed data block in the stripe to obtain a first operation value; performing an exclusive-or operation on the first operation value and the data of the first check block in the strip to obtain a second operation value, wherein the second operation value is an exclusive-or operation result of the data of the two failed data blocks; performing exclusive-or operation on the first operation value and data of a first check block in the strip to obtain a third operation value; performing an exclusive-or operation on the third operation value and the data of the second check block in the strip to obtain a fourth operation value, wherein the fourth operation value is an exclusive-or operation result of the data of the two failed data blocks; reconstructing data of the failed data block based on the third and fourth operation values.
Specifically, the data blocks in the stripe are defined as a, B, C and D, respectively, and the check blocks in the stripe are defined as E and F, respectively; when the failed sub-block is two failed data blocks, that is, assuming that the data block a and the data block B are defined as failed data blocks, setting the data of the data block C, the data block D, the first check block E and the second check block F to be 1; performing exclusive-or operation on data of data blocks except the failed data blocks A and B in the stripe to obtain a first operation value, namely performing exclusive-or operation on a data block C and a data block D to obtain a first operation value 0; performing an exclusive-or operation on the first operation value and the data of the first check block in the stripe to obtain a second operation value, where the second operation value is an exclusive-or operation result of the data of the two failed data blocks, that is, performing an exclusive-or operation on 0 and the data 1 of the first check block E to obtain a second operation value 0, that is, performing an exclusive-or operation on the failed data blocks a and B to obtain a value of 0; performing exclusive-or operation on the first operation value and data of the first check block in the strip to obtain a third operation value, namely performing exclusive-or operation on 0 and data 1 of the first check block E to obtain a third operation value 1; performing an exclusive-or operation on the third operation value and the data of the second check block in the stripe to obtain a fourth operation value, where the fourth operation value is an exclusive-or operation result of the data of the two failed data blocks, that is, after performing the exclusive-or operation on the third operation value 1 and the data 1 of the second check block F, a fourth operation value 1 is obtained, that is, after performing the exclusive-or operation on the failed data blocks a and B, an obtained exclusive-or operation result is 1; reconstructing the data of the failed data block based on the third operation value and the fourth operation value, so as to obtain that the data of the failed data block a and the data of the failed data block B are respectively 0 and 1, or 1 and 0.
In one embodiment, when the number of failed blocks is two, and the failed blocks are one failed data block and one failed check block, the method further includes: when the failed check block is a first failed check block, performing exclusive-or operation on data of data blocks in the stripe except the failed data block to obtain a fifth operation value, wherein the fifth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; performing an exclusive-nor operation on the fifth operation value and the data of the second check block based on the fifth operation value to obtain a sixth operation value, where the sixth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; reconstructing data of the failed data block and the first failed check block based on the fifth operation value and the sixth operation value. The method for reconstructing the data of the failed data block and the first failed check block may refer to the above method for reconstructing the data of the two failed data blocks, and is not described herein again.
In one embodiment, when the number of failed blocks is two, and the failed blocks are one failed data block and one failed check block, the method further includes: when the failed check block is a second failed check block, performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a seventh operation value; performing an exclusive-nor operation on the seventh operation value and the data of the first check block based on the seventh operation value to reconstruct the data of the failed data block; and performing exclusive-or operation on the data of the data block including the failed data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
It should be understood that although the various steps in the flow charts of fig. 2-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 4, there is provided a data writing operation apparatus, which is applied to a data writing operation of a partition in a stripe, the apparatus including: the device comprises a monitoring starting unit, a first obtaining unit and a writing operation unit, wherein:
the monitoring starting unit is used for starting the monitoring of the data writing operation duration of the block when the block to be subjected to the data writing operation in the strip is one, and defining the block as a target block;
a first obtaining unit, configured to obtain a block attribute of the target block when a data write operation duration of the target block exceeds a preset data write operation duration; the data writing operation failure block counting module is further used for obtaining the total number of the data writing operation failure blocks in the stripe according to a preset data writing operation failure block counting rule based on the block attribute of the target block;
the write operation unit is used for terminating the data write operation when the total number of the blocks in which the data write operation fails in the strip is less than a preset value; otherwise, continuing to execute the data writing operation.
In one embodiment, the first obtaining unit is further configured to divide the target block into a data block or a check block based on a block attribute of the target block; when the target block is a data block, acquiring the total number of check blocks in which data write operation in the stripe fails; and when the target block is a check block, acquiring the check block in the stripe, except for the target block, of which the data write operation fails, and the total number of data blocks in the stripe, of which the data write operation fails and the blocks to be checked are to be checked.
In one embodiment, the write operation unit is further configured to terminate the data write operation when the target partition is a data block and a total number of check blocks in the stripe where the data write operation fails is less than 2; and when the target block is a check block, and the total number of the check blocks which fail in the data writing operation except the target block in the stripe and the data writing operation in the stripe fails and the data blocks to be checked by the check block is less than 2, terminating the data writing operation.
In one embodiment, the first obtaining unit is further configured to obtain the number of pointer variables in a preset pointer variable linked list; and when the number of the pointer variables in the preset pointer variable linked list is one, the number of the blocks to be subjected to the data writing operation in the strip is one.
In one embodiment, the first obtaining unit is further configured to obtain, in response to a data write operation request, a target data block and a parity block of a stripe where the target data block is located; acquiring a block information structure of the target data block and the check block; based on the block information structure, acquiring a logic address of a storage data write operation timeout structure, wherein the block information structure comprises a data write operation timeout structure; declaring a logic address of the data writing operation timeout structure body and generating a pointer variable; and generating the preset pointer variable linked list based on the pointer variable.
In one embodiment, the write operation unit is further configured to obtain a target data block and data to be written in the target data block; and executing data writing operation based on the target data block and the data to be written, and writing the data to be written into the target data block.
In one embodiment, the write operation unit is further configured to perform a data write operation on the parity block of the stripe where the target data block is located; performing a data write operation on the parity block of the stripe where the target data block is located, including: acquiring current data of the target data block and data to be written in the target data block; performing XOR operation on the current data and the data to be written to obtain an intermediate check value; acquiring current data of a check block of a stripe where the target data block is located; performing exclusive-or processing on the current data of the check block and the intermediate check value to obtain data to be written in the check block, wherein the check block comprises a first check block and a second check block; and executing data writing operation based on the data to be written of the check block, and writing the data to be written into the check block.
In one embodiment, the apparatus further comprises: the pointer variable updating unit is used for acquiring the number of pointer variables in the pointer variable linked list when the data write operation is completed, wherein the data write operation completion comprises data write operation failure and data write operation success; and if the number of the pointer variables is not less than 2, deleting the pointer variables corresponding to the target data block or the check block from the preset pointer variable linked list, and updating the pointer variable linked list.
In one embodiment, the first obtaining unit is further configured to obtain a data write operation state of a partition in a stripe; acquiring the data writing operation duration of the blocks; and when the data writing operation duration of the block does not exceed the preset data writing operation duration, updating the writing operation early completion state in the block information structure of the block to be true.
In one embodiment, the apparatus further comprises: a state updating unit, configured to determine whether at least one check block with successful data write operation exists in a stripe where the block is located when a data write operation duration of the block exceeds a preset data write operation duration; if yes, updating the write operation early completion state in the block information structure of the block to be true; and if the current block does not exist, updating the check state of the block to be checked in the block information structure body of the block to be true.
In one embodiment, the write operation unit is further configured to, when the data write operation of the check block is successful, traverse a data block of a stripe where the check block is located, where the check block is at least one; judging whether a data block with a true checking state of the block to be checked exists in the strip or not; and if the data block exists, acquiring the data to be written in the data block based on the check block, and performing data writing operation on the data block.
In one embodiment, the status updating unit is further configured to update that the write operation early completion status in the blocking information structure of the data block is true.
In one embodiment, the apparatus further includes an initialization unit, configured to obtain a chunking structure of chunks in the stripe, where the chunking structure of chunks includes that a write operation is completed in advance, and a checksum of a chunk to be verified is overtime; and initializing the write operation advanced completion state of the blocks and the check state of the block to be checked to be false.
In one embodiment, the initialization unit is further configured to generate a block write success counter in advance; initializing the count value of the block write operation success counter to be 0; and when the write operation early completion state in the block information structure body for updating the blocks is true, adding 1 to the count value of the block write operation success counter.
In one embodiment, the monitoring starting unit is further configured to start monitoring of a count duration of the block write operation success counter in response to a data write request operation until a count value of the block write operation success counter is equal to a first preset value; acquiring the counting duration of the block write operation success counter; and when the counting time of the block write operation success counter is not greater than a second preset value, judging that the data write operation rate of the stripe blocks is normal.
For specific limitations of the data writing operation device, reference may be made to the above limitations of the data writing operation method, which are not described herein again. The modules in the data writing operation device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, as shown in fig. 5, the present application further provides a data read operation device, where the data read operation device is configured to perform a read operation on data partitioned into stripes, and the data partitioned into stripes in the stripes are written based on the data write operation device, where the device includes: a second acquisition unit, a reconstruction unit and a read operation unit; wherein:
a second obtaining unit, configured to obtain a chunk in the stripe where a data write operation fails, and define the chunk as a failed chunk, where the failed chunk is at most two;
the reconstruction unit is used for reconstructing the data of the failed sub-blocks according to a preset failed sub-block data calculation rule;
and the read operation unit is used for executing data read operation on the failed blocks after the reconstruction of the data of the failed blocks is completed.
In one embodiment, the reconstructing unit is further configured to obtain a partition type distribution of the failed partition; the distribution condition of the partition types of the failed partitions comprises the following steps: the number of the failed blocks is one, and the failed blocks comprise failed data blocks or failed check blocks; and the number of the failed blocks is two, the failed blocks comprise two failed data blocks, or the failed blocks comprise one failed data block and one failed check block.
In one embodiment, the second obtaining unit is further configured to obtain a blocking type of the check block; when the block type of the check block is a first check block, defining the first check block as a first failed check block; and when the blocking type of the failed blocking is a second check block, defining the second check block as a second failed check block.
In one embodiment, the reconstructing unit is further configured to, when the block type of the failed block is a first failed check block, perform an exclusive or operation on data of each data block in the stripe, and reconstruct the data of the first failed check block: and when the block type of the failed block is a second failed check block, performing exclusive-or operation on the data of each data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
In one embodiment, the reconstructing unit is further configured to perform an exclusive or operation on data of data blocks in the stripe except the failed data block to obtain a first operation value; and performing an exclusive-nor operation on the first operation value and the data of the first check block in the strip to reconstruct the data of the failed data block.
In one embodiment, the reconstructing unit is further configured to perform an exclusive or operation on data of data blocks in the stripe except the failed data block to obtain a first operation value; performing an exclusive-or operation on the first operation value and the data of the first check block in the strip to obtain a second operation value, wherein the second operation value is an exclusive-or operation result of the data of the two failed data blocks; performing exclusive-or operation on the first operation value and data of a first check block in the strip to obtain a third operation value; performing an exclusive-or operation on the third operation value and the data of the second check block in the strip to obtain a fourth operation value, wherein the fourth operation value is an exclusive-or operation result of the data of the two failed data blocks; reconstructing data of the failed data block based on the third operational value and the fourth operational value.
In one embodiment, the reconstructing unit is further configured to, when the failed parity block is a first failed parity block, perform an exclusive or operation on data of data blocks in the stripe except the failed data block to obtain a fifth operation value, where the fifth operation value is an exclusive or operation result of the data of the first failed parity block and the data of the failed data block; performing an exclusive-or operation on the fifth operation value and the data of the second check block based on the fifth operation value to obtain a sixth operation value, wherein the sixth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; reconstructing data of the failed data block and the first failed check block based on the fifth operation value and the sixth operation value.
In one embodiment, the reconstructing unit is further configured to perform an exclusive or operation on data of data blocks in the stripe except the failed data block to obtain a seventh operation value when the failed check block is the second failed check block; performing exclusive-nor operation on the seventh operation value and the data of the first check block based on the seventh operation value, and reconstructing the data of the failed data block; and performing exclusive-or operation on the data of the data block including the failed data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
For specific limitations of the data reading operation device, reference may be made to the above limitations on the data reading operation method, which is not described herein again. All or part of each module in the data reading operation device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, as shown in fig. 6, a data read/write operation system is provided, which includes the above data write operation device and data read operation device.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The computer device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data write operation method and a data read operation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
when a block to be subjected to data writing operation in the stripe is one, starting monitoring the data writing operation duration of the block, and defining the block as a target block;
when the data writing operation duration of the target block exceeds the preset data writing operation duration, acquiring the block attribute of the target block;
based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the data write operation failure block total number in the strip;
when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation.
In one embodiment, the processor when executing the computer program further performs the steps of: dividing the target blocks into data blocks or check blocks based on the block attributes of the target blocks; when the target block is a data block, acquiring the total number of check blocks in which data write operation in the stripe fails; and when the target block is a check block, acquiring the check block in the stripe, except for the target block, of which the data write operation fails, and the total number of data blocks in the stripe, of which the data write operation fails and the blocks to be checked are to be checked.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the target block is a data block and the total number of check blocks in the stripe, which fail in data write operation, is less than 2, terminating the data write operation; and when the target block is a check block, and the total number of the check blocks which fail in the data writing operation except the target block in the stripe and the data writing operation in the stripe fails and the data blocks to be checked by the check block is less than 2, terminating the data writing operation.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the number of pointer variables in a preset pointer variable linked list; and when the number of the pointer variables in the preset pointer variable linked list is one, the number of the blocks to be subjected to the data writing operation in the strip is one.
In one embodiment, the processor, when executing the computer program, further performs the steps of: responding to a data write operation request, acquiring a target data block and a check block of a stripe where the target data block is located; acquiring a block information structure of the target data block and the check block; based on the block information structure, acquiring a logic address of a storage data write operation timeout structure, wherein the block information structure comprises a data write operation timeout structure; declaring a logic address of the data writing operation overtime structure body and generating a pointer variable; and generating the preset pointer variable linked list based on the pointer variable.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a target data block and data to be written in the target data block; and executing data writing operation based on the target data block and the data to be written, and writing the data to be written into the target data block.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring current data of the target data block and data to be written in the target data block; performing exclusive-or operation on the current data and the data to be written to obtain an intermediate check value; acquiring current data of a check block of a stripe where the target data block is located; performing exclusive or processing on the current data of the check block and the intermediate check value to obtain data to be written in the check block, wherein the check block comprises a first check block and a second check block; and executing data writing operation based on the data to be written of the check block, and writing the data to be written into the check block.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the data write operation is completed, acquiring the number of pointer variables in the pointer variable linked list, wherein the data write operation completion comprises data write operation failure and data write operation success; and if the number of the pointer variables is not less than 2, deleting the pointer variables corresponding to the target data block or the check block from the preset pointer variable linked list, and updating the pointer variable linked list.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the data write operation state of the blocks in the stripe; acquiring the data writing operation duration of the blocks; and when the data writing operation duration of the block does not exceed the preset data writing operation duration, updating the writing operation early completion state in the block information structure of the block to be true.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the data writing operation duration of the block exceeds the preset data writing operation duration, judging whether at least one verification block with successful data writing operation exists in the strip where the block is located; if yes, updating the write operation early completion state in the block information structure of the block to be true; and if the current block does not exist, updating the checking state of the block to be checked in the block information structure body of the block to be true.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the data writing operation of the check block is successful, traversing the data block of the strip where the check block is located, wherein the number of the check blocks is at least one; judging whether a data block with a true check state of a block to be checked exists in the strip; and if so, acquiring the data to be written in the data block based on the check block, and executing data writing operation on the data block.
In one embodiment, the processor when executing the computer program further performs the steps of: and updating the write operation early completion state in the block information structure of the data block to be true.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring a block structure of blocks in the strip, wherein the block structure of the blocks comprises that write operation is completed in advance, and the check of the blocks to be checked and the write operation are overtime; and initializing the write operation advanced completion state of the blocks and the check state of the block to be checked to be false.
In one embodiment, the processor, when executing the computer program, further performs the steps of: generating a block write operation success counter in advance; initializing the count value of the block write operation success counter to be 0; and when the write operation early completion state in the block information structure body for updating the blocks is true, adding 1 to the count value of the block write operation success counter.
In one embodiment, the processor, when executing the computer program, further performs the steps of: responding to the data writing request operation, starting the counting time monitoring of the block writing operation success counter until the counting value of the block writing operation success counter is equal to a first preset value; acquiring the counting duration of the block write operation success counter; and when the counting duration of the block write operation success counter is not greater than a second preset value, judging that the data write operation rate of the stripe blocks is normal.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a block in which data write operation in the stripe fails, and defining the block as a failed block, wherein the number of the failed block is at most two; reconstructing the data of the failed blocks according to a preset failed block data calculation rule; and after the data reconstruction of the failed sub-block is completed, executing data reading operation on the failed sub-block.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring the distribution condition of the partition types of the failed partitions; the distribution condition of the partition types of the failed partitions comprises the following steps: the number of the failed blocks is one, and the failed blocks comprise failed data blocks or failed check blocks; and the number of the failed blocks is two, the failed blocks comprise two failed data blocks, or the failed blocks comprise one failed data block and one failed check block.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the block type of the check block; when the blocking type of the check block is a first check block, defining the first check block as a first failed check block; and when the blocking type of the failed blocking block is a second check block, defining the second check block as a second failed check block.
In one embodiment, the processor when executing the computer program further performs the steps of: when the block type of the failed block is a first failed check block, performing exclusive-or operation on the data of each data block in the stripe to reconstruct the data of the first failed check block: and when the block type of the failed block is a second failed check block, performing exclusive-or operation on the data of each data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
In one embodiment, the processor, when executing the computer program, further performs the steps of: performing exclusive or operation on the data of the data blocks except the failed data block in the stripe to obtain a first operation value; and performing exclusive-nor operation on the first operation value and the data of the first check block in the strip to reconstruct the data of the failed data block.
In one embodiment, the processor when executing the computer program further performs the steps of: performing exclusive or operation on the data of the data blocks except the failed data block in the stripe to obtain a first operation value; performing an exclusive-or operation on the first operation value and the data of the first check block in the strip to obtain a second operation value, wherein the second operation value is an exclusive-or operation result of the data of the two failed data blocks; performing exclusive or operation on the first operation value and data of a first check block in the strip to obtain a third operation value; performing an exclusive-or operation on the third operation value and data of a second check block in the strip to obtain a fourth operation value, wherein the fourth operation value is an exclusive-or operation result of the data of the two failed data blocks; reconstructing data of the failed data block based on the third and fourth operation values.
In one embodiment, the processor when executing the computer program further performs the steps of: when the failed check block is a first failed check block, performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a fifth operation value, wherein the fifth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; performing an exclusive-nor operation on the fifth operation value and the data of the second check block based on the fifth operation value to obtain a sixth operation value, where the sixth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; reconstructing data of the failed data block and the first failed check block based on the fifth operation value and the sixth operation value.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the failed check block is a second failed check block, performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a seventh operation value; performing an exclusive-nor operation on the seventh operation value and the data of the first check block based on the seventh operation value to reconstruct the data of the failed data block; and performing exclusive-or operation on the data of the data block including the failed data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
when a block to be subjected to data writing operation in the stripe is one, starting monitoring the data writing operation duration of the block, and defining the block as a target block;
when the data writing operation duration of the target block exceeds the preset data writing operation duration, acquiring the block attribute of the target block;
based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the data write operation failure block total number in the strip;
when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation.
In one embodiment, the computer program when executed by the processor further performs the steps of: dividing the target block into a data block or a check block based on the block attribute of the target block; when the target block is a data block, acquiring the total number of check blocks in which data write operation in the stripe fails; and when the target block is a check block, acquiring the check block in which the data write operation in the stripe except the target block fails, and the total number of the data blocks in the stripe in which the data write operation fails and the blocks to be checked are checked.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the target block is a data block and the total number of check blocks in the stripe, which fail in data write operation, is less than 2, terminating the data write operation; and when the target block is a check block, and the check blocks in the stripe, except the target block, which fail in data writing operation, and the data writing operation in the stripe fail and the total number of the data blocks to be checked by the check blocks is less than 2, terminating the data writing operation.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the number of pointer variables in a preset pointer variable linked list; and when the number of the pointer variables in the preset pointer variable linked list is one, the number of the blocks to be subjected to data writing operation in the strip is one.
In one embodiment, the computer program when executed by the processor further performs the steps of: responding to a data write operation request, acquiring a target data block and a check block of a stripe where the target data block is located; acquiring a block information structure of the target data block and the check block; based on the block information structure, acquiring a logic address of a storage data write operation timeout structure, wherein the block information structure comprises a data write operation timeout structure; declaring a logic address of the data writing operation timeout structure body and generating a pointer variable; and generating the preset pointer variable linked list based on the pointer variable.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a target data block and data to be written in the target data block; and executing data writing operation based on the target data block and the data to be written, and writing the data to be written into the target data block.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring current data of the target data block and data to be written in the target data block; performing XOR operation on the current data and the data to be written to obtain an intermediate check value; acquiring current data of a check block of a stripe where the target data block is located; performing exclusive-or processing on the current data of the check block and the intermediate check value to obtain data to be written in the check block, wherein the check block comprises a first check block and a second check block; and executing data writing operation based on the data to be written in the check block, and writing the data to be written in the check block.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the data write operation is completed, acquiring the number of pointer variables in the pointer variable linked list, wherein the data write operation completion comprises data write operation failure and data write operation success; and if the number of the pointer variables is not less than 2, deleting the pointer variables corresponding to the target data block or the check block from the preset pointer variable linked list, and updating the pointer variable linked list.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the data write operation state of the blocks in the stripe; acquiring the data writing operation duration of the blocks; and when the data writing operation duration of the block does not exceed the preset data writing operation duration, updating the writing operation early completion state in the block information structure of the block to be true.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the data writing operation duration of the block exceeds the preset data writing operation duration, judging whether at least one verification block with successful data writing operation exists in the strip where the block is located; if yes, updating the write operation early completion state in the block information structure of the block to be true; and if the current block does not exist, updating the check state of the block to be checked in the block information structure body of the block to be true.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the data writing operation of the check block is successful, traversing the data block of the strip where the check block is located, wherein the number of the check blocks is at least one; judging whether a data block with a true check state of a block to be checked exists in the strip; and if so, acquiring the data to be written in the data block based on the check block, and executing data writing operation on the data block.
In one embodiment, the computer program when executed by the processor further performs the steps of: and updating the write operation early completion state in the block information structure of the data block to be true.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a block structure of blocks in the strip, wherein the block structure of the blocks comprises that write operation is completed in advance, and the check of the blocks to be checked and the write operation are overtime; and initializing the write operation advanced completion state of the blocks and the check state of the block to be checked to be false.
In one embodiment, the computer program when executed by the processor further performs the steps of: generating a block write operation success counter in advance; initializing the count value of the block write operation success counter to be 0; and when the write operation early completion state in the block information structure body for updating the blocks is true, adding 1 to the count value of the block write operation success counter.
In one embodiment, the computer program when executed by the processor further performs the steps of: responding to the data writing request operation, and starting the counting time length monitoring of the block writing operation success counter until the counting value of the block writing operation success counter is equal to a first preset value; acquiring the counting time length of the block write operation success counter; and when the counting duration of the block write operation success counter is not greater than a second preset value, judging that the data write operation rate of the stripe blocks is normal.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a block in which data write operation in the stripe fails, and defining the block as a failed block, wherein the number of the failed block is at most two; reconstructing the data of the failed blocks according to a preset failed block data calculation rule; and after the data reconstruction of the failed blocks is completed, executing data reading operation on the failed blocks.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the distribution condition of the partition types of the failed partitions; the distribution condition of the partition types of the failed partitions comprises the following steps: the number of the failed blocks is one, and the failed blocks comprise failed data blocks or failed check blocks; and the number of the failed blocks is two, the failed blocks comprise two failed data blocks, or the failed blocks comprise one failed data block and one failed check block.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the block type of the check block; when the blocking type of the check block is a first check block, defining the first check block as a first failed check block; and when the blocking type of the failed blocking is a second check block, defining the second check block as a second failed check block.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the block type of the failed block is a first failed check block, performing exclusive-or operation on the data of each data block in the stripe to reconstruct the data of the first failed check block: and when the block type of the failed block is a second failed check block, performing exclusive-or operation on the data of each data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
In one embodiment, the computer program when executed by the processor further performs the steps of: performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a first operation value; and performing exclusive-nor operation on the first operation value and the data of the first check block in the strip to reconstruct the data of the failed data block.
In one embodiment, the computer program when executed by the processor further performs the steps of: performing exclusive or operation on the data of the data blocks except the failed data block in the stripe to obtain a first operation value; performing an exclusive-nor operation on the first operation value and data of a first check block in the strip to obtain a second operation value, wherein the second operation value is an exclusive-or operation result of the data of the two failed data blocks; performing exclusive-or operation on the first operation value and data of a first check block in the strip to obtain a third operation value; performing an exclusive-or operation on the third operation value and data of a second check block in the strip to obtain a fourth operation value, wherein the fourth operation value is an exclusive-or operation result of the data of the two failed data blocks; reconstructing data of the failed data block based on the third and fourth operation values.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the failed check block is a first failed check block, performing exclusive-or operation on data of data blocks in the stripe except the failed data block to obtain a fifth operation value, wherein the fifth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; performing an exclusive-or operation on the fifth operation value and the data of the second check block based on the fifth operation value to obtain a sixth operation value, wherein the sixth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block; reconstructing data of the failed data block and the first failed check block based on the fifth operation value and the sixth operation value.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the failed check block is a second failed check block, performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a seventh operation value; performing an exclusive-nor operation on the seventh operation value and the data of the first check block based on the seventh operation value to reconstruct the data of the failed data block; and performing exclusive-or operation on the data of the data block including the failed data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (27)

1. A method of data write operations, the method being applied to a data write operation for a partition in a stripe, the method comprising:
when the block to be subjected to data writing operation in the stripe is one, starting data writing operation duration monitoring on the block, and defining the block as a target block;
when the data write operation duration of the target block exceeds the preset data write operation duration, acquiring the block attribute of the target block;
based on the block attribute of the target block, according to a preset data write operation failure block total number calculation rule, acquiring the total number of the blocks in the stripe, of which the data write operation fails;
when the total number of the blocks in which the data writing operation fails in the strip is smaller than a preset value, terminating the data writing operation; otherwise, continuing to execute the data writing operation;
wherein: based on the block attribute of the target block, obtaining the total number of blocks in the stripe where the data write operation fails according to a preset data write operation failure total number calculation rule, including:
dividing the target block into a data block or a check block based on the block attribute of the target block;
when the target block is a data block, acquiring the total number of check blocks in which data write operation in the stripe fails;
and when the target block is a check block, acquiring the check block in the stripe, except for the target block, of which the data write operation fails, and the total number of data blocks in the stripe, of which the data write operation fails and the blocks to be checked are to be checked.
2. The data writing operation method according to claim 1, wherein when the total number of the chunks in the stripe in which the writing operation fails is less than a preset value, terminating the data writing operation comprises:
when the target block is a data block and the total number of check blocks in the stripe, which fail in data write operation, is less than 2, terminating the data write operation;
and when the target block is a check block, and the total number of the check blocks which fail in the data writing operation except the target block in the stripe and the data writing operation in the stripe fails and the data blocks to be checked by the check block is less than 2, terminating the data writing operation.
3. The data write operation method of claim 2, further comprising: generating a preset pointer variable linked list;
generating a preset pointer variable linked list, comprising:
responding to a data write operation request, acquiring a target data block and a check block of a stripe where the target data block is located;
acquiring a block information structure of the target data block and the check block;
based on the block information structure, acquiring a logic address of a storage data write operation timeout structure, wherein the block information structure comprises a data write operation timeout structure;
declaring a logic address of the data writing operation timeout structure body and generating a pointer variable;
and generating the preset pointer variable linked list based on the pointer variable.
4. The data writing operation method according to claim 3, wherein when the block in the stripe in which the data writing operation is to be performed is one, the method comprises:
acquiring the number of pointer variables in a preset pointer variable linked list;
and when the number of the pointer variables in the preset pointer variable linked list is one, the number of the blocks to be subjected to the data writing operation in the strip is one.
5. The data writing operation method according to claim 4, wherein after responding to the data writing operation request, the method further comprises: executing data writing operation on the target data block;
performing a data write operation on the target data block includes:
acquiring a target data block and data to be written in the target data block;
and executing data writing operation based on the target data block and the data to be written, and writing the data to be written into the target data block.
6. The method of claim 4 or 5, wherein in response to the data write operation, the method further comprises: performing data writing operation on the check block of the stripe where the target data block is located;
performing a data write operation on the parity block of the stripe where the target data block is located, including:
acquiring current data of the target data block and data to be written in the target data block;
performing XOR operation on the current data and the data to be written to obtain an intermediate check value;
acquiring current data of a check block of a stripe where the target data block is located;
performing exclusive-or processing on the current data of the check block and the intermediate check value to obtain data to be written in the check block, wherein the check block comprises a first check block and a second check block;
and executing data writing operation based on the data to be written of the check block, and writing the data to be written into the check block.
7. The method according to claim 6, wherein after performing a data write operation on the target data block and/or after performing a data write operation on a parity chunk of a stripe in which the target data block is located, the method further comprises:
when the data writing operation is completed, acquiring the number of pointer variables in the pointer variable linked list, wherein the data writing operation completion comprises data writing operation failure and data writing operation success;
and if the number of the pointer variables is not less than 2, deleting the pointer variables corresponding to the target data block or the check block from the preset pointer variable linked list, and updating the pointer variable linked list.
8. The method of data write operations according to claim 1 or 3 or 4 or 7, wherein the method further comprises:
acquiring the data write operation state of a block in a stripe, and the data write operation duration of the block;
and when the data writing operation duration of the block does not exceed the preset data writing operation duration, updating the writing operation early completion state in the block information structure of the block to be true.
9. The data writing operation method according to claim 8, wherein when the data writing operation state of the block is acquired, the method further comprises:
when the data writing operation duration of the block exceeds the preset data writing operation duration, judging whether at least one verification block with successful data writing operation exists in the strip where the block is located;
if yes, updating the write operation early completion state in the block information structure of the block to be true;
and if the current block does not exist, updating the check state of the block to be checked in the block information structure body of the block to be true.
10. The data write operation method of claim 9, further comprising:
when the data writing operation of the check block is successful, traversing the data block of the strip where the check block is located, wherein the number of the check blocks is at least one;
judging whether a data block with a true checking state of the block to be checked exists in the strip or not;
and if so, acquiring the data to be written in the data block based on the check block, and executing data writing operation on the data block.
11. The data write operation method according to claim 10, wherein the data to be written in the data block is acquired based on the parity block, and after the data write operation is performed on the data block, the method further includes:
and updating the write operation early completion state in the block information structure of the data block to be true.
12. The method of claim 11, further comprising: initializing the state attribute of a block information structure body of a block in a strip;
initializing a state attribute of a block information structure of a block in a stripe, comprising:
acquiring a partitioned block information structure of the blocks in the strip, wherein the partitioned block information structure of the blocks comprises that write operation is completed in advance, and the check of the blocks to be checked and the write operation are overtime;
and initializing the write operation advanced completion state of the blocks and the check state of the block to be checked to be false.
13. The method according to claim 12, wherein the method comprises: monitoring the data writing operation rate of the blocks in the strip;
monitoring a data write operation rate of a partition in the stripe, including:
generating a block write operation success counter in advance;
initializing the count value of the block write operation success counter to be 0;
and when the write operation early completion state in the block information structure body for updating the blocks is true, adding 1 to the count value of the block write operation success counter.
14. The method of claim 13, wherein monitoring a data write operation rate of a partition in the stripe, further comprises:
responding to the data writing request operation, and starting the counting time length monitoring of the block writing operation success counter until the counting value of the block writing operation success counter is equal to a first preset value;
acquiring the counting duration of the block write operation success counter;
and when the counting duration of the block write operation success counter is not greater than a second preset value, judging that the data write operation rate of the stripe blocks is normal.
15. A data reading operation method, wherein the method is used for performing a reading operation on data partitioned in a stripe, the data partitioned in the stripe is written based on the data writing operation method according to any one of claims 1 to 14, the partitioned data includes a check block and a data block, the check block includes a first check block and a second check block, and the method includes:
acquiring a block in which data write operation fails in the stripe, and defining the block as a failed block, wherein the number of the failed blocks is at most two;
reconstructing the data of the failed blocks according to a preset failed block data calculation rule;
and after the data reconstruction of the failed sub-block is completed, executing data reading operation on the failed sub-block.
16. The data reading operation method of claim 15, wherein reconstructing the data of the failed block according to a preset failed block data calculation rule comprises: acquiring the distribution condition of the partition types of the failed partitions;
the distribution condition of the partition types of the failed partitions comprises the following steps:
the number of the failed blocks is one, and the failed blocks comprise failed data blocks or failed check blocks;
and (c) and (d),
the number of the failed blocks is two, and the failed blocks comprise two failed data blocks, or the failed blocks comprise one failed data block and one failed check block.
17. The method of claim 16, wherein when the failed partition includes a parity block, the method further comprises:
acquiring the block type of the check block;
when the blocking type of the check block is a first check block, defining the first check block as a first failed check block;
and when the blocking type of the failed blocking is a second check block, defining the second check block as a second failed check block.
18. The method of claim 17, wherein when the number of failed blocks is one and the failed blocks are failed check blocks, the method further comprises:
when the block type of the failed block is a first failed check block, performing exclusive-or operation on the data of each data block in the stripe to reconstruct the data of the first failed check block:
and when the block type of the failed block is a second failed check block, performing exclusive-or operation on the data of each data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
19. The method of claim 16 or 17, wherein the number of failed blocks is one, and when the failed block is a failed data block, the method further comprises:
performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a first operation value;
and performing exclusive-nor operation on the first operation value and the data of the first check block in the strip to reconstruct the data of the failed data block.
20. The method according to claim 16 or 17, wherein when the number of the failed blocks is two, the failed blocks are two failed data blocks, the method comprises:
performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a first operation value;
performing an exclusive-or operation on the first operation value and the data of the first check block in the strip to obtain a second operation value, wherein the second operation value is an exclusive-or operation result of the data of the two failed data blocks;
performing exclusive or operation on the first operation value and data of a first check block in the strip to obtain a third operation value;
performing an exclusive nor operation on the third operation value and the data of the second check block in the strip to obtain a fourth operation value, wherein the fourth operation value is an exclusive nor operation result of the data of the two failed data blocks;
reconstructing data of the failed data block based on the third operational value and the fourth operational value.
21. The method of claim 17, wherein when the number of failed blocks is two, the failed blocks are one failed data block and one failed check block, the method further comprises:
when the failed check block is a first failed check block, performing exclusive-or operation on data of data blocks except the failed data block in the stripe to obtain a fifth operation value, wherein the fifth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block;
performing an exclusive-nor operation on the fifth operation value and the data of the second check block based on the fifth operation value to obtain a sixth operation value, where the sixth operation value is an exclusive-or operation result of the data of the first failed check block and the data of the failed data block;
reconstructing data of the failed data block and the first failed check block based on the fifth operation value and the sixth operation value.
22. The method of claim 21, wherein when the number of failed blocks is two, the failed blocks are one failed data block and one failed parity block, the method further comprises:
when the failed check block is a second failed check block, performing exclusive or operation on data of data blocks except the failed data block in the stripe to obtain a seventh operation value;
performing an exclusive-nor operation on the seventh operation value and the data of the first check block based on the seventh operation value to reconstruct the data of the failed data block;
and performing exclusive-or operation on the data of the data block including the failed data block in the strip and the data of the first check block to reconstruct the data of the second failed check block.
23. A data write operation apparatus, the apparatus being applied to a data write operation of a partition in a stripe, the apparatus comprising:
the monitoring starting unit is used for starting the monitoring of the data writing operation duration of the block when the block to be subjected to the data writing operation in the strip is one, and defining the block as a target block;
a first obtaining unit, configured to obtain a block attribute of the target block when a data write operation duration of the target block exceeds a preset data write operation duration; the data writing operation failure block counting module is further used for obtaining the total number of the data writing operation failure blocks in the stripe according to a preset data writing operation failure block counting rule based on the block attribute of the target block; wherein: based on the block attribute of the target block, obtaining the total number of blocks in the stripe where the data write operation fails according to a preset data write operation failure total number calculation rule, including: dividing the target block into a data block or a check block based on the block attribute of the target block; when the target block is a data block, acquiring the total number of check blocks in which data write operation in the stripe fails; when the target block is a check block, acquiring the check block in the stripe, except for the target block, of which the data write operation fails, and the total number of data blocks in the stripe, of which the data write operation fails and the blocks to be checked are to be checked;
the write operation unit is used for terminating the data write operation when the total number of the blocks in which the data write operation in the strip fails is less than a preset value; otherwise, continuing to execute the data writing operation.
24. A data read operation apparatus for performing a read operation on data partitioned in a stripe, which is written based on the data write operation apparatus of claim 23, the apparatus comprising:
a second obtaining unit, configured to obtain a chunk in the stripe where a data write operation fails, and define the chunk as a failed chunk, where the failed chunk is at most two;
the reconstruction unit is used for reconstructing the data of the failed sub-blocks according to a preset failed sub-block data calculation rule;
and the read operation unit is used for executing data read operation on the failed sub-block after the data reconstruction of the failed sub-block is completed.
25. A data write operation system comprising a data write operation device according to claim 23 and a data read operation device according to claim 24.
26. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 22 are implemented when the computer program is executed by the processor.
27. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 22.
CN202211498264.5A 2022-11-28 2022-11-28 Data writing operation and data reading operation method and device Active CN115543215B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211498264.5A CN115543215B (en) 2022-11-28 2022-11-28 Data writing operation and data reading operation method and device
PCT/CN2023/114975 WO2024113986A1 (en) 2022-11-28 2023-08-25 Data write operation method, data read operation method, and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211498264.5A CN115543215B (en) 2022-11-28 2022-11-28 Data writing operation and data reading operation method and device

Publications (2)

Publication Number Publication Date
CN115543215A CN115543215A (en) 2022-12-30
CN115543215B true CN115543215B (en) 2023-03-14

Family

ID=84722039

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211498264.5A Active CN115543215B (en) 2022-11-28 2022-11-28 Data writing operation and data reading operation method and device

Country Status (2)

Country Link
CN (1) CN115543215B (en)
WO (1) WO2024113986A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543215B (en) * 2022-11-28 2023-03-14 苏州浪潮智能科技有限公司 Data writing operation and data reading operation method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916173B (en) * 2010-08-27 2013-08-28 杭州华三通信技术有限公司 RAID (Redundant Array of Independent Disks) based data reading and writing method and system thereof
CN102033716B (en) * 2010-12-01 2012-08-22 北京同有飞骥科技股份有限公司 Method for constructing energy-saving type disc array with double discs for fault tolerance
CN102508733B (en) * 2011-09-22 2016-01-20 杭州华三通信技术有限公司 A kind of data processing method based on disk array and disk array manager
CN110568993B (en) * 2019-08-06 2022-04-12 新华三技术有限公司成都分公司 Data updating method and related device
CN114594900A (en) * 2020-12-04 2022-06-07 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for storage management
CN113391941B (en) * 2021-06-18 2022-07-22 苏州浪潮智能科技有限公司 RAID read-write timeout processing method, device, equipment and medium
CN114155906A (en) * 2021-10-29 2022-03-08 广东浪潮智慧计算技术有限公司 Data block repairing method, device, equipment and storage medium
CN115098046B (en) * 2022-08-26 2023-01-24 苏州浪潮智能科技有限公司 Disk array initialization method, system, electronic device and storage medium
CN115543215B (en) * 2022-11-28 2023-03-14 苏州浪潮智能科技有限公司 Data writing operation and data reading operation method and device

Also Published As

Publication number Publication date
WO2024113986A1 (en) 2024-06-06
CN115543215A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN110089035B (en) Storage controller, data processing chip and data processing method
KR20130097995A (en) Method for controlling nonvolatile memory device and nonvolatile memory system
CN109597571B (en) Data storage method, data reading method, data storage device, data reading device and computer equipment
US9710335B2 (en) Versioned memory Implementation
CN115543215B (en) Data writing operation and data reading operation method and device
US20210133029A1 (en) Methods for data writing and for data recovery, electronic devices, and program products
CN113391947B (en) SSD RAID stripe power failure rapid recovery method, device, computer equipment and storage medium
CN110413454B (en) Data reconstruction method and device based on storage array and storage medium
CN115113827B (en) Data destruction method and device, computer equipment and storage medium
TW201423376A (en) Method and system for storing and rebuilding data
CN115657946A (en) Off-chip DDR bandwidth unloading method under RAID sequential writing scene, terminal and storage medium
CN110569000A (en) Host RAID (redundant array of independent disk) management method and device based on solid state disk array
CN114020527A (en) Snapshot recovery method and device, computer equipment and storage medium
CN116795295B (en) Data processing method and device in disk array, storage medium and electronic equipment
CN113312205B (en) Data verification method and device, storage medium and computer equipment
CN111966701A (en) Metadata updating method, device, equipment and storage medium
CN110275596B (en) Solid state disk-based power-on initialization acceleration method and device and computer equipment
CN115878041A (en) Method and device for improving writing performance of RAID (redundant array of independent disks) of solid state disk and computer equipment
CN115291803A (en) Disk array reconstruction method and device, computer equipment and storage medium
US11281535B2 (en) Method and system for performing a checkpoint zone operation for a spare persistent storage
CN113934362A (en) Data storage method and device, computer equipment and storage medium
CN112596679B (en) RAID implementation method and device of solid state disk, computer equipment and storage medium
CN114047880B (en) NAND write power consumption optimization method and device for multi-Pass programming and computer equipment
US11119858B1 (en) Method and system for performing a proactive copy operation for a spare persistent storage
CN114116287A (en) Memory verification method and device for intelligent device, electronic device and storage medium

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