CN110196687B - Data reading and writing method and device and electronic equipment - Google Patents
Data reading and writing method and device and electronic equipment Download PDFInfo
- Publication number
- CN110196687B CN110196687B CN201910419198.XA CN201910419198A CN110196687B CN 110196687 B CN110196687 B CN 110196687B CN 201910419198 A CN201910419198 A CN 201910419198A CN 110196687 B CN110196687 B CN 110196687B
- Authority
- CN
- China
- Prior art keywords
- raid
- read
- data
- storage system
- write
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0637—Permissions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0656—Data buffering arrangements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a data reading and writing method and device, an electronic device and a machine readable storage medium. Receiving a read-write request aiming at data of a storage space corresponding to the storage system; selecting a first RAID array from the RAID arrays based on a preset strategy; responding to the data read-write requests, and storing all write requests in the data read-write requests in the first RAID array. The data read-write requests of the full flash memory storage system are isolated and balanced on the RAID level, and medium conflict between the write requests and pre-read IO generation block (block) levels is avoided, so that the data read-write efficiency of the storage system is improved.
Description
Technical Field
The present application relates to the field of storage technologies, and in particular, to a data reading and writing method and apparatus, an electronic device, and a machine-readable storage medium.
Background
Hard disks are generally classified into Solid State drives (Solid State drives) and mechanical hard disks; wherein, mechanical hard disk refers to traditional ordinary hard disk, and it mainly by: the disk, the magnetic head, the disk rotating shaft and the control motor, the magnetic head controller, the data converter, the interface, the cache and the like; the magnetic head can move along the radius direction of the disk and can be positioned at the designated position of the disk for data reading and writing operation by high-speed rotation of thousands of revolutions per minute of the disk; thus, data is written to the mechanical disk by the electromagnetic current in a manner that the polarity of the data is changed by the electromagnetic current through the magnetic head in close proximity to the magnetic surface, and the data can be read in the opposite manner.
The solid state disk is classified into two categories from the perspective of a storage medium, one category is a solid state disk using a Flash Memory (Flash Memory) as a storage medium, and the other category is a solid state disk using a Dynamic Random Access Memory (DRAM) as a storage medium. Generally, a solid state disk refers to a solid state disk using a flash memory as a storage medium.
The solid state disk has higher speed and higher stability compared with a mechanical hard disk, so that the solid state disk is widely applied to the fields of military affairs, vehicle-mounted, industrial control, video monitoring, network terminals, electric power, medical treatment, aviation, navigation equipment and the like.
Disclosure of Invention
The application provides a data reading and writing method, which is applied to a storage system, wherein the storage system comprises a plurality of solid state disks, a plurality of RAID arrays are preset in the storage system, and the method comprises the following steps:
selecting a first RAID array from the RAID arrays based on a preset strategy;
receiving a read-write request aiming at data of a storage space corresponding to the storage system;
responding to the data read-write requests, and storing all write requests in the data read-write requests in the first RAID array.
Optionally, the storage system further includes a read-ahead cache, and further includes:
performing pre-reading operation on the data in the storage space corresponding to the second RAID, and storing the data obtained by pre-reading in the pre-reading cache;
responding to a read request aiming at the data of the storage space corresponding to the second RAID in the data read-write requests, and searching whether matched data exists in the pre-read cache; and if so, returning the matching data to the application corresponding to the read request.
Optionally, the preset policy is a polling-based RAID selection policy.
Optionally, the RAID arrays are constructed by different partitions located in all the solid state disks.
Optionally, the solid state disk is a solid state disk supporting multi-stream writing.
Optionally, the storage system is a full flash memory storage system, and the storage system supports NVMe protocol management of the solid state disk.
The present application further provides a data read-write apparatus, the apparatus is applied to a storage system, the storage system includes a plurality of solid state disks, a plurality of RAID arrays are preset in the storage system, the apparatus includes:
the selection module selects a first RAID array from the RAID arrays based on a preset strategy;
the acquisition module receives a read-write request aiming at data of a storage space corresponding to the storage system;
and the read-write module responds to the data read-write request and stores all write requests in the data read-write request in the first RAID array.
Optionally, the storage system further includes a read-ahead cache, and further includes:
the selection module is further used for selecting a second RAID array from the RAID arrays based on a preset strategy, wherein the second RAID array is the other RAID array except the first RAID array in the RAID arrays;
the read-write module further executes pre-read operation aiming at the data in the storage space corresponding to the second RAID, and stores the data obtained by pre-read in the pre-read cache;
the read-write module is further used for responding to a read request aiming at the data in the storage space corresponding to the second RAID in the data read-write requests, and searching whether matched data exists in the pre-read cache; and if so, returning the matching data to the application corresponding to the read request.
Optionally, the preset policy is a polling-based RAID selection policy.
Optionally, the RAID arrays are constructed by different partitions located in all the solid state disks.
Optionally, the solid state disk is a solid state disk supporting multi-stream writing.
Optionally, the storage system is a full flash memory storage system, and the storage system supports NVMe protocol management of the solid state disk.
The application also provides an electronic device, which comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are mutually connected through the bus;
the memory stores machine-readable instructions, and the processor executes the method by calling the machine-readable instructions.
The present application also provides a machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, implement the above-described method.
Through the embodiment, the data read-write requests of the full flash memory storage system are isolated and balanced on the RAID level, and block (block) level medium conflict between the write requests and the pre-read IO is avoided, so that the data read-write efficiency of the storage system is improved.
Drawings
FIG. 1 is an architecture diagram of an all flash memory storage system provided by an exemplary embodiment;
FIG. 2 is a flow chart of a method for reading and writing data provided by an exemplary embodiment;
FIG. 3 is a schematic diagram of an SSD in accordance with an illustrative embodiment;
FIG. 4 is a schematic illustration of a partition of an SSD in accordance with an illustrative embodiment;
FIG. 5 is a schematic illustration of a RAID array according to an exemplary embodiment;
FIG. 6 is a schematic diagram illustrating a correspondence relationship between LUN volumes and RAID arrays according to an exemplary embodiment;
FIG. 7 is a hardware block diagram of an electronic device provided by an exemplary embodiment;
fig. 8 is a block diagram of a data read/write apparatus according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
In order to make those skilled in the art better understand the technical solution in the embodiment of the present application, a brief description will be given below to the related technology of data reading and writing related to the embodiment of the present application.
For ease of understanding, the following full flash memory storage system is introduced. Referring to fig. 1, fig. 1 is a schematic diagram of an all flash memory system according to an embodiment of the present application.
The full flash memory storage system as shown in fig. 1 includes: a storage controller and a disk cabinet; the disk cabinet is used for managing a plurality of Solid State Disks (SSDs), the storage controller is connected with the disk cabinet through a storage bus, and accesses the SSDs in the disk cabinet through an SAS (Serial Attached SCSI) protocol or an NVMe (Non-Volatile Memory host controller interface specification) protocol;
wherein a block of SSD may comprise several flash memory particles, a flash memory particle is typically divided into blocks (blocks); wherein, block is an erasing unit of SSD, and is composed of a plurality of pages; and page is the smallest unit of reading and writing in SSD, typically 4KB.
In a normal case, reading and writing to and from the SSD may be based on different unit capacities of flash media included in the SSD, for example: SSD can be read and written by page, block, granule, disk, respectively, based on unit capacity. When reading and writing the SSD, it is essential to read and write the flash memory media of the flash memory granules constituting the SSD. Typically, flash memory granules support three operations, including: read, program (i.e., write) and erase.
Unlike the nature of mechanical hard disks that support overwrite, which does not require erasure, an erase operation must be performed on flash media before a write operation can be performed on them. While the minimum unit for reading and writing to flash media is a page, the minimum unit for erasing is a block (i.e., multiple pages).
Because the flash memory medium does not support overwriting, in some scenes, old data stored in a target page in a block to be erased needs to be copied to other places, and then the block is erased, so that new data can be continuously written into the target page. This results in an additional "write amplification" phenomenon, i.e. the amount of physical data actually written to the flash medium is a multiple of the amount of data planned to be written.
Based on the above scenario, when a SSD is read and written simultaneously, concurrent read and write requests may fall on the same flash memory particle of the SSD and then fall on the same block, so that the read request may be affected by the write request, resulting in an increase in the delay of the read request. For example: under normal conditions, response delay for SSD read requests is generally relatively stable, for example, fluctuates slightly around 0.5ms, but occasionally, the delay of several read requests is increased to 2ms, even 5ms, which is caused by access collision of read and write requests to the same block.
Based on the architecture of the full flash memory storage system as shown in fig. 1, the present application aims to provide a data read-write technical scheme for performing access isolation based on a RAID level of the full flash memory storage system.
When the method is implemented, the storage system comprises a plurality of solid state disks, a plurality of RAID arrays are preset in the storage system, and a first RAID array is selected from the RAID arrays based on a preset strategy; receiving a read-write request aiming at data of a storage space corresponding to the storage system; responding to the data read-write requests, and storing all write requests in the data read-write requests in the first RAID array.
In the above scheme, the data read-write requests of the full flash memory storage system are isolated and balanced at the RAID level, so that block (block) level media collision between the write requests and the pre-read IO is avoided, and the data read-write efficiency of the storage system is improved.
The present application is described below with reference to specific embodiments and specific application scenarios.
Referring to fig. 2, fig. 2 is a flowchart of a data read/write method according to an embodiment of the present application, where the method is applied to a storage system, the storage system includes a plurality of solid state disks, the storage system is preset with a plurality of RAID arrays, and the method performs the following steps:
And 204, receiving a read-write request aiming at the data of the storage space corresponding to the storage system.
The following describes in detail the technical solutions involved in the present application by specific embodiments and in combination with "RAID creation" and "data read/write":
1) RAID creation
In this specification, the storage system refers to a storage system that accommodates a plurality of solid state disks.
When the storage system is implemented, besides the solid state disk, the storage system may also include an SAS disk or an SATA disk.
In one embodiment, the memory system is, for example, the full flash memory system shown in fig. 1; the storage system supports NVMe protocol or SAS protocol to manage the solid state disk.
In this specification, the solid state disk may include any solid state disk in which the storage medium is a flash memory. For convenience of description, the solid state disk is abbreviated as SSD.
Referring to fig. 3, fig. 3 is a schematic diagram of an SSD according to an embodiment of the present application.
The SSD as shown in fig. 3 includes: control components, memory, flash Memory particles; the flash memory particles are used for data storage, are physical media for storing data, can persistently store the data, and can be organized together to provide better reading and writing speed; the control part is a control center of the SSD and is responsible for carrying out protocol processing with an access end of the SSD, thereby realizing mapping conversion from an external logical address to a flash memory medium included in the flash memory particles and realizing IO requests such as reading and writing; memory, which is a cache of SSD, is used to cache write IO and map metadata, and usually has power down protection capability.
In an embodiment shown, further, the solid state disk may also be a solid state disk supporting multi-stream writing. For ease of understanding, the following multi-stream writing concept is introduced here. Multi-stream writing refers to dividing data into multiple data streams according to different update frequencies, and when writing an SSD, a controller of the SSD recognizes the data streams, so as to write the data streams with the same characteristics together (consecutive blocks in the SSD).
In this specification, the storage system supports an SAS protocol to manage the solid state disk.
In another illustrated embodiment, the storage system supports NVMe protocol management of the solid state disk.
In this specification, the storage system may create RAID arrays based on the solid state disks.
For ease of understanding, the following basic RAID-related concepts will be described. RAID technology combines multiple independent physical disks in different ways to form a virtual disk. By adopting the RAID technology, parallel reading and writing of data can be realized, the data access rate is improved, meanwhile, the RAID technology applies technologies such as mirroring and parity check to carry out redundancy protection on the data, and the reliability of the data is greatly improved.
A RAID array may comprise a plurality of member disks, and the data in the RAID array is organized in stripes and stripes. When the RAID array is established, the storage space of the member disks included in the RAID array is divided into blocks with equal size and adjacent addresses according to the size of a preset block, and the blocks with equal size and adjacent addresses are called as blocks; the stripe is a set of stripe blocks related to positions on a plurality of member disks of the RAID array, the RAID implementation mode is different according to different RAID levels, the number of the member disks in the RAID array is different, the states of the member disks are different, RAID algorithms are different, and the RAID redundancy of data in the stripe blocks is also different.
In the RAID technology, the processing of a read/write command by a RAID array is processed according to strips, after the RAID array receives the read/write command sent by upper software, the strips to be operated are determined based on the address carried in the read/write command, then the read/write command is split into the read/write command aiming at the corresponding strips of one or more member disks in the strips based on factors such as RAID level, RAID algorithm, member disk state and the like, and the split read/write command is sent to the corresponding member disks for execution. Subsequently, the member disk executes the received read/write command and returns the execution result to the RAID array.
In this specification, the storage system may create a RAID array in the entire disk space of the plurality of solid state disks.
In a preferred embodiment, the storage system may partition all solid state disks.
Referring to fig. 4, fig. 4 is a schematic partition diagram of an SSD according to an embodiment of the present application.
Fig. 4 is the same SSD configuration as shown in fig. 3, except that the flash memory granule shown in fig. 4 (corresponding to 6 rectangular small squares within the dotted line) is divided into 3 partitions (corresponding to p1, p2, p3 in fig. 4).
For example, the above storage system may perform partitioning as shown in fig. 4 on all solid state disks included in the above storage system.
In an embodiment shown, after the storage system performs partitioning on all included solid state disks, further, the storage system may construct a RAID array with different partitions of all solid state disks. It should be noted that, by constructing a RAID array based on different partitions of all solid state disks, it is possible to provide a relatively large storage space in a relative proportion for each RAID array and provide a faster read-write speed, compared to performing RAID array creation based on a solid state disk full disk in the existing scheme.
For ease of understanding, the following prior RAID array creation scheme is presented herein. Such as: the above storage system has 18 SSD, and the existing RAID array creation scheme includes: the above storage system RAID6 algorithm creates 3 RAID arrays, and each RAID consists of 6 blocks of SSD. Because a RAID array created based on the RAID6 algorithm needs 2 pieces of parity data to maintain redundancy (see the description of the RAID6 algorithm in particular), a RAID array composed of 6 SSDs can only provide the capacity of 4 SSDs, and the capacity of the other 2 SSDs in the 6 SSDs is used to calculate parity data. Based on the above existing RAID array creation scheme, it can be seen that the data capacity that the above 3 RAIDs can finally provide is equal to the capacity of 12 SSDs; meanwhile, the read-write speed of each RAID does not exceed the sum of 6 SSD.
Referring to fig. 5, fig. 5 is a schematic view illustrating a RAID array according to an embodiment of the present application. The RAID array shown in fig. 5 is a schematic configuration diagram, and includes a plurality of 4 SSDs (corresponding to the top 4 solid-line rectangular boxes in fig. 5, respectively) similar to those shown in fig. 4; wherein each SSD performs partitioning similar to that shown in fig. 4 (where each SSD contains 3 partitions, the 1 st partition of the SSD corresponds to p1, p2, p3 in fig. 5, the 2 nd partition of the SSD corresponds to q1, q2, q3 in fig. 5, the 3 rd partition of the SSD corresponds to m1, m2, m3 in fig. 5, and the 4 th partition of the SSD corresponds to n1, n2, n3 in fig. 5).
As shown in fig. 5, the above storage system creates a RAID array as shown in fig. 5 with a partition of the 1 st SSD, a partition of the 2 nd SSD, a partition of the 3 rd SSD, and a partition of the 4 th SSD as "member disks" for creating RAID-a (see the introduction of the above "RAID concept"); wherein, the above-mentioned storage system has established 3 RAID arrays including: RAID-A, RAID-B, RAID-C.
The correspondence between the RAID arrays and the partitions shown in fig. 5 is shown by the dotted lines corresponding to the 3 RAID arrays shown in fig. 5.
For example: referring to fig. 5, RAID-a is composed of the above-described storage system, with a partition p1 of the 1 st SSD, a partition q1 of the 2 nd SSD, a partition m1 of the 3 rd SSD, and a partition m1 of the 4 th SSD; the RAID-B consists of the storage system and comprises a partition p2 of the 1 st SSD, a partition q2 of the 2 nd SSD, a partition m2 of the 3 rd SSD and a partition n2 of the 4 th SSD. The RAID-C consists of the storage system and comprises a partition p3 of the 1 st SSD, a partition q3 of the 2 nd SSD, a partition m3 of the 3 rd SSD and a partition n3 of the 4 th SSD. It should be noted that the storage system may construct a RAID array of any RAID type with different partitions of the solid state disk, and the RAID array corresponding to the RAID type is not specifically limited in this specification.
It should be noted that, because the partitions included in different RAID arrays are different, when concurrent read-write requests fall on different partitions, the concurrent read-write requests do not hit the same block, so that the concurrent processing of the storage system on the concurrent read-write requests is improved. For example: please refer to fig. 5, where the partitions of the 1 st SSD flash memory granule accessed by the 3 read/write requests (corresponding to Stream1, stream2, and Stream3 in fig. 5) are p1, p2, and p3 as shown in fig. 5, that is, the same block will not be hit.
2) Data read and write
In this specification, after the storage system has created a plurality of RAID arrays, an LUN (Logical Unit Number) volume may be further created based on the RAID arrays, so as to provide a storage service for a user; the LUN volume is an object for data storage provided for an application program used by a user in a storage system; that is, a LUN volume is an accessible object that the storage system provides to users (applications) of the storage system.
In this specification, after the storage system receives a read/write request from an application, the storage system may perform different processing for the read/write request.
During implementation, if a write request from an application program is received, the storage system finds an LUN volume corresponding to the write request, allocates a storage space in a corresponding RAID array where the LUN volume is located, and writes data included in the write request into the storage space; the storage system performs calculation and conversion on the data based on a RAID algorithm corresponding to the RAID array, and writes the calculated and converted data into an SSD or an SSD partition included in the RAID array; then, updating the metadata of the LUN volume, where the metadata records a mapping relationship between a logical space corresponding to the LUN volume and the RAID array storage space (please refer to the description of the existing metadata in the storage system, which is not described herein again); finally, a response to the write request is returned to the application.
In this specification, after receiving a read request from an application program, the storage system finds an LUN volume corresponding to the read request; then, according to the metadata of the LUN volume, finding out the mapping relation from the read request logic space to the RAID array storage space corresponding to the LUN volume; based on the mapping relation and on the RAID algorithm corresponding to the RAID array, reading corresponding data from the storage space corresponding to the RAID array; finally, a response to the read request and the corresponding read data are returned to the application.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating a correspondence relationship between a LUN volume and a RAID array according to an embodiment of the present application. The correspondence relationship between the LUN volumes and the RAID array is, for example, as shown in FIG. 6, and 3 LUN volumes (corresponding to LUN-1, LUN-2, and LUN-3 in FIG. 6) exist in RAID-A (RAID array). The storage system receives a plurality of read and write requests from the application program, as shown in fig. 6, there may be a write request for data a to be written into LUN-1; there may also be a write request to write data B of LUN-2; it is also possible that there is a write request to write data C of LUN-3 and a read request to read data D from LUN-3 at the same time. The plurality of read/write requests may be sequential or concurrent.
In this specification, the storage system selects a first RAID array from the plurality of RAID arrays before receiving the read/write request from the application.
In implementation, the storage system may traverse the plurality of RAID arrays to select the first RAID array.
In an embodiment shown, the storage system may also select the first RAID array from the plurality of RAID arrays based on a preset policy; the preset strategy is a polling-based RAID selection strategy.
When the polling is implemented, the polling RAID selection strategy refers to continuously querying and acquiring a plurality of RAID arrays of the storage system within a preset time period T, and selecting one RAID array from the plurality of RAID arrays as the first RAID array; and other RAID arrays except the first RAID array are used as the second RAID array, that is, the second RAID array may include a plurality of RAID arrays. In the next time period T, another RAID array (different from the first RAID array in the previous time period T) is selected from the plurality of RAID arrays as the first RAID array, and other RAID arrays except the first RAID array are used as the second RAID array. Therefore, similar to the process, the RAID array is selected from the RAID arrays in turn to serve as the first RAID array, and other RAID arrays outside the first RAID array are the second RAID array.
For example: based on the above described storage system as described in FIG. 5, there are 3 RAID arrays RAID-A, RAID-B, RAID-C. In a 1 st time period T, the storage system selects RAID-a as the first RAID array; in the 2 nd time period T, the storage system selects RAID-B as the first RAID array; during the 3 rd time period T, the storage system selects RAID-C as the first RAID array.
In this specification, after the first RAID array is selected from the plurality of RAID arrays based on the preset policy, the storage system receives a read/write request for data in a storage space corresponding to the storage system.
The read-write request refers to one or more read-write requests of an application program to a plurality of LUN volumes of the storage system located on the RAID arrays. It should be noted that the read-write request may access different LUN volumes corresponding to different RAID arrays, and the read-write request may be concurrent.
In this specification, the storage system stores all write requests in the data read/write request in the first RAID array in response to the data read/write request.
For example: based on the storage system as shown in fig. 5, there are 3 RAID arrays, RAID-a, RAID-B, and RAID-C, and at the current time (for example, within 1 time period T of the preset policy), the first RAID array is RAID-a. The application program has read-write requests to LUN volumes on RAID-A, RAID-B and RAID-C, and the storage system stores all write requests in the data read-write requests on RAID-A.
It should be noted that, based on the existing implementation (please refer to the corresponding description that, after the storage system receives a read-write request from an application program, the storage system may perform different processing on the read-write request, "in" data read-write "), the write requests for LUN volumes located in different RAID arrays all need to be stored in the storage space allocated to the corresponding different RAID arrays, instead of storing one RAID array. And the storage system responds to the data read-write request and stores all write requests in the data read-write request in the first RAID array, so that all write requests can fall in the same RAID in the same time period.
In an embodiment shown in the present disclosure, the storage system selects the second RAID array from the plurality of RAID arrays based on a preset policy, where the second RAID is another RAID array of the plurality of RAID arrays except the first RAID array.
For example: based on the above described storage system as described in FIG. 5, there are 3 RAID arrays RAID-A, RAID-B, RAID-C. In the 1 st time period T, the storage system selects RAID-A as the first RAID array, and RAID-B and RAID-C arrays except RAID-A as the second RAID array; in the 2 nd time period T, the storage system selects RAID-B as the first RAID array, and RAID-A and RAID-C arrays except RAID-B as the second RAID array; in the 3 rd time period T, the storage system selects RAID-C as the first RAID array and RAID-a and RAID-B arrays other than RAID-C as the second RAID array.
In this specification, after the second RAID array is selected, the storage system performs a pre-read operation on data in a storage space corresponding to the second RAID, and stores data obtained by the pre-read operation in the pre-read cache; the read-ahead cache may be implemented based on a memory or other cache hardware, and is not specifically limited in this specification.
In this specification, after performing a pre-read operation on data in the storage space corresponding to the second RAID, the storage system searches whether there is matching data in the pre-read cache in response to a read request for data in the storage space corresponding to the second RAID in the data read-write request; and if so, returning the matching data to the application corresponding to the read request.
Based on the storage system as shown in fig. 5, there are 3 RAID arrays, RAID-a, RAID-B, and RAID-C, and at the current time (for example, within 1 time period T of the preset policy), the first RAID array is RAID-a, and the second RAID array is RAID-B, and RAID-C. The application program has read-write requests to LUN volumes on RAID-A, RAID-B and RAID-C,
the storage system performs pre-reading on RAID-B and RAID-C (the second RAID) and stores pre-read data in the pre-read cache, and the storage system searches whether there is matching data in the pre-read cache in response to a read request for data in a storage space corresponding to RAID-B and RAID-C (the second RAID) in the data read-write request; if yes, returning the matching data to an application program (or application for short) corresponding to the reading request.
It should be noted that, while the storage system responds to the data read-write request and stores all write requests in the data read-write request in the first RAID array, the RAID array corresponding to the pre-read operation performed on the data in the storage space corresponding to the second RAID is the second RAID array, so that all write requests may fall on the same RAID (the first RAID) and all pre-read IOs may fall on other RAIDs (the second RAID) in the same time period, which avoids a block-level media collision between a write request and a pre-read IO, and does not worry about blocking pre-read by the write request or blocking write request by pre-read.
In a preferred embodiment, the memory system may further expand the capacity of the read-ahead cache to increase the read-ahead hit rate.
It should be noted that, the storage system may implement the write request and the pre-read IO uniformly on each RAID array of the RAID arrays based on the preset policy (for example, a polling-based RAID selection policy).
In the technical scheme, the data read-write requests of the full flash memory storage system are isolated and balanced on the RAID level, and block (block) level medium conflict between the write requests and the pre-read IO is avoided, so that the data read-write efficiency of the storage system is improved.
Corresponding to the embodiment of the method, the application also provides an embodiment of a data reading and writing device.
Corresponding to the above method embodiments, the present specification also provides an embodiment of a data reading and writing apparatus. The embodiment of the data reading and writing device in the specification can be applied to electronic equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware aspect, as shown in fig. 7, the hardware structure diagram of the electronic device where the data reading and writing apparatus of this specification is located is shown in fig. 7, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 7, the electronic device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the electronic device, which is not described again.
Fig. 8 is a block diagram of a data reading and writing apparatus according to an embodiment of the present disclosure.
Referring to fig. 8, the data reading/writing apparatus 80 may be applied to the electronic device shown in fig. 7, where the apparatus is applied to a storage device, the storage system includes a plurality of solid state disks, the storage system is preset with a plurality of RAID arrays, and the apparatus includes:
a selecting module 801, configured to select a first RAID array from the plurality of RAID arrays based on a preset policy;
an obtaining module 802, configured to receive a read-write request for data in a storage space corresponding to the storage system;
the read-write module 803, in response to the data read-write request, stores all write requests in the data read-write request in the first RAID array.
In this embodiment, the storage system further includes a read-ahead cache, and further includes:
the selecting module 801 further selects a second RAID array from the plurality of RAID arrays based on a preset policy, where the second RAID array is another RAID array of the plurality of RAID arrays except the first RAID array;
the read-write module 803 further performs a pre-read operation on the data in the storage space corresponding to the second RAID, and stores the data obtained by pre-read in the pre-read cache;
the read-write module 803 further, in response to a read request for data in the storage space corresponding to the second RAID in the data read-write request, searching whether there is matching data in the pre-read cache; and if so, returning the matching data to the application corresponding to the read request.
In this embodiment, the preset policy is a polling-based RAID selection policy.
In the embodiment, the RAID arrays are constructed by different partitions located in all solid state disks.
In this embodiment, the solid state disk is a solid state disk supporting multi-stream writing.
In this embodiment, the storage system is a full flash memory storage system, and the storage system supports NVMe protocol management on the solid state disk.
For the device embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The apparatuses, modules or modules illustrated in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the method embodiment, the present specification also provides an embodiment of an electronic device. The electronic equipment can be applied to storage equipment, the storage system comprises a plurality of solid state disks, and a plurality of RAID arrays are preset in the storage system; the electronic device includes: a processor and a memory for storing machine executable instructions; wherein the processor and the memory are typically interconnected by an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to, by reading and executing machine-executable instructions stored by the memory corresponding to data read and write logic:
selecting a first RAID array from the RAID arrays based on a preset strategy;
receiving a read-write request aiming at data of a storage space corresponding to the storage system;
responding to the data read-write request, and storing all write requests in the data read-write request in the first RAID array.
In this embodiment, the storage system further includes a read-ahead cache, and the processor is caused to:
selecting a second RAID array from the plurality of RAID arrays based on a preset strategy, wherein the second RAID is other RAID arrays except the first RAID array in the plurality of RAID arrays;
performing pre-reading operation on the data in the storage space corresponding to the second RAID, and storing the data obtained by pre-reading in the pre-reading cache;
responding to a read request aiming at the data of the storage space corresponding to the second RAID in the data read-write requests, and searching whether matched data exists in the pre-read cache; and if so, returning the matching data to the application corresponding to the read request.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following the general principles of the specification and including such departures from the present disclosure as come within known or customary practice in the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.
Claims (10)
1. A data read-write method is characterized in that the method is applied to a storage system, the storage system comprises a plurality of solid state disks, a plurality of RAID arrays and a pre-read cache are preset in the storage system, and the method comprises the following steps:
selecting a first RAID array from the RAID arrays based on a preset strategy in a time period T, wherein the preset strategy is a polling-based RAID selection strategy;
receiving a read-write request aiming at data of a storage space corresponding to the storage system;
responding to the data read-write request, and storing all write requests in the data read-write request in the first RAID array; selecting a second RAID array from the plurality of RAID arrays based on a preset strategy, wherein the second RAID is other RAID arrays except the first RAID array in the plurality of RAID arrays;
performing pre-reading operation on the data in the storage space corresponding to the second RAID, and storing the data obtained by pre-reading in the pre-reading cache;
responding to a read request aiming at the data of the storage space corresponding to the second RAID in the data read-write requests, and searching whether matched data exists in the pre-read cache; and if so, returning the matching data to the application corresponding to the read request.
2. The method of claim 1, wherein the plurality of RAID arrays are constructed from different partitions located on all solid state drives.
3. The method of claim 1, wherein the solid state disk is a solid state disk supporting multi-stream writing.
4. The method of claim 1, wherein the storage system is an all flash storage system, and the storage system supports NVMe protocol management of the solid state disk.
5. The data read-write device is characterized in that the device is applied to a storage system, the storage system comprises a plurality of solid state disks, a plurality of RAID arrays and a pre-read cache are preset in the storage system, and the device comprises:
the selection module selects a first RAID array from the RAID arrays based on a preset strategy in a time period T, wherein the preset strategy is a polling-based RAID selection strategy;
the acquisition module receives a read-write request aiming at data of a storage space corresponding to the storage system;
the read-write module responds to the data read-write request and stores all write requests in the data read-write request in the first RAID array;
the selection module further selects a second RAID array from the RAID arrays based on a preset strategy, wherein the second RAID array is the other RAID arrays except the first RAID array in the RAID arrays;
the read-write module further executes pre-read operation on the data in the storage space corresponding to the second RAID, and stores the data obtained by pre-read in the pre-read cache; responding to a read request aiming at the data of the storage space corresponding to the second RAID in the data read-write requests, and searching whether matched data exists in the pre-read cache; and if so, returning the matching data to the application corresponding to the read request.
6. The apparatus of claim 5, wherein the RAID arrays are constructed from different partitions located on all solid state drives.
7. The apparatus of claim 5, wherein the solid state disk is a solid state disk supporting multi-stream writing.
8. The apparatus of claim 5, wherein the storage system is an all flash storage system, and the storage system supports NVMe protocol management of the solid state disk.
9. An electronic device is characterized by comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory has stored therein machine-readable instructions, which the processor executes by calling the machine-readable instructions to perform the method of any one of claims 1 to 4.
10. A machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, carry out the method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910419198.XA CN110196687B (en) | 2019-05-20 | 2019-05-20 | Data reading and writing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910419198.XA CN110196687B (en) | 2019-05-20 | 2019-05-20 | Data reading and writing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110196687A CN110196687A (en) | 2019-09-03 |
CN110196687B true CN110196687B (en) | 2023-02-03 |
Family
ID=67752922
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910419198.XA Active CN110196687B (en) | 2019-05-20 | 2019-05-20 | Data reading and writing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110196687B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11442809B1 (en) * | 2019-07-17 | 2022-09-13 | Marvell Asia Pte, Ltd. | Double-parity raid enabling recovery of two failed data units |
CN113377278A (en) * | 2020-03-10 | 2021-09-10 | 阿里巴巴集团控股有限公司 | Solid state disk, garbage recycling and controlling method, equipment, system and storage medium |
CN113448877A (en) * | 2020-03-26 | 2021-09-28 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program for data storage |
CN113031862B (en) * | 2021-03-18 | 2024-03-22 | 中国电子科技集团公司第五十二研究所 | Storage system for controlling SATA disk based on NVME protocol |
CN114546294B (en) * | 2022-04-22 | 2022-07-22 | 苏州浪潮智能科技有限公司 | Solid state disk reading method, system and related components |
CN116027975A (en) * | 2022-12-15 | 2023-04-28 | 超聚变数字技术有限公司 | Data multi-stream writing method and related device for RAID group |
CN115858410B (en) * | 2023-02-16 | 2023-05-23 | 浪潮电子信息产业股份有限公司 | IO processing method, device, equipment and storage medium |
CN118244996B (en) * | 2024-05-28 | 2024-08-09 | 山东云海国创云计算装备产业创新中心有限公司 | Hard disk read-write method, hard disk read-write device, electronic equipment, readable storage medium and product |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101118477A (en) * | 2007-08-24 | 2008-02-06 | 成都索贝数码科技股份有限公司 | Process for enhancing magnetic disc data accessing efficiency |
CN101493795A (en) * | 2008-01-24 | 2009-07-29 | 杭州华三通信技术有限公司 | Storage system, storage controller, and cache implementing method in the storage system |
CN102693096A (en) * | 2012-05-17 | 2012-09-26 | 山西达鑫核科技有限公司 | Bit-based serial transmission cloud storage method and device |
US9946471B1 (en) * | 2015-03-31 | 2018-04-17 | EMC IP Holding Company LLC | RAID groups based on endurance sets |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1306381C (en) * | 2004-08-18 | 2007-03-21 | 华为技术有限公司 | Read-write method for disc array data and parallel read-write method |
US8200887B2 (en) * | 2007-03-29 | 2012-06-12 | Violin Memory, Inc. | Memory management system and method |
US20130019057A1 (en) * | 2011-07-15 | 2013-01-17 | Violin Memory, Inc. | Flash disk array and controller |
CN103777894A (en) * | 2012-10-25 | 2014-05-07 | 深圳市中兴微电子技术有限公司 | Method and device for eliminating read-write conflict of memorizer |
CN107203330B (en) * | 2016-03-17 | 2021-03-23 | 北京忆恒创源科技有限公司 | Read-write data stream oriented flash memory data distribution method |
CN106201923B (en) * | 2016-07-20 | 2019-05-07 | 杭州宏杉科技股份有限公司 | Method for reading and writing data and device |
CN109213423B (en) * | 2017-06-30 | 2024-01-26 | 北京忆恒创源科技股份有限公司 | Address barrier-based lock-free processing of concurrent IO commands |
-
2019
- 2019-05-20 CN CN201910419198.XA patent/CN110196687B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101118477A (en) * | 2007-08-24 | 2008-02-06 | 成都索贝数码科技股份有限公司 | Process for enhancing magnetic disc data accessing efficiency |
CN101493795A (en) * | 2008-01-24 | 2009-07-29 | 杭州华三通信技术有限公司 | Storage system, storage controller, and cache implementing method in the storage system |
CN102693096A (en) * | 2012-05-17 | 2012-09-26 | 山西达鑫核科技有限公司 | Bit-based serial transmission cloud storage method and device |
US9946471B1 (en) * | 2015-03-31 | 2018-04-17 | EMC IP Holding Company LLC | RAID groups based on endurance sets |
Also Published As
Publication number | Publication date |
---|---|
CN110196687A (en) | 2019-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110196687B (en) | Data reading and writing method and device and electronic equipment | |
US20090157756A1 (en) | File System For Storing Files In Multiple Different Data Storage Media | |
KR20200022118A (en) | Data storage device and operating method thereof | |
US20100250826A1 (en) | Memory systems with a plurality of structures and methods for operating the same | |
WO2017148242A1 (en) | Method for accessing shingled magnetic recording (smr) hard disk, and server | |
US11144224B2 (en) | Locality-aware, memory-efficient, time-efficient hot data identification using count-min-sketch for flash or streaming applications | |
US8234459B2 (en) | Switch module based non-volatile memory in a server | |
US11042324B2 (en) | Managing a raid group that uses storage devices of different types that provide different data storage characteristics | |
JP2008016025A (en) | Command queue ordering by flipping active write zone | |
US10956326B2 (en) | Storage system with data management and protection mechanism and method of operation thereof | |
US8683120B2 (en) | Method and apparatus to allocate area to virtual volume | |
JP5884602B2 (en) | Storage control device and storage system | |
US11526447B1 (en) | Destaging multiple cache slots in a single back-end track in a RAID subsystem | |
CN103530236A (en) | Method and device for obtaining hybrid hard disk | |
US8468303B2 (en) | Method and apparatus to allocate area to virtual volume based on object access type | |
US11709781B2 (en) | Method of managing data in storage device based on variable size mapping, method of operating storage device using the same and storage device performing the same | |
US10929032B1 (en) | Host hinting for smart disk allocation to improve sequential access performance | |
US10268386B2 (en) | Data storage device including temporary storage locations | |
US11327666B2 (en) | RAID member distribution for granular disk array growth | |
US9785563B1 (en) | Read command processing for data storage system based on previous writes | |
KR20220119348A (en) | Snapshot management in partitioned storage | |
US6898666B1 (en) | Multiple memory system support through segment assignment | |
CN114730291A (en) | Data parking of SSD with partitions | |
KR20210079894A (en) | Data storage device and operating method thereof | |
US20230153238A1 (en) | Method of operating a storage device using multi-level address translation and a storage device performing the same |
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 |