CN116583827A - Data access method, device, disk controller, disk and data storage system - Google Patents

Data access method, device, disk controller, disk and data storage system Download PDF

Info

Publication number
CN116583827A
CN116583827A CN202180031237.4A CN202180031237A CN116583827A CN 116583827 A CN116583827 A CN 116583827A CN 202180031237 A CN202180031237 A CN 202180031237A CN 116583827 A CN116583827 A CN 116583827A
Authority
CN
China
Prior art keywords
data
disk
instruction
target
unit
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.)
Pending
Application number
CN202180031237.4A
Other languages
Chinese (zh)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN116583827A publication Critical patent/CN116583827A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The application discloses a data access method, a device, a disk controller, a disk and a data storage system, wherein the data access method comprises the following steps: the method comprises the steps that a disk controller obtains first data to be written into a target disk, and sends the first data to the target disk; when the first data is determined to be written in a delayed manner, the disk controller sends a delayed writing instruction aiming at the first data to the target disk, so that the target disk is prevented from frequently executing data writing operation, and resource consumption caused by data writing is saved; or the disk controller determines a target storage address of the prefetched data and a target disk, and sends a prefetched data instruction generated based on the target storage address to the target disk, so that the target disk stores the data stored in the nonvolatile memory into the cache unit, and can directly read the data from the cache unit without reading the data in the nonvolatile memory, thereby greatly reducing the reading time delay, improving the reading efficiency of the data, and improving the performance of the data storage system.

Description

Data access method, device, disk controller, disk and data storage system Technical Field
The present application relates to the field of computer storage technologies, and in particular, to a data access method, a data access device, a disk controller, a disk, and a data storage system.
Background
The magnetic disk is a memory for storing computer programs or data, and has the characteristic of keeping the data from losing after power failure. In a data storage system, a computer or an application server can store processed data in a disk through a disk writing instruction, and can also read required data from the disk through a disk reading instruction.
However, if the disk receives data to be written by the computer or the application server, the data writing operation is performed, which results in frequent data writing operation, and increases system power consumption and resource consumption; if the disk receives the disk reading instruction of the computer or the application server and then executes the data reading operation, the required data is read from the disk, the reading time delay is increased, and the data reading efficiency is reduced. The data reading and writing processes can affect the performance of the data storage system.
Disclosure of Invention
The embodiment of the application provides a data access method, a data access device, a disk controller, a disk and a data storage system, which are used for improving the performance of the data storage system.
In a first aspect, an embodiment of the present application provides a data access method, including: a disk controller in a data storage system acquires first data to be written into a target disk and sends the first data to the target disk; if the first data is determined to meet the following setting conditions, the disk controller sends a delayed write instruction for the first data to the target disk; wherein, the setting conditions include: the first data is written into the data to be written of the disk array, and the second data is included in the data to be written of the disk array; the disk array includes a plurality of disks controlled by a disk controller; the second data is the data to be written in the target stripe; the target stripe includes a plurality of stripe units located on different disks, including a target stripe unit in the target disk for storing the first data.
The disk controller sends a delayed write-in instruction aiming at the first data to the target disk, so that the target disk delays writing the first data into the nonvolatile memory, frequent data writing operation of the disk is avoided, resource consumption caused by data writing is saved, and performance of the data storage system is improved.
The disk controller can learn the writing of data to other disks in the disk array in addition to the writing of data to the target disk, and therefore, the disk controller can more accurately determine whether or not the writing of data to the nonvolatile memory of the target disk needs to be delayed in combination with the writing of data to the plurality of disks, as compared with the case where the target disk determines whether or not the writing of data to the nonvolatile memory is delayed.
Illustratively, after the disk controller obtains the first data, a target disk, a target stripe unit, and a target stripe for storing the first data are determined. The target stripe unit is a stripe unit in a target disk, the target stripe is a stripe comprising the target stripe unit, and the target stripe comprises a plurality of stripe units in different disks of the disk array in addition to the target stripe unit. The disk controller may also predict a disk and stripe corresponding to data to be written to the disk array after the first data.
For example, if the first data is data of a first stripe unit to be written to the target disk, the disk controller predicts that the first data is to be written to the disk after the first data, and includes second data of a second stripe unit to be written to the target disk, where the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different disks, the disk controller may predict that the first data needs to be read back when the second data is written, and update the check data of the target stripe based on the first data and the second data, so that the disk controller determines that the first data is to be subsequently read back data to be read back, thereby determining that the first data meets a set condition, and the disk controller sends a delayed write instruction of the first data to the target disk, so that the target disk stores the first data in the cache unit, delays writing to the nonvolatile memory, and reduces the number of times that the target performs data operation. After the disk controller acquires the second data, the first data can be acquired from the target disk, updated check data is determined based on the first data and the second data, and then a data writing instruction is sent to the target disk again, wherein the data writing instruction indicates the target disk to write the first data into a target storage address in the nonvolatile memory.
For another example, if the first data is the check data of the third stripe unit to be written into the target disk, the disk controller predicts that the second data of the second stripe unit to be written into the target disk is included in the data to be written into the disk after the first data, and when the second data is written into the target stripe, the check data needs to be updated, so that the disk controller can determine that the first data is the data to be updated which needs to be updated, and send a delayed write indication to the target disk, so that the target disk delays writing the first data. After the disk controller acquires the second data, updated check data, hereinafter referred to as update data, may be determined based on the second data. The disk controller sends a data writing instruction of the update data to the target disk, wherein the data writing instruction of the update data is used for indicating the target disk to write the update data into the nonvolatile memory of the target disk, and at the moment, the target disk can directly write the update data without writing the first data into the nonvolatile memory, so that the repeated execution of the data writing operation on the same stripe unit in the nonvolatile memory can be reduced, the erasing times of the consumed disk are reduced, and the service life of the disk is prolonged.
In one possible implementation, the disk controller may be connected between the host and the disk, where the host sends data to be written to the disk controller via a write disk command, and the disk controller sends a data write command to the disk. In the embodiment of the application, the first data may be data carried in a write disk instruction received by the disk controller, the disk controller may determine whether the data write mode is sequential write according to logical addresses in a plurality of write disk instructions received continuously, if the data write mode is sequential write, and if there are other spare stripe units in the target stripe besides the target stripe unit, the disk controller may infer that the data to be written includes second data to be written into the target stripe, and further may determine that the first data meets a set condition.
Because the disk controller is connected between the host and the disk, a plurality of disks can be managed, and compared with the case that the disk determines whether the first data is the data which can be written in a delayed manner, the disk controller can more accurately determine whether the first data is the data which can be written in a delayed manner by combining the case of writing the data into the plurality of disks, so that misoperation of the disk is reduced.
In one possible implementation manner, after the disk controller obtains the first data to be written to the target disk, a data writing instruction containing the first data is sent to the target disk, and the disk controller may carry the delayed writing instruction in the data writing instruction and send the delayed writing instruction to the target disk. Carrying the deferred write instruction in the data write instruction may reduce signaling overhead. In another possible implementation manner, the disk controller may also send the delayed write instruction to the target disk in an instruction other than the data write instruction of the first data. For example, the disk controller may send a separate operation instruction containing a delayed write indication to the target disk to increase the degree of freedom to send the delayed write indication. Whether the deferred write instruction is sent to the target disk by a data write instruction or sent to the target disk by a separate operation instruction, the deferred write instruction may include a deferred write identifier and a target storage address of the first data, where the target storage address of the first data may be an address of a target stripe unit used to store the first data, so that the target disk may accurately determine which address of data may be deferred to be written.
If the disk controller sends the delayed write instruction to the target disk in an instruction other than the data write instruction of the first data, the instruction containing the delayed write instruction may be sent after the data write instruction of the first data is sent to the target disk, and a time interval between a sending time of the delayed write instruction and a sending time of the data write instruction of the first data is smaller than a set time threshold value, so as to ensure that the delayed write instruction for the first data may be received before the target disk writes the first data to the nonvolatile memory.
In a second aspect, an embodiment of the present application provides a data access method, including: the method comprises the steps that a disk controller in a data storage system determines a target storage address and a target disk of prefetched data, and sends a prefetched data instruction generated based on the target storage address to the target disk, so that the target disk can read data stored in the target storage address of a nonvolatile memory into a cache unit in advance based on the prefetched data instruction, and can directly read the data from the cache unit without reading the data into the nonvolatile memory when a first data reading instruction for the data is received by a subsequent target disk, thereby greatly reducing the reading time delay, improving the data reading efficiency and improving the performance of a data storage system.
In one possible implementation, the disk controller may determine whether the data read mode is sequential read according to the logical address in the plurality of sequentially received disk read instructions, and if the data read mode is sequential read, determine the target storage address and the target disk of the prefetched data according to the logical address in the currently received disk read instruction. In another possible implementation manner, the disk controller may determine, during the repair of the to-be-repaired disk, the target storage address and the target disk of the prefetched data according to the target stripe to which the stripe unit to be repaired belongs. The stripe unit to be repaired is a stripe unit in the disk to be repaired, the target stripe comprises a plurality of stripe units positioned in different disks, and the target storage address can be an address of any one stripe unit except the stripe unit in the disk to be repaired in the target stripe.
Because the disk controller is connected between the host and the disk, a plurality of disks can be managed, and compared with the case that the disk determines which address to prefetch the data stored by the disk, the disk controller can more accurately determine which address to prefetch the data stored by the disk by combining the situation that the plurality of disks are managed, thereby reducing the misoperation of the disk.
In one possible implementation manner, after the disk controller determines the target storage address and the target disk of the prefetched data, the prefetched data indication may be carried in a second data reading instruction sent to the target disk and sent to the target disk; the second data read instruction is for instructing the target disk to read data from the specified storage address. Carrying the prefetch data indication in the data write instruction or the data read instruction can reduce signaling overhead. In another possible implementation, the disk controller may send a separate operation instruction containing the prefetch data indication to the target disk to increase the degree of freedom to send the prefetch data indication. The individual operation instruction may be any access instruction sent by the disk controller to the target disk.
In a third aspect, an embodiment of the present application further provides a data access method, applied to a magnetic disk, where the method includes:
receiving first data sent by a disk controller and receiving a delayed write instruction of the first data sent by the disk controller; the delayed writing instruction is used for instructing the disk to temporarily store the first data in a cache unit of the disk;
the first data is temporarily stored in a cache unit of the disk.
In one possible implementation, the delayed write indication includes a delayed write identification and a target storage address of the first data.
In one possible implementation manner, the disk may receive a data writing instruction sent by the disk controller, and obtain a delayed writing instruction carried in the data writing instruction; the data writing instruction comprises the first data. In another possible implementation, the disk may receive a separate operation instruction sent by the disk controller that includes a delayed write indication.
In one possible implementation manner, if the first data is verification data, after the first data is temporarily stored in a cache unit of the disk, the disk receives a data writing instruction of update data sent by the disk controller; the data writing instruction of the updated data indicates the disk to write the updated check data into a target storage address, and the target storage address is the same as the target storage address of the first data; and writing the updated data into a nonvolatile memory of the disk according to the target storage address, and deleting the first data in the cache unit.
In a fourth aspect, an embodiment of the present application further provides a data access method, applied to a magnetic disk, where the method includes:
Receiving a prefetch data instruction sent by a disk controller; the prefetch data indication is generated by the disk controller based on a target storage address of the prefetch data;
reading the prefetched data stored in a target storage address carried by the prefetched data indication into a cache unit of a magnetic disk;
receiving a first data reading instruction aiming at prefetched data and sent by a disk controller;
and acquiring the prefetched data from the cache unit and sending the prefetched data to the disk controller.
In one possible implementation manner, the disk may receive a second data reading instruction sent by the disk controller, and obtain a prefetch data indication carried in the second data reading instruction; the second data read instruction is for instructing the disk to read data from the specified storage address. In another possible implementation, the disk may receive a separate operation instruction containing an indication of the prefetch data sent by the disk controller.
In a fifth aspect, an embodiment of the present application further provides a data access apparatus, applied to a disk controller, where the apparatus includes:
the data acquisition unit is used for acquiring first data to be written into the target disk;
a sending unit, configured to send the first data to a target disk and send a delayed write instruction of the first data to the target disk when it is determined that the first data meets a set condition; the delayed write indication is used for indicating the target disk to temporarily store the first data in a cache unit of the target disk.
In a sixth aspect, an embodiment of the present application further provides a data access apparatus, applied to a disk controller, where the apparatus includes:
the prediction unit is used for determining a target storage address and a target disk of the prefetched data; the target disk comprises a cache unit;
an instruction transmitting unit configured to transmit, to a target disk, a prefetch data instruction generated based on a target storage address; the prefetched data indication is used for indicating the target disk to read the prefetched data from the target storage address to the cache unit; and sending a data reading instruction for the prefetched data to the target disk;
the data receiving unit is used for receiving the prefetched data acquired and sent by the target disk from the caching unit.
In a seventh aspect, an embodiment of the present application further provides a data access apparatus, applied to a magnetic disk, including:
the receiving unit is used for receiving the first data sent by the disk controller and receiving a delayed write-in instruction of the first data sent by the disk controller; the delayed writing instruction is used for instructing the disk to temporarily store the first data in a cache unit of the disk;
and the execution unit is used for temporarily storing the first data in a cache unit of the magnetic disk.
In an eighth aspect, an embodiment of the present application further provides a data access apparatus, applied to a magnetic disk, including:
The instruction receiving unit is used for receiving the prefetched data instruction sent by the disk controller; the prefetched data indicates a target memory address carrying the prefetched data;
the instruction execution unit is used for reading the prefetched data stored in the storage space corresponding to the target storage address into a cache unit of a magnetic disk;
the data transmission unit is used for receiving a first data reading instruction aiming at the prefetched data and sent by the disk controller, acquiring the prefetched data from the caching unit and sending the prefetched data to the disk controller.
In a ninth aspect, an embodiment of the present application further provides a disk controller, including a memory and a processor, where the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, causes the processor to implement any one of the methods described in the first aspect or any one of the methods described in the second aspect.
In a tenth aspect, an embodiment of the present application further provides a magnetic disk, including a memory and a processor, where the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, causes the processor to implement any one of the methods described in the third aspect or any one of the methods described in the fourth aspect.
In an eleventh aspect, an embodiment of the present application further provides a data storage system, including the disk controller provided in the ninth aspect and the disk provided in the tenth aspect.
In a twelfth aspect, embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions for causing a computer to perform any one of the methods provided in the first aspect or any one of the methods provided in the second aspect.
In a thirteenth aspect, embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions for causing a computer to perform any one of the methods provided in the third aspect or any one of the methods provided in the fourth aspect.
In a fourteenth aspect, embodiments of the present application provide a computer program product comprising computer executable instructions for causing a computer to perform any of the methods provided in the first aspect, or any of the methods provided in the second aspect.
In a fifteenth aspect, embodiments of the present application provide a computer program product comprising computer executable instructions for causing a computer to perform any of the methods provided in the third aspect or any of the methods provided in the fourth aspect.
The technical effects that can be achieved by any one of the third aspect to the fifteenth aspect may be referred to the description of the advantageous effects in the first aspect or the second aspect, and the detailed description is not repeated here.
Drawings
FIG. 1 is a schematic diagram of a data storage system according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a disk array according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another data storage system according to an embodiment of the present application;
FIG. 4 is a diagram illustrating interactions between a disk controller and a target disk during writing data according to an embodiment of the present application;
FIG. 5 is a diagram illustrating an interaction between a disk controller and a target disk during writing data according to another embodiment of the present application;
FIG. 6 is an interaction diagram between a disk controller and a target disk in a process of prefetching data according to an embodiment of the present application;
FIG. 7 is a diagram illustrating interaction between a disk controller and a target disk during another process of prefetching data according to an embodiment of the present application;
FIG. 8 is a flowchart of a method for accessing data performed by a disk controller according to an embodiment of the present application;
FIG. 9 is a flowchart of a method for accessing data executed by a disk according to an embodiment of the present application;
FIG. 10 is a flowchart of a data access method performed by another disk controller according to an embodiment of the present application;
FIG. 11 is a flowchart of another method for accessing data performed by a disk according to an embodiment of the present application;
FIG. 12 is a block diagram illustrating a data access apparatus according to an embodiment of the present application;
FIG. 13 is a block diagram illustrating another data access apparatus according to an embodiment of the present application;
FIG. 14 is a block diagram illustrating another data access apparatus according to an embodiment of the present application;
FIG. 15 is a block diagram illustrating another data access apparatus according to an embodiment of the present application;
FIG. 16 is a schematic diagram of a disk controller according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of a magnetic disk according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. The terminology used in the description of the embodiments of the application herein is for the purpose of describing particular embodiments of the application only and is not intended to be limiting of the application. It will be apparent that the described embodiments are merely some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Before describing the embodiments of the present application, some of the words in the present application are explained in order to facilitate understanding of those skilled in the art, and the words in the present application are not limited thereto.
(1) Redundant array of independent disks (redundant array of independent disks, RAID) system: the disk array comprising a plurality of disks (also called physical disks) can also be called disk groups, and the plurality of disks as a whole provide a storage function outwards and are the basis of virtual disks. Virtual disks are understood to be sequential data storage elements, divided using disk groups, that correspond to one or more individual disks. A RAID system manages a plurality of disks by using a RAID controller, and one RAID controller can manage a plurality of disks.
The RAID controller obtains redundancy protection by simultaneously writing the same data into a plurality of disks or writing the verification result corresponding to the written data into the disks, thereby improving the reliability of the stored data and providing higher storage performance and higher data reliability for users.
In the embodiments of the present application, "a plurality" refers to two or more, and in this regard, "a plurality" may be understood as "at least two" in the embodiments of the present application. "at least one" may be understood as one or more, for example as one, two or more. For example, including at least one means including one, two or more, and not limiting what is included, e.g., including at least one of A, B and C, then A, B, C, A and B, A and C, B and C, or A and B and C, may be included. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/", unless otherwise specified, generally indicates that the associated object is an "or" relationship.
Unless stated to the contrary, the embodiments of the present application refer to ordinal terms such as "first," "second," etc., for distinguishing between multiple objects and not for defining a sequence, timing, priority, or importance of the multiple objects.
In order to improve performance of a data storage system, an embodiment of the present application provides a data access method. The data access method may be applied to the data storage system shown in fig. 1 or 3.
FIG. 1 is a schematic diagram of a data storage system. As the amount of traffic that needs to be handled increases, so does the data that needs to run on a single server. When a single disk is limited by capacity and security and is insufficient to support system services on a server, multiple disks need to be combined together to be used as a virtual disk to meet the actual needs of the server.
The data storage system shown in fig. 1 may include a server 100, a disk array 300 composed of a plurality of disks, and a disk controller 200 for managing the disks. Wherein disk controller 200 may be a RAID controller, coupled between server 100 and a plurality of disks. The server 100 may be referred to as a host (host), and the disk may be a Solid State Disk (SSD), a mechanical hard disk, such as a serial attached small computer system interface (serial attached small computer system interface, SAS) disk or a serial advanced technology attachment (serial advanced technology attachment, SATA) disk. The RAID controller and the plurality of disks form a RAID system, the RAID controller receives an access disk command sent by a host, and obtains a logic address in the access disk command, wherein the logic address can comprise a logic unit number (logical unit number, LUN). The RAID controller converts the logical address in the access disk instruction into the physical address of the disk, accesses the target disk corresponding to the physical address, and writes data into the target disk or reads data from the target disk according to the access disk instruction. In the application scenario shown in fig. 1, the host is a server, and in other application scenarios, the host may be a computer or other electronic devices.
Illustratively, as shown in FIG. 2, assuming that 3 disks are included in disk array 300, disk 301, disk 302, and disk 303,3, respectively, are managed by disk controller 200. For example, the disk controller may be a RAID controller, where the RAID controller and 3 disks form a RAID system, and the RAID controller may manage the 3 disks according to a RAID5 level rule.
In a RAID system, a RAID controller obtains redundancy protection by writing data and a check result calculated on the data into a plurality of disks, and management of the disks is divided into different RAID levels according to different adopted check calculation methods or data arrangement. The data redundancy strategies corresponding to different RAID levels are different; for example, a RAID system at a RAID5 level may support one disk failure and a RAID system at a RAID6 level may support two disks simultaneously failing. When the disks are in fault, as long as the number of the fault disks does not exceed the tolerance range of the RAID system, the RAID system can recover the data in the fault disks according to the data and the verification information in the residual disks, so that the consistency of the data is ensured. Currently, the seven standard RAID levels are respectively a RAID0 level, a RAID1 level, a RAID2 level, a RAID3 level, a RAID4 level, a RAID5 level, a RAID6 level. Standard RAID levels may be combined to form new extension levels, such as RAID50 level, RAID60 level.
As shown in fig. 2, the storage space in disk 301, disk 302, and disk 303 may be partitioned into one or more virtual disks, where the logical address corresponding to one virtual disk may be LUN x. One virtual disk may include multiple stripes (stripes), and the virtual disk shown in FIG. 2 includes five stripes, stripe 1, stripe 2, stripe 3, stripe 4, and stripe 5. Each stripe includes a plurality of stripe units (stripe units). The plurality of stripe units constituting one stripe are located in different disks, respectively. Taking the strip 1 as an example, the strip 1 includes a strip unit 11, a strip unit 12 and a strip unit 13. Stripe unit 11 is located on disk 301, stripe unit 12 is located on disk 302, and stripe unit 13 is located on disk 303. Taking stripe unit 11 as an example, stripe unit 11 being located on disk 301 means that one or more units of storage in disk 301 make up stripe unit 11. Disk 301 includes stripe unit 21, stripe unit 31, stripe unit 41, and the like, in addition to stripe unit 11. Different stripe units in disk 301 are made up of different units of storage. The storage unit refers to the minimum unit capable of performing read-write operation in the disk. The storage units of different types of disks are different. For example, the minimum storage unit of an SSD is a page (page). The minimum storage unit of the mechanical hard disk is a sector.
The size of the stripe units, which may also be referred to as stripe length (stripe), may be set as desired, e.g., each stripe unit shown in FIG. 2 may store 128KB of data. The plurality of stripe units constituting the same stripe may be divided into a stripe unit for storing data and a stripe unit for storing a check value. For example, stripe units for storing data in stripe 1 may be stripe unit 11 and stripe unit 12, and stripe units for storing check values may be stripe unit 13; the stripe units for storing data in stripe 2 may be stripe units 21 and 23, and the stripe units for storing a check value may be stripe units 22; the stripe units for storing data in stripe 3 may be stripe units 32 and 33, and the stripe units for storing check values may be stripe units 31; and so on. Taking stripe 1 as an example, stripe unit 11 may store data LBAs 0-127, 128KB of data, stripe unit 12 may store data LBAs 128-255, and stripe unit 13 may store verification result P obtained by exclusive OR calculation between LBAs 0-127 and LBAs 128-255.
The RAID controller and the plurality of disks may communicate with each other and communicate control and/or data signals via internal connection paths including buses, such as the peripheral component interconnect standard (peripheral component interconnect express, PCIe) or other buses used to connect the different devices. Stripe state information is stored in the RAID controller, and the stripe state information is used for recording the state of each stripe unit in the RAID system. The state of each stripe unit may include an idle state and an active state, which may also be referred to as an active stripe unit, which refers to a stripe unit in which data is stored; the free stripe units may also be referred to as free stripe units, which refer to stripe units that do not currently store data. For example, when the stripe unit 11 does not store data, the state of the stripe unit 11 is in the free state, and the RAID controller transmits a data write command for the stripe unit 11 to the disk 301, and then changes the state of the stripe unit 11 from the free state to the active state.
The data storage system shown in FIG. 3 may include a computer 400 and a disk array 300 of multiple disks. The computer 400 may be used as a disk controller to manage a plurality of disks. Wherein computer 400 may also be replaced by a server or other electronic device. The structure of the disk array 300 may also refer to fig. 2, and the process of managing a plurality of disks by the computer 400 is the same as the process of managing a plurality of disks by the RAID controller shown in fig. 1, and will not be described herein.
The embodiment of the application improves the performance of the data storage system through the cooperation between the disk controller and the disk. For easy understanding, the following describes a specific implementation manner of the data access method provided in the embodiment of the present application in the process of writing data and prefetching data, taking a disk controller as an example of the RAID controller shown in fig. 1.
FIG. 4 shows a diagram of interactions between a disk controller and a disk during writing data. As shown in fig. 4, in the process of writing data, a data access method provided in one embodiment may include the following steps:
s401, the disk controller acquires first data and determines a target disk and a data type corresponding to the first data.
The first data may be understood as data to be written to the target disk. The data type of the first data may include a delayed write type and a non-delayed write type, wherein the data of the delayed write type may include, but is not limited to, data that is needed to be used later, or data that needs to be updated immediately; the data of the non-delayed write type may also be referred to as data of a non-delayed write type, such as data that is temporarily not needed.
The RAID controller may determine a target disk and a target stripe to which a target stripe unit for holding the first data belongs, and determine that a data type of the first data is a delayed write type if, among data to be written to one or more disks controlled by the RAID controller, second data including the target stripe to be written after the first data.
Illustratively, in some embodiments, the RAID controller receives a write disk command from the host and determines the first data based on the data carried in the write disk command. The RAID controller may determine a target disk for holding the first data based on the logical address in the write disk instruction. In an embodiment, the first data may be data carried in the above-mentioned write disk instruction, where a stripe unit corresponding to a logical address in the write disk instruction is a target stripe unit, and a disk to which the target stripe unit belongs is a target disk. In another embodiment, the first data may be a verification result determined according to data carried in the write disk instruction, where a target stripe to which a stripe unit corresponding to a logical address in the write disk instruction belongs may be determined, and a target stripe unit used for storing the verification result in the target stripe is determined, and a disk to which the target stripe unit belongs is a target disk, which will be described in detail below.
The RAID controller may further determine whether the current data writing mode is sequential writing according to logical addresses in a plurality of sequentially received write disk instructions, where sequential writing refers to sequential writing of logical addresses in a plurality of sequentially received write disk instructions, that is, a plurality of write disk instructions indicate sequential writing of data to each stripe unit in one virtual disk. For example, in an application scenario where a user completes editing a certain document and saves the document, the host continuously sends a plurality of disk writing instructions to the RAID controller, and logical addresses in the plurality of disk writing instructions are continuous, and at this time, the current data writing mode may be considered to be sequential writing, that is, document data may be written into each stripe unit indicated by the logical addresses in each disk writing instruction in sequence. If the logical addresses in the plurality of write disk instructions are discontinuous, it may be determined that the current data write mode is not sequential writing; for example, in an application scenario where a user resets or modifies parameters of a plurality of different functions, the parameters of each function may be stored in a different virtual disk or in a non-adjacent stripe unit within the same virtual disk, when the parameters of each function are stored, the host sends a plurality of disk writing instructions to the RAID controller, and the logical addresses in the plurality of disk writing instructions are discontinuous, where the current data writing mode may be considered not to be sequential writing.
As already described above, the RAID controller may determine a target stripe unit and target stripe for holding the first dataIn an alternative embodiment, if the RAID controller determines that the current data writing mode is sequential writing, the RAID controller may determine, according to the saved stripe state information, a state of each stripe unit in the target stripe for saving the first data, may determine that the first data is data of a delayed writing type if a free stripe unit other than the target stripe unit is included in the target stripe, and may consider the first data to be data of a non-delayed writing type if no free stripe unit other than the target stripe unit is included in the target stripe. For example, assuming that the current data writing mode is sequential writing, the RAID controller receives that the data carried in the write disk command of the host includes data LBAs 0-127. At this time, the data to be written may include data LBAs 0 to 127 and verification results P corresponding to the data LBAs 0 to 127 0
When writing data LBAs 0 to 127, the data LBAs 0 to 127 are the first data, and the RAID controller can determine that the storage locations corresponding to the data LBAs 0 to 127 are stripe units 11 according to the logical addresses in the write disk command, at this time, stripe units 11 are target stripe units, stripe 1 to which stripe units 11 belong is a target stripe, and disk 301 to which stripe units 11 belong is a target disk. The RAID controller may determine that the stripe unit 12 in the target stripe is currently in the free state according to the saved stripe state information, and may determine that the data to be written into the stripe unit 12 later, that is, the second data of the target stripe to be written is included in the data to be written, and may determine that the data LBAs 0 to 127 need to be used and the verification result P needs to be redetermined when the data is written into the stripe unit 12, because the data is currently written sequentially, the RAID controller may determine that the data LBAs 0 to 127 are data to be used later, that is, the RAID controller determines that the first data is data of the delayed writing type.
At the write verification result P 0 At the time, check result P 0 As the first data, the RAID controller can determine that the storage positions corresponding to the data LBAs 0-127 carried in the write disk instruction are stripe units 11 according to the logical addresses in the write disk instruction, and the stripe to which the stripe units 11 belong is stripe unit 11Stripe 1, check result P 0 Since the stripe 1 is the target stripe as the data LBAs 0 to 127 need to be stored in the same stripe, the RAID controller can determine that in the stripe 1, the stripe unit 13 is used to store the verification result, so that the stripe unit 13 is the target stripe unit, and the disk 303 to which the stripe unit 13 belongs is the target disk. The RAID controller can determine that the stripe unit 12 in the target stripe is currently in an idle state according to the stored stripe state information, and then when writing data into the stripe unit 12, the RAID controller needs to re-determine the verification result P by using the data LBAs 0-127 and the data to be written into the stripe unit 12, so as to determine the verification result P 0 The RAID controller determines that the first data is of a delayed write type for data that requires immediate updating, i.e., data that is of a delayed write type.
In an alternative embodiment, assuming the current data write mode is sequential write, RAID controller has sent a data write instruction to disk 301 to write data LBAs 0-127 to stripe unit 11 and set the state of stripe unit 11 to active in the saved stripe state information, and RAID controller has sent a check result P to disk 303 0 A data write instruction to write stripe unit 13 and sets the state of stripe unit 13 to a valid state in the saved stripe state information. When the RAID controller receives the data carried in the write disk command of the host as the data LBAs 128-255, the RAID controller can determine that the storage positions corresponding to the data LBAs 128-255 are stripe units 12 according to the logic addresses carried in the write disk command, and can calculate and obtain a verification result P according to the data LBAs 128-255 and the data LBAs 0-127 in the stripe units 11. At this time, the data to be written may include the data LBAs 128-255, and the verification result P.
When writing data LBAs 128-255, data LBAs 128-255 are first data, the storage locations corresponding to LBAs 128-255 are stripe units 12 being target stripe units, stripe 1 to which stripe units 12 belong is a target stripe, and disk 302 to which stripe units 12 belong is a target disk. The RAID controller may determine, according to the saved stripe status information, that all stripe units except stripe unit 12 in the target stripe are valid, and at this time, the RAID controller may determine that data LBAs 128 to 255 are data of a non-delayed write type that is temporarily not needed to be used, that is, the RAID controller may consider the first data to be data of a non-delayed write type.
When writing the check result P, the RAID controller may determine that the storage location corresponding to the check result P is a stripe unit 13 in stripe 1, stripe 1 is a target stripe, stripe unit 13 is a target stripe unit, and disk 303 to which stripe unit 13 belongs is a target disk. The RAID controller may determine that the stripe units 11 and 12 in the target stripe each store data, and that the remaining stripe units in the target stripe except the stripe unit 13 are all valid, at this time, the RAID controller may determine that the verification result P is data of a non-delayed write type, that is, the RAID controller may consider the first data to be data of a non-delayed write type.
When the service of repairing the disk 302 is executed, if the RAID controller determines, according to the saved stripe state information, that each stripe unit in the next stripe of the target stripe corresponding to the first data is in an idle state, it may be determined that the data need not to be written to the disk 302 continuously temporarily, and it may be considered that the current first data need not be written with delay, and is data of a non-delayed writing type.
S402, if the first data is determined to be the data of the delayed writing type, the disk controller generates a data writing instruction containing a delayed writing instruction.
S403, the disk controller sends a data writing instruction to the target disk.
The data write command includes the first data and the storage address of the first data in addition to the delayed write command, and the storage address of the first data may be an address of a stripe unit for storing the first data. In other embodiments, the data carried in the data writing instruction may be other data to be written, and other storage addresses of the data to be written, instead of the first data.
In an exemplary data structure of the data writing instruction, data bits at certain fixed positions may be preset as operation identification bits, and the operation identification bits may occupy 1 data bit or may occupy multiple data bits. In the following, an example is described in which the operation identification bit occupies 2 data bits, if the operation identification bit is "10", it indicates that the identification is a delayed writing identification, and the data writing instruction carries a delayed writing instruction; if the operation flag bit is "01", indicating that the flag is an immediate write flag, the data write instruction carries an immediate write instruction, which may also be referred to as a non-delayed write instruction.
In one embodiment, in the data structure of the data writing instruction, a target storage address corresponding to the delayed writing instruction or the immediate writing instruction may be carried in N preset data bits, where the target storage address may be an address of a target stripe unit for storing the first data. For example, assuming that the target disk is the disk 301, in a data writing instruction sent by the RAID controller to the disk 301, the set N data bits carry address information of the stripe unit 11, and an operation identification bit in the data writing instruction is "10", the data writing instruction indicates that the disk 301 may delay writing first data corresponding to the stripe unit 11.
In another embodiment, in the data structure of the data writing instruction, the disc identifier of the target disc and the address of the target stripe unit corresponding to the delayed writing instruction or the immediate writing instruction may be carried in M preset data bits. For example, in a data writing instruction sent by the RAID controller to the disk 301, the set M data bits carry a disk identifier of the disk 301 and an address of the stripe unit 11, and an operation identifier bit in the data writing instruction is "10", and the data writing instruction indicates that the disk 301 may delay writing first data corresponding to the stripe unit 11.
In other embodiments, if the first data is determined to be of a non-deferred write type, the RAID controller may generate a data write instruction that includes an immediate write indication and send the data write instruction to the target disk. Wherein the immediate write indication may also be referred to as a non-delayed write indication. For example, assuming that the target disk is the disk 301, in a data writing instruction sent by the RAID controller to the disk 301, the set M data bits carry a disk identifier of the disk 301 and an address of the stripe unit 11, and an operation identifier bit in the data writing instruction is "01", the data writing instruction indicates that the disk 301 may write first data corresponding to the stripe unit 11 immediately. Or if the first data is determined to be the data of the non-delayed writing type, the RAID controller can directly send a data writing instruction to the target disk, and the data writing instruction can not carry the delayed writing instruction or the immediate writing instruction.
In other embodiments, if the RAID controller cannot determine whether the first data is data of a delayed write type or data of a non-delayed write type, the data write instruction sent by the RAID controller to the target disk may not carry a delayed write instruction or an immediate write instruction.
In other embodiments, the disk controller may also send the delayed write indication of the data to the target disk in a data read command sent to the target disk. The data read instruction may include a storage address of the data to be read in addition to the delayed write instruction.
S404, the target disk executes the delayed write instruction carried in the data write instruction.
The disk includes a nonvolatile memory in which each stripe unit is located. In order to reduce the time delay of the RAID controller for accessing the disk, a cache unit is further arranged in the disk, and the time for accessing the cache unit is far less than the time for accessing the nonvolatile memory. The buffer unit may be used to temporarily hold data, i.e. first data, to be written into the non-volatile memory. Illustratively, the cache unit may employ a cache (cache), and the nonvolatile memory may employ a flash (flash).
Taking the target disk as the disk 301, in one embodiment, the disk 301 receives a data writing instruction sent by the RAID controller, reads an address of the stripe unit 11 from N data bits set in the data writing instruction, and reads an operation identification bit in the data writing instruction as "10", and then the disk 301 may execute a delayed writing instruction carried in the data writing instruction, and delay writing first data corresponding to the stripe unit 11. For example, the disk 301 may temporarily store the first data corresponding to the stripe unit 11, that is, the data LBAs 0 to 127, in the buffer unit, wait for receiving other data to be written, execute the data writing operation, write the first data and the other data to be written into the nonvolatile memory together, and write a plurality of data into the nonvolatile memory each time the writing operation is executed, thereby avoiding frequent writing operations into the nonvolatile memory. If no other data to be written is received within the set time period, performing data writing operation, and writing the first data into the stripe unit 11 in the nonvolatile memory; alternatively, when the cache unit of the disk 301 is full and a portion of the data needs to be purged, the disk 301 performs a write operation to write the first data to the stripe unit 11 in the nonvolatile memory. In some alternative embodiments, after the disk performs the delayed write instruction and temporarily stores the first data in the cache unit, the disk may also wait for the first data to be refreshed, perform a data writing operation, and write the refreshed data into the nonvolatile memory.
In another embodiment, when the disk 301 receives a data writing instruction sent by the RAID controller, reads the disk identifier of the disk 301 and the address information of the stripe unit 11 from M data bits set in the data writing instruction, and reads the operation identifier bit in the data writing instruction as "10", the disk 301 may execute a delayed writing instruction carried in the data writing instruction, and delays writing first data corresponding to the stripe unit 11.
In other embodiments, if the disk receives a data write instruction sent by the RAID controller, the data write instruction carries a delayed write instruction, and the disk may determine whether to execute the delayed write instruction according to its own state; for example, if the data storage proportion of the cache unit of the disk reaches the set maximum proportion threshold, the disk may perform the data writing operation without performing the delayed write instruction, and write the first data into the nonvolatile memory together with the other data held in the cache unit. The data storage ratio refers to a ratio between the amount of data stored in the buffer unit and the data capacity of the buffer unit. If the disk receives a data writing instruction sent by the RAID controller, the data writing instruction carries an immediate writing instruction, and the disk can determine whether to execute the immediate writing instruction according to the state of the disk; for example, if the data storage ratio of the cache unit of the disk does not reach the set minimum ratio threshold, the disk may not execute the immediate write instruction, temporarily store the first data in the cache unit, and may execute the data writing operation after the data storage ratio of the cache unit reaches the set minimum ratio threshold, and write the data stored in the cache unit together into the nonvolatile memory.
In some embodiments, if the first data is parity data, after sending a delayed write indication of the first data to the target disk, if the disk controller obtains the second data, determining updated parity data based on the second data, and sending a data write instruction for the updated parity data to the target disk; the data writing instruction is used for indicating the target disk to write the updated check data into the nonvolatile memory of the target disk. After temporarily storing the first data in the buffer unit by the target disk, waiting for a set time, and if the target disk receives a data writing instruction of updated check data sent by the disk controller within the set time; the data writing instruction instructs the disk to write the updated check data into a target storage address, wherein the target storage address is the same as the target storage address of the first data; and writing the updated check data into a nonvolatile memory of the disk according to the target storage address, and deleting the first data in the cache unit. And if the target disk does not receive the data writing instruction of the updated check data within the set time, the target disk writes the first data into the nonvolatile memory.
FIG. 5 shows another interaction diagram between a disk controller and a disk during writing data. As shown in fig. 5, in the process of writing data, the data access method provided in another embodiment may include the following steps:
s501, a disk controller determines a target disk and a data type corresponding to first data.
S502, if the first data is determined to be the data of the delayed writing type, the disk controller generates a delayed operation instruction.
For example, assume that the first data is the above-described check result P 0 Checking the result P 0 The RAID controller receives a disk writing instruction of the host, and determines according to the data LBAs 0-127 carried in the disk writing instruction. See the description in step S401 above, the verification result P 0 The corresponding target disk is disk 303, the target stripe unit is stripe unit 13 of stripe 1, and the RAID controller may determine the parity result P 0 Is a delayed write type of data, the RAID controller generates a delayed operation instruction, which refers to a separate operation instruction containing a delayed write instruction.
S503, the disk controller sends a delay operation instruction to the target disk.
In one embodiment, the disk controller may send the deferred operation instruction to the target disk after sending the data write instruction of the first data to the target disk.
The delay operation instruction only comprises a delay writing instruction, and does not comprise data to be written and storage addresses of the data to be written. Illustratively, in the delayed operation instruction, an operation identification bit and an address identification bit are included. For example, in a delayed operation instruction, the operation identification bit may be "10", indicating that the delayed write instruction is carried in the operation instruction. If the operation identification bit in the operation instruction is "01", the operation instruction can be regarded as an immediate operation instruction.
In one embodiment, in the delay operation instruction, N data bits may be preset as address identification bits, where information in the address identification bits is used to indicate a target storage address corresponding to the delay write instruction, that is, address information of a target stripe unit used to store the first data. For example, in the deferred operation instruction sent by the RAID controller to the disk 303, the N data bits carry the address information of the stripe unit 13, and then the deferred operation instruction indicates that the disk 303 may defer writing the first data corresponding to the stripe unit 13, that is, the above-mentioned verificationResults P 0
In another embodiment, in the deferred operation instruction, M data bits may be preset as address identification bits, where information in the address identification bits is used to indicate a disk identifier of a target disk and address information of a target stripe unit corresponding to the deferred write instruction. For example, in the deferred operation instruction sent by the RAID controller to the disk 303, the M data bits carry the disk identifier of the disk 303 and the address information of the stripe unit 13, and then the deferred operation instruction indicates that the disk 303 may deferred writing the first data corresponding to the stripe unit 13.
If the disk controller sends a deferred operation instruction to the target disk, the deferred operation instruction may be sent after a data write instruction that sends the first data to the target disk. The time interval between the time of transmission of the deferred operation instruction and the time of transmission of the data write instruction of the first data is less than a set time threshold to ensure that the deferred operation instruction for the first data can be received before the target disk writes the first data to the non-volatile memory.
S504, the target disk executes the received delay operation instruction.
Both the delay operation instruction and the immediate operation instruction may be referred to as separate operation instructions.
Taking the target disk as the disk 303 as an example, in one embodiment, the disk 303 receives an individual operation instruction sent by the RAID controller, reads an operation identification bit "10" in the individual operation instruction, which indicates that the individual operation instruction is a delayed operation instruction, and reads address information of the stripe unit 13 from N data bits set in the individual operation instruction, so that the disk 303 may execute the delayed operation instruction and delay writing first data corresponding to the stripe unit 13.
In another embodiment, when the disk 303 receives an individual operation instruction sent by the RAID controller, the operation identification bit read to the individual operation instruction is "10", which indicates that the individual operation instruction is a delayed operation instruction, and the disk 303 reads the disk identification of the disk 303 and the address information of the stripe unit 13 from M data bits set in the individual operation instruction, the disk 303 may execute the delayed operation instruction, and delay writing of the first data corresponding to the stripe unit 13.
In other embodiments, the target disk receives the delay operation instruction sent by the RAID controller, and may also determine whether to execute the delay operation instruction according to its own status.
After executing the received delay operation instruction, the target disk may or may not return the instruction execution result to the RAID controller.
S505, the disk controller updates the first data and determines the data type of the updated first data.
Optionally, when the RAID controller receives the write disk command of the host again, the data carried in the write disk command is data LBAs 128 to 255, and referring to the description in step S401 above, the RAID controller may determine that the target stripe corresponding to the data LBAs 128 to 255 is also stripe 1, and the target stripe is the verification result P corresponding to the first data 0 The corresponding target stripes are the same, and at this time, the RAID controller can verify the result P according to the data LBAs 128-255 0 And updating.
In some embodiments, the update process may include: the RAID controller may obtain data LBAs 0-127 from disk 301. In the above embodiment, it has been described that the disk 301 executes the delayed write instruction issued by the RAID controller, temporarily stores the data LBAs 0 to 127 in the cache unit, receives the read instruction of the RAID controller for the data LBAs 0 to 127, and may directly obtain the data LBAs 0 to 127 from the cache unit, and transmit the data LBAs 0 to 127 to the RAID controller; and the data does not need to be read from the nonvolatile memory, so that the time for reading the data can be greatly saved, and the time delay of the RAID controller for accessing the disk is reduced. After the RAID controller obtains the data LBAs 0-127, the verification result P is used as updated first data according to the verification result P calculated by the data LBAs 0-127 and the data LBAs 128-255.
In other embodiments, the update process may include: the RAID controller may obtain the verification result P from the disk 303 0 . As can be seen from the above, the disk 303 executes the delayed write instruction issued by the RAID controller to verify the result P 0 Temporarily stored in a cache unit, and the RAID controller is received for the check result P 0 The disk 303 may directly obtain the verification result P from the cache unit 0 And check the result P 0 Transmitting to the RAID controller; and the data does not need to be read from the nonvolatile memory, so that the time for reading the data can be greatly saved, and the time delay of the RAID controller for accessing the disk is reduced. RAID controller obtains check result P 0 Then according to the verification result P 0 And data LBA 128-255 determine the verification result P; for example, the RAID controller may be based on the verification result P 0 Reversely calculating the data LBAs 0-127, and taking the verification result P as updated first data according to the verification result P calculated by the data LBAs 0-127 and the data LBAs 128-255.
After determining the updated first data, the RAID controller may determine that the verification result P is data of a non-delayed write type because the data stored in correspondence with each stripe unit of the target stripe, i.e., stripe 1, is determined.
S506, the disk controller sends a data writing instruction containing updated first data to the target disk.
For example, for the verification result P, the corresponding target disk is the disk 303. The RAID controller sends a data writing instruction to the disk 303, wherein the data writing instruction comprises a verification result P and address information of a target stripe unit for storing the verification result P; wherein the target stripe unit is stripe unit 13.
S507, if the updated first data is determined to be the data of the non-delayed writing type, the disk controller generates an immediate operation instruction.
S508, the disk controller sends an immediate operation instruction to the target disk.
Since the check result P is data of the non-delayed write type, the RAID controller transmits an immediate operation instruction to the disk 303. Illustratively, in the immediate operation instruction, an operation identification bit and an address identification bit are included. The operation identification bit may be "01" indicating that the operation instruction carries an immediate write instruction.
In one embodiment, in the immediate operation instruction, N data bits may be preset as address identification bits, where information in the address identification bits is used to indicate that address information indicating a corresponding target stripe unit or address information of a target storage address is written immediately. For example, in the immediate operation instruction sent by the RAID controller to the disk 303, N data bits carry address information of the stripe unit 13, and the immediate operation instruction indicates that the disk 303 may immediately write first data corresponding to the stripe unit 13, that is, updated first data: and checking a result P.
In another embodiment, in the immediate operation instruction, M data bits may be preset as address identification bits, where information in the address identification bits is used to indicate that address information indicating a disk identifier of a corresponding target disk and a target stripe unit, or address information indicating a disk identifier of the target disk and a target storage address is written immediately. For example, in the immediate operation instruction sent by the RAID controller to the disk 303, the M data bits carry the disk identifier of the disk 303 and the address information of the stripe unit 13, and then the immediate operation instruction indicates that the disk 303 may immediately write the data to be written corresponding to the stripe unit 13, that is, the verification result P.
In other embodiments, the disk controller may not send an immediate operation instruction to the target disk after determining that the updated first data is of a non-delayed write type, so as to save signaling overhead.
S509, the target disk executes the received immediate operation instruction.
Taking the target disk as the disk 303 as an example, in one embodiment, the disk 303 receives an individual operation instruction sent by the RAID controller, reads an operation identification bit in the individual operation instruction to be "01", which indicates that the individual operation instruction is an immediate operation instruction, and reads address information of the stripe unit 13 from N data bits set in the individual operation instruction, so that the disk 303 may execute the immediate operation instruction, and write data to be written corresponding to the stripe unit 13, that is, the verification result P, into the stripe unit 13 of the nonvolatile memory.
In another embodiment, when the disk 303 receives an individual operation instruction sent by the RAID controller, the operation identification bit read into the individual operation instruction is "01", which indicates that the individual operation instruction is an immediate operation instruction, and the disk 303 reads the disk identification of the disk 303 and the address information of the stripe unit 13 from M data bits set in the individual operation instruction, the disk 303 may execute the immediate operation instruction, and write the data to be written corresponding to the stripe unit 13, that is, the verification result P, into the stripe unit 13 of the nonvolatile memory.
In other embodiments, the disk receives an immediate operation instruction sent by the RAID controller, and may also determine whether to execute the immediate operation instruction according to its own status.
S510, the target disk sends an instruction execution result to the disk controller.
And after sending the immediate operation instruction to the target disk, the RAID controller waits for the feedback instruction execution result of the target disk. The target disk determines that the received immediate operation instruction is an independent operation instruction, and after the immediate operation instruction sent by the RAID controller is executed, an instruction execution result is sent to the RAID controller, wherein the instruction execution result can contain information that the instruction is executed or the instruction is executed successfully. After the RAID controller receives the instruction execution result fed back by the target disk, the data writing process can be ended.
In other embodiments, the target disk may not send the instruction execution result to the disk controller.
The above description of the data access method shown in fig. 5 focuses on differences from the data access method shown in fig. 4, and the same parts as those of the data access method shown in fig. 4 may be executed with reference to the data access method shown in fig. 4, and will not be described again.
In the embodiment of the application, the disk controller which manages the disk determines the data type of the data to be written, if the disk controller determines that the data to be written is the data which is needed to be used subsequently or is updated immediately, a delayed writing instruction can be sent to the disk to instruct the disk to delay writing the data into the nonvolatile memory, thereby avoiding frequent writing operation of the disk, being beneficial to reducing occupation of memory bandwidth resources and reducing power consumption. If the data to be written is the data updated immediately later, the operation of repeatedly writing the data to the same storage address can be reduced by delaying the data writing, and the service life of the magnetic disk is prolonged. This step may be performed by the disk controller more accurately because the disk controller has better awareness of upper layer traffic than if it were to delay writing of data to the non-volatile memory by the disk.
For example, assuming that a write disk operation is performed once each time a disk receives 64KB of data to be written, if a host needs to write 1TB of data into 3 disks of the RAID system in a sequential write manner, by using the method provided by the embodiment of the present application, the repeated writing of 0.5TB of data can be reduced at most. Therefore, by the method provided by the embodiment of the application, the data writing operation of the magnetic disk can be greatly reduced, the performance is improved, the power consumption is reduced, and the service life of the magnetic disk is prolonged.
FIG. 6 illustrates an interaction diagram between a disk controller and a disk during prefetching of data. As shown in fig. 6, in the process of prefetching data, a data access method provided in one embodiment may include the following steps:
s601, a disk controller determines a target storage address and a target disk of prefetched data.
In some embodiments, the RAID controller may determine whether the current data read mode is sequential read based on logical addresses in a plurality of sequentially received read disk instructions, where sequential read refers to sequential read of logical addresses in a plurality of sequentially received read disk instructions, that is, a plurality of read disk instructions direct sequential read of data from individual stripe units in a virtual disk. For example, when a user opens a document, the host continuously sends a plurality of disk-reading instructions to the RAID controller, and the logical addresses in the plurality of disk-reading instructions are continuous, and at this time, the current data reading mode may be considered to be sequential reading, that is, the data of the document may be sequentially read out from each stripe unit indicated by the logical addresses in each disk-reading instruction, and sent to the host for display. If the logical addresses in the plurality of read disk instructions are discontinuous, it may be determined that the current data read mode is not sequential read; for example, when a user simultaneously operates a plurality of different functions, the host needs to read the parameters of each function, and the parameters of each function may be stored in different virtual disks, so that data needs to be read from different virtual disks or non-adjacent stripe units in the same virtual disk, at this time, the host sends a plurality of disk reading instructions to the RAID controller, and the logical addresses in the plurality of disk reading instructions are discontinuous, at this time, it may be considered that the current data reading mode is not sequential reading.
In an alternative embodiment, if the RAID controller determines that the current data reading mode is sequential reading, then, according to the logical address in the currently received instruction for reading the disk, a target storage address and a target disk corresponding to the data to be read later, that is, a target storage address and a target disk of the prefetched data, where the target storage address may also be understood as an address of a target stripe unit. In another alternative embodiment, if the RAID controller determines that the current data reading mode is sequential reading, determining, according to a logical address in a currently received disk reading instruction, a disk corresponding to the currently read data; and taking the disk corresponding to the currently read data as a target disk, and determining a target storage address of the data which still needs to be read for the target disk, namely, a target storage address of the prefetched data. For example, assuming that the data currently read is data LBAs 0 to 127, the data LBAs 0 to 127 are held in the stripe unit 11 of the disk 301. The disk 301 is the target disk, and the RAID controller may determine that the data to be read subsequently is the data stored in the stripe unit 21, and may determine that the stripe unit 21 is the target stripe unit, because the current sequential reading is performed.
In other embodiments, the RAID controller initiates a background service and determines the target storage address and target disk for the data to be prefetched based on the currently executing service. The RAID controller can start the service of repairing the disk according to the operation of repairing the disk by a user, and can automatically start the service of repairing the disk when a certain disk is monitored to be faulty. Illustratively, assuming that the RAID controller detects that the disk 302 is malfunctioning, the repair of the disk 302 is initiated, i.e., the correct data stored in each stripe unit of the disk 302 is determined from the data stored in each stripe unit of the disk 301 and the disk 303, and the correct data is written to each stripe unit of the disk 302. For example, for stripe 1, the RAID controller may determine the correct data stored in stripe 12 of disk 302 based on data LBAs 0-127 stored in stripe 11 of disk 301 and the verification result P stored in stripe 13 of disk 303. At this time, the disk to be repaired is the disk 302, the stripe unit to be repaired is the stripe unit 12, the target stripe to which the stripe unit 12 belongs is the stripe 1, the stripe 1 includes the stripe unit 11 and the stripe unit 13, the disk 301 may be used as the target disk, the address of the stripe unit 11 may be used as the target storage address, the disk 303 may be used as the target disk, and the address of the stripe unit 13 may be used as the target storage address. The process of performing the prefetch data instruction when the disk 303 is the target disk is the same as the process of performing the prefetch data instruction when the disk 301 is the target disk, and will be described below by taking the disk 301 as the target disk as an example.
S602, the disk controller generates a data access instruction containing a prefetched data instruction according to the address information of the target storage address.
S603, the disk controller sends a data access instruction to the target disk.
The data access instruction may be a data read instruction or a data write instruction.
In some embodiments, the RAID controller receives a disk read command from the host and sends a data access command to the target disk, or the RAID controller may actively send a data read command to the target disk according to the currently executing service. The data reading instruction may include address information of the currently read data, and may further include a prefetch data indication. In an exemplary data structure of the data read instruction, data bits at certain fixed positions may be preset as operation identification bits, and the operation identification bits may occupy 1 data bit or may occupy multiple data bits. The following description will take an example that the operation identification bit occupies 2 data bits, and if the operation identification bit is "00", it indicates that the data read instruction carries the prefetch data indication.
In one embodiment, in the data structure of the data read instruction, the pre-fetch data may further carry address information indicating the corresponding target storage address in N preset data bits. For example, assuming that the target disk is the disk 301, in a data read instruction sent by the RAID controller to the disk 301, the set N data bits carry the address of the stripe unit 11, and the operation identification bit in the data read instruction is "00", the data read instruction instructs the disk 301 to prefetch the data stored in the stripe unit 11.
In another embodiment, in the data structure of the data reading instruction, the preset M data bits may carry the disc identifier of the target disc and the address information of the target storage address corresponding to the prefetch data indication. For example, in a data read instruction sent by the RAID controller to the disk 301, the set M data bits carry a disk identifier of the disk 301 and an address of the stripe unit 11, and an operation identifier bit in the data read instruction is "00", and the data read instruction instructs the disk 301 to prefetch the data stored in the stripe unit 11.
In other embodiments, the RAID controller receives a write command from the host and sends a data write command to the target disk, or the RAID controller may actively send a data write command to the target disk according to the currently executing service. The data writing instruction comprises data to be written and address information of a stripe unit to be written for storing the data to be written. The data write instruction may also include a prefetch data indication. In an exemplary data structure of the data writing instruction, data bits at certain fixed positions may be preset as operation identification bits, and the operation identification bits may occupy 1 data bit or may occupy multiple data bits. For example, the operation identification bit occupies 2 data bits, and if the operation identification bit is "00", it indicates that the data write instruction carries a prefetch data indication.
In an embodiment, in the data structure of the data writing instruction, the pre-fetch data may further carry address information indicating the corresponding target storage address in N preset data bits. In another embodiment, in the data structure of the data writing instruction, the preset M data bits may carry the disc identifier of the corresponding target disc indicated by the prefetched data and the address information of the target storage address.
S604, the target disk executes the prefetched data indication carried in the data access instruction.
Taking the target disk as the disk 301, in one embodiment, the disk 301 receives a data access instruction sent by the RAID controller, reads address information of the stripe unit 11 from N data bits set in the data access instruction, and reads an operation identification bit in the data access instruction as "00", and then the disk 301 may determine that the data access instruction carries a prefetch data indication, and instruct prefetching of data stored in the stripe unit 11.
In another embodiment, when the disk 301 receives a data access instruction sent by the RAID controller, reads the disk identifier of the disk 301 and the address information of the stripe unit 11 from M data bits set in the data access instruction, and reads the operation identifier bit in the data access instruction as "00", the disk 301 may determine that the data access instruction carries a prefetch data indication, and instruct to prefetch the data stored in the stripe unit 11.
When the prefetch data instruction is executed, the disk 301 may first determine whether the data held by the stripe unit 11 is held in the cache unit, and if so, may end this operation; if not stored in the cache unit, the data stored in the stripe unit 11 is read from the nonvolatile memory and stored in the cache unit. When the subsequent disk controller reads the data, the disk 301 can directly obtain the data from the buffer unit, and does not need to read the data from the nonvolatile memory, so that the read delay of the disk can be reduced, and the data can be quickly returned to the disk controller. For example, suppose that the disk reads data from nonvolatile memory and returns it to the disk controller, each time requiring 60us; the disk reads data from the cache unit and returns the data to the disk controller, and the time required for each time is 10us, so that the reading time delay of 50us can be reduced each time the data is read.
FIG. 7 illustrates another interaction diagram between a disk controller and a disk during prefetching of data. As shown in fig. 7, in the process of prefetching data, another embodiment of the data access method may include the following steps:
S701, the disk controller determines a target storage address and a target disk of data to be prefetched.
S702, the disk controller generates a prefetching data instruction according to the address information of the target storage address.
S703, the disk controller sends a prefetch data instruction to the target disk.
The prefetch data instruction only contains prefetch data indication. Illustratively, in the prefetch data instruction, an operation identification bit and an address identification bit are included. For example, in a prefetch data instruction, the operation identification bit may be "00" indicating that the prefetch data instruction is carried in the operation instruction.
In one embodiment, in the prefetch data instruction, N data bits may be preset as address identification bits, where information in the address identification bits is used to indicate that the prefetch data indicates address information of a corresponding target stripe unit. The prefetch data instruction belongs to one of the individual operation instructions. For example, in the separate operation instruction sent by the RAID controller to the disk 301, N data bits carry address information of the stripe unit 11, and if the operation identification bit in the separate operation instruction is "00", the separate operation instruction is a prefetch data instruction, which is used to instruct the disk 301 to prefetch the data stored in the stripe unit 11.
In another embodiment, in the prefetch data instruction, M data bits may be preset as address identification bits, where information in the address identification bits is used to indicate that the prefetch data indicates a disk identifier of a corresponding target disk and address information of a target stripe unit. For example, in the separate operation instruction sent to the disk 301 by the RAID controller, the M data bits carry the disk identifier of the disk 301 and the address information of the stripe unit 11, and the operation identifier bit in the separate operation instruction is "00", and the separate operation instruction is a prefetch data instruction, which is used to instruct the disk 301 to prefetch the data stored in the stripe unit 11.
S704, the target disk executes the received prefetched data instruction.
Taking the target disk as the disk 301 as an example, in one embodiment, the disk 301 receives an individual operation instruction sent by the RAID controller, reads an operation identification bit "00" in the individual operation instruction, which indicates that the individual operation instruction is a prefetch data instruction, and reads address information of the stripe unit 11 from N data bits set in the individual operation instruction, so that the disk 301 may execute the prefetch data instruction and prefetch data stored in the stripe unit 11.
In another embodiment, when the disk 301 receives an individual operation instruction sent by the RAID controller, the operation identification bit read into the individual operation instruction is "00", which indicates that the individual operation instruction is a prefetch data instruction, and the disk 301 reads the disk identification of the disk 301 and the address information of the stripe unit 11 from M data bits set in the individual operation instruction, the disk 301 may execute the prefetch data instruction, and prefetch the data stored in the stripe unit 11.
S705, the target disk sends the instruction execution result to the disk controller.
After sending the prefetching data instruction to the target disk, the RAID controller waits for the feedback instruction execution result of the target disk. The target disk determines that the received prefetched data instruction is an independent operation instruction, and after the prefetched data instruction sent by the RAID controller is executed, an instruction execution result is sent to the RAID controller, wherein the instruction execution result can contain information that the instruction is executed or the instruction is executed successfully. After the RAID controller receives the instruction execution result fed back by the target disk, the data prefetching process can be ended.
In other embodiments, the target disk may not send the instruction execution result to the disk controller.
The above description of the data access method shown in fig. 7 focuses on differences from the data access method shown in fig. 6, and the same parts as those of the data access method shown in fig. 6 may be executed with reference to the data access method shown in fig. 6, and will not be described again.
In the embodiment of the application, the disk controller which manages the disk determines the data to be prefetched, sends the prefetched data indication to the disk, and indicates the disk to read the data to be prefetched into the cache unit, so that the read time delay of the disk when the data is read is reduced, and the system performance is improved. Compared with the data which is determined to be prefetched by the disk, the disk controller has better perceptibility to the upper layer service, so that the data which is determined to be prefetched by the disk controller can be more accurate, and the power consumption generated by additional data movement caused by the misjudgment of prefetching can be reduced, thereby reducing the system power consumption.
For example, assuming that the time required for a disk to read 64KB of data from nonvolatile memory is 60us, if a 1TB capacity RAID system needs to be expanded from 6 disks (stripe unit size 64 KB) to 7 disks, taking a 60us reduction per 1280KB read operation as an example, the time savings of completing a 1TB expansion can be approximately 50s. Therefore, by the method provided by the embodiment of the application, time can be effectively saved in the disk expansion service scene.
The data access method provided by the embodiment of the application not only can be applied to RAID controllers, but also can be used by other nodes which can identify data needed to be used subsequently, including but not limited to a host, an intelligent network card, a computer and the like.
In the process of writing data in the embodiment of the present application, the method executed by the disk controller may refer to fig. 8, and includes the following steps:
s801, first data to be written into a target disk is acquired.
S802, when the first data is determined to meet the set condition, the first data and a delayed write instruction of the first data are sent to the target disk.
The delayed write instruction is used for instructing the target disk to temporarily store the first data in a cache unit of the target disk. The first data satisfies the following setting conditions: the first data are data of a first stripe unit to be written into a target disk, and the data to be written after the first data comprise second data to be written into a second stripe unit; the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different magnetic disks.
If it is determined that the first data satisfies the setting condition, the disk controller transmits a delayed write instruction of the first data to the target disk.
In an alternative embodiment, the set condition includes the first data being data to be read back; determining whether the first data satisfies a set condition by: if the first data is the data of the first stripe unit to be written into the target disk and the second data to be written into the second stripe unit is predicted to be included in the data to be written after the first data, determining the first data as the data to be read back; the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different magnetic disks; or, the setting condition comprises that the first data is to-be-updated data; determining whether the first data satisfies the set condition by: if the first data is the check data of the third stripe unit to be written into the target disk and the second data to be written into the second stripe unit is predicted to be included in the data to be written after the first data, determining the first data as the data to be updated; the second stripe unit and the third stripe unit belong to the same target stripe, and the second stripe unit and the third stripe unit belong to different magnetic disks.
In an alternative embodiment, the first data may be data carried in a write disk instruction received. The disk controller may determine, according to logical addresses in the plurality of continuously received write disk instructions, whether the data write mode is sequential writing, and if the data write mode is sequential writing and the target stripe includes a free stripe unit other than the target stripe unit, determine that the data to be written includes second data of the target stripe to be written.
In some embodiments, after the disk controller obtains the first data to be written to the target disk, a data writing instruction containing the first data is sent to the target disk, and the disk controller may carry the delayed writing instruction in the data writing instruction and send the delayed writing instruction to the target disk. In other embodiments, the disk controller may send a first operation instruction containing a delayed write indication to the target disk, where the first operation instruction may be any instruction other than a data write instruction of the first data. The delayed write indication includes a delayed write identification and a target storage address of the first data. If the disk controller sends the delayed write instruction to the target disk in an instruction other than the data write instruction of the first data, the instruction containing the delayed write instruction may be sent after the data write instruction of the first data is sent to the target disk, and a time interval between a sending time of the delayed write instruction and a sending time of the data write instruction of the first data is smaller than a set time threshold value, so as to ensure that the delayed write instruction for the first data may be received before the target disk writes the first data to the nonvolatile memory.
In some embodiments, if the first data is verification data, after sending a delayed write indication of the first data to the target disk, if the disk controller obtains the second data, determining updated verification data, i.e., update data, based on the second data, and sending a data write instruction for the update data to the target disk; the data writing instruction of the update data is used for instructing the target disk to write the update data into the nonvolatile memory of the target disk.
In the process of writing data, the method executed by the disk may refer to fig. 9, and includes the following steps:
s901, receiving first data sent by a disk controller and receiving a delayed write instruction of the first data sent by the disk controller.
Wherein the first data satisfies the following setting conditions: the first data are data of a first stripe unit to be written into a target disk, and the data to be written after the first data comprise second data to be written into a second stripe unit; the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different magnetic disks.
In one possible embodiment, the disk may receive a data write instruction of the first data sent by the disk controller, and obtain the first data and a delayed write instruction of the first data from the data write instruction; the data write command includes data to be written to the disk. In another possible embodiment, after receiving the data writing instruction of the first data, the magnetic disk may receive the data writing instruction of other data sent by the magnetic disk controller again, and obtain a delayed writing instruction of the first data carried in the data writing instruction; the data write command includes data to be written to the disk. In another possible embodiment, a separate operation instruction including a delayed write indication sent by a disk controller is received.
S902, the first data is temporarily stored in a cache unit of a magnetic disk.
The delayed write indication includes a delayed write identification and a target storage address of the first data. The disk executes the delayed write instruction, and according to the target storage address of the first data, the first data is temporarily stored in a cache unit of the disk, and is delayed to be written into a nonvolatile memory of the disk.
In some embodiments, after the first data is temporarily stored in the cache unit of the disk, if the disk receives a data writing instruction of the update data sent by the disk controller; the updated data is updated check data; the data writing instruction of the update data instructs the disk to write the update data into a target storage address, and the target storage address is the same as the target storage address of the check data; and writing the updated data into a nonvolatile memory of the disk according to the target storage address, and deleting the check data in the cache unit.
In the process of prefetching data according to the embodiment of the present application, the method executed by the disk controller may refer to fig. 10, and includes the following steps:
s1001, determining a target storage address and a target disk of the prefetched data.
In some embodiments, if the disk controller determines that the data read mode is sequential read based on a logical address in a plurality of sequentially received disk read instructions, the target storage address and the target disk of the prefetched data may be determined based on the logical address in the currently received disk read instruction.
In other embodiments, in the process of repairing a to-be-repaired disk, the target storage address of the prefetched data and the target disk may be determined according to a target stripe to which the to-be-repaired stripe unit belongs, where the to-be-repaired stripe unit is a stripe unit in the to-be-repaired disk, and the target stripe includes a plurality of stripe units located on different disks.
S1002 sends, to the target disk, a prefetch data indication generated based on the target storage address.
The target disk comprises a cache unit, and the prefetched data indication is used for indicating the target disk to read the prefetched data from the target storage address to the cache unit.
In some embodiments, the disk controller may send the prefetch data indication to the target disk with the data read instruction sent to the target disk; the data reading instruction comprises a storage address of data to be read. In other embodiments, the disk controller may send a separate operation instruction containing an indication of the prefetch data to the target disk.
S1003, a first data read instruction for the prefetched data is sent to the target disk.
S1004, receiving the prefetched data acquired and sent by the target disk from the cache unit.
In the process of prefetching data according to the embodiment of the present application, the method executed by the disk may refer to fig. 11, and includes the following steps:
s1101, receiving a prefetch data instruction sent by a disk controller.
The prefetched data indication carries a target storage address of the prefetched data.
In some embodiments, the disk may receive a second data reading instruction sent by the disk controller, and obtain a prefetch data indication carried in the data reading instruction; the second data reading instruction comprises a storage address of data to be read. In other embodiments, the disk may receive a second operation instruction including an instruction to prefetch data sent by the disk controller, where the second operation instruction is an instruction other than the second data read instruction.
S1102, the prefetched data stored in the storage space corresponding to the target storage address is read into a cache unit of the magnetic disk.
S1103, a first data reading instruction for prefetched data sent by the disk controller is received.
S1104, obtaining the prefetched data from the cache unit and sending the prefetched data to the disk controller.
The embodiment of the application also provides a data access device, which can be applied to a disk controller, and the disk controller can be a device such as the RAID controller, a host, a computer or a server. The data access device can be used for realizing the functions of the data access method embodiment executed by the disk controller, so that the beneficial effects of the data access method embodiment can be realized.
In one embodiment, as shown in fig. 12, a data access apparatus 1200 provided in an embodiment of the present application may include a data acquisition unit 1201 and a transmission unit 1202. The data access means are arranged to implement the functions described above in the embodiment of the method shown in fig. 8. When the data access device is used to implement the functionality of the method embodiment shown in fig. 8: the data acquisition unit 1201 may be used to perform S801 and the transmission unit 1202 may be used to perform S802. Such as: a data acquisition unit 1201, configured to acquire first data to be written to a target disk; a sending unit 1202, configured to send the first data to the target disk and send a delayed write instruction of the first data to the target disk when it is determined that the first data meets a setting condition, where the setting condition includes: the first data are data of a first stripe unit to be written into a target disk, and the data to be written after the first data comprise second data to be written into a second stripe unit; the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different magnetic disks.
In one possible implementation manner, the first data is data carried in a received write disk instruction; the data acquisition unit 1201 may specifically be configured to: and determining whether the data writing mode is sequential writing according to the logic addresses in the plurality of continuously received magnetic disk writing instructions, and if the data writing mode is sequential writing and the target stripe comprises idle stripe units except the target stripe unit, determining that the data to be written comprises second data of the target stripe to be written.
In one possible implementation, the sending unit 1202 may specifically be configured to: the delayed writing instruction is carried in a data writing instruction of first data sent to a target disk and is sent to the target disk; or sending a first operation instruction containing a delayed write instruction to the target disk, wherein the first operation instruction is an instruction except the first data write instruction. The delayed write indication comprises a delayed write identification and a target storage address of the first data.
In another embodiment, as shown in fig. 13, a data access apparatus 1300 provided by an embodiment of the present application may include a prediction unit 1301, an indication sending unit 1302, and a data receiving unit 1303. The data access means are arranged to implement the functions described above in the embodiment of the method shown in fig. 9. When the data access device is used to implement the functionality of the method embodiment shown in fig. 10: the prediction unit 1301 may be used to perform S1001, the instruction transmission unit 1302 may be used to perform S1002 and S1003, and the data reception unit 1303 may be used to perform S1004. Such as: a prediction unit 1301, configured to determine a target storage address and a target disk of the prefetched data; the target disk comprises a cache unit; an instruction transmitting unit 1302 for transmitting, to the target disk, a prefetch data instruction generated based on the target storage address; the prefetched data indication is used for indicating the target disk to read the prefetched data from the target storage address to the cache unit; and sending a first data reading instruction for the prefetched data to the target disk; the data receiving unit 1303 is configured to receive the prefetched data obtained and sent by the target disk from the caching unit.
In one possible implementation, prediction unit 1301 may be specifically configured to: and determining whether the data reading mode is sequential reading or not according to the logic addresses in the continuously received multiple disk reading instructions, and if the data reading mode is sequential reading, determining a target storage address and a target disk of the prefetched data according to the logic addresses in the currently received disk reading instructions.
In one possible implementation, prediction unit 1301 may be specifically configured to: in the process of repairing the magnetic disk to be repaired, determining a target storage address of prefetched data and the target magnetic disk according to a target stripe to which a stripe unit to be repaired belongs; the stripe unit to be repaired is a stripe unit in the disk to be repaired; the target stripe includes a plurality of stripe units located on different disks.
In one possible implementation, the indication sending unit 1302 may specifically be configured to: carrying the prefetched data instruction in a second data reading instruction sent to the target disk, and sending the prefetched data instruction to the target disk; the second data reading instruction is used for indicating the target disk to read data from the appointed storage address; or, sending a second operation instruction containing the prefetched data indication to the target disk; the second operation instruction is an instruction other than the second data read instruction.
The embodiment of the application also provides a data access device which can be applied to a magnetic disk based on the same inventive concept as the embodiment of the method. The data access device can be used for realizing the functions of the data access method embodiment executed by the magnetic disk, so that the beneficial effects of the data access method embodiment can be realized.
In one embodiment, as shown in fig. 14, a data access device 1400 provided in an embodiment of the present application may include a receiving unit 1401 and an executing unit 1402. The data access means are arranged to implement the functions described above in the embodiment of the method shown in fig. 9. When the data access device is used to implement the functionality of the method embodiment shown in fig. 9: the receiving unit 1401 may be used to perform S901, and the executing unit 1402 may be used to perform S902. Such as: a receiving unit 1401, configured to receive first data sent by the disk controller, and receive a delayed write instruction of the first data sent by the disk controller; the delayed write-in instruction is used for instructing the target disk to temporarily store the first data in a cache unit of the target disk; the execution unit 1402 is configured to temporarily store first data in a cache unit of a disk, where the first data satisfies the following conditions: the first data is data of a first stripe unit to be written into a target disk, the disk controller predicts that the second stripe unit to be written into the data to be written into the disk after the first data, wherein the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different disks.
In one possible implementation, the receiving unit 1401 may be specifically configured to: receiving a data writing instruction of first data sent by a disk controller, and acquiring a delayed writing instruction carried in the data writing instruction of the first data; the data writing instruction of the first data comprises the first data; or receiving a first operation instruction which is sent by the disk controller and contains a delayed writing instruction, wherein the first operation instruction is an instruction except a data writing instruction of the first data. The delayed write indication comprises a delayed write identification and a target storage address of the first data.
In another embodiment, as shown in fig. 15, a data access apparatus 1500 provided in an embodiment of the present application may include an instruction receiving unit 1501, an instruction executing unit 1502 and a data transmitting unit 1503. The data access means are arranged to implement the functions described above in the embodiment of the method shown in fig. 11. When the data access device is used to implement the functionality of the method embodiment shown in fig. 11: the instruction receiving unit 1501 may be used to perform S1101, the instruction executing unit 1502 may be used to perform S1102, and the data transmitting unit 1503 may be used to perform S1103 and S1104. Such as: an instruction receiving unit 1501, configured to receive a prefetch data instruction sent by a disk controller; the prefetch data indication is generated by the disk controller based on a target storage address of the prefetch data; an instruction execution unit 1502, configured to read, into a cache unit of a disk, prefetch data stored in a target storage address carried by a prefetch data instruction; the data transmission unit 1503 is configured to receive a first data read instruction for the prefetched data sent by the disk controller, obtain the prefetched data from the cache unit, and send the prefetched data to the disk controller.
In one possible implementation, the instruction receiving unit 1501 may specifically be configured to: receiving a second data reading instruction sent by a disk controller, and acquiring a prefetched data instruction carried in the data reading instruction; the second data reading instruction is used for indicating the target disk to read data from the appointed storage address; or receiving a single operation instruction which is sent by the disk controller and contains the prefetched data instruction.
Based on the same inventive concept as the above method embodiment, the present application also provides a disk controller, which may be used to implement the functions of the above method embodiment, so as to implement the beneficial effects of the above method embodiment. The disk controller may be a RAID controller, a host, a computer, a server, or the like as described above.
In some embodiments, the disk controller 1600 may be configured as shown in FIG. 16, including a processor 1601 and a memory 1602 coupled to the processor 1601.
Alternatively, the processor 1601 and the memory 1602 may be interconnected by a bus, and the processor 1601 may be a general purpose processor, such as a microprocessor, or other conventional processor. The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The buses may be divided into address buses, data buses, control buses, etc.
The memory 1602 is used for storing instructions or programs executed by the processor 1601, or for storing input data required by the processor 1601 to execute the instructions or programs, or for storing data generated after the processor 1601 executes the instructions or programs. The processor 1601 may include one or more processing units, and the different processing units may be separate devices or integrated into one or more processors. The processor 1601 may further include a controller, which may generate operation control signals according to the instruction operation code and the timing signals, to complete instruction fetching and instruction execution control.
The processor 1601 in the disk controller 1600 is illustratively configured to execute instructions or programs stored in the memory 1602 to perform the functions of the method embodiments shown in fig. 8 or 10. For example, when the disk controller 1600 is used to implement the method shown in fig. 8, the processor 1601 is used to perform the functions of the data acquisition unit 1201 and the transmission unit 1202 described above. When the disk controller 1600 is used to implement the method shown in fig. 10, the processor 1601 is configured to perform the functions of the prediction unit 1301, the instruction transmitting unit 1302, and the data receiving unit 1303 described above.
Based on the same inventive concept as the above method embodiment, the present application also provides a magnetic disk, which can be used to implement the functions of the above method embodiment, so as to implement the beneficial effects of the above method embodiment. The magnetic disk can be a solid state disk or a mechanical hard disk.
In some embodiments, the structure of the disk 1700 may include a processor 1710 and a memory 1720 coupled to the processor 1710, where the memory 1720 may include a cache unit 1721 and a nonvolatile memory 1722, as shown in fig. 17.
In the alternative, processor 1710 and memory 1720 may be interconnected by a bus, and processor 1710 may be a general purpose processor, such as a microprocessor, or other conventional processor. The bus may be a PCI bus or an EISA bus, etc.
The buffer unit 1721 in the memory 1720 may be used to temporarily store data to be written to the nonvolatile memory 1722 or data to be read from the nonvolatile memory 1722. Nonvolatile memory 1722 may be used to provide data storage services that hold data for use in various business scenarios.
The memory 1720 may also be used for storing instructions or programs executed by the processor 1710, or for storing input data required by the processor 1710 to execute instructions or programs, or for storing data generated after the processor 1710 executes instructions or programs. The instructions or programs executed by the processor 1710 may be stored in the non-volatile memory 1722, and the processor 1710 may include one or more processing units, and the different processing units may be separate devices or integrated in one or more processors.
In one embodiment, processor 1710 in disk 1700 may execute instructions or programs stored in memory 1720 to perform the functions of the method embodiments shown in FIG. 9 or FIG. 11. For example, when the magnetic disk 1700 is used to implement the method shown in fig. 9, the processor 1701 is used to perform the functions of the receiving unit 1401 and the executing unit 1402 described above. When the magnetic disk 1700 is used to implement the method shown in fig. 11, the processor 1701 is used to execute the functions of the instruction receiving unit 1501, the instruction executing unit 1502, and the data transmitting unit 1503 described above.
It should be understood that the architecture illustrated by embodiments of the present application is not intended to constitute a particular limitation of computing devices. In other embodiments of the application, the computing device may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The steps of the method in the embodiments of the present application may be implemented by means of hardware, or may be implemented by means of a processor executing a computer program or instructions. The computer program or instructions may constitute a computer program product. Embodiments of the present application also provide a computer program product comprising computer-executable instructions. In one embodiment, the computer-executable instructions are for causing a computer to perform the functions of the method embodiments shown in FIG. 8 or FIG. 10. In another embodiment, the computer-executable instructions are for causing a computer to perform the functions of the method embodiments shown in FIG. 9 or FIG. 11.
The computer executable instructions may be stored in a computer readable storage medium, and embodiments of the present application also provide a computer readable storage medium having the executable instructions stored therein. In one embodiment, the computer-executable instructions are for causing a computer to perform the functions of the method embodiments shown in FIG. 8 or FIG. 10. In another embodiment, the computer-executable instructions are for causing a computer to perform the functions of the method embodiments shown in FIG. 9 or FIG. 11.
The computer readable storage medium provided by embodiments of the present application may be a random access memory (random access memory, RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (programmableROM, PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a removable hard disk, a CD-ROM, or any other form of computer readable storage medium known in the art.
The computer-executable instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wired or wireless means. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that integrates one or more available media. The usable medium may be a magnetic medium, e.g., floppy disk, hard disk, tape; optical media, such as digital video discs (digital video disc, DVD); but also semiconductor media such as solid state disks.
In various embodiments of the application, where no special description or logic conflict exists, terms and/or descriptions between the various embodiments are consistent and may reference each other, and features of the various embodiments may be combined to form new embodiments based on their inherent logic. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion, such as a series of steps or elements. The method, system, article, or apparatus is not necessarily limited to those explicitly listed but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
Although the application has been described in connection with specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made without departing from the spirit and scope of the application. Accordingly, the specification and drawings are merely exemplary of the arrangements defined in the appended claims and are to be construed as covering any and all modifications, variations, combinations, or equivalents that are within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is also intended to include such modifications and variations.

Claims (27)

  1. A data access method, for use with a disk controller, the method comprising:
    acquiring first data to be written into a target disk;
    transmitting the first data and a delayed write instruction of the first data to the target disk under the condition that the first data meets a set condition; the delayed write indication is used for indicating the target disk to temporarily store the first data in a cache unit of the target disk.
  2. The method of claim 1, wherein the setting conditions comprise: the first data are data of a first stripe unit to be written into a target disk, and the data to be written after the first data comprise second data to be written into a second stripe unit; the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different magnetic disks.
  3. The method of claim 1, wherein the setting conditions comprise:
    if the first data is the data of a first stripe unit to be written into the target disk and the data to be written after the first data is predicted to comprise second data to be written into a second stripe unit, determining that the first data meets the set condition; the second stripe unit and the first stripe unit belong to the same target stripe, and the second stripe unit and the first stripe unit belong to different magnetic disks; or alternatively, the process may be performed,
    The setting conditions include
    If the first data is the check data of the third stripe unit to be written into the target disk and the second data to be written into the second stripe unit is predicted to be included in the data to be written after the first data, determining that the first data meets the set condition; the second stripe unit and the third stripe unit belong to the same target stripe, and the second stripe unit and the third stripe unit belong to different magnetic disks.
  4. A method according to claim 2 or 3, wherein the first data is data carried in a received write disc instruction; the method further comprises the steps of:
    and if the data writing mode is determined to be sequential writing and the target stripe comprises a free stripe unit except the target stripe unit, determining that the data to be written comprises the second data.
  5. The method of claim 4, wherein determining whether the data write mode is sequential writing is performed by:
    and determining whether the data writing mode is sequential writing according to the logic addresses in the plurality of continuously received magnetic disk writing instructions.
  6. The method of any of claims 1-5, wherein the deferred write indication includes a deferred write identification and a target storage address of the first data.
  7. The method of any of claims 1-6, wherein the sending the delayed write indication of the first data to the target disk comprises:
    carrying the delayed writing instruction in a first data writing instruction and sending the delayed writing instruction to the target disk; the first data write instruction includes the first data; or alternatively, the process may be performed,
    sending a first operation instruction containing the delayed write instruction to the target disk; the first operation instruction is an instruction other than the first data writing instruction.
  8. The method of any of claims 1-7, wherein the first data is parity data, the method further comprising, after sending the delayed write indication of the first data to the target disk:
    if the second data is acquired, determining update data based on the second data; the updated data is updated check data;
    sending a second data writing instruction to the target disk, wherein the second data writing instruction comprises the updated data; the second data writing instruction is used for instructing the target disk to write the updated data into the nonvolatile memory of the target disk.
  9. A data access method, for use with a disk controller, the method comprising:
    determining a target storage address and a target disk of the prefetched data; the target disk comprises a cache unit;
    sending a prefetch data indication generated based on the target storage address to the target disk; the prefetched data indication is used for indicating the target disk to read the prefetched data from the target storage address to the cache unit;
    sending a first data reading instruction aiming at the prefetched data to the target disk;
    and receiving the prefetched data acquired and sent by the target disk from the cache unit.
  10. The method of claim 9, wherein determining the target storage address and the target disk of the prefetched data comprises:
    if the data reading mode is determined to be sequential reading according to the logic addresses in the continuously received multiple disk reading instructions, determining the target storage address and the target disk of the prefetched data according to the logic address in the currently received disk reading instruction.
  11. The method of claim 9, wherein determining the target storage address and the target disk of the prefetched data comprises:
    In the process of repairing the disk to be repaired, determining a target storage address and a target disk of the prefetched data according to a target stripe to which a stripe unit to be repaired belongs; the stripe unit to be repaired is a stripe unit in the magnetic disk to be repaired; the target stripe includes a plurality of stripe units located on different disks.
  12. The method of any of claims 9-11, wherein the sending, to the target disk, a prefetch data indication generated based on the target storage address comprises:
    carrying the prefetched data instruction in a second data reading instruction sent to the target disk and sending the prefetched data instruction to the target disk; the second data reading instruction is used for indicating the target disk to read data from a designated storage address; or alternatively, the process may be performed,
    sending a second operation instruction containing the prefetched data indication to the target disk; the second operation instruction is an instruction other than the second data read instruction.
  13. A method of data access, for use with a disk, the method comprising:
    receiving first data sent by a disk controller, and receiving a delayed write instruction of the first data sent by the disk controller; the delayed writing instruction is used for instructing the disk to temporarily store the first data in a cache unit of the disk;
    And temporarily storing the first data in a cache unit of the magnetic disk.
  14. The method of claim 13, wherein the deferred write indication includes a deferred write identification and a target memory address of the first data.
  15. The method of claim 13 or 14, wherein the receiving the delayed write indication of the first data sent by the disk controller comprises:
    receiving a first data writing instruction sent by the disk controller, and acquiring the delayed writing instruction carried in the first data writing instruction; the first data writing instruction includes the first data; or alternatively, the process may be performed,
    receiving a first operation instruction which is sent by the disk controller and contains the delayed writing instruction; the first operation instruction is an instruction other than the first data writing instruction.
  16. The method according to any one of claims 13 to 15, wherein the first data is check data, and wherein after the first data is temporarily stored in a cache unit of the disk, the method further comprises:
    receiving a second data writing instruction of the update data sent by the disk controller; the updated data is updated check data; the second data writing instruction instructs the magnetic disk to write the updated data into a target storage address, wherein the target storage address is the same as the target storage address of the check data;
    And writing the updated data into a nonvolatile memory of the magnetic disk according to the target storage address, and deleting the check data in the cache unit.
  17. A method of data access, for use with a disk, the method comprising:
    receiving a prefetch data instruction sent by a disk controller; the prefetched data indicates a target storage address carrying prefetched data;
    reading the prefetched data stored in the storage space corresponding to the target storage address into a cache unit of the magnetic disk;
    receiving a first data reading instruction aiming at the prefetched data, which is sent by the disk controller;
    and acquiring the prefetched data from the cache unit and sending the prefetched data to the disk controller.
  18. The method of claim 17, wherein receiving the prefetch data indication sent by the disk controller comprises:
    receiving a second data reading instruction sent by the disk controller, and acquiring the prefetched data instruction carried in the second data reading instruction; the second data reading instruction is used for indicating the magnetic disk to read data from a designated storage address; or alternatively, the process may be performed,
    Receiving a second operation instruction which is sent by the disk controller and contains the prefetched data indication; the second operation instruction is an instruction other than the second data read instruction.
  19. A data access apparatus for use with a disk controller, said apparatus comprising:
    the data acquisition unit is used for acquiring first data to be written into the target disk;
    a transmitting unit configured to transmit the first data and a delayed write instruction of the first data to the target disk, in a case where it is determined that the first data satisfies a set condition; the delayed write indication is used for indicating the target disk to temporarily store the first data in a cache unit of the target disk.
  20. A data access apparatus for use with a disk controller, said apparatus comprising:
    the prediction unit is used for determining a target storage address and a target disk of the prefetched data; the target disk comprises a cache unit;
    an instruction transmitting unit configured to transmit, to the target disk, a prefetch data instruction generated based on the target storage address; the prefetched data indication is used for indicating the target disk to read the prefetched data from the target storage address to the cache unit; and sending a first data read instruction for the pre-fetch data to the target disk;
    The data receiving unit is used for receiving the prefetched data acquired and sent by the target disk from the caching unit.
  21. A data access device for use with a magnetic disk, said device comprising:
    the device comprises a receiving unit, a first data storage unit and a second data storage unit, wherein the receiving unit is used for receiving first data sent by a disk controller and receiving a delayed writing instruction of the first data sent by the disk controller; the delayed writing instruction is used for instructing the disk to temporarily store the first data in a cache unit of the disk;
    and the execution unit is used for temporarily storing the first data in a cache unit of the magnetic disk.
  22. A data access device for use with a magnetic disk, said device comprising:
    the instruction receiving unit is used for receiving the prefetched data instruction sent by the disk controller; the prefetched data indicates a target storage address carrying prefetched data;
    the instruction execution unit is used for reading the prefetched data stored in the storage space corresponding to the target storage address into the cache unit of the magnetic disk;
    the data transmission unit is used for receiving a first data reading instruction aiming at the prefetched data and sent by the disk controller, acquiring the prefetched data from the caching unit and sending the prefetched data to the disk controller.
  23. A disk controller comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, which when executed by the processor causes the processor to implement the method of any one of claims 1 to 8 or the method of any one of claims 9 to 12.
  24. A magnetic disk comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, which when executed by the processor causes the processor to implement the method of any of claims 13 to 16 or the method of any of claims 17 to 18.
  25. A data storage system, comprising:
    the disk controller of claim 23, and the disk of claim 24.
  26. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method of any one of claims 1 to 12 or to perform the method of any one of claims 13 to 18.
  27. A computer program product comprising computer executable instructions for causing a computer to perform the method of any one of claims 1 to 12 or to perform the method of any one of claims 13 to 18.
CN202180031237.4A 2021-12-08 2021-12-08 Data access method, device, disk controller, disk and data storage system Pending CN116583827A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/136563 WO2023102784A1 (en) 2021-12-08 2021-12-08 Data access method and apparatus, disk controller, disk and data storage system

Publications (1)

Publication Number Publication Date
CN116583827A true CN116583827A (en) 2023-08-11

Family

ID=86729263

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180031237.4A Pending CN116583827A (en) 2021-12-08 2021-12-08 Data access method, device, disk controller, disk and data storage system

Country Status (2)

Country Link
CN (1) CN116583827A (en)
WO (1) WO2023102784A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5522065A (en) * 1991-08-30 1996-05-28 Compaq Computer Corporation Method for performing write operations in a parity fault tolerant disk array
GB2379538B (en) * 2000-06-23 2005-01-12 Intel Corp Non-volatile cache
US6928518B2 (en) * 2001-11-01 2005-08-09 Sun Microsystems, Inc. Disk drive employing adaptive flushing of a write cache
US8024515B2 (en) * 2007-12-07 2011-09-20 Hitachi Global Storage Technologies Netherlands B.V. Non-volatile cache in disk drive emulation
CN107402890B (en) * 2017-07-24 2020-10-02 华中科技大学 Data processing method and system based on solid-state disk array and cache

Also Published As

Publication number Publication date
WO2023102784A1 (en) 2023-06-15

Similar Documents

Publication Publication Date Title
US11960749B2 (en) Data migration method, host, and solid state disk
US9684591B2 (en) Storage system and storage apparatus
US8392670B2 (en) Performance management of access to flash memory in a storage device
US9292228B2 (en) Selective raid protection for cache memory
US9037793B1 (en) Managing data storage
TWI531963B (en) Data storage systems and their specific instruction enforcement methods
JP6691669B2 (en) Information processing system, storage control device, storage control method, and storage control program
CN109791522B (en) Data migration method and system and intelligent network card
US20140189202A1 (en) Storage apparatus and storage apparatus control method
CN108319430B (en) Method and device for processing IO (input/output) request
US8862819B2 (en) Log structure array
CN108228084B (en) Method and apparatus for managing storage system
CN112513804B (en) Data processing method and device
US20130111103A1 (en) High-speed synchronous writes to persistent storage
CN103534688A (en) Data recovery method, storage equipment and storage system
WO2017006675A1 (en) Information processing system, storage control device, storage control method, and storage control program
US20190243758A1 (en) Storage control device and storage control method
US10154113B2 (en) Computer system
CN104899158A (en) Memory access optimization method and memory access optimization device
CN108334457B (en) IO processing method and device
US10162573B2 (en) Storage management system, storage management method, storage medium and information processing system
CN112748865A (en) Method, electronic device and computer program product for storage management
CN116583827A (en) Data access method, device, disk controller, disk and data storage system
US20140351521A1 (en) Storage system and method for controlling storage system
CN104978280B (en) Data storage system and specific instruction execution method thereof

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