WO2020173092A1 - Data processing method, redundant array of independent disks controller, and data storage system - Google Patents

Data processing method, redundant array of independent disks controller, and data storage system Download PDF

Info

Publication number
WO2020173092A1
WO2020173092A1 PCT/CN2019/109088 CN2019109088W WO2020173092A1 WO 2020173092 A1 WO2020173092 A1 WO 2020173092A1 CN 2019109088 W CN2019109088 W CN 2019109088W WO 2020173092 A1 WO2020173092 A1 WO 2020173092A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage device
xor
address
operation result
Prior art date
Application number
PCT/CN2019/109088
Other languages
French (fr)
Chinese (zh)
Inventor
朱志明
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2020173092A1 publication Critical patent/WO2020173092A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms

Definitions

  • This application relates to the field of storage technology, and in particular to data processing methods, redundant array of independent hard disk controllers, and data storage systems and equipment.
  • SSD solid state disk
  • RAID redundant array of independent disks
  • the storage location of the data to be written and the calculation and distribution of the parity data are completed by the RAID controller each time the data processing process.
  • the computing resources and computing capabilities of the RAID controller are required; moreover, all the data to be written needs to go through the RAID controller before being stored on the RAID disks.
  • the storage location of data and the calculation and distribution of check data In the above process, the computing power of the RAID controller directly affects the processing power and processing efficiency of the entire storage system, and easily becomes a bottleneck that affects the processing efficiency of the storage system.
  • the present application discloses a data processing method and device, which can solve the problem that the RAID controller becomes a bottleneck affecting the computing capacity of the storage system in the traditional technology, and improve the computing capacity and processing efficiency of the entire storage system.
  • the disclosure of this application provides a data processing method, which is applied to a data storage system including a redundant array of independent hard disks RAID controller and at least one storage device:
  • the write data request for updating the first data to the second data generates an XOR write instruction, and the XOR write instruction is used to obtain an XOR operation result of the first data and the second data.
  • the exclusive OR update instruction is used to instruct the check storage device to update the check data of the first data to the check data of the second data, the check data of the second data is the check data of the first data and the exclusive OR The exclusive OR operation result of the operation result of the write instruction.
  • the data XOR process and/or the check data XOR process can be migrated to the storage device.
  • the RAID controller completes the above processing process, which can reduce the computing resources of the RAID controller. Calculation load, while reducing data exchange between RAID controller and storage device, improving data processing efficiency.
  • the XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data, and the first address is used to store the XOR write instruction in the RAID controller.
  • the physical address of the operation result of the second data is the physical address used for storing the second data in the RAID controller
  • the logical address of the second data is the logical address used for storing the second data in the data storage device
  • the logical address of the first data is the same as the logical address of the second data.
  • the data storage device is a device in at least one storage device.
  • the RAID controller sends an XOR write instruction to the data storage device, so that the data storage device reads the second data stored in the physical address of the second data and the logical address of the second data according to the XOR write instruction.
  • the first data stored.
  • the data storage device can perform an XOR operation on the first data and the second data to obtain the operation result of the XOR write instruction.
  • the operation result of the XOR write instruction is further sent to the first address of the RAID controller for storage.
  • the data storage device and the verification storage device may be the same storage device or different storage devices, which can be determined according to actual conditions, and this application is not limited.
  • the data XOR is migrated to the data storage device for processing.
  • the RAID controller can obtain the operation result of the XOR write instruction calculated by the data storage device, and then obtain the second data based on the operation result of the XOR write instruction. Check the data, which can reduce the computational load of the RAID controller.
  • the first data includes at least two old data including the first old data and the second old data
  • the second data includes at least two new data including the first new data and the second new data
  • the XOR write instruction includes at least a first XOR write instruction and a second XOR write instruction.
  • the first XOR write instruction carries the second address, the physical address of the first new data, and the logic of the first new data.
  • Address, the second XOR write instruction carries the third address, the physical address of the second new data, and the logical address of the second new data.
  • the data storage device includes at least two of the first storage device and the second storage device. equipment.
  • the RAID controller may specifically send the first XOR write instruction to the first storage device, so that the first storage device reads the first new data stored in the physical address of the first new data and the first new data according to the first XOR write instruction.
  • the first old data is stored at the logical address of the new data, and an exclusive OR operation is performed on the first new data and the first old data to obtain the first operation result.
  • the first storage device may send the first operation result to the second address of the RAID controller for storage.
  • the RAID control can send a second XOR write instruction to the second storage device, so that the second storage device reads the second new data and the second new data stored in the physical address of the second new data according to the second XOR write instruction.
  • the second old data has been stored at the logical address of the new data, and an exclusive OR operation is performed on the second new data and the second old data to obtain the second operation result.
  • the second storage device may also send the second operation result to the third address of the RAID controller for storage.
  • the RAID controller needs to read the XOR operation from at least two data storage devices. As a result, to realize the update of the verification data. Compared with traditional technology, it can reduce the amount of data exchange between the RAID controller and the data storage device and improve the efficiency of data processing.
  • the operation result of the XOR write instruction includes a first operation result and a second operation result.
  • the operation result of the XOR write instruction is the XOR operation result of the first operation result and the second operation result.
  • the operation result of the XOR write instruction may include the operation result of the XOR operation of the two data storage devices, or the operation result of the RAID controller performing the XOR operation on the two operation results again.
  • the exclusive OR operation of the respective operation results of at least two data storage devices can be processed in the RAID controller or stored in the check storage device Medium processing, which can improve the diversity of data processing.
  • the XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data, and the first address is used to store the XOR write instruction in the RAID controller.
  • the physical address of the operation result of the second data is the physical address used for storing the second data in the RAID controller
  • the logical address of the second data is the logical address used for storing the second data in the data storage device.
  • the logical address of the second data is the same as the logical address of the first data
  • the data storage device is a device in at least one storage device.
  • the RAID controller can read the first data stored at the logical address of the second data and the second data stored at the physical address of the second data according to the XOR write instruction. Further, the RAID controller may perform an exclusive OR operation on the first data and the second data to obtain the operation result of the exclusive OR write instruction.
  • the data XOR process is still processed in the RAID controller.
  • the RAID controller can calculate the XOR write instruction according to the XOR write instruction to obtain the operation result of the XOR write instruction, which is convenient for the subsequent XOR process of the check data.
  • the XOR update instruction carries a first address and a fourth address
  • the first address is a physical address used to store the operation result of the XOR write instruction in the RAID controller.
  • the fourth address is a logical address used to store the verification data of the first data in the verification storage device.
  • the RAID controller sends an XOR update instruction to the check storage device, so that the check storage device reads the operation result of the XOR write instruction stored at the first address and reads the operation result of the XOR write instruction stored at the first address according to the XOR update instruction.
  • the stored check data of the first data Further verify the storage device can perform an exclusive OR operation on the operation result of the XOR write instruction and the verification data of the first data to obtain the verification data of the second data, and then update the verification data of the first data to the second data Check data.
  • the XOR operation of the operation result of the XOR write instruction and the check data of the first data can be transferred to the check storage device for processing.
  • the data XOR and check XOR are all processed in the RAID controller, which can reduce the calculation load of the RAID controller, increase the data processing speed of the RAID controller, and further improve the data processing efficiency.
  • the exclusive OR update instruction carries the check data of the second data.
  • the RAID controller may read the parity data of the first data stored at the fourth address from the parity storage device; further write the XOR The operation result of the instruction and the check data of the first data are XORed to obtain the check data of the second data.
  • the XOR of the check data can be processed in the RAID controller, which is convenient for the RAID controller to directly send the check result of the second data obtained by the check XOR to the check storage device for updating, saving the check. Verify the computing resources and computing load of the storage device.
  • the write data request is specifically used to request the second data to update the first data in the stored data.
  • the RAID control The device needs to make sure that it is currently working in RAID lowercase mode. Specifically, when the RAID controller determines that any of the following conditions is satisfied, it may determine to work in the RAID lowercase mode; otherwise, it may determine to work in the RAID uppercase mode.
  • the condition may specifically include: the RAID controller determines that the ratio between the size of the second data and the size of the strip for storing the second data is less than or equal to a preset threshold; or, the RAID controller determines that the first read and write times are less than or Equal to the second read and write times, where the first read and write times is the number of reads and writes required by the RAID controller to store the XOR operation result of the first data, the second data and the check data of the first data, The second read and write times are the read and write times required by the RAID controller when storing the XOR operation result of the second data and the data except the first data in the stored data.
  • this application provides a data processing device, which includes functional modules or units for executing the method described in the first aspect or any possible implementation of the first aspect.
  • this application also provides a RAID controller, including: a processor, a memory, a communication interface, and a bus; the processor, the communication interface, and the memory communicate with each other through the bus; the communication interface is used to receive and send data; and the memory , Is used to store instructions; the processor is used to call instructions in the memory to execute the operation steps of the method described in the first aspect or any possible implementation of the first aspect.
  • this application provides a data storage system, including a redundant array of independent hard disks RAID controller and at least one storage device; wherein:
  • the RAID controller is used to generate an exclusive OR write instruction according to a write data request, the write data request is used to request to update the first data to the second data, and the exclusive OR write instruction is used to obtain the first data and the second data
  • the XOR operation result of the XOR operation is obtained; the operation result of the XOR write instruction is obtained according to the XOR write instruction; the XOR update instruction is sent to the check storage device, which is any one of the at least one storage device.
  • the check storage device is used to receive the exclusive OR update instruction, and update the check data of the first data to the check data of the second data according to the instruction of the exclusive OR update instruction, and the check data of the second data is the first
  • the data check data and the XOR operation result of the XOR write instruction please refer to the relevant descriptions in the method embodiments described in the first aspect, which will not be repeated here.
  • the present application provides a readable storage medium in which instructions are stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the methods described in the above aspects.
  • the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the methods described in the above aspects.
  • FIG. 1 is a schematic diagram of a RAID structure provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a data storage system provided by an embodiment of the present application.
  • Fig. 3 is a schematic flowchart of a data processing method provided by an embodiment of the present application.
  • FIGS 4 to 6 are schematic diagrams of several data processing operations provided by embodiments of the present application.
  • FIG. 7 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of another data processing operation provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another data processing operation provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a data storage system provided by an embodiment of the present application.
  • RAID is composed of at least one logical hard disk block
  • the logical hard disk block may include logical hard disk (logical disk, LDisk) or logical solid state disk (logical solid state disk, LSSD), etc.
  • Each logical hard disk block comes from one or more storage media.
  • the storage medium referred to in this application refers to a carrier that stores data, which may include, but is not limited to, a solid-state hard disk or a mechanical hard disk.
  • the mechanical hard disk includes a serial attached small computer system interface (SAS) hard disk, Serial advanced technology attachment (SATA) hard disk.
  • SAS serial attached small computer system interface
  • SATA Serial advanced technology attachment
  • FIG. 1 a schematic diagram of a RAID is shown.
  • the logical hard disk block is LSSD as an example.
  • the RAID in the figure consists of 4 LSSDs, namely LSSD1, LSSD2, LSSD3, and LSSD4.
  • each LSSD is derived from one or more SSDs.
  • LSSD1 can be derived from SSD1
  • LSSD2 is derived from SSD2
  • LSSD3 is derived from SSD3
  • LSSD4 is derived from SSD2, etc.
  • SSD1 to SSD4 are different solid state drives.
  • the size of the LSSD can be divided according to actual needs, and the size of each LSSD may be the same or different, which is not limited in this application.
  • the same size of each LSSD is taken as an example for detailed description.
  • RAID controllers can use striping technology to achieve data storage.
  • the RAID controller can divide the RAID into multiple stripes (also called RAID stripes) according to actual needs.
  • the size of each strip (also referred to as strip size) can be determined according to actual needs, for example, the strip size can be 1G, 12G, 100G, and so on.
  • Each stripe is composed of at least one stripe unit, and the number of the stripe unit depends on the number of logical hard disk blocks (such as LSSD) constituting the RAID.
  • the size of each strip unit in the constituent strips may be the same.
  • Each stripe unit corresponds to a range of logical addresses, and the logical address in this application may also be referred to as a logical block address (logical block address, LBA). It is convenient for the RAID controller to implement data storage based on the LBA, which will be described in detail below in this application.
  • LBA logical block address
  • the size of different strip units in the same strip may be the same or different, and this application is not limited. For ease of description, in the following embodiments of the present application, the size of each strip unit is the same as an example for detailed description.
  • Figure 1 refer to Figure 1 to take a strip as an example.
  • the RAID controller can divide and obtain 1G strips according to actual needs, which can be specifically shown by the dashed box in the figure.
  • the strip 1 in the figure is composed of 4 strip units, and the size of each strip unit is 1G.
  • FIG. 2 is a schematic diagram of a network framework of a data storage system provided by an embodiment of the present application.
  • the data storage system 20 includes a host 22, a RAID controller 24, and at least one storage device.
  • FIG. 2 uses a storage system including a storage device 1, a storage device 2 and a storage device 3, a total of 3 storage devices for illustration.
  • the host 12 may obtain a data write request, and the data write request is used to request to write the data to be stored into the storage medium of the corresponding storage device. Specifically, the host 12 may receive write data requests sent by other devices. Alternatively, the host 12 can generate a data write request according to the application's own needs, for example, when the mail needs to be updated and saved in the mail application, it can generate a corresponding data write request. Wherein, the write data request is used to update stored data or request to store data to be written.
  • the write data request carries information related to the data to be written, such as the specific data to be written, the starting address of the logical address (specifically the logical block address LBA) of the data to be written, and the size or length of the data to be written.
  • the host 12 After the host 12 obtains the data write request, it can send the data write request to the RAID controller for processing, so as to store the data to be written in the data write request in a corresponding storage device.
  • the host 12 involved in this application refers to a device with data processing capability or computing capability, which may include, but is not limited to, a central processing unit (CPU), a general-purpose processor, or other devices.
  • the RAID controller 14 is used to receive a write data request sent by the host 12, and process the write data request, so as to store the data to be written carried in the write data request to a corresponding storage device, which can be a strip provided by the storage device. With unit.
  • this application will take the data to be written as the second data as an example to describe in detail how to store the second data, that is, how to update the first data to the second data, so as to implement related embodiments related to the storage of the second data.
  • the RAID controller and the storage device can communicate with each other through a storage communication protocol (such as the NVMe protocol), which is not limited in this application.
  • the RAID controller may also be used to manage RAID, including managing at least one storage device that communicates with the RAID controller, so as to form one or more storage media by using multiple storage media included in the at least one storage device. Multiple RAID, and then realize data storage based on RAID.
  • the storage unit 242 is used to implement data storage, for example, storing the XOR operation result obtained by the XOR operation performed by the XOR acceleration unit 241, or storing data sent from other devices (such as storage devices), and so on.
  • the storage unit 242 is used to store data, and it may include, but is not limited to, a cache, a disk, or other storage devices.
  • the calculation unit 243 is used to implement data arithmetic processing, such as calculating the LBA of the stored data based on a preset RAID algorithm. The related embodiments related to the RAID controller are specifically described below in this application, and will not be repeated here.
  • each unit included in the RAID controller can be specifically implemented by hardware or software code.
  • each unit of the RAID controller shown in the figure can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a complex program logic device ( complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), generic array logic (GAL) or any combination thereof.
  • the related functions of the RAID controller can also be realized by software, and the RAID controller and its various units can also be software units.
  • Storage devices can be divided into data storage devices and check storage devices.
  • the data storage device is used to store the data to be written into the storage device in the data write request
  • the verification storage device is used to store the verification data.
  • it can be used as a data storage device or as a verification storage device.
  • an independent storage device can also be used as a verification device or a data device, which is not limited in the present invention.
  • Each storage device includes a storage controller and at least one storage medium.
  • the number of storage media deployed in each storage device is not limited, and may be the same or different.
  • FIG. 2 three storage devices are taken as an example, and each storage device includes n storage media.
  • n is a positive integer set by the system, for example, according to the actual needs of the system.
  • the storage device 1 includes a storage controller 100 and a storage medium 101 to a storage medium 10n.
  • the storage device 2 includes a storage controller 200 and storage media 201-20n.
  • the storage device 3 includes a storage controller 300, a storage medium 301 to a storage medium 30n.
  • each storage controller (such as storage controller 100) can be used to receive a write data request (such as a split write data request) sent by the RAID controller, and the write data request carries new data and the new data.
  • a write data request such as a split write data request
  • the storage controller 100 can determine the PBA corresponding to the LBA of the new data in the write data request and the storage medium where the PBA is located according to the correspondence between at least one pre-stored LBA and PBA, and then write The new data in the data request is sent to the storage medium to store the new data in the PBA corresponding to the LBA of the data in the storage medium, thereby realizing data storage.
  • FIG. 3 is a schematic flowchart of a data processing method provided by an embodiment of the present application.
  • the method shown in FIG. 3 is applied to the data storage system shown in FIG. 2, and the method includes the following implementation steps:
  • the RAID controller receives a data write request sent by the host, where the data write request is used to request to update the first data to the second data.
  • the write data request carries the second data, the logical address LBA and the length of the second data.
  • the data write request is used to request to update the first data in the stored data, and specifically may be a request to update the first data to the second data.
  • the second data carried in the data write request may specifically be a physical address where the second data is stored in the host. It is convenient for the RAID controller to read the second data from the physical address after receiving the data write request.
  • this application takes the second data carried in the data write request as an example to describe the relevant content.
  • the RAID controller obtains m data write sub-requests according to the data write request, and the data write sub-requests carry the new data, the LBA and the length of the new data.
  • the RAID controller determines the stripe unit that carries the second data and the storage device corresponding to the stripe unit according to the LBA and length (ie size) of the second data in the write data request, so that the RAID controller can store the second data
  • the data is stored in a corresponding storage device, which can be specifically a strip unit of the storage device.
  • the number of stripe units and storage devices is not limited, and depends on the size of the second data.
  • the RAID controller determines the stripe unit that carries the second data, if the number of stripe units that carry the second data is m, the RAID controller can split the write data request sent by the host to split the request The second data in is split into m new data to obtain m data write sub-requests.
  • Each data write sub-request includes one new data, the LBA and length of the new data.
  • the RAID controller can process m write data sub-requests to realize the storage and update of the second data.
  • the RAID controller can directly process the write data request.
  • the data write request is directly used as the first data write sub-request, and the second data in the first data write sub-request is the first new data.
  • the RAID controller can split the write data request (specifically the data to be written in the write data request) to obtain m New data and m write data sub-requests.
  • Each data write sub-request carries a new data, the LBA and length of the new data.
  • m pieces of new data constitute the second data (that is, the second data includes m pieces of new data), and the m data writing sub-requests may specifically be: the first data writing sub-request, the second data writing sub-request, ..., the mth Write data subrequest.
  • the first data write sub-request may carry the first new data, the LBA and length of the first new data.
  • the first data write sub-request may be used to request to rewrite the first old data in the stored data with the first new data, where the rewriting includes replacing the first old data with the first new data, or Part of the data of the first old data is replaced with the first data.
  • the second data write sub-request may carry the second new data, the LBA and length of the second new data.
  • the second data write sub-request may be used to request to rewrite the second old data in the stored data with the second new data.
  • the m-th data write sub-request can carry the m-th new data, the LBA and length of the m-th new data, and can optionally be used to request the n-th new data to update the n-th old data in the stored data.
  • the RAID controller after the RAID controller receives the write data request sent by the host, it can store the second data (specifically m new data after splitting) carried in the write data request in its own cache space (specifically RAID controller cache space).
  • each new data corresponds to its own stored physical address, and the corresponding stored physical addresses of any two new data are different from each other.
  • the physical address here may specifically be a memory address or a cache address in the RAID controller, which is not limited in this application.
  • the RAID controller judges whether the data write request is in the RAID lowercase mode.
  • the RAID controller needs to determine whether the current data processing is in the RAID lowercase mode before generating the XOR write command according to the write data request. If yes, continue to perform the subsequent S304 process of this application. If not, the RAID controller implements the storage of the second data in a conventional manner, which is not limited in this application.
  • the RAID controller can use the following two implementation manners to determine to continue the application process, that is, to determine whether the current data processing is in the RAID lowercase mode:
  • the RAID controller determines whether the RAID controller is currently in the RAID lowercase mode by judging whether the ratio between the size of the second data (that is, m new data) and the stripe size used for storing the second data exceeds a preset threshold. If the ratio does not exceed the preset threshold, it is determined that the RAID lowercase mode is currently in operation, and the steps in the implementation process of this application are continued. Otherwise, it is determined that it is currently in the RAID uppercase mode, the implementation process of this application is ended, and the data is stored according to the conventional data storage method.
  • the preset threshold is an empirical value set based on user experience or calculated based on historical conditions of data stored in the storage system. For example, when the preset threshold is 50%, it means that when the size of the second data is less than half of the stripe size of the data to be stored, the process of the embodiment of this application can be continued; otherwise, the data storage is implemented in a conventional manner .
  • XOR means exclusive OR.
  • the host can update the first data in the stored data in the strip according to actual needs, for example, update D1 to D1'. Then the host can generate a corresponding write data request and send the write data request to the RAID controller.
  • the write data request can carry the second data (that is, D1'), the LBA of D1', and the length.
  • the RAID controller receives the data write request, and can learn the ratio between the size of the second data (that is, the size of the old data that needs to be updated) and the stripe size of the second data to be stored, and then determine whether to implement this Application follow-up process.
  • the RAID controller here knows that D1' only occupies 25% of the storage capacity of the entire strip, and this data processing is in RAID lowercase mode, and the subsequent procedures of this application can be continued.
  • the RAID controller uses the old data and the new data to perform an exclusive OR operation, and then performs an exclusive OR operation on the result data of the exclusive OR operation and the original check data to obtain a new checksum data.
  • the new verification data P' D1XOR D1'XOR P.
  • the host needs to update D1, D2, and D3 to D1', D2', and D3' according to actual needs. Then the host can generate a corresponding write data request and send it to the RAID controller.
  • the write data request carries the second data (D1', D2' and D3') and the LBA of the second data (that is, the initial storage LBA) And length. Accordingly, the RAID controller receives the data write request, learns the size of the second data, and then determines whether to implement the subsequent procedures of this application.
  • the RAID controller knows that the second data (D1', D2', and D3') account for 75% (3/4) of the stripe, and the current data processing mode is in the RAID uppercase mode, and the implementation process of this application can be ended.
  • the RAID controller determines whether it is currently in the RAID lowercase mode by judging the magnitude relationship between the first read and write times and the second read and write times. Specifically, when the first number of reads and writes is less than or equal to the second number of reads and writes, it is determined that it is currently in the RAID lowercase mode, and the implementation steps of this application are continued. Otherwise, make sure you are currently in RAID uppercase mode.
  • the first number of reads and writes is the read required by the RAID controller to realize the storage of the operation result obtained by performing the exclusive OR operation on the second data (ie m new data), the first data and the original check data. Number of writes.
  • the second number of reads and writes is the read and write required by the RAID controller to realize the storage of the operation result obtained by the exclusive OR operation on the second data, the data other than the first data in the stored data and the original check data frequency.
  • a strip stores data including D1, D2, D3, and D4.
  • D1 The old data D1 is updated with the new data D1'.
  • the first read and write times are 4 times, which are: read once D1, write once D1', read once P, and write once P'.
  • the second read and write times are 5 times, which are: write once D1', read data D2, D3, and D4 once, and write once P'.
  • the first number of reads and writes is less than the second number of reads and writes, and the RAID controller can continue to execute the embodiments of the present application and use the RAID lowercase mode to update data.
  • the host needs to update D1, D2, and D3 to: D1', D2', and D3' according to actual needs, that is, three new data D1', D2', and D3' are needed to correspond to the old data D1 D2 and D3 are updated.
  • the first number of reads and writes is 8 times.
  • P’ D1’XOR D2’XOR D3’XOR D4.
  • the second number of reads and writes is 5 times.
  • the first number of reads and writes is greater than the second number of reads and writes, and the RAID controller can end the process of the embodiment of the present application and use the RAID uppercase mode for data update, that is, use the conventional data storage process to implement data update.
  • Step 304 The RAID controller generates a first exclusive OR write command (xor write) according to the first data write sub-request.
  • the first exclusive OR write command carries the storage address of the first new data, the LBA of the first new data, and The second address.
  • the second address is used to store the operation result of the first XOR write instruction.
  • the RAID controller can generate an XOR write instruction according to the data write request, and the XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data.
  • the first address is the physical address used to store the operation result of the XOR write instruction in the RAID controller
  • the physical address of the second data is the physical address when the second data is stored in the RAID controller
  • the logical address of the second data It is the logical address occupied when the second data is stored in the data storage device.
  • the data write request will be split into multiple data write sub-requests.
  • the first data write sub-request is taken as an example to describe the related embodiments of the present application in detail.
  • the RAID controller may generate the corresponding first XOR write instruction.
  • the first XOR write instruction is used to obtain the XOR operation result of the first new data and the first old data.
  • the first XOR write instruction carries the physical address of the first new data, the LBA of the first data, and the first data.
  • Second address is a physical address that is customized by the system, for example, customized according to user preferences or actual needs of the system, the physical address in the RAID controller used to store the result data of the first XOR write command. In practical applications, the second address is usually a physical address in the RAID controller, such as a memory address or a cache address.
  • the first XOR write instruction may also include information such as the length of the first new data, which is not limited in this application.
  • the RAID controller sends the first XOR write instruction to the data storage device, where the data storage device is the storage device where the LBA of the first new data corresponds. Correspondingly, the data storage device receives the first XOR write instruction.
  • the RAID controller can determine the data storage device where the LBA is located according to the LBA of the first new data, and then send the first XOR write instruction to the data storage device for processing.
  • the data storage device reads the first new data according to the storage address of the first new data in the first XOR write instruction, reads the first old data stored corresponding to the LBA according to the LBA of the first new data, and stores the first new data. A new data is written into the LBA of the first new data to update the first old data.
  • the data storage device performs an exclusive OR operation on the first new data and the first old data to obtain first result data.
  • the data storage device sends the first result data to the second address in the RAID controller for storage.
  • the data storage device receives the first exclusive OR write instruction sent by the RAID controller. Then, according to the storage address of the first new data in the first XOR write instruction, the first new data is read from the storage address in the RAID controller. According to the LBA of the first new data in the first XOR write instruction, the physical address corresponding to the LBA is determined, which may also be referred to as a physical block address (PBA). Then read the first old data stored at the PBA, and update the first old data with the first new data.
  • PBA physical block address
  • the data storage device may store the first new data at the PBA corresponding to the LBA; or, the data storage device may store the first new data at another new PBA, and update the relationship between the LBA and the PBA. Correspondence between the LBA and the new PBA. That is, the data storage device can cancel the correspondence between the LBA of the first new data and the original PAB, and create a new correspondence between the LBA of the first new data and the new PBA.
  • the data storage device may use direct memory access (DMA) to read data.
  • DMA direct memory access
  • the data storage device reads the first new data from the storage address of the first new data through DMA, or reads the first old data stored at the PBA from the PBA corresponding to the LBA of the first new data through DMA And so on, to save data reading time and improve data processing efficiency.
  • the data storage device may perform an exclusive OR operation on the read first old data and the first new data according to the first exclusive OR instruction to obtain the first operation result, and send the first operation result to the RAID Stored at the second address in the controller.
  • the data storage device includes a storage controller and at least one storage medium.
  • the storage controller determines the PBA corresponding to the LBA of the first new data according to the LBA of the first new data in the first XOR write instruction.
  • the storage controller reads the first new data stored in the storage address from the RAID controller according to the storage address of the first new data in the instruction, and uses the first new data to update the first old data.
  • the storage controller may perform an exclusive OR operation on the read first old data and the first new data to obtain the first operation result, and write the first operation result to the second address in the RAID controller storage.
  • the execution sequence of reading the first new data and reading the first old data is not limited in this application.
  • the order of execution of the update step of the first new data, the asynchronous operation step of the first new data and the first old data is also not limited.
  • the two can be executed in parallel, or the update step of the first new data may be executed first, and then Perform the exclusive OR operation steps of the first new data and the first old data and so on.
  • the first storage device and the verification storage device in this application may be the same storage device or different storage devices, which is not limited in this application.
  • the RAID controller sends an exclusive OR update instruction (xor update) to the check storage device, where the exclusive OR update command carries the first address, the LBA of the original check data, and the length.
  • the verification storage device receives the exclusive OR update instruction.
  • the verification storage device is a storage device that stores original verification data in at least one storage device.
  • the check storage device responds to the XOR update instruction, reads the original check data according to the LBA and length of the original check data in the XOR update instruction, and obtains the operation result of the XOR write instruction according to the first address. One operation result.
  • the check storage device performs an exclusive OR operation on the original check data and the first operation result, thereby obtaining new check data (also called an exclusive OR operation result). And use the new check data to update the original check data.
  • the original verification data involved in this application can also be referred to as the verification data of the first data
  • the new verification data involved in this application can be referred to as the verification data of the second data.
  • the original verification data is used in the following text.
  • the data and the new verification data are collectively referred to as not limited.
  • the RAID controller can send an XOR update instruction to the check storage device, and the XOR update instruction carries the first address, the LBA of the original check data, and the length.
  • the check storage device receives the XOR update instruction, and according to the LBA and length of the original check data in the XOR update instruction, determines the PBA corresponding to the original check data in the check storage device, and then obtains it from the PBA Read the original verification data.
  • the verification storage device can read from the RAID controller the operation result of the XOR write instruction corresponding to the first address according to the first address carried in the XOR update instruction.
  • the XOR update instruction may also directly carry the operation result of the XOR write instruction, instead of the first address where the operation result is stored. In this case, the verification storage device can directly obtain the XOR by parsing the XOR update instruction.
  • the operation result of the write instruction In practical applications, to save instruction overhead, the XOR update instruction usually carries the first address, which is not the result of the XOR write instruction. In the following, this application will use the exclusive OR update instruction to carry the address to explain the relevant content.
  • the check storage device performs an exclusive OR operation on the read original check data and the operation result of the XOR write instruction to obtain new check data.
  • the verification storage device can use the new verification data to update the original verification data. Specifically, the verification storage device can write the new verification data to the PBA corresponding to the LBA of the original verification data; or, The new verification data is written into another new PBA for storage, and the correspondence between the LBA of the original verification data and the original PBA is updated, and the LBA of the original verification data is corresponding to the new PBA.
  • the verification storage device includes a storage controller and at least one storage medium.
  • the storage controller determines the corresponding PBA according to the LBA and length of the original verification data, and then reads the original verification data from the PBA.
  • the storage controller can read from the RAID controller the operation result of the exclusive OR write command corresponding to the first address according to the first address in the exclusive OR update instruction. Further, the storage controller can perform an XOR operation on the original check data and the operation result of the XOR write instruction, thereby obtaining new check data. The new verification data is then used to update the original verification data.
  • the implementation steps of the verification storage device reading the original verification data and the operation result of the XOR write instruction can be executed in parallel or serially.
  • the verification storage device can be executed first. Read the original check data and then read the operation result of the XOR write instruction, or read the operation result of the XOR write instruction first and then read the original check data, which is not limited.
  • the above of this application only takes the write data request including a first data write sub-request as an example to explain how to update the first new data and the original verification data.
  • each data write sub-request may correspond to the processing principle of the aforementioned first data write sub-request to realize the update of each new data.
  • the RAID controller obtains the XOR operation result corresponding to each data write sub-request, it can synthesize the XOR operation results to realize the update of the original parity data.
  • the RAID controller obtains the XOR operation result corresponding to each data write sub-request, it can synthesize the XOR operation results to realize the update of the original parity data.
  • the strip stores the stored data including D1 to D4.
  • the host will generate a write data request and send the write data request to the RAID controller.
  • the write data request carries the second data (D1'), the LBA of D1', and the length.
  • the write data request is used to request the second data D1' to update the first data D1 in the stored data.
  • the RAID controller learns that the size of D1' does not exceed the size of one stripe unit according to the write data request, and there is no need to split the write data request.
  • the write data request is the first data write sub-request.
  • the RAID controller after the RAID controller receives the write data request, it can send an exclusive OR write command to the first storage device.
  • the exclusive OR write command carries the storage address of D1', the LBA of D1', the length, and the first storage device. Address and other information.
  • the RAID controller after the RAID controller receives the data write request, it can store the data to be written D1' carried in the data write request in the corresponding cache space.
  • the storage address of D1' in the first data write sub-request may specifically be the address of storage D1' in the RAID controller.
  • the first storage device receives the XOR write instruction, and the storage controller reads D1' from the storage address of D1'.
  • the storage controller reads the old data D1 stored corresponding to the LBA of D1', and uses D1' to update D1. For details on how to update the data, please refer to the relevant introduction in the foregoing embodiment.
  • the storage controller can perform XOR operation on the read data D1 and new data D1' to obtain the operation result D1" of the XOR write instruction, and send the operation result D1" to the first address in the RAID controller storage.
  • the RAID controller can send an XOR update instruction to the check storage device, and the XOR update instruction carries the LBA of the original check data (P0), the length of the original check data, and the first address.
  • the first address is used to store the operation result of the XOR write instruction.
  • the check storage device receives the XOR update instruction, and reads the original check data P0 corresponding to the LBA according to the LBA and length of the original check data through the storage controller in its own device; reads the exclusive OR write according to the first address The operation result D1" of the instruction.
  • the storage controller can perform an exclusive OR operation on the read original check data P0 and the first operation result D1", thereby obtaining new check data P0'. Further, this P0' can be written into the LBA of the original check data to update the original check data P0 with the new check data P0'.
  • the number m of new data included in the second data is not limited to one.
  • the update principle of the first new data in the first data write subrequest can also be referred to above to realize the update of m new data and the update of the original verification data, which is not limited in this application.
  • the operation results obtained by performing exclusive OR operations on each new data and each old data can be sent to the RAID controller, and the RAID control The device can realize the exclusive OR operation of each operation result, and send the final exclusive OR operation result to the verification storage device. It is convenient for the verification storage device to update the original verification data based on the XOR operation result.
  • the RAID controller can receive a write data request generated by the host according to actual needs, and the write data request carries the second data (D1' and D2'), the LBA and the length of the second data. Since the second data is relatively large, the RAID controller can split the data write request into two data write sub-requests, which are respectively the first data write sub-request and the second data write sub-request.
  • the first data write sub-request carries the storage address of the first new data D1', the LBA and length of D1'
  • the second data write sub-request carries the LBA and length of the second new data D2' and D2'.
  • the second data D1' and D2' carried in the data write request may be stored in the corresponding cache space.
  • the physical address of D1' in the first data write sub-request may specifically be the address of D1' stored in the RAID controller.
  • the physical address of D2' in the second data write sub-request is the address of D2' stored in the RAID controller.
  • the RAID controller may generate a first XOR write instruction according to the first data write sub-request, and send it to the first storage device.
  • the first XOR write instruction carries the storage address of D1', the LBA of D1', the length, and the second address.
  • the second address is used to store the operation result of the first XOR write instruction.
  • the second XOR write instruction carries the storage address of D2', the LBA of D2', the length, and the third address.
  • the third address is used to store the operation result of the second XOR write instruction.
  • the first storage device is the storage device where the LBA of D1' corresponds to, and the second storage device is the storage device where the LBA of D2' corresponds.
  • the first storage device and the second storage device may be the same or different, which is not limited in this application.
  • the first storage device receives the first XOR write instruction, and reads D1' stored at the physical address of D1' through the storage controller of the first storage device. And read the first old data D1 corresponding to the LBA of D1' through the storage controller of the own device, and write the D1' into the storage medium where the LBA of D1' in the first storage device is located, so as to use D1' updates D1, as described above. Further, the storage controller of the first storage device may perform an exclusive OR operation on the read first old data D1 and the first new data D1' to obtain a first operation result D1", and send the first operation result D1" to It is stored at the second address in the RAID controller.
  • the second storage device receives the second XOR write instruction, and reads D2' stored at the physical address of D2' through the storage controller of the second storage device. Read the second old data D2 stored corresponding to the LBA of D2' through the storage controller of the own device, and update D2 with this D2'. Further, the storage controller of the second storage device may perform an exclusive OR operation on the read second old data D2 and the second new data D2' to obtain a second operation result D2", and send the second operation result D2" Store at the third address in the RAID controller.
  • the serial number 2-5 shows the operation flow of the first storage device to realize data processing
  • the serial number 6-9 shows the operation flow of the second storage device to realize data processing.
  • Steps can be executed in parallel or serially.
  • serially you can execute the operation flow of sequence number 2-5 first, and then execute the operation flow of sequence number 6-9; alternatively, you can execute the operation flow of sequence number 6-9 first, and then execute the operation flow of sequence number 2-5
  • the present invention is not limited.
  • the RAID controller may send an exclusive OR update instruction to the check storage device, and the exclusive OR update instruction carries information such as the second address, the third address, the LBA of the original check data P0, and the length.
  • the verification storage device receives the XOR update instruction, reads the first calculation result D1' according to the second address through the storage controller of the own device, reads the second calculation result D2' according to the third address, and reads the second calculation result D2' according to the original verification
  • the LBA and length of data P0 read the original parity data P0. Further verifying the storage controller of the storage device can perform an exclusive OR operation on the original verification data P0, the first calculation result D1" and the second calculation result D2" to obtain the new verification data P0'. Further, this P0' can be written into the LBA of the original check data to update the original check data P0 with the new check data P0'.
  • the RAID controller can first calculate the first storage device to obtain the first operation result D1" and the second storage
  • the second operation result D2" calculated by the device is XORed to obtain the XOR operation result D3". It is convenient for the verification storage device to use the XOR operation result D3" to update the original inspection data P0.
  • the RAID controller After the RAID controller receives the first operation result D1" sent by the first storage device and the second operation result D2" sent by the second storage device, it can compare the first operation result D1" and the second operation result D2. "Perform XOR operation to obtain XOR operation result D3" and cache it in the first address of the RAID controller. Further, the RAID controller can send an XOR update instruction to the check storage device, and the XOR update instruction carries The first address, the LBA and length of the original check data P0.
  • the check storage device receives the XOR update instruction accordingly, reads the exclusive OR operation result D3" according to the third address through its own storage controller, and then reads the XOR operation result D3" according to the original check
  • the LBA and length of data P0 read the original parity data.
  • the XOR operation result D3" and the original check data P0 are further XORed to obtain new check data P0'.
  • the new check data P0' is written to the LBA of the original check data to use the new check data.
  • the verification data P0' updates the original verification data P0.
  • the data exclusive OR operation can be migrated to the data storage device for execution, and the check exclusive OR operation can be migrated to the check storage device for execution.
  • the computing resources and computing load of the RAID controller can be reduced.
  • the above data processing process also reduces the data exchange between the RAID controller and the storage device, thereby reducing the bandwidth occupied during the data exchange process, thereby effectively increasing the data processing rate and improving the efficiency of data processing.
  • FIG. 7 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
  • the method shown in FIG. 7 is applied to the data storage system shown in FIG. 2, and the method includes the following implementation steps:
  • the RAID controller receives a data write request sent by the host, where the data write request is used to request to update the first data in the stored data with the second data, that is, request to update the first data to the second data.
  • the write data request carries the second data, the LBA and the length of the second data.
  • the data write request may also carry the second data corresponding to the physical address stored in the host, so that the RAID controller can read the corresponding data to be written from the host according to the physical address.
  • the RAID controller obtains m data write sub-requests according to the data write request, and the data write sub-requests carry the new data, the LBA and the length of the new data.
  • the write data request is specifically used to request the second data to update the first data in the stored data, the new data is part of the second data, m new data constitute the second data, and m is a positive integer .
  • S701 and S702 please refer to the relevant description in the foregoing S301 and S302 for details.
  • the RAID controller determines whether it is currently in the RAID lowercase mode.
  • the RAID controller needs to determine the working mode of the RAID controller before generating the XOR write command according to the write data request, which can be the RAID lowercase mode or the RAID uppercase mode. When the RAID controller determines that it is in the RAID lowercase mode, it can continue to execute the implementation process of this application; otherwise, the process ends.
  • the RAID controller generates a first XOR write instruction according to the first data write subrequest, where the first XOR write instruction carries the physical address of the first new data, the LBA of the first new data, and the second address.
  • the second address is used to store the operation result of the first XOR write instruction.
  • the RAID controller generates an XOR write instruction according to the write data request.
  • the XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data.
  • the first address is used in the RAID controller.
  • the first data write sub-request correspondingly generates the first XOR write instruction as an example for illustration.
  • the RAID controller sends the first XOR write instruction to the first storage device, where the first storage device is the storage device where the LBA of the first new data corresponds. Correspondingly, the first storage device receives the first XOR write instruction.
  • the first storage device reads the first new data according to the physical address of the first new data in the first XOR write instruction, and reads the stored data corresponding to the LBA according to the LBA of the first new data in the first XOR write instruction. First old data, and update the first old data with the first new data.
  • the first storage device performs an exclusive OR operation on the first new data and the first old data to obtain first result data.
  • the first storage device sends the first result data to the second address storage in the RAID controller.
  • the RAID controller reads the original parity data from the parity storage device where the LBA of the original parity data corresponds to the LBA and length of the original parity data.
  • S708 and S704 in this application can be processed in parallel, that is, the reading step of the original check data and the updating step of the first new data can be processed in parallel or serially.
  • their execution order is not limited.
  • the RAID controller can generate an exclusive OR write command to update the first new data, and then read the original parity data; or, read the original data first. After verifying the data, the first new data is updated, etc., which is not limited in this application.
  • the RAID controller performs an exclusive OR operation on the original check data and the operation result of the XOR write instruction (here it may be the first operation result) to obtain new check data, and write the new check result to the original
  • the LBA of the verification data is used to update the original verification data.
  • the RAID controller may send an exclusive OR update command to the check storage device, and the exclusive OR update command carries new check data.
  • the new verification data can be written to the LBA of the original verification data, so as to update the original verification data with the new verification data.
  • FIG. 8 a schematic diagram of a data processing operation.
  • the host rewrites the first data D1 stored in the stripe according to actual requirements, and suppose that D1 is updated with the second data D1', and the stripe stores stored data including D1 to D4.
  • the host will generate a write data request and send the write data request to the RAID controller.
  • the write data request carries the second data (D1'), the LBA of D1', and the length.
  • the write data request is used to request to use D1' to update D1 in the stored data.
  • the RAID controller learns that the size of D1' does not exceed the size of one stripe unit according to the write data request, and there is no need to split the write data request.
  • the write data request is the first data write sub-request.
  • the RAID controller after the RAID controller receives the write data request, it can send an exclusive OR write command to the first storage device.
  • the exclusive OR write command carries the storage address of D1', the LBA of D1', the length, and the first address. And other information.
  • the storage address of D1' is the address of D1' stored in the RAID controller.
  • the first storage device receives the XOR write instruction, reads the old data D1 stored corresponding to the LBA of D1' through the storage controller, and writes the D1' to the LBA of D1' in the first storage device. In the storage medium where it is located, use D1' to update D1.
  • the storage controller can perform an exclusive OR operation on the read old data D1 and the new data D1' to obtain the operation result of the exclusive OR write instruction, that is, the first operation result D1".
  • the first operation result D1" can then be obtained. Send to the first address in the RAID controller for storage.
  • the RAID controller reads the original parity data P0 from the parity storage device where the LBA of the original parity data P0 is located according to the prestored information such as the LBA and length of the original parity data P0. Further, the RAID controller can perform an exclusive OR operation on the original parity data P0 and the first operation result D1" to obtain new parity data P0'. Then the RAID controller can update the original parity data P0 with the new parity data P0' .
  • the number m of new data included in the second data is not limited to one.
  • m is greater than or equal to 2
  • the results of the exclusive OR operation of m new data and m old data can be sent to the RAID controller.
  • the RAID controller then performs an exclusive OR operation on the m operation results, and realizes the update of the original check data based on the operation result of the exclusive OR operation.
  • the data XOR operation can be migrated to the data storage device for execution, and the check XOR operation can be executed in the RAID controller.
  • the traditional technology it also reduces the computing resources and computing load of the RAID controller, reduces the data exchange between the RAID controller and the storage device, and improves the efficiency of data processing.
  • FIG. 9 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
  • the method shown in FIG. 9 is applied to the data storage system shown in FIG. 2, and the method includes the following implementation steps:
  • the RAID controller receives a write data request sent by the host, where the write data request is used to request to update the first data in the stored data to the second data, and the write data request carries the second data and the second data. LBA and length.
  • the data write request may also carry the second data corresponding to the physical address stored in the host, so that the RAID controller can subsequently read the second data from the host according to the physical address.
  • the RAID controller obtains m data write sub-requests according to the data write request, and the data write sub-request carries the new data, the LBA and the length of the new data.
  • the data write sub-request is specifically used to request the new data to update the old data in the stored data, the new data is part of the second data, m new data constitute the second data, and m is a positive integer .
  • steps 901 and 902 please refer to the relevant descriptions in the foregoing steps 301 and 302 for details.
  • m 1
  • the first data write sub-request is used as an example to describe the relevant embodiments.
  • the RAID controller determines whether it is currently in the RAID lowercase mode.
  • the RAID controller can determine the working mode of its own device, which can be a RAID lowercase mode or a RAID uppercase mode. When the RAID controller determines that it is in the RAID lowercase mode, it can continue to execute the implementation process of this application; otherwise, the process ends.
  • Step 904 The RAID controller sends a read data instruction to the first storage device according to the first data write subrequest, where the read data instruction is used to request to read the first old data stored in the LBA of the first new data.
  • the read data instruction carries the LBA of the first new data.
  • the read data instruction may also carry information such as the length of the first new data.
  • the first storage device is the storage device corresponding to the LBA of the first new data.
  • the first storage device receives a data read instruction.
  • the first storage device In response to the read data instruction, the first storage device reads the first old data stored corresponding to the LBA of the first new data, and sends the first old data to the RAID controller for storage.
  • the RAID controller sends a data write instruction to the first storage device according to the first data write sub-request, where the data write instruction is used to instruct to store the first new data to the LBA of the first new data.
  • the write data command carries information such as the physical address of the first new data, the LBA of the first new data, and the length.
  • the first storage device receives the write data instruction.
  • the first storage device In response to the write data instruction, the first storage device writes the first new data stored at the physical address of the first new data to the LBA of the first new data, so as to update the first old data with the first new data.
  • the first storage device may read the first new data according to the physical address of the first new data, and then write the first new data to the LBA of the first new data, so as to facilitate the subsequent update of the first new data with the first new data.
  • An old data For details on how to update the data, please refer to the relevant description in the foregoing embodiment.
  • the alternative implementation of S904-S907 can also be: the RAID controller can directly send an exclusive OR write command to the storage device.
  • the exclusive OR write command is similar to a data write command and carries the physical address of the first new data, Information such as the LBA and length of the first new data.
  • the first storage device can respond to the first XOR write instruction to read the first new data from the physical address of the first new data, read the first old data from the LBA of the first new data, and then use the first New data to update the first old data.
  • the RAID controller performs an exclusive OR operation on the first new data and the first old data to obtain a first operation result, and stores the first operation result at the first address in the RAID controller.
  • the RAID controller sends an exclusive OR update instruction to the check storage device, where the exclusive OR update instruction carries the first address, the LBA of the original check data, and the length.
  • the verification storage device receives the exclusive OR update instruction.
  • the verification storage device is a storage device storing original verification data.
  • the check storage device responds to the XOR update instruction, reads the original check data according to the LBA and length of the original check data in the XOR update instruction, and obtains the first operation result according to the first address.
  • the verification storage device performs an exclusive OR operation on the original verification data and the first calculation result, thereby obtaining new verification data. And use the new check data to update the original check data.
  • FIG. 10 for a schematic diagram of another data processing operation.
  • the host updates the D1 stored in the stripe according to actual needs, and suppose that D1' is used to update D1, and the stripe stores stored data including D1 to D4.
  • the host will generate a write data request and send the write data request to the RAID controller.
  • the write data request carries the second data (D1'), the LBA of D1', and the length.
  • the write data request is used to request to use D1' to update D1 in the stored data.
  • the RAID controller learns that the size of D1' does not exceed the size of one stripe unit according to the write data request, and there is no need to split the write data request.
  • the write data request is the first data write sub-request.
  • the RAID controller after the RAID controller receives the data write request, it can read the old data D1 stored corresponding to the LBA of D1' from the first storage device according to the LBA and length of D1'. Further, the RAID controller may perform an exclusive OR operation on the new data D1' and the old data D1 to obtain the first operation result D1", and send the first operation result D1" to the first address in the RAID controller for storage.
  • the RAID controller may send an exclusive OR update instruction to the check storage device, and the exclusive OR update command carries the first address, the LBA of the original check data (P0), and the length.
  • the verification storage device receives the XOR update instruction, and reads the original verification data P0 corresponding to the LBA according to the LBA and length of the original verification data through the storage controller of the own device; An operation result D1".
  • the storage controller can perform an exclusive OR operation on the read original check data P0 and the first operation result D1" to obtain new check data P0'.
  • the P0' can be written into the LBA of the original check data to update the original check data P0 with the new check data P0'.
  • the number m of new data included in the second data is not limited to one.
  • the update principle of the first new data in the first data write subrequest can also be referred to above to realize the update of m new data and the update of the original verification data, which is not limited in this application.
  • the data XOR operation can be performed in the RAID controller, and the check XOR operation can be migrated to the check storage device for execution.
  • the computing resources of the RAID controller can be reduced. Occupy, reduce the load of the RAID controller.
  • the above processing process can also reduce the data exchange between the RAID controller and the storage device, thereby reducing the bandwidth occupied by data exchange in the storage system, and the processing delay caused by multiple data exchange processes, and further improving the data
  • the efficiency of data processing in the storage system reduces the time delay of data processing.
  • FIG. 11 for a schematic structural diagram of a data processing apparatus provided by an embodiment of the present application.
  • the data processing device 11 shown in FIG. 11 includes a generating module 112, an acquiring module 114, and a communication module 116. among them,
  • the generating module 112 is configured to generate an XOR write instruction according to a write data request, the write data request is used to request to update the first data to the second data, and the XOR write instruction is used to obtain the first data XOR operation result with the second data;
  • the obtaining module 114 is configured to obtain the operation result of the XOR write instruction according to the XOR write instruction;
  • the communication module 116 is configured to send an exclusive OR update instruction to a check storage device, the check storage device is used to store check data of the second data, and the check storage device is the at least one storage device.
  • the exclusive OR update instruction is used to instruct the verification storage device to update the verification data of the first data to the verification data of the second data, and the verification of the second data
  • the verification data is an XOR operation result of the verification data of the first data and the operation result of the XOR write instruction.
  • the implementation functions involved in the acquisition module 114 can also be implemented in the XOR acceleration unit 241 or the calculation unit 243 in FIG. 2.
  • the storage function involved in the storage unit 242 in FIG. 2 can also be applied to the embodiments of the present application, that is, the data processing device shown in FIG. 11 of the present application may also include a storage module (not shown) for storing the data processing device
  • the data involved in the storage such as storing the operation result of the XOR write instruction, etc.
  • the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data
  • the first address is a RAID controller (the data processing device of this application) ) Is used to store the physical address of the operation result of the XOR write instruction
  • the physical address of the second data is the physical address used for storing the second data in the RAID controller
  • the second data is a logical address used for storing the second data in a data storage device
  • the data storage device is a device in the at least one storage device.
  • the communication module 116 is specifically configured to send the XOR write instruction to the data storage device, so that the data storage device reads the data stored in the physical address of the second data according to the XOR write instruction.
  • the first data stored in the logical addresses of the second data and the second data, and perform an exclusive OR operation on the first data and the second data to obtain the operation result of the exclusive OR write instruction,
  • the operation result of the XOR write instruction is sent to the first address of the RAID controller for storage; the communication module 116 is also used to receive the operation of the XOR write instruction sent by the data storage device As a result, the operation result of the XOR write instruction is stored in the first address.
  • the first data includes at least two old data including first old data and second old data
  • the second data includes at least two new data including first new data and second new data
  • the XOR write instruction includes at least a first XOR write instruction and a second XOR write instruction
  • the first XOR write instruction carries a second address, the physical address of the first new data
  • the second XOR write instruction carries a third address, the physical address of the second new data, and the logical address of the second new data
  • the data storage device includes a first At least two devices including a storage device and a second storage device
  • the communication module 116 is further configured to send the first XOR write instruction to the first storage device, so that the first storage device is based on the The first XOR write instruction reads the first new data stored in the physical address of the first new data and the first old data stored in the logical address of the first new data, and compares all The first new data and the first old data are XORe
  • the second old data stored in the logical addresses of the second new data and the second new data and perform an exclusive OR operation on the second new data and the second old data to obtain a second operation
  • the second operation result is sent to the third address of the RAID controller for storage.
  • the operation result of the XOR write instruction includes the first operation result and the second operation result; or, the operation result of the XOR write instruction is the first operation result and the first operation result. 2.
  • the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, and the first address is used for storing all data in the RAID controller.
  • the physical address of the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, and the logical address of the second data is the The logical address used for storing the second data in a data storage device, the logical address of the second data is the same as the logical address of the first data, and the data storage device is a device in the at least one storage device;
  • the acquiring module 114 is configured to read the first data stored in the logical address of the second data and the second data stored in the physical address of the second data according to the XOR write instruction. Data; the acquisition module 114 is also used to perform an XOR operation on the first data and the second data to obtain the operation result of the XOR write instruction.
  • the exclusive OR update instruction carries the first address and a fourth address
  • the fourth address is a logical address used to store the verification data of the first data in the verification storage device
  • the communication module 116 is configured to send the XOR update instruction to the verification storage device so that the verification storage device reads the XOR stored in the first address according to the XOR update instruction Or the operation result of the write instruction and the check data of the first data stored in the fourth address, and perform an exclusive OR operation on the operation result of the XOR write instruction and the check data of the first data
  • the check data of the second data is obtained to update the check data of the first data to the check data of the second data.
  • the exclusive OR update instruction carries the check data of the second data; the obtaining module 114 is further configured to obtain the check data of the first data stored in the check storage device; Perform an exclusive OR operation on the operation result of the exclusive OR write instruction and the check data of the first data to obtain the check data of the second data.
  • the write data request is used to request to update the first data in the stored data with the second data
  • the data processing apparatus further includes a determining module 118.
  • the determining module 118 is configured to determine that the ratio between the size of the second data and the size of the strip used to store the second data is less than or equal to a preset threshold; or, the determining module 118 is configured to determine A number of reads and writes is less than or equal to a second number of reads and writes, where the first read and write number is the verification of the first data, the second data, and the first data by the RAID controller.
  • the number of reads and writes required for storing the XOR operation result of the data, and the second read and write number is the number of times the RAID controller divides the first data from the second data and the stored data.
  • the number of reads and writes required to store the XOR operation result of the external data is the number of times the RAID controller divides the first data from the second data and the stored data.
  • the device 11 of the embodiment of the present application can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a complex program logic device. (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof. It can also be implemented by software.
  • the device 11 and the functions of each module in the device can also be software modules.
  • data XOR operations and/or check XOR operations can be migrated to storage devices for execution.
  • the resources of the RAID controller can be reduced. Cost and computational load.
  • the above data processing process can also reduce the data exchange between the RAID controller and the storage device, thereby reducing the bandwidth and time delay occupied by the data exchange, thereby improving the efficiency of data processing.
  • the data storage system 12 includes a RAID controller 122 and at least one storage device.
  • the at least one storage device includes a verification storage device 124 and a data storage device 126, and the number of the data storage device and verification storage device is not limited.
  • the data storage device is used to store the data to be written into the storage device in the data write request, and the verification storage device is used to store the verification data.
  • it can be used as a data storage device or as a verification storage device.
  • an independent storage device can also be used as a verification device or a data device, which is not limited in the present invention.
  • the illustrations in this application respectively take a verification storage device 124 and a data storage device 126 that are different from each other as examples.
  • the RAID controller 122 includes one or more processors 1221, a communication interface 1222, and a memory 1223.
  • the processor 1221, the communication interface 1222, and the memory 1223 can be connected by a bus or by other means such as wireless transmission. Realize communication.
  • the embodiment of the present application takes the connection through the bus 1224 as an example, where the memory 1223 is used to store instructions, and the processor 1221 is used to execute instructions stored in the memory 1223.
  • the memory 1223 stores program codes, and the processor 1221 can call the program codes stored in the memory 1223 to perform the following operations:
  • the write data request is used to request to update the first data to the second data
  • the XOR write instruction is used to obtain the XOR operation of the first data and the second data result
  • Send an exclusive OR update instruction to a check storage device the check storage device is used to store the check data of the second data, the check storage device is any one of the at least one storage device, the The exclusive OR update instruction is used to instruct the check storage device to update the check data of the first data to the check data of the second data, and the check data of the second data is the first data
  • the XOR operation result of the check data of the XOR and the operation result of the XOR write instruction is used to send an exclusive OR update instruction to a check storage device, the check storage device is used to store the check data of the second data, the check storage device is any one of the at least one storage device, the The exclusive OR update instruction is used to instruct the check storage device to update the check data of the first data to the check data of the second data, and the check data of the second data is the first data
  • the XOR operation result of the check data of the XOR and the operation result of the XOR write instruction is used to store the check data of the second data
  • the check storage device is any one
  • the verification storage device 124 as shown in the figure includes one or more processors 1241, a communication interface 1242, and a memory 1243.
  • the processor 1241, the communication interface 1242 and the memory 1243 can be connected via a bus or other means such as wireless transmission. Realize communication.
  • the embodiment of the present application takes the connection via the bus 1244 as an example, where the memory 1243 is used to store instructions, and the processor 1241 is used to execute instructions stored in the memory 1243.
  • the memory 1243 stores program codes, and the processor 1241 can call the program codes stored in the memory 1243 to perform the following operations:
  • the check data of the first data is updated to the check data of the second data
  • the check data of the second data is the check data of the first data and the check data of the second data.
  • the data storage device 126 as shown in the figure includes one or more processors 1261, a communication interface 1262, and a memory 1263.
  • the processor 1261, the communication interface 1262 and the memory 1263 can be connected via a bus or can be implemented by other means such as wireless transmission. Communication.
  • the embodiment of the present application takes the connection via the bus 1264 as an example, where the memory 1263 is used to store instructions, and the processor 1261 is used to execute instructions stored in the memory 1263.
  • the memory 1263 stores program codes, and the processor 1261 can call the program codes stored in the memory 1263 to perform the following operations:
  • the physical address used in the controller to store the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, and the second
  • the logical address of the data is a logical address used for storing the second data in a data storage device, and the data storage device is a device in the at least one storage device;
  • the data storage device and the verification storage device involved in the present application are all devices in at least one storage device in the data storage system shown in FIG. 2, and they may be the same or different.
  • the processor may be composed of one or more general-purpose processors, such as a central processing unit (CPU).
  • the processor can be used to run related program codes to perform corresponding operations and realize the functions of related functional modules.
  • the processor 1221 may run related program codes to implement the functional modules or units shown in FIG. 11 or FIG. 2, specifically the generation module, acquisition module, communication module, and determination module shown in FIG. 11, as shown in FIG.
  • the XOR acceleration unit and calculation unit are shown.
  • each functional module or unit mentioned here reference may be made to the relevant description in the foregoing embodiment, which is not repeated here.
  • Communication interface (specifically, communication interface 1222, 1242 or 1262), which can be internal interface (such as high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), wired interface (such as Ethernet interface) or wireless interface (For example, cellular network interface or wireless LAN interface), used to communicate with other modules/devices.
  • the communication interface 1222 in the embodiment of the present application may be specifically used to receive the operation result of the XOR write instruction sent by the data storage device.
  • the memory may include volatile memory (Volatile Memory), such as random access memory (Random Access Memory, RAM); the memory may also include non-volatile memory (Non-Volatile Memory). ), such as Read-Only Memory (ROM), Flash Memory (Flash Memory), Hard Disk Drive (HDD), or Solid-State Drive (SSD); memory 503 may also include the above types The combination of memory.
  • volatile memory such as random access memory (Random Access Memory, RAM
  • non-Volatile Memory Non-Volatile Memory
  • ROM Read-Only Memory
  • Flash Memory Flash Memory
  • HDD Hard Disk Drive
  • SSD Solid-State Drive
  • memory 503 may also include the above types The combination of memory.
  • the memory can be used to store a set of program codes, so that the processor can call the program codes stored in the memory to execute corresponding operation steps.
  • FIG. 12 is only a possible implementation of the embodiment of the present application.
  • the storage system in FIG. 12 may correspond to the storage system in FIG. 2, or may be a combination of other RAID controllers and storage devices.
  • each device involved in the data storage system may also include more or fewer components, which is not limited here.
  • Regarding the content that is not shown or described in the embodiments of the present application please refer to the relevant descriptions in the embodiments described in FIG. 1 to FIG. 11, which will not be repeated here.
  • An embodiment of the present application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, and when it runs on a processor, the method flow shown in FIG. 3, FIG. 7 or FIG. 9 can be implemented .
  • the embodiment of the present application also provides a computer program product.
  • the computer program product runs on a processor, the method flow shown in FIG. 3, FIG. 7 or FIG. 9 is realized.
  • the foregoing embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination.
  • the above-mentioned embodiments may be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • 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 or a data center that includes one or more sets of available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium.
  • the semiconductor medium may be a solid state drive (SSD).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method for data processing, comprising: a redundant array of independent disks controller first generates an exclusive-OR write instruction on the basis of a write data request used for requesting to update first data to second data and then acquires the computation result of the exclusive-OR write instruction, then transmits an exclusive-OR update instruction to a verification storage device used for storing verification data of the second data, the exclusive-OR update instruction being used for instructing the verification storage device to update verification data of the first data to the verification data of the second data, and the verification data of the second data being the result of an exclusive-OR computation of the verification data of the first data and of the computation result of the exclusive-OR write instruction. The method increases the performance of a storage system.

Description

数据处理方法、独立硬盘冗余阵列控制器和数据存储***Data processing method, independent hard disk redundant array controller and data storage system 技术领域Technical field
本申请涉及存储技术领域,尤其涉及数据处理方法、独立硬盘冗余阵列控制器和数据存储***和设备。This application relates to the field of storage technology, and in particular to data processing methods, redundant array of independent hard disk controllers, and data storage systems and equipment.
背景技术Background technique
在存储技术领域中,随着固态硬盘(solid state disk,SSD)读写速度的大大提升,采用SSD组建独立硬盘冗余阵列(redundant array of independent disks,RAID)的存储技术亦带来了数据处理速度的极大提升。In the field of storage technology, as solid state disk (SSD) read and write speeds are greatly improved, the use of SSDs to form redundant array of independent disks (RAID) storage technology also brings data processing Great increase in speed.
然而,传统的基于RAID的数据存储方案中,每次数据处理过程都是通过RAID控制器完成待写数据的存储位置和校验数据的计算和分配。当待存储数据较大(即数据量较多)时,对RAID控制器的计算资源和计算能力要求较高;而且,由于所有待写数据存储至RAID的磁盘前,均需要经由RAID控制器进行数据的存储位置和校验数据的计算和分配,上述过程中RAID控制器的计算能力直接影响整个存储***的处理能力和处理效率,容易成为影响存储***处理效率的瓶颈。However, in the traditional RAID-based data storage solution, the storage location of the data to be written and the calculation and distribution of the parity data are completed by the RAID controller each time the data processing process. When the data to be stored is large (that is, the amount of data is large), the computing resources and computing capabilities of the RAID controller are required; moreover, all the data to be written needs to go through the RAID controller before being stored on the RAID disks. The storage location of data and the calculation and distribution of check data. In the above process, the computing power of the RAID controller directly affects the processing power and processing efficiency of the entire storage system, and easily becomes a bottleneck that affects the processing efficiency of the storage system.
发明内容Summary of the invention
本申请公开了一种数据处理方法和设备,能够解决传统技术中RAID控制器成为影响存储***计算能力瓶颈的问题,提升整个存储***的计算能力和处理效率。The present application discloses a data processing method and device, which can solve the problem that the RAID controller becomes a bottleneck affecting the computing capacity of the storage system in the traditional technology, and improve the computing capacity and processing efficiency of the entire storage system.
第一方面,本申请公开提供了一种数据处理方法,应用于包括独立硬盘冗余阵列RAID控制器和至少一个存储设备的数据存储***:RAID控制器先根据用于请求将已存储数据中的第一数据更新为第二数据的写数据请求生成异或写指令,该异或写指令用于获取第一数据和第二数据的异或运算结果。再获得该异或写指令的运算结果,然后,再向校验存储设备发送用于存储第二数据的校验数据的异或更新指令,该校验存储设备为至少一个存储设备中的任意设备,该异或更新指令用于指示校验存储设备将第一数据的校验数据更新为第二数据的校验数据,该第二数据的校验数据为第一数据的校验数据和异或写指令的运算结果的异或运算结果。In the first aspect, the disclosure of this application provides a data processing method, which is applied to a data storage system including a redundant array of independent hard disks RAID controller and at least one storage device: The write data request for updating the first data to the second data generates an XOR write instruction, and the XOR write instruction is used to obtain an XOR operation result of the first data and the second data. Then obtain the operation result of the XOR write instruction, and then send an XOR update instruction for storing the check data of the second data to the check storage device, which is any device in at least one storage device , The exclusive OR update instruction is used to instruct the check storage device to update the check data of the first data to the check data of the second data, the check data of the second data is the check data of the first data and the exclusive OR The exclusive OR operation result of the operation result of the write instruction.
通过实施本申请,能够将数据异或流程和/或校验数据异或流程迁移到存储设备中实现,相比传统技术中RAID控制器完成上述处理过程,可减小RAID控制器的计算资源和计算负荷,同时减小RAID控制器和存储设备之间的数据交换,提升数据处理效率。Through the implementation of this application, the data XOR process and/or the check data XOR process can be migrated to the storage device. Compared with the RAID controller in the traditional technology, the RAID controller completes the above processing process, which can reduce the computing resources of the RAID controller. Calculation load, while reducing data exchange between RAID controller and storage device, improving data processing efficiency.
在一种可能的实现方式中,该异或写指令中携带第一地址、第二数据的物理地址以及第二数据的逻辑地址,该第一地址为RAID控制器中用于存储异或写指令的运算结果的物理地址,该第二数据的物理地址为第二数据在RAID控制器中存储所用的物理地址,第二数据的逻辑地址为第二数据在数据存储设备中存储所用的逻辑地址,该 第一数据的逻辑地址和第二数据的逻辑地址相同。其中,数据存储设备为至少一个存储设备中的设备。相应地,RAID控制器向数据存储设备发送异或写指令,使得数据存储设备根据该异或写指令,读取第二数据的物理地址所存储的第二数据以及第二数据的逻辑地址处已存储的第一数据。进而数据存储设备可对第一数据和第二数据进行异或运算,以获得异或写指令的运算结果。进一步将该异或写指令的运算结果发送至RAID控制器的第一地址处存储。In a possible implementation, the XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data, and the first address is used to store the XOR write instruction in the RAID controller. The physical address of the operation result of the second data is the physical address used for storing the second data in the RAID controller, and the logical address of the second data is the logical address used for storing the second data in the data storage device, The logical address of the first data is the same as the logical address of the second data. Wherein, the data storage device is a device in at least one storage device. Correspondingly, the RAID controller sends an XOR write instruction to the data storage device, so that the data storage device reads the second data stored in the physical address of the second data and the logical address of the second data according to the XOR write instruction. The first data stored. Furthermore, the data storage device can perform an XOR operation on the first data and the second data to obtain the operation result of the XOR write instruction. The operation result of the XOR write instruction is further sent to the first address of the RAID controller for storage.
在实际应用中,数据存储设备和校验存储设备可为同一存储设备,也可为不同的存储设备,具体可根据实际情况确定,本申请并不做限定。In actual applications, the data storage device and the verification storage device may be the same storage device or different storage devices, which can be determined according to actual conditions, and this application is not limited.
通过实施上述方法,将数据异或迁移至数据存储设备中处理,RAID控制器可获取数据存储设备计算的异或写指令的运算结果,再基于该异或写指令的运算结果获得第二数据的校验数据,这样可减少RAID控制器的计算负荷。By implementing the above method, the data XOR is migrated to the data storage device for processing. The RAID controller can obtain the operation result of the XOR write instruction calculated by the data storage device, and then obtain the second data based on the operation result of the XOR write instruction. Check the data, which can reduce the computational load of the RAID controller.
在一种可能的实现方式中,第一数据包括第一旧数据和第二旧数据在内的至少两个旧数据,第二数据包括第一新数据和第二新数据在内的至少两个新数据,该异或写指令至少包括第一异或写指令和第二异或写指令,该第一异或写指令中携带第二地址、第一新数据的物理地址和第一新数据的逻辑地址,第二异或写指令中携带第三地址、第二新数据的物理地址和第二新数据的逻辑地址,该数据存储设备包括第一存储设备和第二存储设备在内的至少两个设备。则RAID控制器具体可向第一存储设备发送第一异或写指令,使得第一存储设备根据第一异或写指令,读取第一新数据的物理地址所存储的第一新数据以及第一新数据的逻辑地址处已存储的第一旧数据,并对第一新数据和第一旧数据进行异或运算以获得第一运算结果。进一步第一存储设备可将第一运算结果发送至RAID控制器的第二地址存储。相应地,RAID控制可向第二存储设备发送第二异或写指令,使得第二存储设备根据第二异或写指令读取第二新数据的物理地址所存储的第二新数据和第二新数据的逻辑地址处已存储的第二旧数据,并对第二新数据和第二旧数据进行异或运算获得第二运算结果。第二存储设备还可将第二运算结果发送至RAID控制器的第三地址存储。In a possible implementation manner, the first data includes at least two old data including the first old data and the second old data, and the second data includes at least two new data including the first new data and the second new data. The XOR write instruction includes at least a first XOR write instruction and a second XOR write instruction. The first XOR write instruction carries the second address, the physical address of the first new data, and the logic of the first new data. Address, the second XOR write instruction carries the third address, the physical address of the second new data, and the logical address of the second new data. The data storage device includes at least two of the first storage device and the second storage device. equipment. Then the RAID controller may specifically send the first XOR write instruction to the first storage device, so that the first storage device reads the first new data stored in the physical address of the first new data and the first new data according to the first XOR write instruction. The first old data is stored at the logical address of the new data, and an exclusive OR operation is performed on the first new data and the first old data to obtain the first operation result. Furthermore, the first storage device may send the first operation result to the second address of the RAID controller for storage. Correspondingly, the RAID control can send a second XOR write instruction to the second storage device, so that the second storage device reads the second new data and the second new data stored in the physical address of the second new data according to the second XOR write instruction. The second old data has been stored at the logical address of the new data, and an exclusive OR operation is performed on the second new data and the second old data to obtain the second operation result. The second storage device may also send the second operation result to the third address of the RAID controller for storage.
通过实施上述方法,当第二数据较大时数据异或流程可对应迁移至至少两个数据存储设备中处理,相应地RAID控制器需从至少两个数据存储设备中读取异或运算的运算结果,以实现校验数据的更新。相比传统技术而言,可减少RAID控制器和数据存储设备之间的数据交换量,提升数据处理效率。By implementing the above method, when the second data is large, the data XOR process can be correspondingly migrated to at least two data storage devices for processing. Accordingly, the RAID controller needs to read the XOR operation from at least two data storage devices. As a result, to realize the update of the verification data. Compared with traditional technology, it can reduce the amount of data exchange between the RAID controller and the data storage device and improve the efficiency of data processing.
在一种可能的实现方式中,该异或写指令的运算结果包括第一运算结果和第二运算结果。或者,该异或写指令的运算结果为第一运算结果和第二运算结果的异或运算结果。换句话说,该异或写指令的运算结果可以包括两个数据存储设备各自实现数据异或运算的运算结果,也可包括RAID控制器对这两个运算结果再次进行异或运算的运算结果。In a possible implementation manner, the operation result of the XOR write instruction includes a first operation result and a second operation result. Alternatively, the operation result of the XOR write instruction is the XOR operation result of the first operation result and the second operation result. In other words, the operation result of the XOR write instruction may include the operation result of the XOR operation of the two data storage devices, or the operation result of the RAID controller performing the XOR operation on the two operation results again.
通过实施上述方法,在实现第二数据的校验数据的更新过程中,可将至少两个数据存储设备各自的运算结果的异或运算放在RAID控制器中处理,或者放在校验存储设备中处理,这样能够提升数据处理的多样性。By implementing the above method, in the process of updating the check data of the second data, the exclusive OR operation of the respective operation results of at least two data storage devices can be processed in the RAID controller or stored in the check storage device Medium processing, which can improve the diversity of data processing.
在一种可能的实现方式中,该异或写指令中携带第一地址、第二数据的物理地址和第二数据的逻辑地址,该第一地址为RAID控制器中用于存储异或写指令的运算结 果的物理地址,第二数据的物理地址为第二数据在RAID控制器中存储所用的物理地址,第二数据的逻辑地址为第二数据在数据存储设备中存储所用的逻辑地址,第二数据的逻辑地址和第一数据的逻辑地址相同,数据存储设备为至少一个存储设备中的设备。相应地,RAID控制器根据异或写指令可读取第二数据的逻辑地址处已存储的第一数据以及读取第二数据的物理地址处存储的第二数据。进一步RAID控制器可对第一数据和第二数据进行异或运算,获得该异或写指令的运算结果。In a possible implementation, the XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data, and the first address is used to store the XOR write instruction in the RAID controller. The physical address of the operation result of the second data is the physical address used for storing the second data in the RAID controller, and the logical address of the second data is the logical address used for storing the second data in the data storage device. The logical address of the second data is the same as the logical address of the first data, and the data storage device is a device in at least one storage device. Correspondingly, the RAID controller can read the first data stored at the logical address of the second data and the second data stored at the physical address of the second data according to the XOR write instruction. Further, the RAID controller may perform an exclusive OR operation on the first data and the second data to obtain the operation result of the exclusive OR write instruction.
通过实施上述方法,将数据异或流程仍然放在RAID控制器中处理,RAID控制器可根据异或写指令计算获得该异或写指令的运算结果,便于后续将校验数据异或流程放在校验存储设备中处理,以实现校验数据的更新。这样可增加数据处理的多样性,节省数据处理流程,提升数据处理效率。Through the implementation of the above method, the data XOR process is still processed in the RAID controller. The RAID controller can calculate the XOR write instruction according to the XOR write instruction to obtain the operation result of the XOR write instruction, which is convenient for the subsequent XOR process of the check data. Check processing in the storage device to update the check data. This can increase the diversity of data processing, save data processing procedures, and improve data processing efficiency.
在一种可能的实现方式中,异或更新指令中携带第一地址和第四地址,该第一地址为RAID控制器中用于存储异或写指令的运算结果的物理地址。第四地址为校验存储设备中用于存储第一数据的校验数据的逻辑地址。相应地,RAID控制器向校验存储设备发送异或更新指令,使得校验存储设备根据该异或更新指令读取第一地址处存储的异或写指令的运算结果以及读取第四地址处存储的第一数据的校验数据。进一步校验存储设备可对异或写指令的运算结果和第一数据的校验数据进行异或运算以获得第二数据的校验数据,进而将第一数据的校验数据更新为第二数据的校验数据。In a possible implementation manner, the XOR update instruction carries a first address and a fourth address, and the first address is a physical address used to store the operation result of the XOR write instruction in the RAID controller. The fourth address is a logical address used to store the verification data of the first data in the verification storage device. Correspondingly, the RAID controller sends an XOR update instruction to the check storage device, so that the check storage device reads the operation result of the XOR write instruction stored at the first address and reads the operation result of the XOR write instruction stored at the first address according to the XOR update instruction. The stored check data of the first data. Further verify the storage device can perform an exclusive OR operation on the operation result of the XOR write instruction and the verification data of the first data to obtain the verification data of the second data, and then update the verification data of the first data to the second data Check data.
通过实施上述方法,能够将异或写指令的运算结果和教第一数据的校验数据的异或运算迁移至校验存储设备中处理。相比传统技术数据异或和校验异或均在RAID控制器中处理而言,能减轻RAID控制器的计算负荷,提升RAID控制器的数据处理速度,进而提升数据处理效率。By implementing the above method, the XOR operation of the operation result of the XOR write instruction and the check data of the first data can be transferred to the check storage device for processing. Compared with the traditional technology, the data XOR and check XOR are all processed in the RAID controller, which can reduce the calculation load of the RAID controller, increase the data processing speed of the RAID controller, and further improve the data processing efficiency.
在一种可能的实现方式中,异或更新指令中携带第二数据的校验数据。具体的,RAID控制器在向校验存储设备发送异或更新指令之前,RAID控制器可从校验存储设备中读取第四地址处存储的第一数据的校验数据;进一步对异或写指令的运算结果和第一数据的校验数据进行异或运算,以获得第二数据的校验数据。In a possible implementation manner, the exclusive OR update instruction carries the check data of the second data. Specifically, before the RAID controller sends the XOR update instruction to the parity storage device, the RAID controller may read the parity data of the first data stored at the fourth address from the parity storage device; further write the XOR The operation result of the instruction and the check data of the first data are XORed to obtain the check data of the second data.
通过实施上述方法,能够将校验数据异或放在RAID控制器中处理,便于RAID控制器后续直接将校验异或获得的第二数据的校验结果发送给校验存储设备更新,节省校验存储设备端的计算资源和计算负荷。By implementing the above method, the XOR of the check data can be processed in the RAID controller, which is convenient for the RAID controller to directly send the check result of the second data obtained by the check XOR to the check storage device for updating, saving the check. Verify the computing resources and computing load of the storage device.
在一种可能的实现方式中,该写数据请求具体用于请求用第二数据对已存储数据中的第一数据进行更新,RAID控制器向校验存储设备发送异或更新指令之前,RAID控制器需确定当前工作在RAID小写模式下。具体的,RAID控制器在确定到满足以下任一条件时,可确定工作在RAID小写模式;否则,确定工作在RAID大写模式下。该条件具体可包括:RAID控制器确定第二数据的大小和存储第二数据用的条带的大小之间的比值小于或等于预设阈值;或者,RAID控制器确定第一读写次数小于或等于第二读写次数,其中第一读写次数为RAID控制器在对第一数据、第二数据以及第一数据的校验数据的异或运算结果进行存储时所需的读写次数,第二读写次数为RAID控制器在对第二数据、存储数据中除第一数据外的数据的异或运算结果进行存储时所需的读写次数。In a possible implementation, the write data request is specifically used to request the second data to update the first data in the stored data. Before the RAID controller sends the exclusive OR update instruction to the parity storage device, the RAID control The device needs to make sure that it is currently working in RAID lowercase mode. Specifically, when the RAID controller determines that any of the following conditions is satisfied, it may determine to work in the RAID lowercase mode; otherwise, it may determine to work in the RAID uppercase mode. The condition may specifically include: the RAID controller determines that the ratio between the size of the second data and the size of the strip for storing the second data is less than or equal to a preset threshold; or, the RAID controller determines that the first read and write times are less than or Equal to the second read and write times, where the first read and write times is the number of reads and writes required by the RAID controller to store the XOR operation result of the first data, the second data and the check data of the first data, The second read and write times are the read and write times required by the RAID controller when storing the XOR operation result of the second data and the data except the first data in the stored data.
第二方面,本申请提供了一种数据处理装置,所述装置包括用于执行如上第一方 面或第一方面的任意可能的实施方式中所描述的方法的功能模块或单元。In a second aspect, this application provides a data processing device, which includes functional modules or units for executing the method described in the first aspect or any possible implementation of the first aspect.
第三方面,本申请还提供了一种RAID控制器,包括:处理器,存储器,通信接口和总线;处理器、通信接口、存储器通过总线相互通信;通信接口,用于接收和发送数据;存储器,用于存储指令;处理器,用于调用存储器中的指令,执行上述第一方面或第一方面的任意可能的实施方式中所描述的方法的操作步骤。In the third aspect, this application also provides a RAID controller, including: a processor, a memory, a communication interface, and a bus; the processor, the communication interface, and the memory communicate with each other through the bus; the communication interface is used to receive and send data; and the memory , Is used to store instructions; the processor is used to call instructions in the memory to execute the operation steps of the method described in the first aspect or any possible implementation of the first aspect.
第四方面,本申请提供了一种数据存储***,包括独立硬盘冗余阵列RAID控制器和至少一个存储设备;其中:In a fourth aspect, this application provides a data storage system, including a redundant array of independent hard disks RAID controller and at least one storage device; wherein:
RAID控制器,用于根据写数据请求生成异或写指令,该写数据请求用于请求将第一数据更新为第二数据,该异或写指令用于获得所述第一数据和第二数据的异或运算结果;根据异或写指令获取该异或写指令的运算结果;向校验存储设备发送异或更新指令,该校验存储设备为所述至少一个存储设备中的任意一个。The RAID controller is used to generate an exclusive OR write instruction according to a write data request, the write data request is used to request to update the first data to the second data, and the exclusive OR write instruction is used to obtain the first data and the second data The XOR operation result of the XOR operation is obtained; the operation result of the XOR write instruction is obtained according to the XOR write instruction; the XOR update instruction is sent to the check storage device, which is any one of the at least one storage device.
该校验存储设备,用于接收异或更新指令,根据异或更新指令的指示将第一数据的校验数据更新为第二数据的校验数据,该第二数据的校验数据为第一数据的校验数据和异或写指令的运算结果的异或运算结果。关于本申请未示出或未描述的内容可对应参见前述第一方面所述方法实施例中的相关阐述,这里不再赘述。The check storage device is used to receive the exclusive OR update instruction, and update the check data of the first data to the check data of the second data according to the instruction of the exclusive OR update instruction, and the check data of the second data is the first The data check data and the XOR operation result of the XOR write instruction. For the content not shown or described in this application, please refer to the relevant descriptions in the method embodiments described in the first aspect, which will not be repeated here.
第五方面,本申请提供了可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a fifth aspect, the present application provides a readable storage medium in which instructions are stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the methods described in the above aspects.
第六方面,本申请提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a sixth aspect, the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the methods described in the above aspects.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided by the above aspects, this application can be further combined to provide more implementation manners.
附图说明Description of the drawings
图1是本申请实施例提供的一种RAID组建的示意图。FIG. 1 is a schematic diagram of a RAID structure provided by an embodiment of the present application.
图2是本申请实施例提供的一种数据存储***的架构示意图。FIG. 2 is a schematic structural diagram of a data storage system provided by an embodiment of the present application.
图3是本申请实施例提供的一种数据处理方法的流程示意图。Fig. 3 is a schematic flowchart of a data processing method provided by an embodiment of the present application.
图4-图6是本申请实施例提供的几种数据处理的操作示意图。Figures 4 to 6 are schematic diagrams of several data processing operations provided by embodiments of the present application.
图7是本申请实施例提供的另一种数据处理方法的流程示意图。FIG. 7 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
图8是本申请实施例提供的另一种数据处理的操作示意图。FIG. 8 is a schematic diagram of another data processing operation provided by an embodiment of the present application.
图9是本申请实施例提供的另一种数据处理方法的流程示意图。FIG. 9 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
图10是本申请实施例提供的另一种数据处理的操作示意图。FIG. 10 is a schematic diagram of another data processing operation provided by an embodiment of the present application.
图11是本申请实施例提供的一种数据处理装置的结构示意图。FIG. 11 is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
图12是本申请实施例提供的一种数据存储***的结构示意图。FIG. 12 is a schematic structural diagram of a data storage system provided by an embodiment of the present application.
具体实施方式detailed description
首先,阐述本申请涉及的一些技术概念或技术术语。First, explain some technical concepts or technical terms involved in this application.
(一)独立硬盘冗余阵列(redundant array of independent disks,RAID)(1) Redundant array of independent disks (RAID)
在存储技术领域中,RAID是由至少一个逻辑硬盘块组成,该逻辑硬盘块可包括逻辑硬盘(logical disk,LDisk)或者逻辑固态硬盘(logical solid state disk,LSSD) 等形态。每个逻辑硬盘块来源于一个或多个存储介质。本申请涉及的存储介质是指存储数据的载体,其可包括但不限于固态硬盘或机械硬盘,其中,机械硬盘包括串行连接的小型计算机***接口(serial attached small computer system interface,SAS)硬盘、串行高级技术附件(serial advanced technology attachment,SATA)硬盘。In the storage technology field, RAID is composed of at least one logical hard disk block, and the logical hard disk block may include logical hard disk (logical disk, LDisk) or logical solid state disk (logical solid state disk, LSSD), etc. Each logical hard disk block comes from one or more storage media. The storage medium referred to in this application refers to a carrier that stores data, which may include, but is not limited to, a solid-state hard disk or a mechanical hard disk. The mechanical hard disk includes a serial attached small computer system interface (SAS) hard disk, Serial advanced technology attachment (SATA) hard disk.
参考图1示出一种RAID的示意图。如图1中,以逻辑硬盘块为LSSD为例,图示中的RAID由4个LSSD组成,分别为LSSD1、LSSD2、LSSD3以及LSSD4。其中,每个LSSD来源于一个或多个SSD,例如LSSD1可来源于SSD1,LSSD2来源于SSD2、LSSD3来源于SSD3、LSSD4来源于SSD2等,其中SSD1~SSD4为互不相同的固态硬盘。LSSD的大小可以根据实际需求划分,每个LSSD的大小相同也可以不同,本申请对此并不作限定。为了便于描述,本申请的以下实施例中,以每个LSSD的大小相同为例进行详细说明。Referring to FIG. 1, a schematic diagram of a RAID is shown. As shown in Figure 1, the logical hard disk block is LSSD as an example. The RAID in the figure consists of 4 LSSDs, namely LSSD1, LSSD2, LSSD3, and LSSD4. Among them, each LSSD is derived from one or more SSDs. For example, LSSD1 can be derived from SSD1, LSSD2 is derived from SSD2, LSSD3 is derived from SSD3, LSSD4 is derived from SSD2, etc., and SSD1 to SSD4 are different solid state drives. The size of the LSSD can be divided according to actual needs, and the size of each LSSD may be the same or different, which is not limited in this application. For ease of description, in the following embodiments of the present application, the same size of each LSSD is taken as an example for detailed description.
(二)RAID条带(stripe)(2) RAID stripe (stripe)
为实现数据的可靠存储,RAID控制器可采用条带技术实现数据的存储。具体的,RAID控制器可根据实际需求将RAID划分为多个条带(也可称为RAID条带)。其中,每个条带的大小(也可以称为条带大小)可根据实际需求确定,例如条带大小可为1G、12G、100G等等。每个条带是由至少一个条带单元组成,该条带单元的数量取决于组成RAID中的逻辑硬盘块(例如LSSD)的数量。组成条带中的每个条带单元的大小可相同。每个条带单元对应有一段逻辑地址范围,本申请中的逻辑地址也可称为逻辑块地址(logical block address,LBA)。便于RAID控制器基于LBA实现数据的存储,具体在本申请下文详述。其中,同一条带中不同条带单元的大小可以相同或不同,本申请并不作限定。为了便于描述,本申请的以下实施例中,以每个条带单元的大小均相同为例进行详细说明。In order to achieve reliable data storage, RAID controllers can use striping technology to achieve data storage. Specifically, the RAID controller can divide the RAID into multiple stripes (also called RAID stripes) according to actual needs. Among them, the size of each strip (also referred to as strip size) can be determined according to actual needs, for example, the strip size can be 1G, 12G, 100G, and so on. Each stripe is composed of at least one stripe unit, and the number of the stripe unit depends on the number of logical hard disk blocks (such as LSSD) constituting the RAID. The size of each strip unit in the constituent strips may be the same. Each stripe unit corresponds to a range of logical addresses, and the logical address in this application may also be referred to as a logical block address (logical block address, LBA). It is convenient for the RAID controller to implement data storage based on the LBA, which will be described in detail below in this application. Wherein, the size of different strip units in the same strip may be the same or different, and this application is not limited. For ease of description, in the following embodiments of the present application, the size of each strip unit is the same as an example for detailed description.
举例来说,参见图1以一个条带为例示出。如图1中,RAID控制器可根据实际需求划分获得1G的条带,具体可为图中虚线框所示。图示中的条带1由4个条带单元组成,每个条带单元的大小均为1G。For example, refer to Figure 1 to take a strip as an example. As shown in Figure 1, the RAID controller can divide and obtain 1G strips according to actual needs, which can be specifically shown by the dashed box in the figure. The strip 1 in the figure is composed of 4 strip units, and the size of each strip unit is 1G.
请参见图2,是本申请实施例提供的一种数据存储***的网络框架示意图。如图2所示,数据存储***20包括:主机22、RAID控制器24以及至少一个存储设备。其中,图2以存储***包括存储设备1、存储设备2以及存储设备3,共3个存储设备为例进行说明。Refer to FIG. 2, which is a schematic diagram of a network framework of a data storage system provided by an embodiment of the present application. As shown in FIG. 2, the data storage system 20 includes a host 22, a RAID controller 24, and at least one storage device. Wherein, FIG. 2 uses a storage system including a storage device 1, a storage device 2 and a storage device 3, a total of 3 storage devices for illustration.
其中,主机12可获取写数据请求,该写数据请求用于请求将待存储数据写入至相应存储设备的存储介质中。具体的,主机12可接收其他设备发送的写数据请求。或者,主机12可根据应用程序的自身需求生成写数据请求,例如在邮件应用程序中需更新并保存邮件时即可生成相应地写数据请求。其中,该写数据请求用于对已存储数据进行更新,或者请求存储待写数据。写数据请求中携带有待写数据相关的信息,例如具体的待写数据、待写数据的逻辑地址(具体为逻辑块地址LBA)的起始地址以及待写数据的大小或长度等信息。The host 12 may obtain a data write request, and the data write request is used to request to write the data to be stored into the storage medium of the corresponding storage device. Specifically, the host 12 may receive write data requests sent by other devices. Alternatively, the host 12 can generate a data write request according to the application's own needs, for example, when the mail needs to be updated and saved in the mail application, it can generate a corresponding data write request. Wherein, the write data request is used to update stored data or request to store data to be written. The write data request carries information related to the data to be written, such as the specific data to be written, the starting address of the logical address (specifically the logical block address LBA) of the data to be written, and the size or length of the data to be written.
主机12获得写数据请求后,可将该写数据请求发送给RAID控制器进行处理,以将写数据请求中的待写数据存储至相应地存储设备中。本申请中涉及的主机12是指具备数据处理能力或计算能力的设备,其可包括但不限于中央处理器(Central Processing  Unit,CPU)、通用处理器或其他设备等。After the host 12 obtains the data write request, it can send the data write request to the RAID controller for processing, so as to store the data to be written in the data write request in a corresponding storage device. The host 12 involved in this application refers to a device with data processing capability or computing capability, which may include, but is not limited to, a central processing unit (CPU), a general-purpose processor, or other devices.
RAID控制器14用于接收主机12发送的写数据请求,并对写数据请求进行处理,以将写数据请求中携带的待写数据存储至相应地存储设备,具体可为存储设备所提供的条带单元中。本申请下文将以待写数据为第二数据为例,详述如何存储第二数据,即如何将第一数据更新为第二数据,以实现第二数据的存储所涉及的相关实施例。其中,RAID控制器和存储设备之间可通过存储通信协议(例如NVMe协议)相互通信,本申请不做限定。The RAID controller 14 is used to receive a write data request sent by the host 12, and process the write data request, so as to store the data to be written carried in the write data request to a corresponding storage device, which can be a strip provided by the storage device. With unit. Hereinafter, this application will take the data to be written as the second data as an example to describe in detail how to store the second data, that is, how to update the first data to the second data, so as to implement related embodiments related to the storage of the second data. Among them, the RAID controller and the storage device can communicate with each other through a storage communication protocol (such as the NVMe protocol), which is not limited in this application.
作为一个可能的实施例,RAID控制器还可用于管理RAID,包括对与该RAID控制器通信的至少一个存储设备进行管理,以利用该至少一个存储设备中包括的多个存储介质组建形成一个或多个RAID,进而基于RAID实现数据的存储。进一步地,RAID控制器的内部结构可包括异或加速单元241、存储单元242以及计算单元243。其中,异或加速单元241用于实现数据的异或运算,例如数据D1XOR数据D1’=R1。存储单元242用于实现数据的存储,例如存储异或加速单元241执行异或运算获得的异或运算结果、或存储来自其他设备(例如存储设备)发送的数据等等。该存储单元242用于存储数据,其可包括但不限于缓存、磁盘或其他存储设备。计算单元243用于实现数据的运算处理,例如基于预设的RAID算法计算获得存储数据的LBA等。关于RAID控制器涉及的相关实施例,具体在本申请下文阐述,这里不再赘述。As a possible embodiment, the RAID controller may also be used to manage RAID, including managing at least one storage device that communicates with the RAID controller, so as to form one or more storage media by using multiple storage media included in the at least one storage device. Multiple RAID, and then realize data storage based on RAID. Further, the internal structure of the RAID controller may include an exclusive OR acceleration unit 241, a storage unit 242, and a calculation unit 243. Wherein, the exclusive OR acceleration unit 241 is used to implement the exclusive OR operation of data, for example, data D1XOR data D1'=R1. The storage unit 242 is used to implement data storage, for example, storing the XOR operation result obtained by the XOR operation performed by the XOR acceleration unit 241, or storing data sent from other devices (such as storage devices), and so on. The storage unit 242 is used to store data, and it may include, but is not limited to, a cache, a disk, or other storage devices. The calculation unit 243 is used to implement data arithmetic processing, such as calculating the LBA of the stored data based on a preset RAID algorithm. The related embodiments related to the RAID controller are specifically described below in this application, and will not be repeated here.
在实际应用中,RAID控制器包括的各个单元具体可由硬件或软件代码实现。例如,图示中RAID控制器的各单元可通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现RAID控制器的相关功能,该RAID控制器及其各个单元也可为软件单元。In practical applications, each unit included in the RAID controller can be specifically implemented by hardware or software code. For example, each unit of the RAID controller shown in the figure can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The above-mentioned PLD can be a complex program logic device ( complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), generic array logic (GAL) or any combination thereof. The related functions of the RAID controller can also be realized by software, and the RAID controller and its various units can also be software units.
存储设备又可以区分为数据存储设备和校验存储设备。数据存储设备为用于存储数据写请求中待写入存储设备的数据,校验存储设备用于存储校验数据。对于同一个存储设备而言,即可以作为数据存储设备,也可以作为校验存储设备。具体实施例时,也可以利用独立的存储设备作为校验设备或数据设备,本发明对此并不做限定。Storage devices can be divided into data storage devices and check storage devices. The data storage device is used to store the data to be written into the storage device in the data write request, and the verification storage device is used to store the verification data. For the same storage device, it can be used as a data storage device or as a verification storage device. In a specific embodiment, an independent storage device can also be used as a verification device or a data device, which is not limited in the present invention.
每个存储设备中包括存储控制器以及至少一个存储介质。在实际应用中,每个存储设备中部署的存储介质的数量并不做限定,可以相同,也可不同。如图2中以三个存储设备,每个存储设备中包括n个存储介质为例示出。n为***自定义设置的正整数,例如根据***实际需求自定义设置的。如图,存储设备1中包括存储控制器100、存储介质101~存储介质10n。存储设备2中包括存储控制器200、存储介质201~20n。存储设备3中包括存储控制器300、存储介质301~存储介质30n。其中,每个存储控制器(例如存储控制器100)都可用于接收RAID控制器发送的写数据请求(例如拆分后的写数据请求),该写数据请求中携带有新数据、该新数据的LBA以及长度。存储控制器100可响应该写数据请求,根据预先存储的至少一个LBA和PBA之间的对应关系,确定写数据请求中新数据的LBA所对应的PBA以及该PBA所在的存储介质,进而将写数据请求中的新数据发送至该存储介质中,以将该新数据存储至该存储 介质中与数据的LBA所对应的PBA处,从而实现数据的存储。Each storage device includes a storage controller and at least one storage medium. In actual applications, the number of storage media deployed in each storage device is not limited, and may be the same or different. As shown in FIG. 2, three storage devices are taken as an example, and each storage device includes n storage media. n is a positive integer set by the system, for example, according to the actual needs of the system. As shown in the figure, the storage device 1 includes a storage controller 100 and a storage medium 101 to a storage medium 10n. The storage device 2 includes a storage controller 200 and storage media 201-20n. The storage device 3 includes a storage controller 300, a storage medium 301 to a storage medium 30n. Wherein, each storage controller (such as storage controller 100) can be used to receive a write data request (such as a split write data request) sent by the RAID controller, and the write data request carries new data and the new data. The LBA and the length. In response to the write data request, the storage controller 100 can determine the PBA corresponding to the LBA of the new data in the write data request and the storage medium where the PBA is located according to the correspondence between at least one pre-stored LBA and PBA, and then write The new data in the data request is sent to the storage medium to store the new data in the PBA corresponding to the LBA of the data in the storage medium, thereby realizing data storage.
请参见图3,是本申请实施例提供的一种数据处理方法的流程示意图。如图3所示的方法应用于图2所示的数据存储***中,该方法包括如下实施步骤:Please refer to FIG. 3, which is a schematic flowchart of a data processing method provided by an embodiment of the present application. The method shown in FIG. 3 is applied to the data storage system shown in FIG. 2, and the method includes the following implementation steps:
S301、RAID控制器接收主机发送的写数据请求,该写数据请求用于请求将第一数据更新为第二数据。该写数据请求中携带有第二数据、第二数据的逻辑地址LBA以及长度。S301. The RAID controller receives a data write request sent by the host, where the data write request is used to request to update the first data to the second data. The write data request carries the second data, the logical address LBA and the length of the second data.
该写数据请求用于请求对已存储数据中的第一数据进行更新,具体可为请求将第一数据更新为第二数据。在实际应用中,为节省资源开销,该写数据请求中携带的第二数据,具体可为第二数据在主机中存储的物理地址。便于RAID控制器接收该写数据请求后从该物理地址处读取得到第二数据。本申请下文以写数据请求中携带有第二数据为例进行相关内容的阐述。The data write request is used to request to update the first data in the stored data, and specifically may be a request to update the first data to the second data. In actual applications, in order to save resource overhead, the second data carried in the data write request may specifically be a physical address where the second data is stored in the host. It is convenient for the RAID controller to read the second data from the physical address after receiving the data write request. In the following, this application takes the second data carried in the data write request as an example to describe the relevant content.
S302、RAID控制器根据写数据请求,获得m个写数据子请求,该写数据子请求中携带有新数据、新数据的LBA以及长度。S302. The RAID controller obtains m data write sub-requests according to the data write request, and the data write sub-requests carry the new data, the LBA and the length of the new data.
具体的,RAID控制器根据写数据请求中第二数据的LBA以及长度(即大小),确定承载第二数据的条带单元以及该条带单元对应所在的存储设备,便于RAID控制器将第二数据存储至相应地存储设备,具体可为该存储设备的条带单元中。其中关于条带单元和存储设备的数量并不做限定,取决于第二数据的大小。例如,RAID控制器在确定承载第二数据的条带单元时,如果承载第二数据的条带单元的数量为m,则RAID控制器可对主机发送的写数据请求进行拆分,以将请求中的第二数据拆分为m个新数据,从而获得m个写数据子请求,每个写数据子请求中包括一个新数据、该新数据的LBA以及长度。相应地RAID控制器可对m个写数据子请求进行处理,以实现第二数据的存储和更新。Specifically, the RAID controller determines the stripe unit that carries the second data and the storage device corresponding to the stripe unit according to the LBA and length (ie size) of the second data in the write data request, so that the RAID controller can store the second data The data is stored in a corresponding storage device, which can be specifically a strip unit of the storage device. The number of stripe units and storage devices is not limited, and depends on the size of the second data. For example, when the RAID controller determines the stripe unit that carries the second data, if the number of stripe units that carry the second data is m, the RAID controller can split the write data request sent by the host to split the request The second data in is split into m new data to obtain m data write sub-requests. Each data write sub-request includes one new data, the LBA and length of the new data. Correspondingly, the RAID controller can process m write data sub-requests to realize the storage and update of the second data.
在实际应用中,当第二数据的长度(即大小)较小时,例如小于或等于一个条带单元的大小,则RAID控制器可直接对写数据请求进行处理,具体的本申请实例中可将写数据请求直接作为第一写数据子请求,第一写数据子请求中的第二数据即为第一新数据。当第二数据的长度(即大小)较大,例如大于一个条带单元的大小时,RAID控制器可对写数据请求(具体对写数据请求中的待写数据)进行拆分,以获得m个新数据以及m个写数据子请求。每个写数据子请求中都携带有一个新数据、该新数据的LBA以及长度。其中,m个新数据组成第二数据(即第二数据包括m个新数据),m个写数据子请求具体可为:第一写数据子请求、第二写数据子请求,…,第m写数据子请求。该第一写数据子请求可携带第一新数据、第一新数据的LBA以及长度。In practical applications, when the length (ie size) of the second data is small, for example, less than or equal to the size of a stripe unit, the RAID controller can directly process the write data request. In the specific example of this application, The data write request is directly used as the first data write sub-request, and the second data in the first data write sub-request is the first new data. When the length (ie size) of the second data is relatively large, for example, greater than the size of a stripe unit, the RAID controller can split the write data request (specifically the data to be written in the write data request) to obtain m New data and m write data sub-requests. Each data write sub-request carries a new data, the LBA and length of the new data. Among them, m pieces of new data constitute the second data (that is, the second data includes m pieces of new data), and the m data writing sub-requests may specifically be: the first data writing sub-request, the second data writing sub-request, ..., the mth Write data subrequest. The first data write sub-request may carry the first new data, the LBA and length of the first new data.
可选地,第一写数据子请求可用于请求用第一新数据对已存储数据中的第一旧数据进行重写,其中,重写包括将第一旧数据替换为第一新数据,或者将第一旧数据的部分数据替换为第一数据。该第二写数据子请求可携带第二新数据、第二新数据的LBA以及长度。可选地,第二写数据子请求可用于请求用第二新数据对已存储数据中的第二旧数据进行重写。依此类推,第m写数据子请求可携带第m新数据、第m新数据的LBA以及长度,可选地具体可用于请求用第n新数据对已存储数据中的第n旧数据进行更新。本申请下文以m=1,第一写数据子请求为例进行相关内容的阐述,并不构成限定。Optionally, the first data write sub-request may be used to request to rewrite the first old data in the stored data with the first new data, where the rewriting includes replacing the first old data with the first new data, or Part of the data of the first old data is replaced with the first data. The second data write sub-request may carry the second new data, the LBA and length of the second new data. Optionally, the second data write sub-request may be used to request to rewrite the second old data in the stored data with the second new data. By analogy, the m-th data write sub-request can carry the m-th new data, the LBA and length of the m-th new data, and can optionally be used to request the n-th new data to update the n-th old data in the stored data. . In the following, this application uses m=1, the first data write sub-request as an example to illustrate related content, which does not constitute a limitation.
在实际应用中,RAID控制器接收主机发送的写数据请求后,可将写数据请求中携带的第二数据(具体可为拆分后的m个新数据)存储至自身的缓存空间(具体为RAID控制器的缓存空间)中。其中,每个新数据对应有各自存储的物理地址,任意两个新数据对应存储的物理地址互不相同。这里的物理地址具体可为RAID控制器中的内存地址或者缓存地址,本申请不做限定。In practical applications, after the RAID controller receives the write data request sent by the host, it can store the second data (specifically m new data after splitting) carried in the write data request in its own cache space (specifically RAID controller cache space). Among them, each new data corresponds to its own stored physical address, and the corresponding stored physical addresses of any two new data are different from each other. The physical address here may specifically be a memory address or a cache address in the RAID controller, which is not limited in this application.
S303、RAID控制器判断写数据请求是否处于RAID小写模式。S303. The RAID controller judges whether the data write request is in the RAID lowercase mode.
RAID控制器在根据写数据请求生成异或写指令之前,需确定本次数据处理是否处于RAID小写模式。如果是,则继续执行本申请后续S304的流程。如果不是,则RAID控制器按照常规方式来实现第二数据的存储,本申请不做限定。The RAID controller needs to determine whether the current data processing is in the RAID lowercase mode before generating the XOR write command according to the write data request. If yes, continue to perform the subsequent S304 process of this application. If not, the RAID controller implements the storage of the second data in a conventional manner, which is not limited in this application.
具体的,RAID控制器可采用以下两种实施方式来确定实现继续执行本申请流程,即确定本次数据处理是否处于RAID小写模式:Specifically, the RAID controller can use the following two implementation manners to determine to continue the application process, that is, to determine whether the current data processing is in the RAID lowercase mode:
第一种,RAID控制器通过判断第二数据(即m个新数据)的大小和存储第二数据所使用的条带大小之间的比例是否超过预设阈值来确定当前是否处于RAID小写模式。如果比例未超过预设阈值,则确定当前处于RAID小写模式,继续执行本申请实施流程步骤。否则,确定当前处于RAID大写模式,结束本申请实施流程,按照常规的数据存储方式来存储数据。该预设阈值为根据用户经验设置的经验值或根据存储***已存储的数据的历史情况计算获得。例如,当该预设阈值为50%,则表示第二数据的大小占待存储该数据的条带大小的一半以下时,可继续执行本申请实施例流程;否则,按照常规方式实现数据的存储。In the first type, the RAID controller determines whether the RAID controller is currently in the RAID lowercase mode by judging whether the ratio between the size of the second data (that is, m new data) and the stripe size used for storing the second data exceeds a preset threshold. If the ratio does not exceed the preset threshold, it is determined that the RAID lowercase mode is currently in operation, and the steps in the implementation process of this application are continued. Otherwise, it is determined that it is currently in the RAID uppercase mode, the implementation process of this application is ended, and the data is stored according to the conventional data storage method. The preset threshold is an empirical value set based on user experience or calculated based on historical conditions of data stored in the storage system. For example, when the preset threshold is 50%, it means that when the size of the second data is less than half of the stripe size of the data to be stored, the process of the embodiment of this application can be continued; otherwise, the data storage is implemented in a conventional manner .
举例来说,假设某个条带中存储有四个旧数据:D1、D2、D3以及D4。已存储数据对应的原校验数据P=D1 XOR D2 XOR D3 XOR D4,XOR表示异或。其中,主机根据实际需求可对条带中已存储数据中的第一数据进行更新,例如将D1更新为D1’。则主机可生成相应地写数据请求,并将写数据请求发送给RAID控制器,写数据请求中可携带第二数据(即D1’)、D1’的LBA以及长度。For example, suppose there are four old data stored in a strip: D1, D2, D3, and D4. The original verification data corresponding to the stored data P=D1 XOR D2 XOR D3 XOR D4, XOR means exclusive OR. Among them, the host can update the first data in the stored data in the strip according to actual needs, for example, update D1 to D1'. Then the host can generate a corresponding write data request and send the write data request to the RAID controller. The write data request can carry the second data (that is, D1'), the LBA of D1', and the length.
相应地,RAID控制器接收该写数据请求,可获知第二数据的大小(即所需更新的旧数据的大小)与待存储第二数据的条带大小之间的比例,进而确定是否实施本申请后续流程。本例中,这里RAID控制器可知D1’仅占整个条带存储容量的25%,本次数据处理处于RAID小写模式,可继续执行本申请后续流程。其中,在条带中已存储数据存在更新时,RAID控制器通过旧数据和新数据进行异或运算,将异或运算的结果数据再和原校验数据进行异或运算,可获得新校验数据。这里新校验数据P’=D1XOR D1’XOR P。Correspondingly, the RAID controller receives the data write request, and can learn the ratio between the size of the second data (that is, the size of the old data that needs to be updated) and the stripe size of the second data to be stored, and then determine whether to implement this Application follow-up process. In this example, the RAID controller here knows that D1' only occupies 25% of the storage capacity of the entire strip, and this data processing is in RAID lowercase mode, and the subsequent procedures of this application can be continued. Among them, when there is an update of the stored data in the stripe, the RAID controller uses the old data and the new data to perform an exclusive OR operation, and then performs an exclusive OR operation on the result data of the exclusive OR operation and the original check data to obtain a new checksum data. Here the new verification data P'=D1XOR D1'XOR P.
又如,主机根据实际需求需将D1、D2以及D3分别更新为:D1’、D2’以及D3’。则主机可生成相应地写数据请求,并发送给RAID控制器,该写数据请求中携带有第二数据(D1’、D2’以及D3’)、第二数据的LBA(即起始存储LBA)以及长度。相应地RAID控制器接收该写数据请求,获知第二数据的大小,进而确定是否实施本申请后续流程。本例中,RAID控制器可知第二数据(D1’、D2’以及D3’)占条带的75%(3/4),本次数据处理模式处于RAID大写模式,可结束本申请实施流程。其中,此例中不支持RAID小写模式,RAID控制器可采用以下方式获得新校验数据P’:P’=D1’XOR D2’XOR D3’XOR D4。For another example, the host needs to update D1, D2, and D3 to D1', D2', and D3' according to actual needs. Then the host can generate a corresponding write data request and send it to the RAID controller. The write data request carries the second data (D1', D2' and D3') and the LBA of the second data (that is, the initial storage LBA) And length. Accordingly, the RAID controller receives the data write request, learns the size of the second data, and then determines whether to implement the subsequent procedures of this application. In this example, the RAID controller knows that the second data (D1', D2', and D3') account for 75% (3/4) of the stripe, and the current data processing mode is in the RAID uppercase mode, and the implementation process of this application can be ended. Among them, the RAID lowercase mode is not supported in this example, and the RAID controller can obtain the new parity data P'in the following manner: P'=D1'XOR D2'XOR D3'XOR D4.
第二种,RAID控制器通过判断第一读写次数和第二读写次数的大小关系来确定当前是否处于RAID小写模式。具体的,当第一读写次数小于或等于第二读写次数时,确定当前处于RAID小写模式,继续执行本申请实施步骤。否则,确定当前处于RAID大写模式。其中,第一读写次数为RAID控制器在实现对第二数据(即m个新数据)、所述第一数据以及原校验数据进行异或运算获得的运算结果的存储时所需的读写次数。第二读写次数为RAID控制器在实现对第二数据、已存储数据中除所述第一数据外的数据和原校验数据进行异或运算获得的运算结果的存储时所需的读写次数。In the second type, the RAID controller determines whether it is currently in the RAID lowercase mode by judging the magnitude relationship between the first read and write times and the second read and write times. Specifically, when the first number of reads and writes is less than or equal to the second number of reads and writes, it is determined that it is currently in the RAID lowercase mode, and the implementation steps of this application are continued. Otherwise, make sure you are currently in RAID uppercase mode. Among them, the first number of reads and writes is the read required by the RAID controller to realize the storage of the operation result obtained by performing the exclusive OR operation on the second data (ie m new data), the first data and the original check data. Number of writes. The second number of reads and writes is the read and write required by the RAID controller to realize the storage of the operation result obtained by the exclusive OR operation on the second data, the data other than the first data in the stored data and the original check data frequency.
举例来说,参考上文RAID大写模式和小写模式的例子,某条带中存储有包括D1、D2、D3以及D4在内的数据,假设主机根据实际需求需将D1更新为D1’,即需利用新数据D1’对旧数据D1进行更新。则第一读写次数即为RAID控制器在存储如下异或运算的运算结果(P’)时的读写次数:P’=D1 XOR D1’XOR P。这里第一读写次数即为4次,分别为:读一次D1、写一次D1’、读一次P以及写一次P’。For example, referring to the example of RAID uppercase and lowercase modes above, a strip stores data including D1, D2, D3, and D4. Assuming that the host needs to update D1 to D1' according to actual needs, that is, The old data D1 is updated with the new data D1'. Then the first number of reads and writes is the number of reads and writes when the RAID controller stores the operation result (P') of the XOR operation as follows: P'= D1 XOR D1' XOR P. Here, the first read and write times are 4 times, which are: read once D1, write once D1', read once P, and write once P'.
第二读写次数即为RAID控制器在存储如下异或运算的运算结果(P’)时的读写次数:P’=D1’XOR D2 XOR D3 XOR D4。这里第二读写次数即为5次,分别为:写一次D1’、各读一次数据D2、D3和D4以及写一次P’。显然地,此例中第一读写次数小于第二读写次数,RAID控制器可继续执行本申请实施例,采用RAID小写模式进行数据更新。The second number of reads and writes is the number of reads and writes when the RAID controller stores the result (P') of the XOR operation: P'= D1' XOR D2 XOR D3 XOR D4. Here, the second read and write times are 5 times, which are: write once D1', read data D2, D3, and D4 once, and write once P'. Obviously, in this example, the first number of reads and writes is less than the second number of reads and writes, and the RAID controller can continue to execute the embodiments of the present application and use the RAID lowercase mode to update data.
又如,假设主机根据实际需求需将D1、D2以及D3分别更新为:D1’、D2’以及D3’,即需利用3个新数据D1’、D2’以及D3’来对应将旧数据D1、D2以及D3进行更新。则第一读写次数即为RAID控制器在存储如下异或运算的运算结果(P’)时的读写次数:P’=D1 XOR D1’XOR D2 XOR D2’XOR D3 XOR D3’XOR P。这里第一读写次数即为8次。第二读写次数即为RAID控制器在存储如下异或运算的运算结果(P’)时的读写次数:P’=D1’XOR D2’XOR D3’XOR D4。这里第二读写次数即为5次。显然地,本例中第一读写次数大于第二读写次数,RAID控制器可结束本申请实施例流程,采用RAID大写模式进行数据更新,即采用常规的数据存储流程实现数据更新。For another example, suppose the host needs to update D1, D2, and D3 to: D1', D2', and D3' according to actual needs, that is, three new data D1', D2', and D3' are needed to correspond to the old data D1 D2 and D3 are updated. Then the first number of reads and writes is the number of reads and writes when the RAID controller stores the result (P') of the XOR operation: P’ = D1 XOR D1’ XOR D2 XOR D2’ XOR D3 XOR D3’ XOR P. Here the first number of reads and writes is 8 times. The second number of reads and writes is the number of reads and writes when the RAID controller stores the operation result (P') of the XOR operation as follows: P’=D1’XOR D2’XOR D3’XOR D4. Here the second number of reads and writes is 5 times. Obviously, in this example, the first number of reads and writes is greater than the second number of reads and writes, and the RAID controller can end the process of the embodiment of the present application and use the RAID uppercase mode for data update, that is, use the conventional data storage process to implement data update.
步骤304、RAID控制器根据第一写数据子请求,生成第一异或写指令(xor write),该第一异或写指令携带有第一新数据的存储地址、第一新数据的LBA以及第二地址。该第二地址用于存储第一异或写指令的运算结果。Step 304: The RAID controller generates a first exclusive OR write command (xor write) according to the first data write sub-request. The first exclusive OR write command carries the storage address of the first new data, the LBA of the first new data, and The second address. The second address is used to store the operation result of the first XOR write instruction.
RAID控制器根据写数据请求可生成异或写指令,该异或写指令中携带有第一地址、第二数据的物理地址和第二数据的逻辑地址。其中第一地址为RAID控制器中用于存储异或写指令的运算结果的物理地址,第二数据的物理地址为第二数据在RAID控制器中存储时的物理地址,第二数据的逻辑地址为第二数据在数据存储设备中存储时所占的逻辑地址。具体实现时,第二数据较大时,写数据请求将被拆分为多个写数据子请求,本申请下文以第一写数据子请求为例,详述本申请涉及的相关实施例。具体的,RAID控制器在获得第一写数据子请求后,可生成相应地第一异或写指令。该第一异或写指令用于获取第一新数据和第一旧数据的异或运算结果,该第一异或写指令中携带有第一新数据的物理地址、第一数据的LBA以及第二地址。其中,该第二地址为***自定义设置的,例如根据用户偏好或***实际需求自定义设置的,RAID控 制器中用于存储第一异或写指令的结果数据的物理地址。在实际应用中,该第二地址通常为RAID控制器中的物理地址,例如内存地址或缓存地址等。可选地,该第一异或写指令还可包括第一新数据的长度等信息,本申请并不做限定。The RAID controller can generate an XOR write instruction according to the data write request, and the XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data. The first address is the physical address used to store the operation result of the XOR write instruction in the RAID controller, the physical address of the second data is the physical address when the second data is stored in the RAID controller, and the logical address of the second data It is the logical address occupied when the second data is stored in the data storage device. In specific implementation, when the second data is relatively large, the data write request will be split into multiple data write sub-requests. In the following, the first data write sub-request is taken as an example to describe the related embodiments of the present application in detail. Specifically, after obtaining the first data write sub-request, the RAID controller may generate the corresponding first XOR write instruction. The first XOR write instruction is used to obtain the XOR operation result of the first new data and the first old data. The first XOR write instruction carries the physical address of the first new data, the LBA of the first data, and the first data. Second address. Wherein, the second address is a physical address that is customized by the system, for example, customized according to user preferences or actual needs of the system, the physical address in the RAID controller used to store the result data of the first XOR write command. In practical applications, the second address is usually a physical address in the RAID controller, such as a memory address or a cache address. Optionally, the first XOR write instruction may also include information such as the length of the first new data, which is not limited in this application.
S305、RAID控制器将第一异或写指令发送给数据存储设备,该数据存储设备为第一新数据的LBA对应所在的存储设备。相应地数据存储设备接收该第一异或写指令。S305. The RAID controller sends the first XOR write instruction to the data storage device, where the data storage device is the storage device where the LBA of the first new data corresponds. Correspondingly, the data storage device receives the first XOR write instruction.
RAID控制器根据第一新数据的LBA可确定该LBA所在的数据存储设备,再将第一异或写指令发送给该数据存储设备进行处理。The RAID controller can determine the data storage device where the LBA is located according to the LBA of the first new data, and then send the first XOR write instruction to the data storage device for processing.
S306、数据存储设备根据第一异或写指令中第一新数据的存储地址读取第一新数据,根据第一新数据的LBA读取该LBA对应存储的第一旧数据,并将该第一新数据写入至该第一新数据的LBA中,以更新第一旧数据。S306. The data storage device reads the first new data according to the storage address of the first new data in the first XOR write instruction, reads the first old data stored corresponding to the LBA according to the LBA of the first new data, and stores the first new data. A new data is written into the LBA of the first new data to update the first old data.
S307、数据存储设备对第一新数据和第一旧数据进行异或运算,获得第一结果数据。数据存储设备将第一结果数据发送至RAID控制器中的第二地址存储。S307. The data storage device performs an exclusive OR operation on the first new data and the first old data to obtain first result data. The data storage device sends the first result data to the second address in the RAID controller for storage.
数据存储设备接收RAID控制器发送的第一异或写指令。再根据第一异或写指令中第一新数据的存储地址,从RAID控制器中该存储地址处读取第一新数据。根据第一异或写指令中第一新数据的LBA,确定该LBA对应的物理地址,也可称为物理块地址(physical block address,PBA)。进而读取该PBA处已存储的第一旧数据,并利用第一新数据更新第一旧数据。The data storage device receives the first exclusive OR write instruction sent by the RAID controller. Then, according to the storage address of the first new data in the first XOR write instruction, the first new data is read from the storage address in the RAID controller. According to the LBA of the first new data in the first XOR write instruction, the physical address corresponding to the LBA is determined, which may also be referred to as a physical block address (PBA). Then read the first old data stored at the PBA, and update the first old data with the first new data.
具体的,数据存储设备可将该第一新数据存储至该LBA对应的PBA处;或者,数据存储设备可将该第一新数据存储至另一新PBA处,并更新该LBA与PBA之间的对应关系,将该LBA与新PBA对应。即,数据存储设备可解除第一新数据的LBA与原PAB之间的对应关系,新建第一新数据的LBA和新PBA之间的对应关系。可选地,数据存储设备可采用直接内存存取(direct memory access,DMA)方式来读取数据。例如,数据存储设备通过DMA从第一新数据的存储地址处读取该第一新数据,或者通过DMA从第一新数据的LBA所对应的PBA处读取该PBA处存储的第一旧数据等等,以节省数据读取时间,提升数据处理效率。Specifically, the data storage device may store the first new data at the PBA corresponding to the LBA; or, the data storage device may store the first new data at another new PBA, and update the relationship between the LBA and the PBA. Correspondence between the LBA and the new PBA. That is, the data storage device can cancel the correspondence between the LBA of the first new data and the original PAB, and create a new correspondence between the LBA of the first new data and the new PBA. Optionally, the data storage device may use direct memory access (DMA) to read data. For example, the data storage device reads the first new data from the storage address of the first new data through DMA, or reads the first old data stored at the PBA from the PBA corresponding to the LBA of the first new data through DMA And so on, to save data reading time and improve data processing efficiency.
进一步地,数据存储设备还可根据该第一异或指令对读取的第一旧数据和第一新数据进行异或运算,从而获得第一运算结果,并将该第一运算结果发送至RAID控制器中的第二地址处存储。Further, the data storage device may perform an exclusive OR operation on the read first old data and the first new data according to the first exclusive OR instruction to obtain the first operation result, and send the first operation result to the RAID Stored at the second address in the controller.
在实际应用中,参见图2所示,数据存储设备包括存储控制器和至少一个存储介质。数据存储设备接收第一异或写指令后,通过存储控制器根据第一异或写指令中第一新数据的LBA,确定该第一新数据的LBA所对应的PBA,进而存储控制器从该PBA所在的存储介质中读取该PBA处已存储的第一旧数据。并通过存储控制器根据指令中第一新数据的存储地址从RAID控制器中读取该存储地址中存储的第一新数据,并利用该第一新数据来更新第一旧数据。进一步地,存储控制器可对读取的第一旧数据和第一新数据进行异或运算,获得第一运算结果,并将该第一运算结果写入至RAID控制器中的第二地址处存储。In practical applications, as shown in FIG. 2, the data storage device includes a storage controller and at least one storage medium. After the data storage device receives the first XOR write instruction, the storage controller determines the PBA corresponding to the LBA of the first new data according to the LBA of the first new data in the first XOR write instruction. Read the first old data stored at the PBA from the storage medium where the PBA is located. The storage controller reads the first new data stored in the storage address from the RAID controller according to the storage address of the first new data in the instruction, and uses the first new data to update the first old data. Further, the storage controller may perform an exclusive OR operation on the read first old data and the first new data to obtain the first operation result, and write the first operation result to the second address in the RAID controller storage.
需要说明的是,本申请上文中读取第一新数据和读取第一旧数据的执行先后顺序,并不做限定。且第一新数据的更新步骤、第一新数据和第一旧数据的异步运算步骤的执行先后顺序同样不做限定,例如两者可并行执行,或者先执行第一新数据的更新步 骤、后执行第一新数据和第一旧数据的异或运算步骤等等。在实际应用中,本申请中第一存储设备和校验存储设备可为同一存储设备,也可为不同的存储设备,本申请并不做限定。It should be noted that the execution sequence of reading the first new data and reading the first old data is not limited in this application. Moreover, the order of execution of the update step of the first new data, the asynchronous operation step of the first new data and the first old data is also not limited. For example, the two can be executed in parallel, or the update step of the first new data may be executed first, and then Perform the exclusive OR operation steps of the first new data and the first old data and so on. In practical applications, the first storage device and the verification storage device in this application may be the same storage device or different storage devices, which is not limited in this application.
S308、RAID控制器向校验存储设备发送异或更新指令(xor update),该异或更新指令携带有第一地址、原校验数据的LBA以及长度。相应地,校验存储设备接收该异或更新指令。该校验存储设备为至少一个存储设备中存储有原校验数据的存储设备。S308. The RAID controller sends an exclusive OR update instruction (xor update) to the check storage device, where the exclusive OR update command carries the first address, the LBA of the original check data, and the length. Correspondingly, the verification storage device receives the exclusive OR update instruction. The verification storage device is a storage device that stores original verification data in at least one storage device.
S309、校验存储设备响应该异或更新指令,根据异或更新指令中原校验数据的LBA以及长度,读取原校验数据,根据第一地址获取异或写指令的运算结果,这里即第一运算结果。S309. The check storage device responds to the XOR update instruction, reads the original check data according to the LBA and length of the original check data in the XOR update instruction, and obtains the operation result of the XOR write instruction according to the first address. One operation result.
校验存储设备对原校验数据和第一运算结果进行异或运算,从而获得新校验数据(也可称为异或运算结果)。并利用新校验数据对原校验数据进行更新。本申请涉及的原校验数据也可称为第一数据的校验数据,本申请涉及的新校验数据可称为第二数据的校验数据,为方便描述本申请下文均采用原校验数据和新校验数据作为统称,并不做限定。The check storage device performs an exclusive OR operation on the original check data and the first operation result, thereby obtaining new check data (also called an exclusive OR operation result). And use the new check data to update the original check data. The original verification data involved in this application can also be referred to as the verification data of the first data, and the new verification data involved in this application can be referred to as the verification data of the second data. For the convenience of description, the original verification data is used in the following text. The data and the new verification data are collectively referred to as not limited.
RAID控制器在获得异或写指令的运算结果后,可向校验存储设备发送异或更新指令,该异或更新指令携带有第一地址、原校验数据的LBA以及长度。After obtaining the operation result of the XOR write instruction, the RAID controller can send an XOR update instruction to the check storage device, and the XOR update instruction carries the first address, the LBA of the original check data, and the length.
相应地,校验存储设备接收该异或更新指令,并根据该异或更新指令中原校验数据的LBA以及长度,确定原校验数据在本校验存储设备中对应的PBA,进而从该PBA处读取该原校验数据。此外,校验存储设备可根据异或更新指令中携带的第一地址,从RAID控制器中读取该第一地址对应存储的异或写指令的运算结果。可选地,该异或更新指令中也可直接携带异或写指令的运算结果,并非存储该运算结果的第一地址,此时校验存储设备可通过解析异或更新指令直接获得该异或写指令的运算结果。在实际应用中为节省指令开销,异或更新指令中通常携带第一地址,并非该异或写指令的运算结果。本申请下文将以异或更新指令携带地址的方式,进行相关内容的阐述。Correspondingly, the check storage device receives the XOR update instruction, and according to the LBA and length of the original check data in the XOR update instruction, determines the PBA corresponding to the original check data in the check storage device, and then obtains it from the PBA Read the original verification data. In addition, the verification storage device can read from the RAID controller the operation result of the XOR write instruction corresponding to the first address according to the first address carried in the XOR update instruction. Optionally, the XOR update instruction may also directly carry the operation result of the XOR write instruction, instead of the first address where the operation result is stored. In this case, the verification storage device can directly obtain the XOR by parsing the XOR update instruction. The operation result of the write instruction. In practical applications, to save instruction overhead, the XOR update instruction usually carries the first address, which is not the result of the XOR write instruction. In the following, this application will use the exclusive OR update instruction to carry the address to explain the relevant content.
接下来,校验存储设备对读取的原校验数据和异或写指令的运算结果进行异或运算,获得新校验数据。校验存储设备可利用该新校验数据来更新原校验数据,具体的,校验存储设备可将该新校验数据写入至原校验数据的LBA所对应的PBA;或者,将该新校验数据写入至另一新PBA处存储,并更新原校验数据的LBA和原PBA之间的对应关系,将原校验数据的LBA与新PBA对应。Next, the check storage device performs an exclusive OR operation on the read original check data and the operation result of the XOR write instruction to obtain new check data. The verification storage device can use the new verification data to update the original verification data. Specifically, the verification storage device can write the new verification data to the PBA corresponding to the LBA of the original verification data; or, The new verification data is written into another new PBA for storage, and the correspondence between the LBA of the original verification data and the original PBA is updated, and the LBA of the original verification data is corresponding to the new PBA.
在实际应用中,参见图2,校验存储设备包括存储控制器以及至少一个存储介质。具体实现时,校验存储设备接收异或更新指令后,通过存储控制器根据原校验数据的LBA以及长度,确定与之对应的PBA,进而从该PBA中读取原校验数据。存储控制器可根据异或更新指令中的第一地址,从RAID控制器中读取该第一地址对应存储的异或写指令的运算结果。进一步存储控制器可对原校验数据和异或写指令的运算结果进行异或运算,从而获得新校验数据。进而利用该新校验数据来更新原校验数据。In practical applications, referring to FIG. 2, the verification storage device includes a storage controller and at least one storage medium. In specific implementation, after the verification storage device receives the XOR update instruction, the storage controller determines the corresponding PBA according to the LBA and length of the original verification data, and then reads the original verification data from the PBA. The storage controller can read from the RAID controller the operation result of the exclusive OR write command corresponding to the first address according to the first address in the exclusive OR update instruction. Further, the storage controller can perform an XOR operation on the original check data and the operation result of the XOR write instruction, thereby obtaining new check data. The new verification data is then used to update the original verification data.
需要说明的是,校验存储设备读取原校验数据以及异或写指令的运算结果的实施步骤,可以并行执行,也可以串行执行,当进行串行执行时,校验存储设备可先读取原校验数据、后读取异或写指令的运算结果,也可以先读取异或写指令的运算结果、后读取原校验数据,并不做限定。此外,本申请上文仅以写数据请求包括一个第一写 数据子请求为例,阐述如何实现第一新数据的更新以及原校验数据的更新。同样地当写数据请求包括至少两个写数据子请求时,每个写数据子请求可对应参见前述第一写数据子请求的处理原理,实现各新数据的更新。相应地,RAID控制器在获得每个写数据子请求对应的异或运算结果后,可综合各异或运算结果进而实现原校验数据的更新,具体可参见下文图5或图6示例详述。It should be noted that the implementation steps of the verification storage device reading the original verification data and the operation result of the XOR write instruction can be executed in parallel or serially. When performing serial execution, the verification storage device can be executed first. Read the original check data and then read the operation result of the XOR write instruction, or read the operation result of the XOR write instruction first and then read the original check data, which is not limited. In addition, the above of this application only takes the write data request including a first data write sub-request as an example to explain how to update the first new data and the original verification data. Similarly, when the data write request includes at least two data write sub-requests, each data write sub-request may correspond to the processing principle of the aforementioned first data write sub-request to realize the update of each new data. Correspondingly, after the RAID controller obtains the XOR operation result corresponding to each data write sub-request, it can synthesize the XOR operation results to realize the update of the original parity data. For details, please refer to the detailed examples in Figure 5 or Figure 6 below. .
下面结合图4-图6举例详述本申请涉及的相关实施例。如图4所示,假设主机根据实际需求需对条带中存储的D1进行重写,假设利用D1’更新D1,该条带中存储有包括D1~D4在内的已存储数据。主机将生成写数据请求,并将该写数据请求发送给RAID控制器,该写数据请求中携带有第二数据(D1’)、D1’的LBA以及长度。该写数据请求用于请求用第二数据D1’对已存储数据中的第一数据D1进行更新。相应地RAID控制器根据该写数据请求,获知D1’大小不超过一个条带单元大小,无需对写数据请求进行拆分,该写数据请求即为第一写数据子请求。Hereinafter, the relevant embodiments involved in the present application will be described in detail with reference to FIGS. 4 to 6. As shown in Figure 4, suppose that the host needs to rewrite the D1 stored in the strip according to actual needs, and suppose that D1 is updated with D1'. The strip stores the stored data including D1 to D4. The host will generate a write data request and send the write data request to the RAID controller. The write data request carries the second data (D1'), the LBA of D1', and the length. The write data request is used to request the second data D1' to update the first data D1 in the stored data. Correspondingly, the RAID controller learns that the size of D1' does not exceed the size of one stripe unit according to the write data request, and there is no need to split the write data request. The write data request is the first data write sub-request.
相应地如图4,RAID控制器接收该写数据请求后,可向第一存储设备发送异或写指令,该异或写指令中携带D1’的存储地址、D1’的LBA、长度以及第一地址等信息。可选地,RAID控制器接收写数据请求后,可将写数据请求中携带的待写数据D1’存储至相应地缓存空间中。第一写数据子请求中D1’的存储地址具体可为RAID控制器中存储D1’的地址。相应地,第一存储设备接收该异或写指令,存储控制器从D1’的存储地址处读取D1’。存储控制器读取该D1’的LBA对应存储的旧数据D1,并利用D1’来更新D1,关于如何更新数据具体可参见前述实施例中的相关介绍。存储控制器可对读取的旧数据D1和新数据D1’进行异或运算,获得异或写指令的运算结果D1”,并将该运算结果D1”发送至RAID控制器中的第一地址处存储。Correspondingly as shown in Figure 4, after the RAID controller receives the write data request, it can send an exclusive OR write command to the first storage device. The exclusive OR write command carries the storage address of D1', the LBA of D1', the length, and the first storage device. Address and other information. Optionally, after the RAID controller receives the data write request, it can store the data to be written D1' carried in the data write request in the corresponding cache space. The storage address of D1' in the first data write sub-request may specifically be the address of storage D1' in the RAID controller. Correspondingly, the first storage device receives the XOR write instruction, and the storage controller reads D1' from the storage address of D1'. The storage controller reads the old data D1 stored corresponding to the LBA of D1', and uses D1' to update D1. For details on how to update the data, please refer to the relevant introduction in the foregoing embodiment. The storage controller can perform XOR operation on the read data D1 and new data D1' to obtain the operation result D1" of the XOR write instruction, and send the operation result D1" to the first address in the RAID controller storage.
相应地,RAID控制器可向校验存储设备发送异或更新指令,该异或更新指令中携带有原校验数据(P0)的LBA、原校验数据的长度以及第一地址。该第一地址用于存储异或写指令的运算结果。校验存储设备接收异或更新指令,通过自身设备中的存储控制器根据原校验数据的LBA以及长度,读取该LBA对应存储的原校验数据P0;根据第一地址读取异或写指令的运算结果D1”。进一步该存储控制器可对读取的原校验数据P0和第一运算结果D1”进行异或运算,从而获得新校验数据P0’。进一步可将该P0’写入至原校验数据的LBA处,以利用新校验数据P0’更新原校验数据P0。Correspondingly, the RAID controller can send an XOR update instruction to the check storage device, and the XOR update instruction carries the LBA of the original check data (P0), the length of the original check data, and the first address. The first address is used to store the operation result of the XOR write instruction. The check storage device receives the XOR update instruction, and reads the original check data P0 corresponding to the LBA according to the LBA and length of the original check data through the storage controller in its own device; reads the exclusive OR write according to the first address The operation result D1" of the instruction. Further, the storage controller can perform an exclusive OR operation on the read original check data P0 and the first operation result D1", thereby obtaining new check data P0'. Further, this P0' can be written into the LBA of the original check data to update the original check data P0 with the new check data P0'.
在实际应用中,第二数据中包括的新数据的数量m并不局限于一个。当m大于等于2时,同样可参考上文针对第一写数据子请求中第一新数据的更新原理,实现m个新数据的更新以及原校验数据的更新,本申请不做限定。可选地,当m大于或等于2时,为提升数据处理效率,节省数据读写时长,可将各新数据和各旧数据进行异或运算获得的运算结果发送至RAID控制器中,RAID控制器可实现各运算结果的异或运算,将最终获得的异或运算结果发送至校验存储设备。便于校验存储设备基于该异或运算结果实现原校验数据的更新。本申请下文以m=2为例示出数据处理涉及的两种具体实施例。In practical applications, the number m of new data included in the second data is not limited to one. When m is greater than or equal to 2, the update principle of the first new data in the first data write subrequest can also be referred to above to realize the update of m new data and the update of the original verification data, which is not limited in this application. Optionally, when m is greater than or equal to 2, in order to improve data processing efficiency and save data read and write time, the operation results obtained by performing exclusive OR operations on each new data and each old data can be sent to the RAID controller, and the RAID control The device can realize the exclusive OR operation of each operation result, and send the final exclusive OR operation result to the verification storage device. It is convenient for the verification storage device to update the original verification data based on the XOR operation result. In the following, the application uses m=2 as an example to illustrate two specific embodiments involved in data processing.
请参见图5,假设主机根据实际需求需将某条带中的D1更新为D1’、将D2更新为D2’。相应地RAID控制器可接收主机根据实际需求生成的写数据请求,该写数 据请求中携带有第二数据(D1’和D2’)、第二数据的LBA以及长度。由于第二数据较大,RAID控制器可将写数据请求拆分为2个写数据子请求,分别为第一写数据子请求和第二写数据子请求。其中,第一写数据子请求中携带有第一新数据D1’的存储地址、D1’的LBA以及长度,第二写数据子请求中携带有第二新数据D2’、D2’的LBA以及长度。可选地RAID控制器接收写数据请求后,可将写数据请求中携带的第二数据D1’和D2’存储至相应地缓存空间中。相应地第一写数据子请求中D1’的物理地址具体可为RAID控制器中存储D1’的地址。第二写数据子请求中D2’的物理地址为RAID控制器中存储D2’的地址。Refer to Figure 5, assuming that the host needs to update D1 to D1' and D2 to D2' in a certain band according to actual needs. Correspondingly, the RAID controller can receive a write data request generated by the host according to actual needs, and the write data request carries the second data (D1' and D2'), the LBA and the length of the second data. Since the second data is relatively large, the RAID controller can split the data write request into two data write sub-requests, which are respectively the first data write sub-request and the second data write sub-request. Among them, the first data write sub-request carries the storage address of the first new data D1', the LBA and length of D1', and the second data write sub-request carries the LBA and length of the second new data D2' and D2'. . Optionally, after the RAID controller receives the data write request, the second data D1' and D2' carried in the data write request may be stored in the corresponding cache space. Correspondingly, the physical address of D1' in the first data write sub-request may specifically be the address of D1' stored in the RAID controller. The physical address of D2' in the second data write sub-request is the address of D2' stored in the RAID controller.
进一步RAID控制器可根据第一写数据子请求生成第一异或写指令,并将其发送给第一存储设备。根据第二写数据子请求生成第二异或写指令,并发送给第二存储设备。该第一异或写指令携带有D1’的存储地址、D1’的LBA、长度以及第二地址,第二地址用于存储第一异或写指令的运算结果。该第二异或写指令携带有D2’的存储地址、D2’的LBA、长度以及第三地址,第三地址用于存储第二异或写指令的运算结果。其中,第一存储设备为D1’的LBA对应所在的存储设备,第二存储设备为D2’的LBA对应所在的存储设备。在实际应用中,第一存储设备和第二存储设备可以相同,也可不同,本申请不做限定。Further, the RAID controller may generate a first XOR write instruction according to the first data write sub-request, and send it to the first storage device. Generate a second XOR write instruction according to the second data write sub-request, and send it to the second storage device. The first XOR write instruction carries the storage address of D1', the LBA of D1', the length, and the second address. The second address is used to store the operation result of the first XOR write instruction. The second XOR write instruction carries the storage address of D2', the LBA of D2', the length, and the third address. The third address is used to store the operation result of the second XOR write instruction. The first storage device is the storage device where the LBA of D1' corresponds to, and the second storage device is the storage device where the LBA of D2' corresponds. In practical applications, the first storage device and the second storage device may be the same or different, which is not limited in this application.
相应地,第一存储设备接收第一异或写指令,通过第一存储设备的存储控制器读取D1’的物理地址处存储的D1’。并通过自身设备的存储控制器读取该D1’的LBA对应存储的第一旧数据D1,并将该D1’写入至第一存储设备中该D1’的LBA所在的存储介质中,以利用D1’更新D1,具体可前文所述。进一步第一存储设备的存储控制器可对读取的第一旧数据D1和第一新数据D1’进行异或运算,获得第一运算结果D1”,并将该第一运算结果D1”发送至RAID控制器中的第二地址处存储。Correspondingly, the first storage device receives the first XOR write instruction, and reads D1' stored at the physical address of D1' through the storage controller of the first storage device. And read the first old data D1 corresponding to the LBA of D1' through the storage controller of the own device, and write the D1' into the storage medium where the LBA of D1' in the first storage device is located, so as to use D1' updates D1, as described above. Further, the storage controller of the first storage device may perform an exclusive OR operation on the read first old data D1 and the first new data D1' to obtain a first operation result D1", and send the first operation result D1" to It is stored at the second address in the RAID controller.
第二存储设备接收第二异或写指令,通过第二存储设备的存储控制器读取D2’的物理地址处存储的D2’。通过自身设备的存储控制器读取该D2’的LBA对应存储的第二旧数据D2,并用该D2’更新D2。进一步第二存储设备的存储控制器可对读取的第二旧数据D2和第二新数据D2’进行异或运算,以获得第二运算结果D2”,并将该第二运算结果D2”发送至RAID控制器中的第三地址处存储。如图序号2-5示出第一存储设实现数据处理的操作流程,序号6-9示出第二存储设备实现数据处理的操作流程,第一存储设备和第二存储设备各自操作流程中的步骤可以并行执行、也可串行执行。当串行执行时,可先执行序号2-5的操作流程,后执行序号6-9的操作流程;或者,也可先执行序号6-9的操作流程,后执行序号2-5的操作流程本发明并不限定。The second storage device receives the second XOR write instruction, and reads D2' stored at the physical address of D2' through the storage controller of the second storage device. Read the second old data D2 stored corresponding to the LBA of D2' through the storage controller of the own device, and update D2 with this D2'. Further, the storage controller of the second storage device may perform an exclusive OR operation on the read second old data D2 and the second new data D2' to obtain a second operation result D2", and send the second operation result D2" Store at the third address in the RAID controller. As shown in the figure, the serial number 2-5 shows the operation flow of the first storage device to realize data processing, and the serial number 6-9 shows the operation flow of the second storage device to realize data processing. In the respective operation flow of the first storage device and the second storage device, Steps can be executed in parallel or serially. When executing serially, you can execute the operation flow of sequence number 2-5 first, and then execute the operation flow of sequence number 6-9; alternatively, you can execute the operation flow of sequence number 6-9 first, and then execute the operation flow of sequence number 2-5 The present invention is not limited.
进一步的,RAID控制器可向校验存储设备发送异或更新指令,该异或更新指令中携带有第二地址、第三地址、原校验数据P0的LBA以及长度等信息。相应地校验存储设备接收该异或更新指令,通过自身设备的存储控制器根据第二地址读取第一运算结果D1’,根据第三地址读取第二运算结果D2’,根据原校验数据P0的LBA以及长度读取原校验数据P0。进一步校验存储设备的存储控制器可对原校验数据P0、第一运算结果D1”以及第二运算结果D2”进行异或运算,获得新校验数据P0’。进一步可将该P0’写入至原校验数据的LBA处,以利用新校验数据P0’更新原校验数据P0。Further, the RAID controller may send an exclusive OR update instruction to the check storage device, and the exclusive OR update instruction carries information such as the second address, the third address, the LBA of the original check data P0, and the length. Correspondingly, the verification storage device receives the XOR update instruction, reads the first calculation result D1' according to the second address through the storage controller of the own device, reads the second calculation result D2' according to the third address, and reads the second calculation result D2' according to the original verification The LBA and length of data P0 read the original parity data P0. Further verifying the storage controller of the storage device can perform an exclusive OR operation on the original verification data P0, the first calculation result D1" and the second calculation result D2" to obtain the new verification data P0'. Further, this P0' can be written into the LBA of the original check data to update the original check data P0 with the new check data P0'.
请参考图6,同样引用并参考图5中的例子,为减少数据读写次数、提升数据处理的效率,RAID控制器可先对第一存储设备计算获得第一运算结果D1”以及第二存储设备计算获得的第二运算结果D2”进行异或运算,获得异或运算结果D3”。便于校验存储设备利用该异或运算结果D3”实现原检验数据P0的更新。Please refer to Figure 6, also quote and refer to the example in Figure 5. In order to reduce the number of data reads and writes and improve the efficiency of data processing, the RAID controller can first calculate the first storage device to obtain the first operation result D1" and the second storage The second operation result D2" calculated by the device is XORed to obtain the XOR operation result D3". It is convenient for the verification storage device to use the XOR operation result D3" to update the original inspection data P0.
具体的,在RAID控制器接收到第一存储设备发送的第一运算结果D1”和第二存储设备发送的第二运算结果D2”后,可对第一运算结果D1”以及第二运算结果D2”进行异或运算,获得异或运算结果D3”,并缓存至RAID控制器的第一地址中。进一步RAID控制器可向校验存储设备发送异或更新指令,该异或更新指令中携带有第一地址、原校验数据P0的LBA以及长度。相应地校验存储设备接收该异或更新指令,通过自身的存储控制器根据第三地址读取异或运算结果D3”,根据原校验数据P0的LBA以及长度读取原校验数据。进一步对异或运算结果D3”和原校验数据P0进行异或运算,获得新校验数据P0’。进而将该新校验数据P0’写入至原校验数据的LBA处,以利用新校验数据P0’更新原校验数据P0。Specifically, after the RAID controller receives the first operation result D1" sent by the first storage device and the second operation result D2" sent by the second storage device, it can compare the first operation result D1" and the second operation result D2. "Perform XOR operation to obtain XOR operation result D3" and cache it in the first address of the RAID controller. Further, the RAID controller can send an XOR update instruction to the check storage device, and the XOR update instruction carries The first address, the LBA and length of the original check data P0. The check storage device receives the XOR update instruction accordingly, reads the exclusive OR operation result D3" according to the third address through its own storage controller, and then reads the XOR operation result D3" according to the original check The LBA and length of data P0 read the original parity data. The XOR operation result D3" and the original check data P0 are further XORed to obtain new check data P0'. Then the new check data P0' is written to the LBA of the original check data to use the new check data. The verification data P0' updates the original verification data P0.
通过实施本申请实施例,能够将数据异或运算迁移到数据存储设备中执行,将校验异或运算迁移至校验存储设备中执行。相比于传统技术能够减少RAID控制器的计算资源和计算负荷。同时上述数据处理过程还减少了RAID控制器和存储设备之间的数据交换,进而减少数据交换过程中所占用的带宽,从而可有效提高数据处理的速率,提升数据处理的效率。By implementing the embodiments of the present application, the data exclusive OR operation can be migrated to the data storage device for execution, and the check exclusive OR operation can be migrated to the check storage device for execution. Compared with the traditional technology, the computing resources and computing load of the RAID controller can be reduced. At the same time, the above data processing process also reduces the data exchange between the RAID controller and the storage device, thereby reducing the bandwidth occupied during the data exchange process, thereby effectively increasing the data processing rate and improving the efficiency of data processing.
请参见图7,是本申请实施例提供的另一种数据处理方法的流程示意图。如图7所示的方法应用于图2所示的数据存储***中,所述方法包括如下实施步骤:Please refer to FIG. 7, which is a schematic flowchart of another data processing method provided by an embodiment of the present application. The method shown in FIG. 7 is applied to the data storage system shown in FIG. 2, and the method includes the following implementation steps:
S701、RAID控制器接收主机发送的写数据请求,该写数据请求用于请求用第二数据对已存储数据中的第一数据进行更新,即请求将第一数据更新为第二数据。该写数据请求中携带有第二数据、第二数据的LBA以及长度。S701. The RAID controller receives a data write request sent by the host, where the data write request is used to request to update the first data in the stored data with the second data, that is, request to update the first data to the second data. The write data request carries the second data, the LBA and the length of the second data.
可选地,该写数据请求也可携带第二数据对应存储于主机中的物理地址,便于RAID控制器根据该物理地址从主机中读取获得相应地待写数据。Optionally, the data write request may also carry the second data corresponding to the physical address stored in the host, so that the RAID controller can read the corresponding data to be written from the host according to the physical address.
S702、RAID控制器根据写数据请求,获得m个写数据子请求,该写数据子请求中携带有新数据、新数据的LBA以及长度。S702. The RAID controller obtains m data write sub-requests according to the data write request, and the data write sub-requests carry the new data, the LBA and the length of the new data.
该写数据请求具体用于请求用第二数据对已存储数据中的第一数据进行更新,该新数据为第二数据中的部分数据,m个新数据组成该第二数据,m为正整数。关于S701和S702的相关阐述,具体可参见前述S301和S302中的相关阐述,本申请下文以m=1,第一写数据子请求为例进行相关实施例的阐述。The write data request is specifically used to request the second data to update the first data in the stored data, the new data is part of the second data, m new data constitute the second data, and m is a positive integer . Regarding the relevant description of S701 and S702, please refer to the relevant description in the foregoing S301 and S302 for details. In the following, m=1, the first data write sub-request is used as an example to describe the relevant embodiments.
S703、RAID控制器判定当前是否处于RAID小写模式。S703. The RAID controller determines whether it is currently in the RAID lowercase mode.
RAID控制器在根据写数据请求生成异或写指令之前,需确定RAID控制器的工作模式,其具体可为RAID小写模式或者RAID大写模式。当RAID控制器确定到处于RAID小写模式时,可继续执行本申请实施流程;否则,结束流程。The RAID controller needs to determine the working mode of the RAID controller before generating the XOR write command according to the write data request, which can be the RAID lowercase mode or the RAID uppercase mode. When the RAID controller determines that it is in the RAID lowercase mode, it can continue to execute the implementation process of this application; otherwise, the process ends.
S704、RAID控制器根据第一写数据子请求,生成第一异或写指令,该第一异或写指令携带有第一新数据的物理地址、第一新数据的LBA以及第二地址,该第二地址用于存储第一异或写指令的运算结果。S704. The RAID controller generates a first XOR write instruction according to the first data write subrequest, where the first XOR write instruction carries the physical address of the first new data, the LBA of the first new data, and the second address. The second address is used to store the operation result of the first XOR write instruction.
RAID控制器根据写数据请求生成异或写指令,该异或写指令中携带有第一地址、第二数据的物理地址以及第二数据的逻辑地址,其中第一地址为RAID控制器中用于存储该异或写指令的运算结果的物理地址。本申请这里以第一写数据子请求对应生成第一异或写指令为例进行阐述。The RAID controller generates an XOR write instruction according to the write data request. The XOR write instruction carries the first address, the physical address of the second data, and the logical address of the second data. The first address is used in the RAID controller. Store the physical address of the operation result of the XOR write instruction. In this application, the first data write sub-request correspondingly generates the first XOR write instruction as an example for illustration.
S705、RAID控制器将第一异或写指令发送给第一存储设备,该第一存储设备为第一新数据的LBA对应所在的存储设备。相应地第一存储设备接收该第一异或写指令。S705. The RAID controller sends the first XOR write instruction to the first storage device, where the first storage device is the storage device where the LBA of the first new data corresponds. Correspondingly, the first storage device receives the first XOR write instruction.
S706、第一存储设备根据第一异或写指令中第一新数据的物理地址读取第一新数据,根据第一异或写指令中第一新数据的LBA,读取该LBA对应存储的第一旧数据,并利用该第一新数据更新第一旧数据。S706. The first storage device reads the first new data according to the physical address of the first new data in the first XOR write instruction, and reads the stored data corresponding to the LBA according to the LBA of the first new data in the first XOR write instruction. First old data, and update the first old data with the first new data.
S707、第一存储设备对第一新数据和第一旧数据进行异或运算,获得第一结果数据。第一存储设备将第一结果数据发送至RAID控制器中的第二地址存储。S707. The first storage device performs an exclusive OR operation on the first new data and the first old data to obtain first result data. The first storage device sends the first result data to the second address storage in the RAID controller.
S708、RAID控制器根据原校验数据的LBA以及长度,从该原校验数据的LBA对应所在的校验存储设备中读取原校验数据。S708. The RAID controller reads the original parity data from the parity storage device where the LBA of the original parity data corresponds to the LBA and length of the original parity data.
需要说明的是,本申请中S708和S704可以并行处理,即原校验数据的读取步骤和第一新数据的更新步骤可以并行处理,也可以串行处理。当进行串行处理时,它们的执行顺序并不做限定,例如RAID控制器可先生成异或写指令以实现第一新数据的更新,后读取原校验数据;或者,先读取原校验数据,后实现第一新数据的更新等,本申请不做限定。It should be noted that S708 and S704 in this application can be processed in parallel, that is, the reading step of the original check data and the updating step of the first new data can be processed in parallel or serially. When performing serial processing, their execution order is not limited. For example, the RAID controller can generate an exclusive OR write command to update the first new data, and then read the original parity data; or, read the original data first. After verifying the data, the first new data is updated, etc., which is not limited in this application.
S709、RAID控制器对原校验数据和异或写指令的运算结果(这里可为第一运算结果)进行异或运算,从而获得新校验数据,并将该新校验结果写入至原校验数据的LBA处,以对原校验数据进行更新。具体的,RAID控制器可向校验存储设备发送异或更新指令,该异或更新指令携带有新校验数据。相应地校验存储设备接收异或更新指令后,可将该新校验数据写入至原校验数据的LBA处,以利用新校验数据来更新原校验数据。S709. The RAID controller performs an exclusive OR operation on the original check data and the operation result of the XOR write instruction (here it may be the first operation result) to obtain new check data, and write the new check result to the original The LBA of the verification data is used to update the original verification data. Specifically, the RAID controller may send an exclusive OR update command to the check storage device, and the exclusive OR update command carries new check data. Correspondingly, after the verification storage device receives the XOR update instruction, the new verification data can be written to the LBA of the original verification data, so as to update the original verification data with the new verification data.
举例来说,请参见图8示出一种数据处理的操作示意图。假设主机根据实际需求对条带中存储的第一数据D1进行重写,假设利用第二数据D1’更新D1,该条带中存储有包括D1~D4的已存储数据数据。主机将生成写数据请求,并将该写数据请求发送给RAID控制器,该写数据请求中携带有第二数据(D1’)、D1’的LBA以及长度。该写数据请求用于请求用D1’对已存储数据中的D1进行更新。相应地RAID控制器根据该写数据请求,获知D1’大小不超过一个条带单元大小,无需对写数据请求进行拆分,该写数据请求即为第一写数据子请求。For example, refer to FIG. 8 for a schematic diagram of a data processing operation. Suppose that the host rewrites the first data D1 stored in the stripe according to actual requirements, and suppose that D1 is updated with the second data D1', and the stripe stores stored data including D1 to D4. The host will generate a write data request and send the write data request to the RAID controller. The write data request carries the second data (D1'), the LBA of D1', and the length. The write data request is used to request to use D1' to update D1 in the stored data. Correspondingly, the RAID controller learns that the size of D1' does not exceed the size of one stripe unit according to the write data request, and there is no need to split the write data request. The write data request is the first data write sub-request.
参考图8,RAID控制器接收该写数据请求后,可向第一存储设备发送异或写指令,该异或写指令中携带有D1’的存储地址、D1’的LBA、长度以及第一地址等信息。该D1’的存储地址为RAID控制器中存储D1’的地址。相应地,第一存储设备接收该异或写指令,通过存储控制器读取该D1’的LBA对应存储的旧数据D1,并将该D1’写入至第一存储设备中该D1’的LBA所在的存储介质中,以利用D1’来更新D1。进一步存储控制器可对读取的旧数据D1和新数据D1’进行异或运算,获得该异或写指令的运算结果,即第一运算结果D1”。进而可将该第一运算结果D1”发送至RAID控制器中的第一地址处存储。Referring to FIG. 8, after the RAID controller receives the write data request, it can send an exclusive OR write command to the first storage device. The exclusive OR write command carries the storage address of D1', the LBA of D1', the length, and the first address. And other information. The storage address of D1' is the address of D1' stored in the RAID controller. Correspondingly, the first storage device receives the XOR write instruction, reads the old data D1 stored corresponding to the LBA of D1' through the storage controller, and writes the D1' to the LBA of D1' in the first storage device. In the storage medium where it is located, use D1' to update D1. Further, the storage controller can perform an exclusive OR operation on the read old data D1 and the new data D1' to obtain the operation result of the exclusive OR write instruction, that is, the first operation result D1". The first operation result D1" can then be obtained. Send to the first address in the RAID controller for storage.
RAID控制器根据预存的原校验数据P0的LBA以及长度等信息,从该原校验数据的LBA所在的校验存储设备中读取该原校验数据P0。进一步RAID控制器可对原校验数据P0和第一运算结果D1”进行异或运算,从而获得新校验数据P0’。进而RAID控制器可利用新校验数据P0’更新原校验数据P0。The RAID controller reads the original parity data P0 from the parity storage device where the LBA of the original parity data P0 is located according to the prestored information such as the LBA and length of the original parity data P0. Further, the RAID controller can perform an exclusive OR operation on the original parity data P0 and the first operation result D1" to obtain new parity data P0'. Then the RAID controller can update the original parity data P0 with the new parity data P0' .
在实际应用中,第二数据中包括的新数据的数量m并不限于一个。当m大于或等于2时,为提升数据处理效率,可将m个新数据和m个旧数据各自进行异或运算的运算结果发送至RAID控制器中。RAID控制器再对m个运算结果进行异或运算,并基于该异或运算的运算结果来实现原校验数据的更新。其中,关于本申请实施例中未阐述或未描述的内容,具体可参见前述图3所述实施例中的相关阐述,这里不再赘述。In practical applications, the number m of new data included in the second data is not limited to one. When m is greater than or equal to 2, in order to improve the efficiency of data processing, the results of the exclusive OR operation of m new data and m old data can be sent to the RAID controller. The RAID controller then performs an exclusive OR operation on the m operation results, and realizes the update of the original check data based on the operation result of the exclusive OR operation. For the content that is not described or described in the embodiment of the present application, for details, please refer to the relevant description in the embodiment described in FIG. 3, which will not be repeated here.
通过实施本申请实施例,能够将数据异或运算迁移至数据存储设备中执行,将校验异或运算放在RAID控制器中执行。相比传统技术而言,同样减少RAID控制器的计算资源和计算负荷,同时减少了RAID控制器和存储设备之间的数据交换,提升了数据处理的效率。By implementing the embodiments of the present application, the data XOR operation can be migrated to the data storage device for execution, and the check XOR operation can be executed in the RAID controller. Compared with the traditional technology, it also reduces the computing resources and computing load of the RAID controller, reduces the data exchange between the RAID controller and the storage device, and improves the efficiency of data processing.
请参见图9,是本申请实施例提供的另一种数据处理方法的流程示意图。如图9所示的方法应用于图2所示的数据存储***中,所述方法包括如下实施步骤:Please refer to FIG. 9, which is a schematic flowchart of another data processing method provided by an embodiment of the present application. The method shown in FIG. 9 is applied to the data storage system shown in FIG. 2, and the method includes the following implementation steps:
S901、RAID控制器接收主机发送的写数据请求,该写数据请求用于请求将已存储数据中的第一数据更新为第二数据,该写数据请求中携带有第二数据、第二数据的LBA以及长度。可选地,该写数据请求中也可携带第二数据对应存储于主机中的物理地址,便于RAID控制器后续根据该物理地址从主机中读取获得该第二数据。S901. The RAID controller receives a write data request sent by the host, where the write data request is used to request to update the first data in the stored data to the second data, and the write data request carries the second data and the second data. LBA and length. Optionally, the data write request may also carry the second data corresponding to the physical address stored in the host, so that the RAID controller can subsequently read the second data from the host according to the physical address.
S902、RAID控制器根据写数据请求,获得m个写数据子请求,该写数据子请求中携带有新数据、新数据的LBA以及长度。该写数据子请求具体用于请求用该新数据对已存储数据中的旧数据进行更新,该新数据为第二数据中的部分数据,m个新数据组成该第二数据,m为正整数。关于步骤901和902的相关阐述,具体可参见前述步骤301和302中的相关阐述,本申请下文以m=1,第一写数据子请求为例进行相关实施例的阐述。S902. The RAID controller obtains m data write sub-requests according to the data write request, and the data write sub-request carries the new data, the LBA and the length of the new data. The data write sub-request is specifically used to request the new data to update the old data in the stored data, the new data is part of the second data, m new data constitute the second data, and m is a positive integer . For the relevant descriptions of steps 901 and 902, please refer to the relevant descriptions in the foregoing steps 301 and 302 for details. In this application, m=1, the first data write sub-request is used as an example to describe the relevant embodiments.
S903、RAID控制器判定当前是否处于RAID小写模式。S903. The RAID controller determines whether it is currently in the RAID lowercase mode.
RAID控制器可确定自身设备的工作模式,其具体可为RAID小写模式或者RAID大写模式。当RAID控制器确定到处于RAID小写模式时,可继续执行本申请实施流程;否则,结束流程。The RAID controller can determine the working mode of its own device, which can be a RAID lowercase mode or a RAID uppercase mode. When the RAID controller determines that it is in the RAID lowercase mode, it can continue to execute the implementation process of this application; otherwise, the process ends.
步骤904、RAID控制器根据第一写数据子请求,向第一存储设备发送读数据指令,所述读数据指令用于请求读取第一新数据的LBA处对应存储的第一旧数据。该读数据指令携带有第一新数据的LBA。可选地,该读数据指令还可携带第一新数据的长度等信息。该第一存储设备为第一新数据的LBA对应所在的存储设备。相应地,第一存储设备接收读数据指令。Step 904: The RAID controller sends a read data instruction to the first storage device according to the first data write subrequest, where the read data instruction is used to request to read the first old data stored in the LBA of the first new data. The read data instruction carries the LBA of the first new data. Optionally, the read data instruction may also carry information such as the length of the first new data. The first storage device is the storage device corresponding to the LBA of the first new data. Correspondingly, the first storage device receives a data read instruction.
S905、第一存储设备响应该读数据指令,读取第一新数据的LBA对应存储的第一旧数据,并将该第一旧数据发送至RAID控制器中存储。S905. In response to the read data instruction, the first storage device reads the first old data stored corresponding to the LBA of the first new data, and sends the first old data to the RAID controller for storage.
S906、RAID控制器根据第一写数据子请求,向第一存储设备发送写数据指令,该写数据指令用于指示将第一新数据存储至该第一新数据的LBA处。该写数据指令携 带有第一新数据的物理地址、第一新数据的LBA以及长度等信息。相应地,第一存储设备接收写数据指令。S906. The RAID controller sends a data write instruction to the first storage device according to the first data write sub-request, where the data write instruction is used to instruct to store the first new data to the LBA of the first new data. The write data command carries information such as the physical address of the first new data, the LBA of the first new data, and the length. Correspondingly, the first storage device receives the write data instruction.
S907、第一存储设备响应写数据指令,将第一新数据的物理地址处所存储的第一新数据写入至第一新数据的LBA处,以利用第一新数据更新第一旧数据。S907: In response to the write data instruction, the first storage device writes the first new data stored at the physical address of the first new data to the LBA of the first new data, so as to update the first old data with the first new data.
具体的,第一存储设备可根据第一新数据的物理地址读取第一新数据,然后将该第一新数据写入至第一新数据的LBA处,便于后续利用第一新数据更新第一旧数据,关于数据如何更新具体可参见前述实施例中的相关阐述。Specifically, the first storage device may read the first new data according to the physical address of the first new data, and then write the first new data to the LBA of the first new data, so as to facilitate the subsequent update of the first new data with the first new data. An old data. For details on how to update the data, please refer to the relevant description in the foregoing embodiment.
在实际应用中,S904-S907的替代实现方式也可为:RAID控制器可直接向存储设备发送异或写指令,该异或写指令类似写数据指令,携带有第一新数据的物理地址、第一新数据的LBA以及长度等信息。相应地第一存储设备可响应该第一异或写指令从第一新数据的物理地址处读取第一新数据,从第一新数据的LBA处读取第一旧数据,进而利用第一新数据来更新第一旧数据。In practical applications, the alternative implementation of S904-S907 can also be: the RAID controller can directly send an exclusive OR write command to the storage device. The exclusive OR write command is similar to a data write command and carries the physical address of the first new data, Information such as the LBA and length of the first new data. Correspondingly, the first storage device can respond to the first XOR write instruction to read the first new data from the physical address of the first new data, read the first old data from the LBA of the first new data, and then use the first New data to update the first old data.
S908、RAID控制器对第一新数据和第一旧数据进行异或运算,获得第一运算结果,并将该第一运算结果存储至RAID控制器中的第一地址处。S908. The RAID controller performs an exclusive OR operation on the first new data and the first old data to obtain a first operation result, and stores the first operation result at the first address in the RAID controller.
S909、RAID控制器向校验存储设备发送异或更新指令,该异或更新指令携带有第一地址、原校验数据的LBA以及长度。相应地,校验存储设备接收该异或更新指令。该校验存储设备为存储有原校验数据的存储设备。S909. The RAID controller sends an exclusive OR update instruction to the check storage device, where the exclusive OR update instruction carries the first address, the LBA of the original check data, and the length. Correspondingly, the verification storage device receives the exclusive OR update instruction. The verification storage device is a storage device storing original verification data.
S910、校验存储设备响应该异或更新指令,根据异或更新指令中原校验数据的LBA以及长度,读取原校验数据,根据第一地址获取第一运算结果。校验存储设备对原校验数据和第一运算结果进行异或运算,从而获得新校验数据。并利用新校验数据对原校验数据进行更新。其中,关于本申请实施例中未阐述或未描述的内容,具体可参见前述图3实施例中的相关阐述,这里不再赘述。S910. The check storage device responds to the XOR update instruction, reads the original check data according to the LBA and length of the original check data in the XOR update instruction, and obtains the first operation result according to the first address. The verification storage device performs an exclusive OR operation on the original verification data and the first calculation result, thereby obtaining new verification data. And use the new check data to update the original check data. For the content that is not described or described in the embodiment of the present application, for details, please refer to the relevant description in the embodiment of FIG. 3, which will not be repeated here.
举例来说,请参见图10示出另一种数据处理的操作示意图。假设主机根据实际需求对条带中存储的D1进行更新,假设利用D1’更新D1,该条带中存储有包括D1~D4的已存储数据。主机将生成写数据请求,并将该写数据请求发送给RAID控制器,该写数据请求中携带有第二数据(D1’)、D1’的LBA以及长度。该写数据请求用于请求用D1’对已存储数据中的D1进行更新。相应地RAID控制器根据该写数据请求,获知D1’大小不超过一个条带单元大小,无需对写数据请求进行拆分,该写数据请求即为第一写数据子请求。For example, refer to FIG. 10 for a schematic diagram of another data processing operation. Suppose that the host updates the D1 stored in the stripe according to actual needs, and suppose that D1' is used to update D1, and the stripe stores stored data including D1 to D4. The host will generate a write data request and send the write data request to the RAID controller. The write data request carries the second data (D1'), the LBA of D1', and the length. The write data request is used to request to use D1' to update D1 in the stored data. Correspondingly, the RAID controller learns that the size of D1' does not exceed the size of one stripe unit according to the write data request, and there is no need to split the write data request. The write data request is the first data write sub-request.
参见图10,RAID控制器接收该写数据请求后,可根据D1’的LBA以及长度,从第一存储设备中读取该D1’的LBA对应存储的旧数据D1。进一步RAID控制器可对新数据D1’和旧数据D1进行异或运算,获得第一运算结果D1”,并将该第一运算结果D1”发送至RAID控制器中的第一地址处存储。Referring to FIG. 10, after the RAID controller receives the data write request, it can read the old data D1 stored corresponding to the LBA of D1' from the first storage device according to the LBA and length of D1'. Further, the RAID controller may perform an exclusive OR operation on the new data D1' and the old data D1 to obtain the first operation result D1", and send the first operation result D1" to the first address in the RAID controller for storage.
进一步RAID控制器可向校验存储设备发送异或更新指令,该异或更新指令中携带有第一地址、原校验数据(P0)的LBA以及长度。相应地校验存储设备接收该异或更新指令,通过自身设备的存储控制器根据原校验数据的LBA以及长度,读取该LBA对应存储的原校验数据P0;根据第一地址读取第一运算结果D1”。进一步该存储控制器可对读取的原校验数据P0和第一运算结果D1”进行异或运算,从而获得新校验数据P0’。进一步可将该P0’写入至原校验数据的LBA处,以利用新校验数据P0’ 更新原校验数据P0。Further, the RAID controller may send an exclusive OR update instruction to the check storage device, and the exclusive OR update command carries the first address, the LBA of the original check data (P0), and the length. Correspondingly, the verification storage device receives the XOR update instruction, and reads the original verification data P0 corresponding to the LBA according to the LBA and length of the original verification data through the storage controller of the own device; An operation result D1". Further, the storage controller can perform an exclusive OR operation on the read original check data P0 and the first operation result D1" to obtain new check data P0'. Further, the P0' can be written into the LBA of the original check data to update the original check data P0 with the new check data P0'.
在实际应用中,第二数据中包括的新数据的数量m并不局限于一个。当m大于等于2时,同样可参考上文针对第一写数据子请求中第一新数据的更新原理,实现m个新数据的更新以及原校验数据的更新,本申请不做限定。In practical applications, the number m of new data included in the second data is not limited to one. When m is greater than or equal to 2, the update principle of the first new data in the first data write subrequest can also be referred to above to realize the update of m new data and the update of the original verification data, which is not limited in this application.
通过实施本申请实施例,能够将数据异或运算放在RAID控制器中执行,将校验异或运算迁移至校验存储设备中执行,相比传统技术方案能够减少RAID控制器的计算资源的占用,降低RAID控制器的负载。上述处理过程同样可以减少了RAID控制器和存储设备之间的数据交换,进而减少存储***内数据交换所占用的带宽,以及多次数据交换过程所导致的处理过程的时延,进一步提升了数据存储***中数据处理的效率,降低了数据处理的时延。By implementing the embodiments of the present application, the data XOR operation can be performed in the RAID controller, and the check XOR operation can be migrated to the check storage device for execution. Compared with the traditional technical solution, the computing resources of the RAID controller can be reduced. Occupy, reduce the load of the RAID controller. The above processing process can also reduce the data exchange between the RAID controller and the storage device, thereby reducing the bandwidth occupied by data exchange in the storage system, and the processing delay caused by multiple data exchange processes, and further improving the data The efficiency of data processing in the storage system reduces the time delay of data processing.
结合上文图1-图10所述实施例中的相关描述,下面介绍本申请适用的相关装置。请参见图11是本申请实施例提供的一种数据处理装置的结构示意图。如图11所示的数据处理装置11包括生成模块112、获取模块114以及通信模块116。其中,With reference to the related descriptions in the embodiments described in Figures 1 to 10 above, the following describes related devices applicable to this application. Refer to FIG. 11 for a schematic structural diagram of a data processing apparatus provided by an embodiment of the present application. The data processing device 11 shown in FIG. 11 includes a generating module 112, an acquiring module 114, and a communication module 116. among them,
所述生成模块112,用于根据写数据请求生成异或写指令,所述写数据请求用于请求将第一数据更新为第二数据,所述异或写指令用于获得所述第一数据和第二数据的异或运算结果;The generating module 112 is configured to generate an XOR write instruction according to a write data request, the write data request is used to request to update the first data to the second data, and the XOR write instruction is used to obtain the first data XOR operation result with the second data;
所述获取模块114,用于根据所述异或写指令获取所述异或写指令的运算结果;The obtaining module 114 is configured to obtain the operation result of the XOR write instruction according to the XOR write instruction;
所述通信模块116,用于向校验存储设备发送异或更新指令,所述校验存储设备用于存储所述第二数据的校验数据,所述校验存储设备为所述至少一个存储设备中的任意一个,所述异或更新指令用于指示所述校验存储设备将所述第一数据的校验数据更新为所述第二数据的校验数据,所述第二数据的校验数据为所述第一数据的校验数据和所述异或写指令的运算结果的异或运算结果。The communication module 116 is configured to send an exclusive OR update instruction to a check storage device, the check storage device is used to store check data of the second data, and the check storage device is the at least one storage device. In any one of the devices, the exclusive OR update instruction is used to instruct the verification storage device to update the verification data of the first data to the verification data of the second data, and the verification of the second data The verification data is an XOR operation result of the verification data of the first data and the operation result of the XOR write instruction.
具体实现时,获取模块114涉及的实现功能具体也可应用在图2中的异或加速单元241或者计算单元243中实现。图2中存储单元242涉及的存储功能同样也可应用在本申请实施例中,即本申请图11所示的数据处理装置中同样可包括存储模块(图未示),用于存储数据处理装置中涉及的数据,例如存储异或写指令的运算结果等。During specific implementation, the implementation functions involved in the acquisition module 114 can also be implemented in the XOR acceleration unit 241 or the calculation unit 243 in FIG. 2. The storage function involved in the storage unit 242 in FIG. 2 can also be applied to the embodiments of the present application, that is, the data processing device shown in FIG. 11 of the present application may also include a storage module (not shown) for storing the data processing device The data involved in the storage, such as storing the operation result of the XOR write instruction, etc.
可选的,所述异或写指令中携带第一地址、所述第二数据的物理地址和所述第二数据的逻辑地址,所述第一地址为RAID控制器(本申请的数据处理装置)中用于存储所述异或写指令的运算结果的物理地址,所述第二数据的物理地址为所述第二数据在所述RAID控制器中存储所用的物理地址,所述第二数据的逻辑地址为所述第二数据在数据存储设备中存储所用的逻辑地址,所述数据存储设备为所述至少一个存储设备中的设备。所述通信模块116具体用于向所述数据存储设备发送所述异或写指令,使得所述数据存储设备根据所述异或写指令读取所述第二数据的物理地址所存储的所述第二数据和所述第二数据的逻辑地址中已存储的所述第一数据,并对所述第一数据和所述第二数据进行异或运算获得所述异或写指令的运算结果,以将所述异或写指令的运算结果发送至所述RAID控制器的所述第一地址存储;所述通信模块116还用于接收所述数据存储设备发送的所述异或写指令的运算结果,并将所述异或写指令的运算结果存储至所述第一地址。Optionally, the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, and the first address is a RAID controller (the data processing device of this application) ) Is used to store the physical address of the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, and the second data The logical address of is a logical address used for storing the second data in a data storage device, and the data storage device is a device in the at least one storage device. The communication module 116 is specifically configured to send the XOR write instruction to the data storage device, so that the data storage device reads the data stored in the physical address of the second data according to the XOR write instruction. The first data stored in the logical addresses of the second data and the second data, and perform an exclusive OR operation on the first data and the second data to obtain the operation result of the exclusive OR write instruction, The operation result of the XOR write instruction is sent to the first address of the RAID controller for storage; the communication module 116 is also used to receive the operation of the XOR write instruction sent by the data storage device As a result, the operation result of the XOR write instruction is stored in the first address.
可选的,所述第一数据包括第一旧数据和第二旧数据在内的至少两个旧数据,所述第二数据包括第一新数据和第二新数据在内的至少两个新数据,则所述异或写指令至少包括第一异或写指令和第二异或写指令,所述第一异或写指令中携带第二地址、所述第一新数据的物理地址和所述第一新数据的逻辑地址,所述第二异或写指令中携带第三地址、所述第二新数据的物理地址和所述第二新数据的逻辑地址,所述数据存储设备包括第一存储设备和第二存储设备在内的至少两个设备,所述通信模块116还用于向所述第一存储设备发送所述第一异或写指令,使得所述第一存储设备根据所述第一异或写指令读取所述第一新数据的物理地址所存储的所述第一新数据和所述第一新数据的逻辑地址中已存储的所述第一旧数据,并对所述第一新数据和所述第一旧数据进行异或运算获得第一运算结果,以将所述第一运算结果发送至所述RAID控制器的所述第二地址存储;所述通信模块116还用于向所述第二存储设备发送所述第二异或写指令,使得所述第二存储设备根据所述第二异或写指令读取所述第二新数据的物理地址所存储的所述第二新数据和所述第二新数据的逻辑地址中已存储的所述第二旧数据,并对所述第二新数据和所述第二旧数据进行异或运算获得第二运算结果,以将所述第二运算结果发送至所述RAID控制器的所述第三地址存储。Optionally, the first data includes at least two old data including first old data and second old data, and the second data includes at least two new data including first new data and second new data , The XOR write instruction includes at least a first XOR write instruction and a second XOR write instruction, and the first XOR write instruction carries a second address, the physical address of the first new data, and the The logical address of the first new data, the second XOR write instruction carries a third address, the physical address of the second new data, and the logical address of the second new data, and the data storage device includes a first At least two devices including a storage device and a second storage device, the communication module 116 is further configured to send the first XOR write instruction to the first storage device, so that the first storage device is based on the The first XOR write instruction reads the first new data stored in the physical address of the first new data and the first old data stored in the logical address of the first new data, and compares all The first new data and the first old data are XORed to obtain a first calculation result, so as to send the first calculation result to the second address storage of the RAID controller; the communication module 116 It is also used to send the second XOR write instruction to the second storage device, so that the second storage device reads the data stored in the physical address of the second new data according to the second XOR write instruction. The second old data stored in the logical addresses of the second new data and the second new data, and perform an exclusive OR operation on the second new data and the second old data to obtain a second operation As a result, the second operation result is sent to the third address of the RAID controller for storage.
可选的,所述异或写指令的运算结果包括所述第一运算结果和所述第二运算结果;或者,所述异或写指令的运算结果为所述第一运算结果和所述第二运算结果的异或运算结果。Optionally, the operation result of the XOR write instruction includes the first operation result and the second operation result; or, the operation result of the XOR write instruction is the first operation result and the first operation result. 2. The exclusive OR operation result of the operation result.
可选的,所述异或写指令中携带第一地址、所述第二数据的物理地址和所述第二数据的逻辑地址,所述第一地址为所述RAID控制器中用于存储所述异或写指令的运算结果的物理地址,所述第二数据的物理地址为所述第二数据在所述RAID控制器中存储所用的物理地址,所述第二数据的逻辑地址为所述第二数据在数据存储设备中存储所用的逻辑地址,所述第二数据的逻辑地址和所述第一数据的逻辑地址相同,所述数据存储设备为所述至少一个存储设备中的设备;所述获取模块114用于根据所述异或写指令,读取所述第二数据的逻辑地址中已存储的所述第一数据和所述第二数据的物理地址中所存储的所述第二数据;所述获取模块114还用于对所述第一数据和所述第二数据进行异或运算,以获得所述异或写指令的运算结果。Optionally, the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, and the first address is used for storing all data in the RAID controller. The physical address of the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, and the logical address of the second data is the The logical address used for storing the second data in a data storage device, the logical address of the second data is the same as the logical address of the first data, and the data storage device is a device in the at least one storage device; The acquiring module 114 is configured to read the first data stored in the logical address of the second data and the second data stored in the physical address of the second data according to the XOR write instruction. Data; the acquisition module 114 is also used to perform an XOR operation on the first data and the second data to obtain the operation result of the XOR write instruction.
可选的,所述异或更新指令中携带所述第一地址以及第四地址,所述第四地址为所述校验存储设备中用于存储所述第一数据的校验数据的逻辑地址;所述通信模块116用于向所述校验存储设备发送所述异或更新指令,使得所述校验存储设备根据所述异或更新指令读取所述第一地址所存储的所述异或写指令的运算结果和所述第四地址所存储的所述第一数据的校验数据,并对所述异或写指令的运算结果和所述第一数据的校验数据进行异或运算获得所述第二数据的校验数据,以将所述第一数据的校验数据更新为所述第二数据的校验数据。Optionally, the exclusive OR update instruction carries the first address and a fourth address, and the fourth address is a logical address used to store the verification data of the first data in the verification storage device The communication module 116 is configured to send the XOR update instruction to the verification storage device so that the verification storage device reads the XOR stored in the first address according to the XOR update instruction Or the operation result of the write instruction and the check data of the first data stored in the fourth address, and perform an exclusive OR operation on the operation result of the XOR write instruction and the check data of the first data The check data of the second data is obtained to update the check data of the first data to the check data of the second data.
可选的,所述异或更新指令中携带所述第二数据的校验数据;所述获取模块114还用于获取所述校验存储设备中存储的所述第一数据的校验数据;对所述异或写指令的运算结果和所述第一数据的校验数据进行异或运算,以获得所述第二数据的校验数据。Optionally, the exclusive OR update instruction carries the check data of the second data; the obtaining module 114 is further configured to obtain the check data of the first data stored in the check storage device; Perform an exclusive OR operation on the operation result of the exclusive OR write instruction and the check data of the first data to obtain the check data of the second data.
可选的,所述写数据请求用于请求用所述第二数据对存储数据中的第一数据进行 更新,所述数据处理装置还包括确定模块118。所述确定模块118用于确定所述第二数据的大小和存储所述第二数据所用的条带的大小之间的比值小于或等于预设阈值;或者,所述确定模块118用于确定第一读写次数小于或等于第二读写次数,其中所述第一读写次数为所述RAID控制器在实现对所述第一数据、所述第二数据和所述第一数据的校验数据的异或运算结果进行存储时所需的读写次数,所述第二读写次数为所述RAID控制器在实现对所述第二数据和所述存储数据中除所述第一数据之外的数据的异或运算结果进行存储时所需的读写次数。Optionally, the write data request is used to request to update the first data in the stored data with the second data, and the data processing apparatus further includes a determining module 118. The determining module 118 is configured to determine that the ratio between the size of the second data and the size of the strip used to store the second data is less than or equal to a preset threshold; or, the determining module 118 is configured to determine A number of reads and writes is less than or equal to a second number of reads and writes, where the first read and write number is the verification of the first data, the second data, and the first data by the RAID controller. The number of reads and writes required for storing the XOR operation result of the data, and the second read and write number is the number of times the RAID controller divides the first data from the second data and the stored data. The number of reads and writes required to store the XOR operation result of the external data.
在实际应用中,本申请实施例的装置11可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现,当由软件实现时,装置11以及装置中的各个模块的功能也都可以是软件模块。In practical applications, the device 11 of the embodiment of the present application can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The above-mentioned PLD can be a complex program logic device. (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof. It can also be implemented by software. When implemented by software, the device 11 and the functions of each module in the device can also be software modules.
通过实施本申请实施例,能够将数据异或运算和/或校验异或运算迁移至存储设备中执行,相比于传统技术均在RAID控制器中执行而言,能够降低RAID控制器的资源开销以及计算负荷。上述数据处理过程同样可以减小RAID控制器和存储设备之间的数据交换,进而减少数据交换所占的带宽和时延,从而提升了数据处理的效率。By implementing the embodiments of the present application, data XOR operations and/or check XOR operations can be migrated to storage devices for execution. Compared with traditional technologies that are executed in RAID controllers, the resources of the RAID controller can be reduced. Cost and computational load. The above data processing process can also reduce the data exchange between the RAID controller and the storage device, thereby reducing the bandwidth and time delay occupied by the data exchange, thereby improving the efficiency of data processing.
请参见图12是本申请实施例提供的一种数据存储***,该数据存储***12中包括RAID控制器122和至少一个存储设备。该至少一个存储设备中包括有校验存储设备124和数据存储设备126,该数据存储设备和校验存储设备的数量并不做限定。数据存储设备为用于存储数据写请求中待写入存储设备的数据,校验存储设备用于存储校验数据。对于同一个存储设备而言,即可以作为数据存储设备,也可以作为校验存储设备。具体实施例时,也可以利用独立的存储设备作为校验设备或数据设备,本发明对此并不做限定。本申请图示分别以互不相同的一个校验存储设备124和一个数据存储设备126为例示出。Please refer to FIG. 12 for a data storage system provided by an embodiment of the present application. The data storage system 12 includes a RAID controller 122 and at least one storage device. The at least one storage device includes a verification storage device 124 and a data storage device 126, and the number of the data storage device and verification storage device is not limited. The data storage device is used to store the data to be written into the storage device in the data write request, and the verification storage device is used to store the verification data. For the same storage device, it can be used as a data storage device or as a verification storage device. In a specific embodiment, an independent storage device can also be used as a verification device or a data device, which is not limited in the present invention. The illustrations in this application respectively take a verification storage device 124 and a data storage device 126 that are different from each other as examples.
如图12所示,RAID控制器122包括一个或多个处理器1221、通信接口1222和存储器1223,处理器1221、通信接口1222和存储器1223可通过总线方式连接,也可通过无线传输等其他手段实现通信。本申请实施例以通过总线1224连接为例其中,该存储器1223用于存储指令,该处理器1221用于执行该存储器1223存储的指令。该存储器1223存储程序代码,且处理器1221可以调用存储器1223中存储的程序代码执行以下操作:As shown in FIG. 12, the RAID controller 122 includes one or more processors 1221, a communication interface 1222, and a memory 1223. The processor 1221, the communication interface 1222, and the memory 1223 can be connected by a bus or by other means such as wireless transmission. Realize communication. The embodiment of the present application takes the connection through the bus 1224 as an example, where the memory 1223 is used to store instructions, and the processor 1221 is used to execute instructions stored in the memory 1223. The memory 1223 stores program codes, and the processor 1221 can call the program codes stored in the memory 1223 to perform the following operations:
根据写数据请求生成异或写指令,所述写数据请求用于请求将第一数据更新为第二数据,所述异或写指令用于获得所述第一数据和第二数据的异或运算结果;Generate an XOR write instruction according to a write data request, the write data request is used to request to update the first data to the second data, and the XOR write instruction is used to obtain the XOR operation of the first data and the second data result;
根据所述异或写指令获取所述异或写指令的运算结果;Obtaining the operation result of the exclusive OR write instruction according to the exclusive OR write instruction;
向校验存储设备发送异或更新指令,所述校验存储设备用于存储所述第二数据的校验数据,所述校验存储设备为所述至少一个存储设备中的任意一个,所述异或更新指令用于指示所述校验存储设备将所述第一数据的校验数据更新为所述第二数据的校验数据,所述第二数据的校验数据为所述第一数据的校验数据和所述异或写指令的运算结果的异或运算结果。Send an exclusive OR update instruction to a check storage device, the check storage device is used to store the check data of the second data, the check storage device is any one of the at least one storage device, the The exclusive OR update instruction is used to instruct the check storage device to update the check data of the first data to the check data of the second data, and the check data of the second data is the first data The XOR operation result of the check data of the XOR and the operation result of the XOR write instruction.
如图所示的校验存储设备124包括一个或多个处理器1241、通信接口1242和存储器1243,处理器1241、通信接口1242和存储器1243可通过总线方式连接,也可通过无线传输等其他手段实现通信。本申请实施例以通过总线1244连接为例其中,该存储器1243用于存储指令,该处理器1241用于执行该存储器1243存储的指令。该存储器1243存储程序代码,且处理器1241可以调用存储器1243中存储的程序代码执行以下操作:The verification storage device 124 as shown in the figure includes one or more processors 1241, a communication interface 1242, and a memory 1243. The processor 1241, the communication interface 1242 and the memory 1243 can be connected via a bus or other means such as wireless transmission. Realize communication. The embodiment of the present application takes the connection via the bus 1244 as an example, where the memory 1243 is used to store instructions, and the processor 1241 is used to execute instructions stored in the memory 1243. The memory 1243 stores program codes, and the processor 1241 can call the program codes stored in the memory 1243 to perform the following operations:
接收RAID控制器发送的异或更新指令;Receive the exclusive OR update command sent by the RAID controller;
根据所述异或更新指令的指示,将第一数据的校验数据更新为第二数据的校验数据,所述第二数据的校验数据为所述第一数据的校验数据和所述异或写指令的运算结果的异或运算结果。According to the instruction of the exclusive OR update instruction, the check data of the first data is updated to the check data of the second data, and the check data of the second data is the check data of the first data and the check data of the second data. XOR The XOR operation result of the operation result of the write instruction.
如图所示的数据存储设备126包括一个或多个处理器1261、通信接口1262和存储器1263,处理器1261、通信接口1262和存储器1263可通过总线方式连接,也可通过无线传输等其他手段实现通信。本申请实施例以通过总线1264连接为例其中,该存储器1263用于存储指令,该处理器1261用于执行该存储器1263存储的指令。该存储器1263存储程序代码,且处理器1261可以调用存储器1263中存储的程序代码执行以下操作:The data storage device 126 as shown in the figure includes one or more processors 1261, a communication interface 1262, and a memory 1263. The processor 1261, the communication interface 1262 and the memory 1263 can be connected via a bus or can be implemented by other means such as wireless transmission. Communication. The embodiment of the present application takes the connection via the bus 1264 as an example, where the memory 1263 is used to store instructions, and the processor 1261 is used to execute instructions stored in the memory 1263. The memory 1263 stores program codes, and the processor 1261 can call the program codes stored in the memory 1263 to perform the following operations:
接收RAID控制器发送的异或写指令,所述异或写指令中携带第一地址、所述第二数据的物理地址和所述第二数据的逻辑地址,所述第一地址为所述RAID控制器中用于存储所述异或写指令的运算结果的物理地址,所述第二数据的物理地址为所述第二数据在所述RAID控制器中存储所用的物理地址,所述第二数据的逻辑地址为所述第二数据在数据存储设备中存储所用的逻辑地址,所述数据存储设备为所述至少一个存储设备中的设备;Receive an XOR write instruction sent by a RAID controller, where the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, where the first address is the RAID The physical address used in the controller to store the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, and the second The logical address of the data is a logical address used for storing the second data in a data storage device, and the data storage device is a device in the at least one storage device;
根据所述异或写指令读取所述第二数据的物理地址所存储的所述第二数据和所述第二数据的逻辑地址中已存储的所述第一数据,并对所述第一数据和所述第二数据进行异或运算获得所述异或写指令的运算结果,以将所述异或写指令的运算结果发送至所述RAID控制器的所述第一地址存储。Read the second data stored in the physical address of the second data and the first data stored in the logical address of the second data according to the XOR write instruction, and compare the data to the first data The data and the second data are XORed to obtain the operation result of the XOR write instruction, so as to send the operation result of the XOR write instruction to the first address of the RAID controller for storage.
其中,在实际应用中本申请涉及的数据存储设备和校验存储设备均为图2所示的数据存储***中至少一个存储设备中的任意设备,它们可以相同,也可不相同。关于本申请未示出或未阐述的内容可具体参见前述图2-图11所示实施例中的相关阐述,这里不再赘述。Wherein, in practical applications, the data storage device and the verification storage device involved in the present application are all devices in at least one storage device in the data storage system shown in FIG. 2, and they may be the same or different. For the content not shown or explained in this application, please refer to the relevant explanations in the aforementioned embodiments shown in FIG. 2 to FIG. 11, which will not be repeated here.
应理解的,处理器(具体可为处理器1221、1241、或1261)可以由一个或者多个通用处理器构成,例如中央处理器(Central Processing Unit,CPU)。处理器可用于运行相关的程序代码中以执行相应操作,实现相关功能模块的功能。示例性地,处理器1221可运行相关的程序代码实现如图11或图2所示的功能模块或单元,具体的图11所示的生成模块、获取模块、通信模块以及确定模块,图2所示的异或加速单元以及计算单元等等。关于这里提及的各个功能模块或单元具体可参见前述实施例中的相关阐述,这里不再赘述。It should be understood that the processor (specifically, the processor 1221, 1241, or 1261) may be composed of one or more general-purpose processors, such as a central processing unit (CPU). The processor can be used to run related program codes to perform corresponding operations and realize the functions of related functional modules. Exemplarily, the processor 1221 may run related program codes to implement the functional modules or units shown in FIG. 11 or FIG. 2, specifically the generation module, acquisition module, communication module, and determination module shown in FIG. 11, as shown in FIG. The XOR acceleration unit and calculation unit are shown. For details of each functional module or unit mentioned here, reference may be made to the relevant description in the foregoing embodiment, which is not repeated here.
通信接口(具体可为通信接口1222、1242或者1262),可以为内部接口(例如高速串行计算机扩展总线(Peripheral Component Interconnect express,PCIe)总线接口)、 有线接口(例如以太网接口)或无线接口(例如蜂窝网络接口或使用无线局域网接口),用于与其他模块/设备进行通信。例如,本申请实施例中通信接口1222具体可用于接收数据存储设备发送的异或写指令的运算结果等。Communication interface (specifically, communication interface 1222, 1242 or 1262), which can be internal interface (such as high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), wired interface (such as Ethernet interface) or wireless interface (For example, cellular network interface or wireless LAN interface), used to communicate with other modules/devices. For example, the communication interface 1222 in the embodiment of the present application may be specifically used to receive the operation result of the XOR write instruction sent by the data storage device.
存储器(具体可为存储器1223、1243或者1263)可以包括易失性存储器(Volatile Memory),例如随机存取存储器(Random Access Memory,RAM);存储器也可以包括非易失性存储器(Non-Volatile Memory),例如只读存储器(Read-Only Memory,ROM)、快闪存储器(Flash Memory)、硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);存储器503还可以包括上述种类的存储器的组合。存储器可用于存储一组程序代码,以便于处理器调用该存储器中存储的程序代码以执行相应地操作步骤。The memory (specifically, the memory 1223, 1243, or 1263) may include volatile memory (Volatile Memory), such as random access memory (Random Access Memory, RAM); the memory may also include non-volatile memory (Non-Volatile Memory). ), such as Read-Only Memory (ROM), Flash Memory (Flash Memory), Hard Disk Drive (HDD), or Solid-State Drive (SSD); memory 503 may also include the above types The combination of memory. The memory can be used to store a set of program codes, so that the processor can call the program codes stored in the memory to execute corresponding operation steps.
需要说明的,图12仅仅是本申请实施例的一种可能的实现方式,图12所述存储***可以对应图2所述存储***,也可以是其他RAID控制器和存储设备的组合。实际应用中,数据存储***中涉及的各设备还可以包括更多或更少的部件,这里不作限制。关于本申请实施例中未示出或未描述的内容,可参见前述图1-图11所述实施例中的相关阐述,这里不再赘述。It should be noted that FIG. 12 is only a possible implementation of the embodiment of the present application. The storage system in FIG. 12 may correspond to the storage system in FIG. 2, or may be a combination of other RAID controllers and storage devices. In actual applications, each device involved in the data storage system may also include more or fewer components, which is not limited here. Regarding the content that is not shown or described in the embodiments of the present application, please refer to the relevant descriptions in the embodiments described in FIG. 1 to FIG. 11, which will not be repeated here.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在处理器上运行时,图3、图7或图9所示的方法流程得以实现。An embodiment of the present application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, and when it runs on a processor, the method flow shown in FIG. 3, FIG. 7 or FIG. 9 can be implemented .
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在处理器上运行时,图3、图7或图9所示的方法流程得以实现。The embodiment of the present application also provides a computer program product. When the computer program product runs on a processor, the method flow shown in FIG. 3, FIG. 7 or FIG. 9 is realized.
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。The foregoing embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above-mentioned embodiments may be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer 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 instructions may be transmitted from a website, computer, server, or data center. Transmission to another website site, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). 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 or a data center that includes one or more sets of available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium may be a solid state drive (SSD).
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in the present invention. Modifications or replacements, these modifications or replacements should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (17)

  1. 一种数据处理的方法,其特征在于,所述方法应用于数据存储***,所述数据存储***包括独立硬盘冗余阵列RAID控制器和至少一个存储设备,所述方法包括:A data processing method, characterized in that the method is applied to a data storage system, the data storage system includes a redundant array of independent hard disks RAID controller and at least one storage device, and the method includes:
    所述RAID控制器根据写数据请求生成异或写指令,所述写数据请求用于请求将第一数据更新为第二数据,所述异或写指令用于获得所述第一数据和第二数据的异或运算结果;The RAID controller generates an XOR write instruction according to a write data request, the write data request is used to request to update the first data to the second data, and the XOR write instruction is used to obtain the first data and the second data. XOR operation result of data;
    所述RAID控制器根据所述异或写指令获取所述异或写指令的运算结果;Obtaining, by the RAID controller, an operation result of the exclusive OR write instruction according to the exclusive OR write instruction;
    所述RAID控制器向校验存储设备发送异或更新指令,所述校验存储设备用于存储所述第二数据的校验数据,所述校验存储设备为所述至少一个存储设备中的任意一个,所述异或更新指令用于指示所述校验存储设备将所述第一数据的校验数据更新为所述第二数据的校验数据,所述第二数据的校验数据为所述第一数据的校验数据和所述异或写指令的运算结果的异或运算结果。The RAID controller sends an exclusive OR update instruction to a parity storage device, where the parity storage device is used to store parity data of the second data, and the parity storage device is one of the at least one storage device In any one, the exclusive OR update instruction is used to instruct the check storage device to update the check data of the first data to the check data of the second data, and the check data of the second data is The exclusive OR operation result of the check data of the first data and the operation result of the exclusive OR write instruction.
  2. 根据权利要求1所述方法,其特征在于,所述异或写指令中携带第一地址、所述第二数据的物理地址和所述第二数据的逻辑地址,所述第一地址为所述RAID控制器中用于存储所述异或写指令的运算结果的物理地址,所述第二数据的物理地址为所述第二数据在所述RAID控制器中存储所用的物理地址,所述第二数据的逻辑地址为所述第二数据在数据存储设备中存储所用的逻辑地址,所述数据存储设备为所述至少一个存储设备中的设备;则所述RAID控制器根据所述异或写指令获取所述异或写指令的运算结果,包括:The method according to claim 1, wherein the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, and the first address is the The physical address in the RAID controller used to store the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, the first The logical address of the second data is the logical address used for storing the second data in a data storage device, and the data storage device is a device in the at least one storage device; then the RAID controller writes according to the XOR The instruction to obtain the operation result of the XOR write instruction includes:
    所述RAID控制器向所述数据存储设备发送所述异或写指令,使得所述数据存储设备根据所述异或写指令读取所述第二数据的物理地址所存储的所述第二数据和所述第二数据的逻辑地址中已存储的所述第一数据,并对所述第一数据和所述第二数据进行异或运算获得所述异或写指令的运算结果,以将所述异或写指令的运算结果发送至所述RAID控制器的所述第一地址存储;The RAID controller sends the XOR write instruction to the data storage device, so that the data storage device reads the second data stored in the physical address of the second data according to the XOR write instruction And the first data stored in the logical address of the second data, and perform an XOR operation on the first data and the second data to obtain the operation result of the XOR write instruction, so as The operation result of the exclusive OR write instruction is sent to the first address of the RAID controller for storage;
    所述RAID控制器接收所述数据存储设备发送的所述异或写指令的运算结果,并将所述异或写指令的运算结果存储至所述第一地址。The RAID controller receives the operation result of the XOR write instruction sent by the data storage device, and stores the operation result of the XOR write instruction to the first address.
  3. 根据权利要求2所述方法,其特征在于,所述第一数据包括第一旧数据和第二旧数据在内的至少两个旧数据,所述第二数据包括第一新数据和第二新数据在内的至少两个新数据,则所述异或写指令至少包括第一异或写指令和第二异或写指令,所述第一异或写指令中携带第二地址、所述第一新数据的物理地址和所述第一新数据的逻辑地址,所述第二异或写指令中携带第三地址、所述第二新数据的物理地址和所述第二新数据的逻辑地址,所述数据存储设备包括第一存储设备和第二存储设备在内的至少两个设备;则所述RAID控制器根据所述异或写指令获取所述异或写指令的运算结果,包括:The method according to claim 2, wherein the first data includes at least two old data including first old data and second old data, and the second data includes first new data and second new data At least two new data in the data, the XOR write instruction includes at least a first XOR write instruction and a second XOR write instruction, and the first XOR write instruction carries a second address, the first The physical address of the new data and the logical address of the first new data, the second XOR write instruction carries a third address, the physical address of the second new data, and the logical address of the second new data, The data storage device includes at least two devices including a first storage device and a second storage device; then the RAID controller acquiring the operation result of the XOR write instruction according to the XOR write instruction includes:
    所述RAID控制器向所述第一存储设备发送所述第一异或写指令,使得所述第一存储设备根据所述第一异或写指令读取所述第一新数据的物理地址所存储的所述第一新数据和所述第一新数据的逻辑地址中已存储的所述第一旧数据,并对所述第一新数 据和所述第一旧数据进行异或运算获得第一运算结果,以将所述第一运算结果发送至所述RAID控制器的所述第二地址存储;The RAID controller sends the first XOR write instruction to the first storage device, so that the first storage device reads the physical address of the first new data according to the first XOR write instruction. The first old data stored in the logical addresses of the first new data and the first new data are stored, and the first new data and the first old data are XORed to obtain the first An operation result, to send the first operation result to the second address of the RAID controller for storage;
    所述RAID控制器向所述第二存储设备发送所述第二异或写指令,使得所述第二存储设备根据所述第二异或写指令读取所述第二新数据的物理地址所存储的所述第二新数据和所述第二新数据的逻辑地址中已存储的所述第二旧数据,并对所述第二新数据和所述第二旧数据进行异或运算获得第二运算结果,以将所述第二运算结果发送至所述RAID控制器的所述第三地址存储。The RAID controller sends the second XOR write instruction to the second storage device, so that the second storage device reads the physical address of the second new data according to the second XOR write instruction. The second old data stored in the logical addresses of the stored second new data and the second new data, and the second new data and the second old data are XORed to obtain the first A second operation result to send the second operation result to the third address of the RAID controller for storage.
  4. 根据权利要求3所述的方法,其特征在于,所述异或写指令的运算结果包括所述第一运算结果和所述第二运算结果;或者,所述异或写指令的运算结果为所述第一运算结果和所述第二运算结果的异或运算结果。The method according to claim 3, wherein the operation result of the XOR write instruction includes the first operation result and the second operation result; or, the operation result of the XOR write instruction is the The exclusive OR operation result of the first operation result and the second operation result.
  5. 根据权利要求1所述的方法,其特征在于,所述异或写指令中携带第一地址、所述第二数据的物理地址和所述第二数据的逻辑地址,所述第一地址为所述RAID控制器中用于存储所述异或写指令的运算结果的物理地址,所述第二数据的物理地址为所述第二数据在所述RAID控制器中存储所用的物理地址,所述第二数据的逻辑地址为所述第二数据在数据存储设备中存储所用的逻辑地址,所述第二数据的逻辑地址和所述第一数据的逻辑地址相同,所述数据存储设备为所述至少一个存储设备中的设备;则所述RAID控制器根据所述异或写指令获取所述异或写指令的运算结果,包括:The method according to claim 1, wherein the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, and the first address is The physical address in the RAID controller used to store the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, the The logical address of the second data is the logical address used for storing the second data in the data storage device, the logical address of the second data is the same as the logical address of the first data, and the data storage device is the A device in at least one storage device; then the RAID controller acquiring the operation result of the XOR write instruction according to the XOR write instruction includes:
    所述RAID控制器根据所述异或写指令,读取所述第二数据的逻辑地址中已存储的所述第一数据和所述第二数据的物理地址中所存储的所述第二数据;The RAID controller reads the first data stored in the logical address of the second data and the second data stored in the physical address of the second data according to the XOR write instruction ;
    所述RAID控制器对所述第一数据和所述第二数据进行异或运算,以获得所述异或写指令的运算结果。The RAID controller performs an XOR operation on the first data and the second data to obtain the operation result of the XOR write instruction.
  6. 根据权利要求2-5中任一项所述的方法,其特征在于,所述异或更新指令中携带所述第一地址以及第四地址,所述第四地址为所述校验存储设备中用于存储所述第一数据的校验数据的逻辑地址;The method according to any one of claims 2-5, wherein the exclusive-or update instruction carries the first address and a fourth address, and the fourth address is in the verification storage device A logical address used to store the verification data of the first data;
    所述RAID控制器向所述校验存储设备发送所述异或更新指令,使得所述校验存储设备根据所述异或更新指令读取所述第一地址所存储的所述异或写指令的运算结果和所述第四地址所存储的所述第一数据的校验数据,并对所述异或写指令的运算结果和所述第一数据的校验数据进行异或运算获得所述第二数据的校验数据,以将所述第一数据的校验数据更新为所述第二数据的校验数据。The RAID controller sends the XOR update instruction to the check storage device, so that the check storage device reads the XOR write instruction stored in the first address according to the XOR update instruction The result of the operation and the check data of the first data stored in the fourth address, and the operation result of the XOR write instruction and the check data of the first data are XORed to obtain the The check data of the second data to update the check data of the first data to the check data of the second data.
  7. 根据权利要求2-4中任一项所述的方法,其特征在于,所述异或更新指令中携带所述第二数据的校验数据;所述RAID控制器向校验存储设备发送异或更新指令之前,所述方法还包括:The method according to any one of claims 2-4, wherein the exclusive OR update instruction carries the check data of the second data; the RAID controller sends an exclusive OR to a check storage device Before updating the instruction, the method further includes:
    所述RAID控制器获取所述校验存储设备中存储的所述第一数据的校验数据;Acquiring, by the RAID controller, the verification data of the first data stored in the verification storage device;
    所述RAID控制器对所述异或写指令的运算结果和所述第一数据的校验数据进行异或运算,以获得所述第二数据的校验数据。The RAID controller performs an XOR operation on the operation result of the XOR write instruction and the check data of the first data to obtain the check data of the second data.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述写数据请求用于请求用所述第二数据对存储数据中的第一数据进行更新,所述RAID控制器向校验存储设备发送异或更新指令之前,所述方法还包括:The method according to any one of claims 1-7, wherein the write data request is used to request to update the first data in the stored data with the second data, and the RAID controller sends Before the verification storage device sends the exclusive OR update instruction, the method further includes:
    所述RAID控制器确定所述第二数据的大小和存储所述第二数据所用的条带的大小之间的比值小于或等于预设阈值;或者,The RAID controller determines that the ratio between the size of the second data and the size of the stripe used for storing the second data is less than or equal to a preset threshold; or,
    所述RAID控制器确定第一读写次数小于或等于第二读写次数,其中所述第一读写次数为所述RAID控制器在实现对所述第一数据、所述第二数据和所述第一数据的校验数据的异或运算结果进行存储时所需的读写次数,所述第二读写次数为所述RAID控制器在实现对所述第二数据和所述存储数据中除所述第一数据之外的数据的异或运算结果进行存储时所需的读写次数。The RAID controller determines that the first number of reads and writes is less than or equal to the second number of reads and writes. The number of reads and writes required when the XOR operation result of the check data of the first data is stored, and the second number of reads and writes is the number of reads and writes required by the RAID controller for the second data and the stored data The number of reads and writes required when the XOR operation result of data other than the first data is stored.
  9. 一种数据存储***,其特征在于,包括独立硬盘冗余阵列RAID控制器和至少一个存储设备;其中,A data storage system, characterized in that it comprises a redundant array of independent hard disks RAID controller and at least one storage device; wherein,
    所述RAID控制器,用于根据写数据请求生成异或写指令,所述写数据请求用于请求将第一数据更新为第二数据,所述异或写指令用于获得所述第一数据和第二数据的异或运算结果;根据所述异或写指令获取所述异或写指令的运算结果;向校验存储设备发送异或更新指令,所述校验存储设备为所述至少一个存储设备中的任意一个;The RAID controller is configured to generate an exclusive OR write instruction according to a write data request, the write data request is used to request to update first data to second data, and the exclusive OR write instruction is used to obtain the first data And the result of the exclusive OR operation of the second data; obtain the result of the operation of the exclusive OR write instruction according to the exclusive OR write instruction; send an exclusive OR update instruction to a check storage device, where the check storage device is the at least one Any one of the storage devices;
    所述校验存储设备,用于接收所述异或更新指令,根据所述异或更新指令的指示将所述第一数据的校验数据更新为所述第二数据的校验数据,所述第二数据的校验数据为所述第一数据的校验数据和所述异或写指令的运算结果的异或运算结果。The check storage device is configured to receive the XOR update instruction, and update the check data of the first data to the check data of the second data according to the instruction of the XOR update instruction. The check data of the second data is an exclusive OR operation result of the check data of the first data and the operation result of the exclusive OR write instruction.
  10. 根据权利要求9所述的***,其特征在于,所述异或写指令中携带第一地址、所述第二数据的物理地址和所述第二数据的逻辑地址,所述第一地址为所述RAID控制器中用于存储所述异或写指令的运算结果的物理地址,所述第二数据的物理地址为所述第二数据在所述RAID控制器中存储所用的物理地址,所述第二数据的逻辑地址为所述第二数据在数据存储设备中存储所用的逻辑地址,所述数据存储设备为所述至少一个存储设备中的设备;The system according to claim 9, wherein the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, and the first address is The physical address in the RAID controller used to store the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, the The logical address of the second data is a logical address used for storing the second data in a data storage device, and the data storage device is a device in the at least one storage device;
    所述数据存储设备,用于根据所述异或写指令读取所述第二数据的物理地址所存储的所述第二数据和所述第二数据的逻辑地址中已存储的所述第一数据,并对所述第一数据和所述第二数据进行异或运算获得所述异或写指令的运算结果,以将所述异或写指令的运算结果发送至所述RAID控制器的所述第一地址存储;The data storage device is configured to read the second data stored in the physical address of the second data and the first data stored in the logical address of the second data according to the XOR write instruction Data, and perform an exclusive OR operation on the first data and the second data to obtain the operation result of the exclusive OR write instruction, so as to send the operation result of the exclusive OR write instruction to all of the RAID controller The first address is stored;
    所述RAID控制器,还用于接收所述数据存储设备发送的所述异或写指令的运算结果,并将所述异或写指令的运算结果存储至所述第一地址。The RAID controller is further configured to receive the operation result of the XOR write instruction sent by the data storage device, and store the operation result of the XOR write instruction to the first address.
  11. 根据权利要求10所述的***,其特征在于,所述第一数据包括第一旧数据和第二旧数据在内的至少两个旧数据,所述第二数据包括第一新数据和第二新数据在内的至少两个新数据,则所述异或写指令至少包括第一异或写指令和第二异或写指令,所述第一异或写指令中携带第二地址、所述第一新数据的物理地址和所述第一新数据 的逻辑地址,所述第二异或写指令中携带第三地址、所述第二新数据的物理地址和所述第二新数据的逻辑地址,所述数据存储设备包括第一存储设备和第二存储设备在内的至少两个设备,The system according to claim 10, wherein the first data includes at least two old data including first old data and second old data, and the second data includes first new data and second new data. At least two new data including data, the XOR write instruction includes at least a first XOR write instruction and a second XOR write instruction, and the first XOR write instruction carries the second address and the first XOR write instruction. The physical address of a new data and the logical address of the first new data, the second XOR write instruction carries a third address, the physical address of the second new data, and the logical address of the second new data , The data storage device includes at least two devices including a first storage device and a second storage device,
    所述RAID控制器,还用于向所述第一存储设备发送所述第一异或写指令;向所述第二存储设备发送所述第二异或写指令;The RAID controller is further configured to send the first XOR write instruction to the first storage device; send the second XOR write instruction to the second storage device;
    所述第一存储设备,用于根据所述第一异或写指令读取所述第一新数据的物理地址所存储的所述第一新数据和所述第一新数据的逻辑地址中已存储的所述第一旧数据,并对所述第一新数据和所述第一旧数据进行异或运算获得第一运算结果,以将所述第一运算结果发送至所述RAID控制器的所述第二地址存储;The first storage device is configured to read the first new data stored in the physical address of the first new data and the logical address of the first new data according to the first XOR write instruction. The stored first old data, and perform an exclusive OR operation on the first new data and the first old data to obtain a first operation result, so as to send the first operation result to the RAID controller The second address is stored;
    所述第二存储设备,用于根据所述第二异或写指令读取所述第二新数据的物理地址所存储的所述第二新数据和所述第二新数据的逻辑地址中已存储的所述第二旧数据,并对所述第二新数据和所述第二旧数据进行异或运算获得第二运算结果,以将所述第二运算结果发送至所述RAID控制器的所述第三地址存储。The second storage device is configured to read the second new data stored in the physical address of the second new data and the logical address of the second new data according to the second XOR write instruction. Store the second old data, and perform an exclusive OR operation on the second new data and the second old data to obtain a second operation result, so as to send the second operation result to the RAID controller The third address is stored.
  12. 根据权利要求11所述的***,其特征在于,所述异或写指令的运算结果包括所述第一运算结果和所述第二运算结果;或者,所述异或写指令的运算结果为所述第一运算结果和所述第二运算结果的异或运算结果。The system according to claim 11, wherein the operation result of the XOR write instruction includes the first operation result and the second operation result; or, the operation result of the XOR write instruction is the The exclusive OR operation result of the first operation result and the second operation result.
  13. 根据权利要求9所述的***,其特征在于,所述异或写指令中携带第一地址、所述第二数据的物理地址和所述第二数据的逻辑地址,所述第一地址为所述RAID控制器中用于存储所述异或写指令的运算结果的物理地址,所述第二数据的物理地址为所述第二数据在所述RAID控制器中存储所用的物理地址,所述第二数据的逻辑地址为所述第二数据在数据存储设备中存储所用的逻辑地址,所述第二数据的逻辑地址和所述第一数据的逻辑地址相同,所述数据存储设备为所述至少一个存储设备中的设备;The system according to claim 9, wherein the XOR write instruction carries a first address, a physical address of the second data, and a logical address of the second data, and the first address is The physical address in the RAID controller used to store the operation result of the XOR write instruction, the physical address of the second data is the physical address used for storing the second data in the RAID controller, the The logical address of the second data is the logical address used for storing the second data in the data storage device, the logical address of the second data is the same as the logical address of the first data, and the data storage device is the At least one storage device;
    所述RAID控制器,用于根据所述异或写指令,读取所述第二数据的逻辑地址中已存储的所述第一数据和所述第二数据的物理地址中所存储的所述第二数据;对所述第一数据和所述第二数据进行异或运算,以获得所述异或写指令的运算结果。The RAID controller is configured to read the first data stored in the logical address of the second data and the physical address stored in the second data according to the XOR write instruction Second data; XOR operation is performed on the first data and the second data to obtain the operation result of the XOR write instruction.
  14. 根据权利要求10-13中任一项所述的***,其特在于,所述异或更新指令中携带所述第一地址以及第四地址,所述第四地址为所述校验存储设备中用于存储所述第一数据的校验数据的逻辑地址;The system according to any one of claims 10-13, wherein the exclusive OR update instruction carries the first address and a fourth address, and the fourth address is in the verification storage device A logical address used to store the verification data of the first data;
    所述校验存储设备,还用于根据所述异或更新指令读取所述第一地址所存储的所述异或写指令的运算结果和所述第四地址所存储的所述第一数据的校验数据,并对所述异或写指令的运算结果和所述第一数据的校验数据进行异或运算获得所述第二数据的校验数据,以将所述第一数据的校验数据更新为所述第二数据的校验数据。The check storage device is further configured to read the operation result of the exclusive OR write instruction stored in the first address and the first data stored in the fourth address according to the exclusive OR update instruction The check data of the second data is obtained by performing an exclusive OR operation on the operation result of the XOR write instruction and the check data of the first data to obtain the check data of the first data. The verification data is updated to the verification data of the second data.
  15. 根据权利要求10-13中任一项所述的***,其特征在于,所述异或更新指令中携带所述第二数据的校验数据;The system according to any one of claims 10-13, wherein the exclusive OR update instruction carries check data of the second data;
    所述RAID控制器,还用于在向校验存储设备发送异或更新指令之前,获取所述 校验存储设备中存储的所述第一数据的校验数据;对所述异或写指令的运算结果和所述第一数据的校验数据进行异或运算,以获得所述第二数据的校验数据。The RAID controller is further configured to obtain the check data of the first data stored in the check storage device before sending the XOR update instruction to the check storage device; The operation result and the check data of the first data are XORed to obtain the check data of the second data.
  16. 根据权利要求9-15中任一项所述的***,其特征在于,所述写数据请求用于请求用所述第二数据对存储数据中的第一数据进行更新;The system according to any one of claims 9-15, wherein the write data request is used to request to update the first data in the stored data with the second data;
    所述RAID控制器,还用于在向校验存储设备发送异或更新指令之前,确定所述第二数据的大小和存储所述第二数据所用的条带的大小之间的比值小于或等于预设阈值;或者,确定第一读写次数小于或等于第二读写次数;The RAID controller is further configured to determine that the ratio between the size of the second data and the size of the stripe used for storing the second data is less than or equal to before sending the exclusive OR update instruction to the check storage device Preset threshold; or, determine that the first read and write times are less than or equal to the second read and write times;
    其中,所述第一读写次数为所述RAID控制器在实现对所述第一数据、所述第二数据和所述第一数据的校验数据的异或运算结果进行存储时所需的读写次数,所述第二读写次数为所述RAID控制器在实现对所述第二数据和所述存储数据中除所述第一数据之外的数据的异或运算结果进行存储时所需的读写次数。Wherein, the first number of reads and writes is required by the RAID controller when storing the XOR operation result of the first data, the second data, and the check data of the first data The number of reads and writes, where the second number of reads and writes is determined by the RAID controller when storing the XOR operation result of the second data and the stored data except for the first data. The number of reads and writes required.
  17. 一种独立硬盘冗余阵列RAID控制器,其特征在于,包括处理器,存储器,通信接口和总线;所述处理器、所述通信接口和所述存储器通过总线相互通信;所述通信接口,用于接收和发送数据;所述存储器,用于存储指令;所述处理器,用于调用所述存储器中的指令,执行如上权利要求1-8中任一项所述方法的操作步骤。A RAID controller with a redundant array of independent hard disks, which is characterized in that it comprises a processor, a memory, a communication interface and a bus; the processor, the communication interface and the memory communicate with each other through the bus; the communication interface uses For receiving and sending data; the memory is used to store instructions; the processor is used to call the instructions in the memory to perform the operation steps of the method according to any one of claims 1-8.
PCT/CN2019/109088 2019-02-28 2019-09-29 Data processing method, redundant array of independent disks controller, and data storage system WO2020173092A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910152241.0 2019-02-28
CN201910152241.0A CN111625181B (en) 2019-02-28 2019-02-28 Data processing method, redundant array controller of independent hard disk and data storage system

Publications (1)

Publication Number Publication Date
WO2020173092A1 true WO2020173092A1 (en) 2020-09-03

Family

ID=72240186

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/109088 WO2020173092A1 (en) 2019-02-28 2019-09-29 Data processing method, redundant array of independent disks controller, and data storage system

Country Status (2)

Country Link
CN (1) CN111625181B (en)
WO (1) WO2020173092A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687978A (en) * 2021-09-07 2021-11-23 天津津航计算技术研究所 Data processing method for storage array controller
CN113687977A (en) * 2021-09-07 2021-11-23 天津津航计算技术研究所 Data processing device based on RAID controller to realize calculation performance improvement
CN114546272A (en) * 2022-02-18 2022-05-27 山东云海国创云计算装备产业创新中心有限公司 Method, system, apparatus and storage medium for fast universal RAID demotion to RAID5

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022246727A1 (en) * 2021-05-27 2022-12-01 华为技术有限公司 Data processing apparatus and data processing method
CN114756404B (en) * 2022-06-15 2024-04-05 上海江波龙数字技术有限公司 Data processing method, device, electronic equipment and storage medium
CN117369732B (en) * 2023-12-07 2024-02-23 苏州元脑智能科技有限公司 Logic disc processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763220A (en) * 2008-12-25 2010-06-30 成都市华为赛门铁克科技有限公司 Data updating method, controller and storage system
CN101984400A (en) * 2010-11-05 2011-03-09 成都市华为赛门铁克科技有限公司 RAID control method, device and system
US20180356949A1 (en) * 2017-06-12 2018-12-13 Royal Bank Of Canada System and method for adaptive data visualization
CN109358809A (en) * 2018-09-28 2019-02-19 方信息科技(上海)有限公司 A kind of RAID data storage system and method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101566924B (en) * 2008-04-23 2011-07-13 中兴通讯股份有限公司 Data read-write method of disk array
KR20110095126A (en) * 2008-11-19 2011-08-24 엘에스아이 코포레이션 Memory efficient check of raid information
US20120158652A1 (en) * 2010-12-15 2012-06-21 Pavan Ps System and method for ensuring consistency in raid storage array metadata
CN102184079B (en) * 2011-04-29 2012-11-07 华中科技大学 Method for optimizing writing performance of redundant array of independent disk (RAID5)-grade disk array
CN109358980B (en) * 2018-09-25 2022-03-01 华东交通大学 RAID6 encoding method friendly to data updating and single-disk error recovery

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763220A (en) * 2008-12-25 2010-06-30 成都市华为赛门铁克科技有限公司 Data updating method, controller and storage system
CN101984400A (en) * 2010-11-05 2011-03-09 成都市华为赛门铁克科技有限公司 RAID control method, device and system
US20180356949A1 (en) * 2017-06-12 2018-12-13 Royal Bank Of Canada System and method for adaptive data visualization
CN109358809A (en) * 2018-09-28 2019-02-19 方信息科技(上海)有限公司 A kind of RAID data storage system and method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687978A (en) * 2021-09-07 2021-11-23 天津津航计算技术研究所 Data processing method for storage array controller
CN113687977A (en) * 2021-09-07 2021-11-23 天津津航计算技术研究所 Data processing device based on RAID controller to realize calculation performance improvement
CN113687977B (en) * 2021-09-07 2024-05-28 天津津航计算技术研究所 Data processing device for improving computing performance based on RAID controller
CN113687978B (en) * 2021-09-07 2024-05-28 天津津航计算技术研究所 Data processing method for memory array controller
CN114546272A (en) * 2022-02-18 2022-05-27 山东云海国创云计算装备产业创新中心有限公司 Method, system, apparatus and storage medium for fast universal RAID demotion to RAID5
CN114546272B (en) * 2022-02-18 2024-04-26 山东云海国创云计算装备产业创新中心有限公司 Method, system, device and storage medium for degrading RAID (redundant array of independent disks) to RAID5 (redundant array of independent disks)

Also Published As

Publication number Publication date
CN111625181A (en) 2020-09-04
CN111625181B (en) 2022-03-29

Similar Documents

Publication Publication Date Title
WO2020173092A1 (en) Data processing method, redundant array of independent disks controller, and data storage system
CN110770710B (en) Apparatus and method for controlling acceleration of data
US11126353B2 (en) Method and apparatus for data copy
US8332367B2 (en) Parallel data redundancy removal
US9986028B2 (en) Techniques to replicate data between storage servers
CN107305534B (en) Method for simultaneously carrying out kernel mode access and user mode access
US11003374B2 (en) Methods, devices and computer program products for managing a redundant array of independent disks
EP4216515A1 (en) Method and apparatus for transmitting data processing request
US20180113635A1 (en) Memory controller utilizing scatter gather list techniques
US10558398B2 (en) Reducing read latency
WO2019047834A1 (en) Method and device for transmitting data processing request
US11467987B1 (en) Computational pipelines for computational storage devices
JP2023036774A (en) Access control method of shared memory, access control device of shared memory, electronic apparatus, and autonomous vehicle
CN105302536A (en) Configuration method and apparatus for related parameters of MapReduce application
CN105528183A (en) Data storage method and storage equipment
US20220075525A1 (en) Redundant Array of Independent Disks (RAID) Management Method, and RAID Controller and System
WO2014115277A1 (en) Storage device and method for controlling storage device
US20120166686A1 (en) Method, apparatus and system for aggregating interrupts of a data transfer
US20200334103A1 (en) Storage system, drive housing thereof, and parity calculation method
US20200319819A1 (en) Method and Apparatus for Improving Parity Redundant Array of Independent Drives Write Latency in NVMe Devices
US20160041765A1 (en) Storage device control system and storage device control apparatus
US10705905B2 (en) Software-assisted fine-grained data protection for non-volatile memory storage devices
US20240103722A1 (en) Metadata management for transparent block level compression
EP4258097A1 (en) Operation method of host device and operation method of storage device
US20240192870A1 (en) Data transform acceleration

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19916753

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19916753

Country of ref document: EP

Kind code of ref document: A1