WO2021082011A1 - 应用于磁盘阵列系统的数据重构方法、装置及计算设备 - Google Patents

应用于磁盘阵列系统的数据重构方法、装置及计算设备 Download PDF

Info

Publication number
WO2021082011A1
WO2021082011A1 PCT/CN2019/115154 CN2019115154W WO2021082011A1 WO 2021082011 A1 WO2021082011 A1 WO 2021082011A1 CN 2019115154 W CN2019115154 W CN 2019115154W WO 2021082011 A1 WO2021082011 A1 WO 2021082011A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
physical address
disk
target
failed disk
Prior art date
Application number
PCT/CN2019/115154
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to PCT/CN2019/115154 priority Critical patent/WO2021082011A1/zh
Priority to CN201980101699.1A priority patent/CN114600073A/zh
Publication of WO2021082011A1 publication Critical patent/WO2021082011A1/zh

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

Definitions

  • This application relates to the field of storage technology, and in particular to a data reconstruction method, device, computing device, storage device, and storage medium.
  • the main memory in the server As the amount of data processed by the server becomes larger and larger, it is difficult for the main memory in the server to simultaneously meet the demands of large storage capacity and fast reading and writing speed.
  • the system may be a system based on redundant array of independent disks (RAID) technology.
  • a disk array system with a RAID level of RAID 4 is taken as an example.
  • the disk array system includes four solid state drives (SSD), of which three are data disks and one is a parity disk.
  • SSD solid state drives
  • the array system performs XOR check on the data of three data disks on the same strip, and writes the check data obtained by the XOR check into the check disk.
  • the server needs to read all the data in the same strip in the other disks except the failed disk, and then reverse the data according to the check data in the check disk.
  • the exclusive OR check is to reconstruct all the data in the failed disk, and finally write the reconstructed data into the new disk to replace the failed disk.
  • the embodiments of the present application provide a data reconstruction method, device, computing device, storage device, and storage medium, which can save reconstruction time and improve reconstruction efficiency.
  • the technical solution is as follows.
  • a data reconstruction method includes: receiving a data read request from a computing device, where the data read request carries a target logical address; and determining the corresponding data in the failed disk according to the target logical address. If the target physical address includes the first physical address in the failed disk, a response message for indicating a data read error is fed back to the computing device, wherein the data write in the failed disk.
  • the physical address whose entry time is after the first time point is the first physical address, and the first time point is the time of the address mapping table last saved by the failed disk before the time when the failure occurred.
  • the target physical address is the second physical address in the failed disk
  • the data stored in the second physical address is fed back to the computing device, and the data in the failed disk
  • the storage address whose writing time is before the first time point is the second physical address.
  • the data of the failed disk can be quickly transferred, which greatly reduces the reading and processing during reconstruction.
  • the amount of data shortens the data reconstruction time and improves the data reconstruction efficiency.
  • the method It also includes: querying a fault data table according to the target physical address, where the fault data table is used to record the first physical address; if the target physical address hits any physical address recorded in the fault data table, It is determined that the target physical address includes the first physical address in the failed disk.
  • the first physical address is marked in the form of a fault data table, and the first physical address can be quickly determined by query, so as to realize the foregoing reconstruction process.
  • the method before the receiving the data read request from the computing device, the method further includes: acquiring the time of the address mapping table last saved by the failed disk before the time of the failure as the first A point in time; use the physical address whose data writing time in the failed disk is after the first time point as the first physical address; write the data writing time in the failed disk at the first time point The previous physical address is used as the second physical address.
  • the process of how to distinguish between the first physical address and the second physical address is provided, so that which data is reliable and which data is unreliable are determined based on the time when the fault occurs.
  • Selectively reconstruct some data during the construction process to achieve the above technical effects.
  • the method further includes: receiving a first command, the first command is used to instruct the failed disk to enter a target data processing mode, and the target data processing mode is used to distinguish the first physical address from the second physical address; execute; The step of acquiring the first time point.
  • the first customized command is used to instruct the failed disk to enter the target data processing mode to start the physical address discrimination process, which can avoid reading failures that may be caused by not running the target data processing mode.
  • the method further includes: receiving a second command, The second command is used to inquire whether the failed disk supports the target data processing mode, and the target data processing mode is used to distinguish between the first physical address and the second physical address; when the target data processing mode is supported, return Confirm the response.
  • the method further includes: receiving a third command, where the third command is used to instruct to resume operation; and to resume operation.
  • a data reconstruction method includes:
  • the method further includes: if the response message is data, writing the received data into the replacement disk.
  • the method before sending the data read request to the failed disk in the disk array system, the method further includes: sending a first command to the failed disk, the first command being used to instruct all The failed disk enters a target data processing mode, and the target data processing mode is used to distinguish physical addresses.
  • the method before sending the data read request to the failed disk in the disk array system, the method further includes: sending a second command to the failed disk, and the second command is used to query the Whether the failed disk supports the target data processing mode, the target data processing mode is used to distinguish the physical addresses; when the confirmation response sent by the failed disk is received, the data read is sent to the failed disk in the disk array system The requested steps.
  • the method further includes: sending a third command to the failed disk, where the third command is used to instruct the failed disk to resume operation.
  • the performing data reconstruction on the data stored at the target physical address includes: determining the stripe corresponding to the data in the disk array system, and downloading the data from the disk array system The data corresponding to the stripe is read from the disks other than the failed disk; and the data is reconstructed based on the read data.
  • a data reconstruction device in a third aspect, includes: a data reconstruction method for executing the above-mentioned data reconstruction method executed on the computing device side.
  • the data reconstruction device includes a functional module for executing the data reconstruction method described in the first aspect or any one of the optional manners of the first aspect.
  • a data reconstruction device in a fourth aspect, includes: a data reconstruction method for executing the above-mentioned data reconstruction method executed on the storage device side.
  • the data reconstruction device includes a functional module for executing the data reconstruction method described in the second aspect or any one of the optional manners of the second aspect.
  • a storage device in a fifth aspect, includes a controller and one or more storage chips, the one or more storage chips are used to store data, and the controller is used to implement the first aspect or the first aspect described above.
  • a computing device in a sixth aspect, includes a processor, a memory, and a transceiver.
  • the memory stores instructions.
  • the transceiver is used to receive and send data.
  • the computing device When loaded and executed, the computing device is enabled to implement the data reconstruction method as described in the second aspect or any one of the optional manners of the second aspect.
  • a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the instruction is loaded and executed by the processor to implement the above-mentioned first aspect, second aspect, or first aspect or The data reconstruction method described in any optional manner of the second aspect.
  • a disk array system including: the computing device according to the sixth aspect described above and a plurality of storage devices according to the fifth aspect described above.
  • the disk in the disk array system is any type of disk among SSD, embedded multimedia card (eMMC), and universal flash storage (UFS).
  • SSD embedded multimedia card
  • UFS universal flash storage
  • the address mapping table is a flash memory conversion layer mapping table.
  • the response message for indicating a data read error carries an error code.
  • FIG. 1 is a schematic diagram of the principle of a flash translation layer (FTL) provided by an embodiment of the present application;
  • FTL flash translation layer
  • FIG. 2 is a schematic diagram of an implementation environment of a data reconstruction method provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a data reconstruction method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the relationship between the saving time point, the failure occurrence time and the written data of a timeline-based address mapping table provided by an embodiment of the present application;
  • FIG. 5 is a schematic structural diagram of a data reconstruction device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of another data reconstruction device provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another data reconstruction device provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a data reconstruction device provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a storage device provided by an embodiment of the present application.
  • Redundant Array of Independent Disks refers to the formation of a logical hard disk with multiple separate disks in different combinations, thereby improving disk read performance and data security.
  • Strip A strip can include a single or multiple consecutive sectors in a disk. It is the smallest unit for reading and writing data on a disk. It is an element that makes up a strip.
  • Stiple Stripes with the same "position" (or the same number) on multiple disk drives in the same disk array.
  • Strip width The number of data member disks in a strip.
  • Striping depth the capacity of a strip.
  • RAID can have different combinations, and different combinations can be identified by RAID levels. Different RAID levels represent different storage performance, data security, and storage costs.
  • RAID 6 After continuous development of RAID technology, there are currently six clear standard RAID levels ranging from RAID 0 to RAID 5. In addition, there are RAID 6, RAID 7, RAID 10 (combination of RAID 1 and RAID 0), RAID 01 (combination of RAID 0 and RAID 1), RAID 30 (combination of RAID 3 and RAID 0), RAID 50 ( Combination of RAID 0 and RAID 5) and so on. It should be noted that, for the convenience of subsequent presentation, the RAID level will be directly used to indicate the corresponding RAID system in the following.
  • RAID 3 uses one disk as the parity disk, and the other disks as data disks. Data is interleaved to each data disk in a bit or byte manner. RAID 3 also provides data fault tolerance, which will not affect the user's reading of data. RAID 3 performs XOR verification on the same strip of data on different disks and writes the verification value to the verification disk. When RAID 3 If the data disk is damaged, if the read data block happens to be on the damaged disk, you need to read all the data blocks in the same strip, and then reconstruct the data on the damaged disk according to the check value. RAID 3 is suitable for applications with a large number of read operations, such as web systems and information queries, or applications with continuous large data streams (such as non-linear editing).
  • RAID 3 is only an example of RAID, and its data verification is achieved by P code.
  • P/Q code can also be used to achieve double parity, which can be applied to A system that requires a higher level of data security.
  • RAID (such as RAID 1, RAID 3, RAID 5, RAID 6, RAID 10, or RAID 50, etc.) can also provide data reconstruction functions, referred to as data reconstruction, that is, for RAID
  • data reconstruction data reconstruction
  • the member disks in the system when a member disk in the RAID system fails, according to the RAID algorithm and other normal member disks, all data on the failed member disk is recalculated and written to the replacement disk. , That is, the process of hot spare disks or replacement new hard disks. Based on this data reconstruction, the security and reliability of the data in the RAID system can be guaranteed.
  • FTL which exists between the file system and physical media (flash memory), is responsible for all the conversion work from logical block address (LBA) to physical block address (physics block address, PBA), and can be applied to physical media
  • LBA logical block address
  • PBA physical block address
  • FTL maintains an FTL mapping table.
  • the above FTL function can be implemented by the main controller in the disk array system or the firmware in the disk, and the FTL mapping table can be stored in the internal static random access memory (SRAM) Or dynamic random access memory (DRAM) or external DRAM or NAND particles.
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • NAND particles external DRAM or NAND particles.
  • the FTL mapping table may also have multiple backups.
  • Fig. 2 shows an implementation environment of a data reconstruction method provided by an embodiment of the present application.
  • the implementation environment may be a disk array system, which may specifically include: a storage controller 210, a plurality of storage devices 220 and a computing device 230 connected to the storage controller 210.
  • the storage controller 210 is used to implement the storage control function between the computing device 230 and the storage device 220. For example, when a read/write request from the computing device is received, the storage controller can determine the storage to be read according to the read/write request. Device, and interact with the storage device through read and write instructions to achieve data read and write.
  • the multiple storage devices 220 may be solid state drives (solid state drives, SSDs) and the like.
  • Solid-state hard drives can include components such as controllers and memory chips.
  • the memory chips can include NOR flash chips, dynamic random access memory (DRAM) chips, etc.
  • SSDs are widely used It is used in many fields such as military, vehicle, industrial control, video surveillance, network monitoring, network terminal, electric power, medical treatment, aviation, navigation equipment and so on.
  • the number of computing devices 230 may be one or more. When there are multiple computing devices 230, there are at least two computing devices used to provide different services, and/or, there are at least two computing devices used to provide the same service, for example, multiple computing devices provide the same service in a load balancing manner. This type of service is not limited in the embodiment of this application.
  • the computing device 230 can be used for data scheduling and data manipulation, and scheduling and operating data in multiple storage devices 220 through a suitable data scheduling algorithm.
  • Fig. 3 is a flowchart of a data reconstruction method provided by an embodiment of the present application. With reference to Fig. 3, the method includes:
  • the computing device sends a first command to a failed disk, where the first command is used to instruct the failed disk to enter a target data processing mode, and the target data processing mode is used to distinguish a first physical address from a second physical address.
  • the failed disk is the aforementioned storage device, that is, the disk in the disk array system.
  • the above-mentioned first command may be a restart command.
  • the restart command may be used to instruct the failed disk to perform subsequent data differentiation and other processes, thereby realizing data reconstruction.
  • the first physical address and the second physical address are determined by the faulty disk according to the address mapping table, the physical address whose data writing time in the faulty disk is after the first time point is the first physical address, and the data in the faulty disk
  • the physical address whose writing time is before the first time point is the second physical address, and the first time point is the time of the address mapping table last saved by the failed disk before the time when the failure occurred.
  • the first time point is at least one storage time point corresponding to the FTL mapping table
  • a storage time point before the failure occurrence time of the faulty disk that is, at least one storage time point corresponding to the FTL mapping table is
  • the time interval between the failure occurrence times of the failed disk is the shortest, and is located at the storage time point before the failure time.
  • FIG. 4 is a schematic diagram of the relationship between the storage time point, the failure occurrence time, and the written data of a timeline-based address mapping table provided by an embodiment of the present application.
  • data is written every 13 times.
  • the FTL mapping table will be saved once. Therefore, it can be seen from Figure 4 that at least three times of saving are performed before the SSD failure time. That is, at least one point in time when the FTL mapping table is saved includes saving the FTL mapping table.
  • the address mapping table is used to indicate the mapping relationship between logical addresses and physical addresses. It should be noted that the address mapping table will be saved periodically.
  • the address mapping table may be an FTL mapping table.
  • the computing device can periodically monitor the failure status of each disk in the system to determine the failed disk, or the failed disk can report to the computing device based on its own failure status. This allows the computing device to learn about the failed disk; and the computing device can periodically perform data processing on the failed disk, or perform the above data processing after determining the failed disk, which is not limited in the embodiment of the present application.
  • the failed disk receives the first command.
  • the firmware (FW) of the failed disk can still work. Therefore, when the firmware of the failed disk receives the first command, it can be restarted based on the first command. . After the failed disk is restarted, the target data processing mode for distinguishing the second physical address from the first physical address can be entered to execute the subsequent data distinguishing process.
  • step 302 of the embodiment of the present application after the failed disk receives the first command, the failed disk can be restarted so that the failed disk can stop the current data processing in the failed disk by restarting, so as to provide a safer and more secure Stable operating environment to perform steps such as data differentiation.
  • the failed disk after receiving the first command, the failed disk may directly enter the target data processing mode without restarting.
  • the above first command is used to power off the failed disk and then power it on again, so that the failed disk performs the restart process.
  • This form of power-off and power-on can be used in situations where the failed disk itself cannot be restarted due to the firmware failure of the failed disk itself.
  • the restart process is implemented directly and effectively, so that the failed disk can enter the processing steps of address differentiation.
  • the computing device sends a second command to the failed disk, where the second command is used to inquire whether the failed disk supports the target data processing mode.
  • the second command may be a self-defined command.
  • the second command may be implemented by adding a new definition to an existing field of an existing command format in the disk array system.
  • the computing device may repeatedly send the second command to the faulty disk multiple times without receiving feedback from the faulty disk to inquire whether the faulty disk supports the above-mentioned distinguishing process, and when the number of repetitions reaches the preset number of times, the When the confirmation response of the failed disk is received, the sending can be stopped, and the data can be reconstructed through other data reconstruction methods.
  • the computing device may also not execute the sending of the above-mentioned second command, but by default all the failed disks in the disk array system support the distinguishing process.
  • the second command can also be performed after the failed disk is determined but before the first command is sent, so that it can be performed after it is determined that the failed disk can support the target data processing mode. Notifying it to enter the target data processing mode can ensure the normal progress of data reconstruction.
  • the failed disk After the failed disk receives the second command, if it supports it, it returns a confirmation response to the computing device, where the confirmation response is used to indicate that the failed disk supports the target data processing mode.
  • the failed disk can detect whether it supports the target data processing mode, that is, whether it supports the distinction between the second physical address and the first physical address.
  • the detection process may include: detecting whether the failed disk can be read Take the address mapping table, which is used to indicate the mapping relationship between the logical address and the physical address. If the address mapping table can be read, it is determined that the faulty disk supports this mode. If the address mapping table cannot be read, then This mode is not supported.
  • the detection process may include: detecting whether the setting item of the target data processing mode of the failed disk is turned on, etc., which is not limited in the embodiment of the present application.
  • the target response may not be returned.
  • the second command is ignored or a rejection response is returned.
  • the rejection response is used to indicate that the failed disk does not support the target data processing mode, so that the computing device can learn The current failed disk cannot be supported, and other data reconstruction methods are used instead to perform reconstruction to avoid too long a delay in reconstruction.
  • the address mapping table may be an FTL mapping table.
  • the address mapping table may be called other names, which will not be repeated here.
  • the faulty disk acquires the time of the address mapping table last saved by the faulty disk before the time when the fault occurs as the first time point.
  • the address mapping table can be automatically saved, and for each time Save, the corresponding storage has its save time point.
  • step 305 is: at least one saving time point of the address mapping table is obtained as the first saving time point before the fault occurrence time of the faulty disk.
  • the failure disk can read the storage time points of each address mapping table and the time when the failure occurs, sort these times, and save the time point that is located before the time of the failure and with the smallest difference from the time of the failure. Determined as the first point in time.
  • address mapping table may be a collective term for a collection of multiple address mapping tables, and the mapping relationship between a pair of logical addresses and physical addresses may be referred to as an address mapping table.
  • the faulty disk uses the physical address whose data writing time in the faulty disk is after the first time point as the first physical address.
  • the data can be labeled based on the first time point.
  • the specific labeling method can be implemented by writing the first physical address into the fault data table.
  • the first physical address is maintained in other forms, for example, not in the form of a form, but in the form of a document for recording, etc., which is not limited in the embodiment of the present application.
  • the fault data table may only include the above-mentioned first physical address, and other physical addresses on the faulty disk may be directly determined as the second physical address, or, In order to avoid errors, the writing time can be compared to determine the second physical address and the first physical address, so as to prepare for subsequent data reconstruction.
  • the above steps 305 to 306 are the process of distinguishing the physical address of the failed disk.
  • the process is essentially based on the time of failure to determine which data has higher reliability and which data has lower reliability, so that the reliability is higher. For high data, the reconstruction process can no longer be performed.
  • the distinguishing process is simple to operate and has high accuracy, which provides a reference for subsequent data reconstruction of the computing device.
  • the computing device sends a data read request to the failed disk, where the data read request carries the target logical address.
  • one or more reading processes can be initiated based on the logical address or physical address corresponding to the failed disk, so as to realize the reading of data.
  • the data read request may carry the logical address to be read.
  • the failed disk receives a data read request from the computing device, and the data read request carries a target logical address.
  • the failed disk determines the corresponding target physical address in the failed disk according to the target logical address.
  • the failed disk can convert the logical address to the physical address by querying the address mapping table, thereby determining the physical address of the data to be read by the computing device.
  • the failed disk feeds back to the computing device a response message indicating a data read error.
  • the failure disk can query the failure data table according to the data read request, and the failure data table is used to record the first physical address; if the target If the physical address hits any physical address recorded in the fault data table, it is determined that the target physical address includes the first physical address in the faulty disk.
  • the first physical address without labeling the first physical address
  • it can be directly used as the second physical address to respond to the data read request of the computing device .
  • the fault data table is used for labeling
  • only the first physical address may be stored in the fault data table.
  • the calculation can be instructed The device reconstructs the data stored in the target physical address.
  • the failed disk can also mark the second physical address instead of the first physical address.
  • the data read request hits any unmarked physical address, it can be directly marked.
  • the first physical address it responds to the data read request of the computing device.
  • the second physical address may be stored in the fault data table.
  • the computing device can be instructed to reconstruct the data stored in the target physical address.
  • the response message may carry an error code for indicating a data read error, that is, the physical address corresponding to the data read request includes the first physical address on the failed disk.
  • the faulty disk sends the data stored in the second physical address in the faulty disk to the computing device, and The data read from the second physical address of the failed disk by the computing device is copied to the replacement disk of the failed disk.
  • the replacement disk may be any disk that operates normally in the disk array system, or may be a disk newly added to the disk array system by means such as replacement, which is not limited in the embodiment of the present application.
  • the computing device when the computing device reads any data, it can also verify the read data. When the data verification passes, the above copy process can be performed to ensure the consistency and integrity of the data. Sex.
  • the data stored in the physical address involved in the embodiment of the present application is used to refer to the data stored in the storage space corresponding to the physical address.
  • the computing device performs data reconstruction on the data stored in the target physical address, and writes the reconstructed data into the replacement disk.
  • the process of "data reconstruction on the data stored in the target physical address" in step 311 may include the following steps 311A and 311B:
  • the computing device determines the stripe corresponding to the data stored in the target physical address in the disk array system, and reads the data corresponding to the stripe from the disks in the disk array system except the failed disk.
  • the process may include: the computing device determines, based on the stripe corresponding to the data in the disk array system, a disk other than the failed disk that is used to store each data block on the stripe, and the computing device obtains data from the determined stripe. In the disk, read the data belonging to the strip, where the data belonging to the strip includes the data block itself and the check data block.
  • striping processing refers to dividing continuous data into data blocks of the same size, and writing each piece of data to On different disks, each piece of data can be determined to belong to the data on the same strip.
  • the verification data can be generated based on the data belonging to the same strip, and the verification data can be stored on the same strip.
  • the verification data can be used for data reconstruction.
  • the method of generating the verification data It can include parity check, XOR check, Hamming check and so on.
  • the computing device performs data reconstruction on the data based on the read data.
  • the data reconstruction process may include: based on the read data and the verification data generation method when the failed disk writes the data, executing the de-verification data generation method, and use the obtained data as the reconstructed data. For example, when an exclusive OR check method is adopted when writing data, the read data is subjected to an inverse exclusive OR check to obtain the reconstructed data.
  • the computing device After the data reconstruction is completed, the computing device sends a third command to the failed disk, where the third command is used to instruct the failed disk to resume operation.
  • the computing device can notify the failed disk to resume normal operation, and the notification process can be implemented through the above step 312.
  • the third command may be a self-defined command.
  • the third command is implemented by adding a newly defined word to an existing field of an existing command in the disk array system.
  • the computing device can also notify the failed disk to resume operation when the replication is completed, without waiting for the completion of data reconstruction, so that the failed disk can be resumed in advance.
  • the failed disk receives the third command and resumes operation.
  • the failed disk can automatically resume operation based on whether the response to the data read request is completed or not. Of course, it can also resume operation after receiving the third command to perform subsequent tasks.
  • the method provided by the embodiment of the present application directly copies a part of the data with higher reliability in the failed disk that has failed to the new disk, and only reconstructs the unreliable data in the disk, which greatly reduces The amount of data read and processed during reconstruction shortens the data reconstruction time and improves the data reconstruction efficiency.
  • FIG. 5 is a schematic structural diagram of a data reconstruction device provided by an embodiment of the present application. As shown in FIG. 5, the device includes:
  • the receiving module 501 is configured to receive a data read request from a computing device, where the data read request carries a target logical address;
  • the determining module 502 is configured to determine the corresponding target physical address in the failed disk according to the target logical address
  • the sending module 503 is configured to, if the target physical address includes the first physical address in the failed disk, feed back a response message for indicating a data read error to the computing device, wherein the data in the failed disk
  • the physical address whose writing time is after the first time point is the first physical address, and the first time point is the time of the address mapping table last saved by the failed disk before the time when the failure occurred.
  • the response message for indicating a data read error carries an error code.
  • the address mapping table is a flash memory conversion layer mapping table.
  • the failed disk will perform address conversion based on the target logical address in the data read request to obtain the target physical address, and then determine whether the target physical address includes the first physical address based on the target physical address. That is, whether the physical address whose data writing time is after the first time point is included, which is the time when the address mapping table of the failed disk was last saved before the time of the failure.
  • the failed disk can learn which physical addresses have reliable and unreliable data, so as to respond to the data read request. If the target physical address includes the first physical address, it can feed back a response message indicating a data read error to inform If the computing device reads incorrectly, the computing device will reconstruct based on the target physical address.
  • the sending module is further configured to feed back the data stored in the second physical address to the computing device if the target physical address is the second physical address in the failed disk , The storage address in the failed disk whose data writing time is before the first time point is the second physical address.
  • the device further includes:
  • the query module 504 is configured to query a fault data table according to the target physical address, and the fault data table is used to record the first physical address; if the target physical address hits any one of the records in the fault data table Physical address, it is determined that the target physical address includes the first physical address in the failed disk.
  • the device further includes:
  • the obtaining module 505 is configured to obtain the time of the address mapping table last saved by the failed disk before the time of the failure as the first time point;
  • the address distinguishing module 506 is configured to use the physical address whose data writing time in the faulty disk is after the first time point as the first physical address; and writing the data writing time in the faulty disk to the first physical address; The physical address before a point in time is used as the second physical address.
  • the receiving module 501 is further configured to receive a first command, the first command is used to instruct the failed disk to enter the target data processing mode, and the target data processing mode is used to perform the first command.
  • the first command can be a system-defined command, which can be used to trigger the failed disk to enter the target data processing mode. It should be noted that the failed disk can be run by entering the target data processing mode after restarting to avoid some data In the case of a mode startup error caused by being read, of course, it is also possible to directly enter the target data processing mode, which is not limited in the embodiment of the present application.
  • the receiving module 501 is also used to receive a second command, the second command is used to inquire whether the failed disk supports a target data processing mode, and the target data processing mode is used to perform the first
  • the distinction between a physical address and a second physical address; the sending module 502 is also configured to return a confirmation response when the target data processing mode is supported.
  • the second command can be a system-defined command. Through the second command, the computing device can ensure the success rate of subsequent process implementation based on the query mechanism. Of course, for the entire system, it can also support the target data processing by default. Mode, it is also possible not to perform the inquiry through the above-mentioned inquiry mechanism, but directly execute the above-mentioned physical address distinguishing process.
  • the receiving module 501 is further configured to receive a third command, which is used to instruct to resume operation; referring to FIG. 7, the apparatus further includes: an operation processing module 507, which is used to The instruction of the third command resumes operation.
  • the failed disk can exit from the target data processing mode and resume its normal operation, to a certain extent, to ensure the normal reading of the data in the storage space indicated by the second physical address, and it can be used when the replacement disk is not officially launched. Provide a data basis for the normal operation of the business.
  • the disk array system is RAID; for example, the disks in the disk array system include at least one of SSD, eMMC, and UFS.
  • the data reconstruction device provided in the above embodiment only uses the division of the above functional modules for illustration during data reconstruction. In actual applications, the above functions can be allocated by different functional modules according to needs. , Divide the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the data reconstruction device provided in the foregoing embodiment and the data reconstruction method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
  • FIG. 8 is a schematic structural diagram of a data reconstruction device provided by an embodiment of the present application. As shown in FIG. 8, the device includes:
  • the sending module 801 is configured to send a data read request to a failed disk in the disk array system, where the data read request carries a target logical address;
  • the receiving module 802 is configured to receive a response message fed back by the failed disk in response to the data read request, where the response message is the data read result of the target physical address corresponding to the target logical address;
  • the reconstruction module 803 is configured to perform data reconstruction on the data stored in the target physical address if the response message is a response message for indicating a data read error; for example, the data read for instructing
  • the error response message carries the error code.
  • the writing module 804 is used to write the reconstructed data into the replacement disk.
  • the failed disk will perform address conversion based on the target logical address in the data read request to obtain the target physical address, and then determine whether the target physical address includes the first physical address based on the target physical address. That is, whether the physical address whose data writing time is after the first time point is included, which is the time when the address mapping table of the failed disk was last saved before the time of the failure.
  • the failed disk can learn which physical addresses have reliable and unreliable data, so as to respond to the data read request. If the target physical address includes the first physical address, it can feed back a response message indicating a data read error to inform If the computing device reads incorrectly, the computing device will reconstruct based on the target physical address.
  • the disk array system is RAID.
  • the disk of the disk array system is any type of disk among SSD, eMMC and UFS.
  • the address mapping table is a flash memory conversion layer mapping table.
  • the writing module 804 is further configured to write the received data into the replacement disk if the response message is data.
  • the data writing process can be directly performed to complete the data backup process from the failed disk to the replacement disk.
  • the computing device may also verify the data when receiving the data, and then perform the process of writing to the replacement disk after the verification is passed, which is not limited in the embodiment of the present disclosure.
  • the sending module 801 is further configured to send a first command to the failed disk, and the first command is used to instruct the failed disk to enter the target data processing mode, and the target data processing mode Used to distinguish physical addresses.
  • the first command can be a system-defined command, which can be used to trigger the failed disk to enter the target data processing mode. It should be noted that the failed disk can be run by entering the target data processing mode after restarting to avoid some data In the case of a mode startup error caused by being read, of course, it is also possible to directly enter the target data processing mode, which is not limited in the embodiment of the present application.
  • the sending module 801 is further configured to send a second command to the failed disk, and the second command is used to inquire whether the failed disk supports the target data processing mode, and the target data processing The mode is used to distinguish physical addresses; the sending module 801 is also used to execute the step of sending a data read request to the faulty disk in the disk array system when receiving the confirmation response sent by the faulty disk.
  • the second command can be a system-defined command. Through the second command, the computing device can ensure the success rate of subsequent process implementation based on the query mechanism. Of course, for the entire system, it can also support the target data processing by default. Mode, it is also possible not to perform the inquiry through the above-mentioned inquiry mechanism, but directly execute the above-mentioned physical address distinguishing process.
  • the sending module 801 is further configured to send a third command to the failed disk, and the third command is used to instruct the failed disk to resume operation.
  • the failed disk can exit from the target data processing mode and resume its normal operation, to a certain extent, to ensure the normal reading of the data in the storage space indicated by the second physical address, and it can be used when the replacement disk is not officially launched. Provide a data basis for the normal operation of the business.
  • the reconstruction module 803 is configured to: determine the stripe corresponding to the data in the disk array system, from the disk array system except for the failed disk Read the data corresponding to the strip; based on the read data, perform data reconstruction on the data.
  • the data reconstruction device provided in the above embodiment only uses the division of the above functional modules for illustration during data reconstruction. In actual applications, the above functions can be allocated by different functional modules according to needs. , Divide the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the data reconstruction device provided in the foregoing embodiment and the data reconstruction method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
  • FIG. 9 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • the computing device may be provided as a personal computer (PC) or server, etc.
  • the computing device may include one or more processors (central processing unit (CPU) 901, one or more memories 902, and a transceiver 903, where at least one instruction is stored in the memory 902, and the at least one instruction is loaded and executed by the processor 901 to implement the foregoing method embodiments.
  • the transceiver 903 can be used to transmit and receive data.
  • the computing device may also have components such as a wired or wireless network interface, a keyboard, an input and output interface for input and output, and the computing device may also include other components for implementing device functions, which will not be repeated here.
  • the foregoing memory 902 may be used to perform the steps of storing the read data in the foregoing embodiment, and the processor 901 may be used to perform the process of data reconstruction in the foregoing embodiment, and the transceiver 903 may be based on processing.
  • the controller 901 is controlled to perform the sending steps of the first command, the second command, the third command, and the data read request, etc., and may also perform the receiving step of the response message.
  • a computer-readable storage medium such as a memory including a program code, which can be executed by a processor in a computing device to complete the data reconstruction method in the foregoing embodiment.
  • the computer-readable storage medium may be ROM (Read-Only Memory), RAM (random access memory), CD-ROM (Compact Disc Read-Only Memory, CD-ROM), Magnetic tapes, floppy disks and optical data storage devices, etc.
  • FIG. 10 is a schematic structural diagram of a storage device 220 shown in FIG. 2 provided by an embodiment of the present application.
  • the storage device 220 may include a controller 1001 and one or more storage chips 1002.
  • the memory chip 1002 includes an erasable block for storing one or more flash memory pages.
  • the controller 1001 can execute the steps performed by the failed disk in the above embodiment through interaction with the storage chip 1002. Taking RAID as an example, the controller 1001 is operatively coupled to the storage chip 1002 for organizing at least two flash memory pages into RAID row groups and writing the composition information of the RAID row group members into each of the RAID row groups Flash page.
  • the controller 1001 can perform parallel operations on the memory chip 1002 through multiple channels.
  • the main functions of the controller 1001 can include: error checking and correction, wear leveling, bad block mapping, cache control, garbage collection, encryption, etc.
  • the aforementioned memory chip 1002 can be used to store data
  • the controller 1001 can be used to perform processes such as physical address discrimination in the aforementioned embodiment, and the controller 1001 can receive the first command, the second command, and the first command from the computing device.
  • Three sending steps such as commands and data reading requests, and corresponding steps are executed based on the above commands or requests, and a response message can also be returned to the computing device based on the data reading request.
  • a computer-readable storage medium such as a memory including program code, which can be executed by a controller in a storage device to complete the data reconstruction method in the foregoing embodiment.
  • the computer-readable storage medium may be ROM (Read-Only Memory), RAM (random access memory), CD-ROM (Compact Disc Read-Only Memory, CD-ROM), Magnetic tapes, floppy disks and optical data storage devices, etc.
  • the program can be stored in a computer-readable storage medium.
  • the storage medium can be read-only memory, magnetic disk or optical disk, etc.

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)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请提供了一种应用于磁盘阵列系统的数据重构方法、装置及计算设备,属于存储技术领域。在本申请所提供的技术方案中,通过将磁盘阵列系统中发生故障的故障盘中的一部分可靠性较高的数据直接复制到新盘,而只对该故障盘中的不可靠的数据进行重构,并将重构后的数据写入新盘,以实现故障盘的更换,采用这种方式,可以大大降低了重构时读取和处理的数据量,缩短了数据重构时间,提高了数据重构效率。

Description

应用于磁盘阵列系统的数据重构方法、装置及计算设备 技术领域
本申请涉及存储技术领域,特别涉及一种数据重构方法、装置、计算设备、存储设备及存储介质。
背景技术
随着服务器处理的数据量越来越大,服务器中的主存储器难以同时满足存储量大和读写速度快的需求。为了解决这一问题,可以利用不同存储容量和读写速度的盘,基于一定的层次构成磁盘阵列系统,并选用合适的控制调度算法,让磁盘阵列系统达到最优的性能,例如,该磁盘阵列系统可以为基于独立磁盘冗余阵列(redundant array of independent disks,RAID)技术的系统。
现有技术中,以RAID级别为RAID4的磁盘阵列系统为例,该磁盘阵列系统包括四个固态硬盘(solid state drive,SSD),其中,三个为数据盘,一个为校验盘,该磁盘阵列系统将同一条带上三个数据盘的数据作异或校验,将该异或校验得到的校验数据写入校验盘中。当该磁盘阵列系统中的某一数据盘出现故障时,服务器需要读取除该故障盘之外的其他盘中相同条带内的全部数据,再根据校验盘中的校验数据,作反异或校验,从对对该故障盘中的数据全部进行重构,最后将重构后的数据写入新盘中,以替换故障盘。
但是,在上述数据重构的过程中,需要先读取其他盘中的对应条带内的全部数据,再将该故障盘的数据全部重构,这一过程需要消耗大量的时间,并且随着固态盘的容量越来越大,重构时间也会线性增长,使数据重构效率降低,影响客户的正常使用。
发明内容
本申请实施例提供了一种数据重构方法、装置、计算设备、存储设备及存储介质,能够节约重构时间、提高重构效率。所述技术方案如下。
第一方面,提供了一种数据重构方法,所述方法包括:接收计算设备的数据读取请求,所述数据读取请求携带有目标逻辑地址;根据所述目标逻辑地址确定故障盘中对应的目标物理地址;若所述目标物理地址包括所述故障盘中的第一物理地址,则向所述计算设备反馈用于指示数据读取错误的响应消息,其中,所述故障盘中数据写入时间在第一时间点之后的物理地址为第一物理地址,所述第一时间点为所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻。
在本申请所提供的技术方案中,通过将磁盘阵列系统中发生故障的故障盘中的一部分可靠性较高的数据直接复制到新盘,而只对该故障盘中的不可靠的数据进行重构,并将重构后的数据写入新盘,以实现故障盘的更换,采用这种方式,可以大大降低了重构时读取和处理的数据量,缩短了数据重构时间,提高了数据重构效率。
在一种可能实现方式中,若所述目标物理地址为所述故障盘中的第二物理地址,向所述计算设备反馈所述第二物理地址中所存储的数据,所述故障盘中数据写入时间在所述第一时 间点之前的存储地址为第二物理地址。
在上述实施方式中,通过对第一物理地址对应的数据进行重构,第二物理地址的数据进行直接复制,可以完成对故障盘数据迅速的转移,大大降低了重构时读取和处理的数据量,缩短了数据重构时间,提高了数据重构效率。
在一种可能实现方式中,所述若所述目标物理地址包括所述故障盘中的第一物理地址,则向所述计算设备反馈用于指示数据读取错误的响应消息之前,所述方法还包括:根据所述目标物理地址,查询故障数据表,所述故障数据表用于记录所述第一物理地址;若所述目标物理地址命中所述故障数据表中记录的任一物理地址,则确定所述目标物理地址包括所述故障盘中的第一物理地址。
在上述实施方式中,利用故障数据表的形式来标注第一物理地址,可以通过查询的方式迅速的确定第一物理地址,从而实现上述重构过程。
在一种可能实现方式中,所述接收计算设备的数据读取请求之前,所述方法还包括:将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点;将所述故障盘中数据写入时间在所述第一时间点之后的物理地址作为所述第一物理地址;将所述故障盘中数据写入时间在所述第一时间点之前的物理地址作为所述第二物理地址。
在上述实施方式中,提供了具体如何对第一物理地址和第二物理地址进行区分的过程,使得基于故障发生时刻来确定哪些数据是可靠的而哪些数据是不可靠的,达到了在数据重构过程中有选择的重构某些数据,以取得上述技术效果。
在一种可能实现方式中,所述根据所述故障盘的故障发生时刻,将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点之前,所述方法还包括:接收第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;执行所述获取所述第一时间点的步骤。
在上述实施方式中,通过自定义的第一命令来指示故障盘进入目标数据处理模式以启动上述物理地址的区分过程,可以避免由于未运行目标数据处理模式而可能导致的读取失败。
在一种可能实现方式中,所述将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点之前,所述方法还包括:接收第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;当支持所述目标数据处理模式,返回确认响应。
在上述实施方式中,通过与故障盘之间的交互来确认是否能够支持物理地址的区分,从而保证了后续提高重构效率的成功率。
在一种可能实现方式中,所述方法还包括:接收第三命令,所述第三命令用于指示恢复运行;恢复运行。
在上述实施方式中,通过基于命令来恢复运行,可以保证其能够在重构完成后恢复正常运行。
第二方面,提供了一种数据重构方法,所述方法包括:
向磁盘阵列系统中的故障盘发送数据读取请求,所述数据读取请求携带目标逻辑地址;
接收所述故障盘响应所述数据读取请求反馈的响应消息,所述响应消息为所述目标逻辑地址所对应的目标物理地址的数据读取结果;若所述响应消息为用于指示数据读取错误的响应消息,则对存储于所述目标物理地址的数据进行数据重构,将重构数据写入替代盘中。
在一种可能实现方式中,所述方法还包括:若所述响应消息为数据,将接收到的数据写入所述替代盘中。
在一种可能实现方式中,所述向磁盘阵列系统中的故障盘发送数据读取请求之前,所述方法还包括:向所述故障盘发送第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分。
在一种可能实现方式中,所述向磁盘阵列系统中的故障盘发送数据读取请求之前,所述方法还包括:向所述故障盘发送第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分;当接收到所述故障盘发送的确认响应时,执行向磁盘阵列系统中的故障盘发送数据读取请求的步骤。
在一种可能实现方式中,所述方法还包括:向所述故障盘发送第三命令,所述第三命令用于指示所述故障盘恢复运行。
在一种可能实现方式中,所述对存储于所述目标物理地址的数据进行数据重构,包括:确定所述数据在所述磁盘阵列系统中所对应的条带,从所述磁盘阵列系统中除所述故障盘之外的磁盘中读取所述条带对应的数据;基于读取到的数据,对所述数据进行数据重构。
第三方面,提供了一种数据重构装置,所述装置包括:用于执行上述计算设备侧执行的数据重构方法。具体地,该数据重构装置包括用于执行上述第一方面或第一方面的任一种可选方式所述的数据重构方法的功能模块。
第四方面,提供了一种数据重构装置,所述装置包括:用于执行上述存储设备侧执行的数据重构方法。具体地,该数据重构装置包括用于执行上述第二方面或第二方面的任一种可选方式所述的数据重构方法的功能模块。
第五方面,提供一种存储设备,所述存储设备包括控制器和一个或多个存储芯片,所述一个或多个存储芯片用于存储数据,所述控制器用于实现上述第一方面或第一方面的任一种可选方式所述的数据重构方法。
第六方面,提供一种计算设备,所述计算设备包括处理器、存储器以及收发器,所述存储器中存储有指令,所述收发器用于接收和发送数据,当所述指令由所述处理器加载并执行时,使得所述计算设备实现如上述第二方面或第二方面的任一种可选方式所述的数据重构方法。
第七方面,提供一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由所述处理器加载并执行以实现上述第一方面、第二方面或第一方面或第二方面的任一种可选方式所述的数据重构方法。
第八方面,提供一种磁盘阵列系统,包括:如上述第六方面的计算设备以及多个上述第五方面的存储设备。
在上述任一方面中,所述磁盘阵列系统中的磁盘为SSD、嵌入式多媒体芯片(embedded multi media card,eMMC)和通用闪存存储器(universal flash storage,UFS)中的任一类型的盘。
在上述任一方面中,所述地址映射表为闪存转化层映射表。
在上述任一方面中,所述用于指示数据读取错误的响应消息携带错误码。
附图说明
图1是本申请实施例提供的闪存转换层(flash translation layer,FTL)的原理示意图;
图2是本申请实施例提供的一种数据重构方法的实施环境的示意图;
图3是本申请实施例提供的一种数据重构方法的流程示意图;
图4是本申请实施例提供的一种基于时间线的地址映射表的保存时间点、故障发生时间以及写入数据之间的关系示意图;
图5是本申请实施例提供的一种数据重构装置的结构示意图;
图6是本申请实施例提供的又一种数据重构装置的结构示意图;
图7是本申请实施例提供的另一种数据重构装置的结构示意图;
图8是本申请实施例提供的一种数据重构装置的结构示意图;
图9是本申请实施例提供的一种计算设备的结构示意图;
图10是本申请实施例提供的一种存储设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
首先对本申请实施例所涉及的RAID系统进行简要的介绍:
独立磁盘冗余阵列(Redundant Array of Independent Disks,RAID)系统是指:将多个单独的磁盘以不同的组合方式形成一个逻辑硬盘,从而提高了磁盘读取的性能和数据的安全性。
在RAID系统中,有以下的概念:
条带(strip):一个条带可以包括磁盘中单个或多个连续的扇区,是一块磁盘上进行一次数据读写的最小单元,它是组成分条的元素。
分条(stiple):同一磁盘阵列中的多个磁盘驱动器上的相同“位置”(或相同编号)的条带。
分条宽度:在一个分条中,数据成员盘的个数。
分条深度:一个条带的容量大小。
基于上述介绍可知,RAID可以具有不同的组合方式,而不同的组合方式可以用RAID级别来标识,不同RAID级别代表着不同的存储性能、数据安全性和存储成本。
RAID技术经过不断的发展,目前已拥有了从RAID 0到RAID 5等6种明确标准级别的RAID级别。另外,其他还有RAID 6、RAID 7、RAID 10(RAID 1与RAID 0的组合)、RAID 01(RAID 0与RAID 1的组合)、RAID 30(RAID 3与RAID 0的组合)、RAID 50(RAID 0与RAID 5的组合)等。需要说明的是,为了后续表述方便,下文中将直接用RAID级别表示对应的RAID系统。
下面仅以RAID 3为例对RAID进行示例性的介绍:
RAID 3采用一个磁盘作为校验盘,其余磁盘作为数据盘,数据按位或字节的方式交叉的存取到各个数据盘中。RAID 3还提供了数据容错能力,不会影响用户读取数据,RAID 3将不同磁盘上同一条带的数据做异或校验,并把校验值写入到校验盘中,当RAID 3中有数据盘出现损坏,如果读取的数据块正好在损坏的磁盘上,则需要读取位于同一条带的所有数据块,然后根据校验值对损坏的磁盘上的数据进行重新构建。RAID 3适用于有大量读操作如网站(web)系统以及信息查询等应用或持续大块数据流(例如非线性编辑)的应用。
当然,上述RAID 3仅仅是对RAID的一种举例,其数据校验是通过P码来实现,而在例如RAID6等技术中,还可以采用P/Q码来实现双重奇偶校验,可以适用于数据安全级别要求较高的系统。
下面对RAID技术中的数据重构进行示例性的介绍:
对于RAID系统来说,RAID(例如RAID 1、RAID 3、RAID 5、RAID 6、RAID 10或RAID 50等)还可以提供有数据重新构建的功能,简称为数据重构,也即是,对于RAID系统中的成员盘来说,当RAID系统中某个成员盘故障时,根据RAID算法和其他正常的成员盘,重新计算生成发生故障的成员盘上的所有数据,并将这些数据写到替代盘,也即是热备盘或者替换的新硬盘上的过程,基于这种数据重构,则可以保证RAID系统中数据的安全性和可靠性。
下面对FTL进行简要介绍:
FTL,存在于文件系统和物理介质(闪存)之间,负责逻辑区块地址(logical block address,LBA)到物理区块地址(physics block address,PBA)的所有转换工作,可以适用于对物理介质的读写进行管理,对于文件系统来说,其只需跟原有文件系统一样操作LBA即可。其中,FTL维护有FTL映射表(mapping table)。当文件系统发送指令要写入或者更新一个特定的LBA时,FTL实际上是把数据写入到一个不同的空闲PBA中,更新FTL映射表,建立LBA和新的PBA之间的映射关系,而由于更新后的数据已经写入该新的PBA,旧的PBA中的数据自然就失效了,因此,可以把这个旧的PBA上包含的“旧数据”标记为“无效”。通过上述FTL的映射功能,文件系统实现了将SSD当成机械硬盘操作的目的。
需要说明的是,上述FTL的功能可以由磁盘阵列系统中的主控制器或磁盘中的固件来实现,而该FTL映射表可以存放在内部的静态随机存取存储器(static random access memory,SRAM)或动态随机存取存储器(dynamic random access memory,DRAM)或者外部DRAM或者NAND颗粒中。当然,为了防止断电丢失等情况的发生,该FTL映射表还可以存在多个备份。
以图1为例,假设在page0上写入数据(物理地址n),接下来写入数据到page1(物理地址n+1)。接着page0数据被更新,但是更新后的数据并不是覆盖上去,FTL会把它写入到物理地址n+2上,然后将物理地址n标记为“无效”。经过多次这样的操作后,这个块上就会装满了许多“有效”及“无效”的数据。
图2所示是本申请实施例提供的一种数据重构方法的实施环境。该实施环境可以为一磁盘阵列系统,具体可以包括:存储控制器210、与该存储控制器210相连的多个存储设备220和计算设备230。
其中,存储控制器210用于实现计算设备230和存储设备220之间的存储控制功能,例如,在接收到计算设备的读写请求时,存储控制器可以根据读写请求确定被读取的存储设备,并通过读写指令与存储设备之间进行交互,以实现数据读写。
其中,该多个存储设备220可以是固态硬盘(solid state drive,SSD)等。固态硬盘可以包括控制器和存储芯片等组件,其中,存储芯片可以包括编码型快闪记忆体(NOR flash)芯片、动态随机存取存储器(dynamic random access memory,DRAM)芯片等,SSD被广泛应用于军事、车载、工控、视频监控、网络监控、网络终端、电力、医疗、航空、导航设备等 诸多领域。
计算设备230的数量可以是一台或多台。当计算设备230是多台时,存在至少两台计算设备用于提供不同的服务,和/或,存在至少两台计算设备用于提供相同的服务,比如多台计算设备以负载均衡方式提供同一种服务,本申请实施例对此不做限定。该计算设备230可以用于数据调度和数据操作,通过合适的数据调度算法,对多个存储设备220中的数据进行调度和操作。
图3是本申请实施例提供的一种数据重构方法的流程图,结合图3,该方法包括:
301、计算设备向故障盘发送第一命令,该第一命令用于指示该故障盘进入目标数据处理模式,该目标数据处理模式用于进行第一物理地址和第二物理地址的区分。
在本申请实施例中,该故障盘即是上述存储设备,也即是磁盘阵列系统中的磁盘。其中,上述第一命令可以是重启命令,对于计算设备来说,可以通过重启命令来指示故障盘进行后续的数据区分等流程,从而实现数据重构。
其中,该第一物理地址和该第二物理地址由故障盘根据地址映射表确定,该故障盘中数据写入时间在第一时间点之后的物理地址为第一物理地址,该故障盘中数据写入时间在第一时间点之前的物理地址为第二物理地址,该第一时间点为该故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻。
例如,该第一时间点为该FTL映射表对应的至少一个保存时间点中,位于该故障盘的故障发生时刻前的一个保存时间点,即该FTL映射表对应的至少一个保存时间点中与该故障盘的故障发生时刻之间时间间隔最短,且位于故障时间之前的保存时间点。
例如,图4是本申请实施例提供的一种基于时间线的地址映射表的保存时间点、故障发生时间以及写入数据之间的关系示意图,如图4所示,每写入13次数据,FTL映射表会进行一次保存,因此,从图4中可以看出,在SSD故障时刻之前,至少进行了三次保存,也即是,该FTL映射表的至少一个保存时间点包括保存FTL映射表1的时间点、保存FTL映射表2的时间点以及保存FTL映射表3的时间点,故障时刻之前地址映射表最后一次保存为地址映射表3,则可以将该地址映射表3的保存时间点确定为第一时间点。其中,该地址映射表用于表示逻辑地址和物理地址之间的映射关系。需要说明的是,该地址映射表会周期性的进行保存。例如,该地址映射表可以为FTL映射表。
需要说明的是,对于磁盘阵列系统来说,其计算设备可以周期性对系统内各个盘的故障情况进行监测,以确定故障盘,又或者,故障盘可以基于自身的故障情况向计算设备上报,从而使得计算设备获知该故障盘;而计算设备可以周期性的对故障盘进行数据处理,也可以是在确定了故障盘后执行上述数据处理,本申请实施例对此不做限定。
302、该故障盘接收第一命令。
需要说明的是,对于故障盘来说,在大多故障场景下,该故障盘的固件(FW)仍然可以工作,因此,当故障盘的固件接收到该第一命令,可以基于第一命令进行重启。在故障盘重启后,则可以进入用于对第二物理地址和第一物理地址进行区分的目标数据处理模式,以执行后续的数据区分流程。
在本申请实施例的步骤302中,当故障盘接收到第一命令后,可以通过对故障盘进行重启可以使得故障盘能够通过重启来停止故障盘中当前的数据处理,以提供一个较安全和稳定 的运行环境,以进行数据的区分等步骤。在另一可能实现方式中,该故障盘在接收到第一命令后,还可以不进行重启,而直接进入该目标数据处理模式。
上述通过第一命令使得故障盘下电后再上电,以使该故障盘执行重启流程,这种下电和上电的形式,可以在由于故障盘本身固件故障而造成的无法自行重启的情况下,直接、有效的实现重启过程,从而使得故障盘能够进入地址区分的处理步骤。
303、该计算设备向该故障盘发送第二命令,该第二命令用于询问该故障盘是否支持目标数据处理模式。
其中,该第二命令可以是一种自定义命令,例如,该第二命令可以是通过在磁盘阵列系统中已有命令格式的已有字段中添加新定义来实现。
需要说明的是,该计算设备可以在未接收到故障盘的反馈时,重复多次向故障盘发送第二命令,以询问故障盘是否支持上述区分过程,而当重复次数到达预设次数仍未接收到故障盘的确认响应时,则可以停止发送,并通过其他数据重构方式来进行数据重构。当然,该计算设备还可以不执行上述第二命令的发送,而是默认磁盘阵列系统内的故障盘均支持该区分过程。
另外,对于该计算设备来说,该第二命令还可以是在确定了故障盘之后,发送第一命令之前进行,从而可以在确定了该故障盘能够支持该目标数据处理模式的情况下,再通知其进入该目标数据处理模式,可以保证数据重构的正常进行。
304、该故障盘接收第二命令后,如果支持,则向该计算设备返回确认响应,该确认响应用于指示该故障盘支持目标数据处理模式。
在一种可能实现方式中,故障盘可以检测是否支持目标数据处理模式,也即是,是否支持第二物理地址和第一物理地址的区分,该检测过程可以包括:检测该故障盘是否能够读取地址映射表,该地址映射表用于表示逻辑地址和物理地址之间的映射关系,如果能够读取地址映射表,则确定该故障盘支持该模式,如果不能读取该地址映射表,则不支持该模式。又或者,该检测过程可以包括:检测该故障盘的目标数据处理模式的设置项是否开启等,本申请实施例对此不做限定。
另外,如果故障盘不支持该模式,也可以不返回目标响应,例如忽略该第二命令或者返回拒绝响应,该拒绝响应用于指示该故障盘不支持目标数据处理模式,从而使得计算设备可以获知当前故障盘不能够支持,而转而采用其他数据重构方式来进行重构,避免对重构的延时时间过长。
其中,如果该磁盘阵列系统为RAID系统,则上述地址映射表可以为FTL映射表,当然,在其他类型的磁盘阵列系统中,该地址映射表可以被称为其他名称,在此不做赘述。
305、该故障盘将该故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为该第一时间点。
对于硬盘来说,每当写入该硬盘的数据达到一定容量,或者,该硬盘的运行时间达到一定时长,或者有新数据写入硬盘时,可以自动对地址映射表进行保存,并对于每次保存,对应存储有其保存时间点。
基于上述地址映射表,该步骤305的一种可能实现方式为:将该地址映射表的至少一个保存时间点中位于该故障盘故障发生时刻的前一个保存时间点,获取为该第一时间点。例如,故障盘可以读取各个地址映射表的保存时间点以及发生故障的时刻,对这些时间进行排序, 将位于发生故障的时刻之前且与该发生故障的时刻之间差值最小的保存时间点确定为该第一时间点。
需要说明的是,上述地址映射表可以是对多个地址映射表的合集的统称,对于一对逻辑地址和物理地址之间的映射关系,可以称之为地址映射表。
306、该故障盘将该故障盘中数据写入时间在该第一时间点之后的物理地址作为该第一物理地址。
在确定了第一时间点后,则可以基于该第一时间点来对数据进行标注,该具体的标注方式可以通过将第一物理地址写入故障数据表的形式来实现,当然,还可以采用其他形式来维护该第一物理地址,例如,不采用表单的形式,而是采用文档形式进行记录等,本申请实施例对此不做限定。
需要说明的是,在上述过程中,可以仅确定第一物理地址,在该故障盘上的其他物理地址只要未被进行标注,则可以直接被确定为第二物理地址。例如,在以故障数据表来进行标注的场景下,该故障数据表可以仅包括上述第一物理地址,则在该故障盘上的其他物理地址可以直接被确定为第二物理地址,又或者,为了避免出现错误的情况,可以对写入时间均进行比较,从而确定第二物理地址和第一物理地址,为后续的数据重构做准备。
上述步骤305至306是该故障盘进行物理地址区分的过程,该过程实质上是基于发生故障的时刻,来确定哪些数据的可靠性较高,哪些数据的可靠性较低,从而对于可靠性较高的数据可以不再执行重构过程,该区分过程操作简单,准确性高,为后续该计算设备进行数据重构提供了参考。
307、该计算设备向该故障盘发送数据读取请求,该数据读取请求携带目标逻辑地址。
对于计算设备来说,可以基于该故障盘对应的逻辑地址或者物理地址,发起一次或多次读取过程,从而实现对数据的读取,在此,仅以一次读取过程为例进行说明,该数据读取请求可以携带待读取的逻辑地址。
308、该故障盘接收计算设备的数据读取请求,该数据读取请求携带有目标逻辑地址。
309、该故障盘根据该目标逻辑地址确定故障盘中对应的目标物理地址。
故障盘可以通过查询地址映射表,来进行逻辑地址到物理地址的转换,从而确定计算设备所要读取的数据的物理地址。
310、若该目标物理地址包括故障盘中的第一物理地址,该故障盘向该计算设备反馈用于指示数据读取错误的响应消息。
在一种可能实现方式中,在通过故障数据表进行标注的场景下,该故障盘可以根据该数据读取请求查询故障数据表,该故障数据表用于记录该第一物理地址;若该目标物理地址命中该故障数据表中记录的任一物理地址,则确定该目标物理地址包括该故障盘中的第一物理地址。
以对第一物理地址进行标注,而不对第一物理地址进行标注为例,对于任一未标注的物理地址,则可以直接将其作为第二物理地址来对计算设备的数据读取请求进行响应。例如,在通过故障数据表进行标注的场景下,该故障数据表里也可以仅存储有第一物理地址,则当数据读取请求命中故障数据表中所存储的物理地址时,则可以指示计算设备对目标物理地址中所存储的数据进行数据重构。
在另一种可能实现方式中,故障盘还可以对第二物理地址进行标注,而不对第一物理地 址进行标注,则当数据读取请求命中任一未标注的物理地址,则可以直接将其作为第一物理地址来对计算设备的数据读取请求进行响应。例如,在通过故障数据表进行标注的场景下,该故障数据表里也可以仅存储有第二物理地址,则当数据读取请求命中故障数据表以外的物理地址,也即是第二物理地址以外的第一物理地址时,则可以指示计算设备对目标物理地址中所存储的数据进行数据重构。
需要说明的是,本公开对具体采用上述哪一种标注方法不做限定。
在一种可能实现方式中,该响应消息可以携带用于指示数据读取错误的错误码,也即是,该数据读取请求所对应的物理地址包括故障盘上的第一物理地址。
需要说明的是,当数据读取请求所对应的目标物理地址中有部分物理地址命中第一物理地址,而另一部分命中第二物理地址,为了保证整个流程的简化程度,则可以直接返回错误码,来告知该数据读取请求读取错误,从而使得计算设备对目标物理地址对应的数据进行数据重构。
可选地,若目标物理地址命中第二物理地址,则对于除第一物理地址以外的第二物理地址,该故障盘将故障盘中存储于第二物理地址的数据发送给该计算设备,该计算设备从该故障盘的第二物理地址中读取到的数据复制到该故障盘的替代盘中。其中,该替代盘可以是磁盘阵列系统中任一个运行正常的盘,也可以是通过更换等手段在磁盘阵列系统中新增的盘,本申请实施例对此不做限定。
需要说明的是,当计算设备读取到任一数据时,还可以对读取到的数据进行校验,当数据校验通过时,则可以执行上述复制过程,以保证数据的一致性和完整性。
需要说明的是,本申请实施例中所涉及的存储于物理地址中的数据用于指代存储于该物理地址对应的存储空间中的数据。
311、该计算设备对该目标物理地址所存储的数据进行数据重构,将重构数据写入该替代盘中。
在一种可能实现方式中,步骤311中“对该目标物理地址所存储的数据进行数据重构”的过程可以包括以下步骤311A和311B:
311A、该计算设备确定该目标物理地址所存储的数据在该磁盘阵列系统中所对应的条带,从该磁盘阵列系统中除该故障盘之外的磁盘中读取该条带对应的数据。
该过程可以包括:该计算设备根据该数据在该磁盘阵列系统中所对应的条带,确定除故障盘以外的、用于存储该条带上各个数据块的盘,该计算设备从所确定的盘中,读取属于该条带的数据,其中,该属于该条带的数据包括数据块本身和校验数据块。
需要说明的是,当连续的数据写入磁盘阵列系统时,需要进行条带化处理,该条带化处理是指将连续的数据分割成相同大小的数据块,把每段数据分别写入到不同的盘上,则可以将该每段数据确定为属于同一条带上的数据。另外,还可以基于该属于同一条带上的数据生成校验数据,并将校验数据存储在同一条带上,该校验数据可以用于数据重构,其中,该校验数据的生成方式可以包括奇偶校验、异或校验、海明校验等。
311B、该计算设备基于读取到的该数据,对该数据进行数据重构。
其中,该数据重构过程可以包括:基于读取到的数据以及该故障盘写入数据时的校验数据生成方式,执行反校验数据生成方式,将得到的数据作为重构后的数据。例如,当写入数据时采用异或校验的方式时,将该读取到的数据进行反异或校验,得到重构后的数据。
312、该计算设备在数据重构完成后,向该故障盘发送第三命令,该第三命令用于指示该故障盘恢复运行。
当复制过程和重构过程完成后,该计算设备可以告知故障盘恢复正常运行,该告知过程可以通过上述步骤312来实现。其中,该第三命令可以是一种自定义命令,例如,该第三命令通过在磁盘阵列系统中已有命令的已有字段中添加新定义的字来实现。当然,该计算设备也可以复制完成即告知故障盘恢复运行,而无需等待数据重构完成,这样可以提前对故障盘进行恢复运行。
313、该故障盘接收第三命令,恢复运行。
该故障盘可以基于对数据读取请求的响应是否完成,来自行恢复运行,当然,还可以在接收到第三命令后恢复运行,执行后续任务。
本申请实施例提供的方法,通过将发生故障的故障盘中的一部分可靠性较高的数据直接复制到新盘,而只对该盘中的不可靠的数据进行重构的方式,大大降低了重构时读取和处理的数据量,缩短了数据重构时间,提高了数据重构效率。
对于一个故障盘来说,在实际场景下,由于可靠性不好的数据仅占盘上数据的少数,则通过上述对部分数据进行复制,而对另一存在可靠性问题的数据进行数据重构的方式,也即是,通过实际效果可以证明,应用该申请实施例可以大大降低数据重构过程中的读写数据量。
图5是本申请实施例提供的一种数据重构装置的结构示意图,如图5所示,该装置包括:
接收模块501,用于接收计算设备的数据读取请求,所述数据读取请求携带有目标逻辑地址;
确定模块502,用于根据所述目标逻辑地址确定故障盘中对应的目标物理地址;
发送模块503,用于若所述目标物理地址包括所述故障盘中的第一物理地址,则向所述计算设备反馈用于指示数据读取错误的响应消息,其中,所述故障盘中数据写入时间在第一时间点之后的物理地址为第一物理地址,所述第一时间点为所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻。
例如,所述用于指示数据读取错误的响应消息携带错误码。又例如,所述地址映射表为闪存转化层映射表。
在上述实施例提供的装置中,故障盘会基于数据读取请求中目标逻辑地址进行地址转换,以得到目标物理地址,再基于目标物理地址来确定该目标物理地址是否包括第一物理地址,也即是,是否包括数据写入时间在第一时间点之后的物理地址,该第一时间点,也即是故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻,通过上述确定过程,故障盘可以获知哪些物理地址的数据可靠哪些不可靠,从而对数据读取请求进行响应,如果该目标物理地址包括第一物理地址,则可以反馈用于指示数据读取错误的响应消息,来告知计算设备读取错误,则计算设备会基于目标物理地址进行重构。
在一种可能实现方式中,所述发送模块还用于若所述目标物理地址为所述故障盘中的第二物理地址,向所述计算设备反馈所述第二物理地址中所存储的数据,所述故障盘中数据写入时间在所述第一时间点之前的存储地址为第二物理地址。
在一种可能实现方式中,参见图6,所述装置还包括:
查询模块504,用于根据所述目标物理地址,查询故障数据表,所述故障数据表用于记 录所述第一物理地址;若所述目标物理地址命中所述故障数据表中记录的任一物理地址,则确定所述目标物理地址包括所述故障盘中的第一物理地址。
在一种可能实现方式中,所述装置还包括:
获取模块505,用于将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点;
地址区分模块506,用于将所述故障盘中数据写入时间在所述第一时间点之后的物理地址作为所述第一物理地址;将所述故障盘中数据写入时间在所述第一时间点之前的物理地址作为所述第二物理地址。
在一种可能实现方式中,所述接收模块501还用于接收第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;触发所述获取模块505执行所述获取所述第一时间点的步骤。该第一命令可以为系统自定义的命令,可以用于触发故障盘进入目标数据处理模式,需要说明的是,故障盘可以通过重启后进入目标数据处理模式的方式来运行,以达到避免一些数据正在被读取而导致的模式启动错误等情况,当然,也可以直接进入目标数据处理模式,本申请实施例对此不做限定。
在一种可能实现方式中,所述接收模块501还用于接收第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;所述发送模块502还用于当支持对所述目标数据处理模式,返回确认响应。该第二命令可以为系统自定义命令,通过该第二命令,计算设备可以基于询问机制来保障后续流程实施的成功率,当然,对于整个系统来说,还可以是默认均支持该目标数据处理模式,则也可以不通过上述询问机制来进行询问,而是直接执行上述物理地址的区分过程。
在一种可能实现方式中,所述接收模块501还用于接收第三命令,所述第三命令用于指示恢复运行;参见图7,所述装置还包括:运行处理模块507,用于根据所述第三命令的指示,恢复运行。在该过程中,故障盘可以从目标数据处理模式退出而恢复其正常运行,以在一定程度上保障对第二物理地址所指示的存储空间中数据的正常读取,可以在替代盘未正式上线时为业务的正常运行提供数据基础。
其中,所述磁盘阵列系统为RAID;例如,所述磁盘阵列系统中的磁盘包括SSD、eMMC和UFS中的至少一项。
需要说明的是:上述实施例提供的数据重构装置在数据重构时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据重构装置与数据重构方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图8是本申请实施例提供的一种数据重构装置的结构示意图,如图8所示,该装置包括:
发送模块801,用于向磁盘阵列系统中的故障盘发送数据读取请求,所述数据读取请求携带目标逻辑地址;
接收模块802,用于接收所述故障盘响应所述数据读取请求反馈的响应消息,所述响应消息为所述目标逻辑地址所对应的目标物理地址的数据读取结果;
重构模块803,用于若所述响应消息为用于指示数据读取错误的响应消息,则对存储于所述目标物理地址的数据进行数据重构;例如,所述用于指示数据读取错误的响应消息携带错误码。
写入模块804,用于将重构数据写入替代盘中。
在上述实施例提供的装置中,故障盘会基于数据读取请求中目标逻辑地址进行地址转换,以得到目标物理地址,再基于目标物理地址来确定该目标物理地址是否包括第一物理地址,也即是,是否包括数据写入时间在第一时间点之后的物理地址,该第一时间点,也即是故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻,通过上述确定过程,故障盘可以获知哪些物理地址的数据可靠哪些不可靠,从而对数据读取请求进行响应,如果该目标物理地址包括第一物理地址,则可以反馈用于指示数据读取错误的响应消息,来告知计算设备读取错误,则计算设备会基于目标物理地址进行重构。
例如,所述磁盘阵列系统为RAID。又例如,所述磁盘阵列系统的磁盘为SSD、eMMC和UFS中的任一类型的盘。
在一种可能实现方式中,所述地址映射表为闪存转化层映射表。
在一种可能实现方式中,所述写入模块804还用于若所述响应消息为数据,将接收到的数据写入所述替代盘中。对于这类故障盘直接反馈的存储数据,则可以直接进行数据的写入过程,来完成数据从故障盘到替代盘的备份过程。可选地,该计算设备还可以在接收到数据时,对数据进行校验,在校验通过后再进行写入替代盘的过程,本公开实施例对此不做限定。
在一种可能实现方式中,所述发送模块801还用于向所述故障盘发送第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分。该第一命令可以为系统自定义的命令,可以用于触发故障盘进入目标数据处理模式,需要说明的是,故障盘可以通过重启后进入目标数据处理模式的方式来运行,以达到避免一些数据正在被读取而导致的模式启动错误等情况,当然,也可以直接进入目标数据处理模式,本申请实施例对此不做限定。
在一种可能实现方式中,所述发送模块801还用于向所述故障盘发送第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分;所述发送模块801还用于当接收到所述故障盘发送的确认响应时,执行向磁盘阵列系统中的故障盘发送数据读取请求的步骤。该第二命令可以为系统自定义命令,通过该第二命令,计算设备可以基于询问机制来保障后续流程实施的成功率,当然,对于整个系统来说,还可以是默认均支持该目标数据处理模式,则也可以不通过上述询问机制来进行询问,而是直接执行上述物理地址的区分过程。
在一种可能实现方式中,所述发送模块801还用于向所述故障盘发送第三命令,所述第三命令用于指示所述故障盘恢复运行。在该过程中,故障盘可以从目标数据处理模式退出而恢复其正常运行,以在一定程度上保障对第二物理地址所指示的存储空间中数据的正常读取,可以在替代盘未正式上线时为业务的正常运行提供数据基础。
在一种可能实现方式中,所述重构模块803用于:确定所述数据在所述磁盘阵列系统中所对应的条带,从所述磁盘阵列系统中除所述故障盘之外的磁盘中读取所述条带对应的数据;基于读取到的数据,对所述数据进行数据重构。
需要说明的是:上述实施例提供的数据重构装置在数据重构时,仅以上述各功能模块的 划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据重构装置与数据重构方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图9是本申请实施例提供的一种计算设备的结构示意图,该计算设备可以被提供为个人电脑(personal computer,PC)或服务器等设备,该计算设备可以包括一个或一个以上处理器(central processing unit,CPU)901、一个或一个以上的存储器902和收发器903,其中,该存储器902中存储有至少一条指令,该至少一条指令由该处理器901加载并执行以实现上述方法实施例提供的数据重构方法中如计算设备侧的步骤,该收发器903可以用于进行数据收发。当然,该计算设备还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该计算设备还可以包括其他用于实现设备功能的部件,在此不做赘述。
例如,上述存储器902可以用于执行上述实施例中对读取到的数据进行存储的步骤,而处理器901可以用于执行上述实施例中的数据重构等过程,而收发器903可以基于处理器901的控制来进行第一命令、第二命令、第三命令以及数据读取请求等的发送步骤,还可以执行对响应消息的接收步骤。
在示例性实施例中,还提供了一种计算机可读存储介质,例如包括程序代码的存储器,上述程序代码可由计算设备中的处理器执行以完成上述实施例中的数据重构方法。例如,该计算机可读存储介质可以是ROM(Read-Only Memory,只读存储器)、RAM(random access memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,只读光盘)、磁带、软盘和光数据存储设备等。
图10是本申请实施例提供的一种如图2所示的存储设备220的结构示意图,该存储设备220可以包括控制器1001和一个或多个存储芯片1002。该存储芯片1002中包括可擦除块,用于存储一个或多个闪存页。该控制器1001可以通过与存储芯片1002之间的交互,来执行上述实施例中故障盘所进行的各个步骤。以RAID为例,该控制器1001以可操作方式耦合至存储芯片1002,用于将至少两个闪存页组织成RAID行组并将RAID行组成员的组成信息写入该RAID行组的每个闪存页。该控制器1001可以通过多个通道来对该存储芯片1002进行并行操作,该控制器1001的主要功能可以有:错误检查和纠正、磨损平衡、坏块映射、缓存控制、垃圾回收、加密等。
例如,上述存储芯片1002可以用于存储数据,而控制器1001可以用于执行上述实施例中的物理地址区分等过程,而控制器1001可以接收来自计算设备的第一命令、第二命令、第三命令以及数据读取请求等的发送步骤,并基于上述命令或请求执行相应步骤,并且,还可以基于数据读取请求向计算设备返回响应消息。
在示例性实施例中,还提供了一种计算机可读存储介质,例如包括程序代码的存储器,上述程序代码可由存储设备中的控制器执行以完成上述实施例中的数据重构方法。例如,该计算机可读存储介质可以是ROM(Read-Only Memory,只读存储器)、RAM(random access memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,只读光盘)、磁带、软盘和光数据存储设备等。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上该仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (42)

  1. 一种数据重构方法,其特征在于,所述方法包括:
    接收计算设备的数据读取请求,所述数据读取请求携带有目标逻辑地址;
    根据所述目标逻辑地址确定故障盘中对应的目标物理地址;
    若所述目标物理地址包括所述故障盘中的第一物理地址,则向所述计算设备反馈用于指示数据读取错误的响应消息,其中,所述故障盘中数据写入时间在第一时间点之后的物理地址为第一物理地址,所述第一时间点为所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    若所述目标物理地址为所述故障盘中的第二物理地址,向所述计算设备反馈所述第二物理地址中所存储的数据,所述故障盘中数据写入时间在所述第一时间点之前的存储地址为第二物理地址。
  3. 根据权利要求1或2所述的方法,其特征在于,所述若所述目标物理地址包括所述故障盘中的第一物理地址,则向所述计算设备反馈用于指示数据读取错误的响应消息之前,所述方法还包括:
    根据所述目标物理地址,查询故障数据表,所述故障数据表用于记录所述第一物理地址;
    若所述目标物理地址命中所述故障数据表中记录的任一物理地址,则确定所述目标物理地址包括所述故障盘中的第一物理地址。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述接收计算设备的数据读取请求之前,所述方法还包括:
    将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点;
    将所述故障盘中数据写入时间在所述第一时间点之后的物理地址作为所述第一物理地址;
    将所述故障盘中数据写入时间在所述第一时间点之前的物理地址作为所述第二物理地址。
  5. 根据权利要求4所述的方法,其特征在于,所述将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点之前,所述方法还包括:
    接收第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;
    执行所述获取所述第一时间点的步骤。
  6. 根据权利要求4或5所述的方法,其特征在于,所述将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点之前,所述方法还包括:
    接收第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;
    当支持所述目标数据处理模式,返回确认响应。
  7. 根据权利要求1至6任一项所述的方法,其特征在于,所述方法还包括:
    接收第三命令,所述第三命令用于指示恢复运行;
    根据所述第三命令的指示,恢复运行。
  8. 根据权利要求1至7任一项所述的方法,其特征在于,所述故障盘为SSD、eMMC和UFS中的任一类型的盘。
  9. 根据权利要求1至8任一项所述的方法,其特征在于,所述地址映射表为闪存转化层映射表。
  10. 根据权利要求1至9任一项所述的方法,其特征在于,所述用于指示数据读取错误的响应消息携带错误码。
  11. 一种数据重构方法,其特征在于,所述方法包括:
    向磁盘阵列系统中的故障盘发送数据读取请求,所述数据读取请求携带目标逻辑地址;
    接收所述故障盘响应所述数据读取请求反馈的响应消息,所述响应消息为所述目标逻辑地址所对应的目标物理地址的数据读取结果;
    若所述响应消息为用于指示数据读取错误的响应消息,则对存储于所述目标物理地址的数据进行数据重构,将重构数据写入替代盘中。
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括:若所述响应消息为数据,将接收到的数据写入所述替代盘中。
  13. 根据权利要求11或12所述的方法,其特征在于,所述向磁盘阵列系统中的故障盘发送数据读取请求之前,所述方法还包括:
    向所述故障盘发送第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分。
  14. 根据权利要求11至13任一项所述的方法,其特征在于,所述向磁盘阵列系统中的故障盘发送数据读取请求之前,所述方法还包括:
    向所述故障盘发送第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分;
    当接收到所述故障盘发送的确认响应时,执行向磁盘阵列系统中的故障盘发送数据读取 请求的步骤。
  15. 根据权利要求11至14任一项所述的方法,其特征在于,所述方法还包括:
    向所述故障盘发送第三命令,所述第三命令用于指示所述故障盘恢复运行。
  16. 根据权利要求11至15任一项所述的方法,其特征在于,所述对存储于所述目标物理地址的数据进行数据重构,包括:
    确定所述数据在所述磁盘阵列系统中所对应的条带,从所述磁盘阵列系统中除所述故障盘之外的磁盘中读取所述条带对应的数据;
    基于读取到的数据,对所述数据进行数据重构。
  17. 根据权利要求11至16任一项所述的方法,其特征在于,所述磁盘阵列系统为RAID。
  18. 根据权利要求11至17任一项所述的方法,其特征在于,所述磁盘阵列系统中的磁盘包括SSD、eMMC和UFS中的至少一项。
  19. 根据权利要求11至18任一项所述的方法,其特征在于,所述用于指示数据读取错误的响应消息携带错误码。
  20. 一种数据重构装置,其特征在于,所述装置包括:
    接收模块,用于接收计算设备的数据读取请求,所述数据读取请求携带有目标逻辑地址;
    确定模块,用于根据所述目标逻辑地址确定故障盘中对应的目标物理地址;
    发送模块,用于若所述目标物理地址包括所述故障盘中的第一物理地址,则向所述计算设备反馈用于指示数据读取错误的响应消息,其中,所述故障盘中数据写入时间在第一时间点之后的物理地址为第一物理地址,所述第一时间点为所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻。
  21. 根据权利要求20所述的装置,其特征在于,所述发送模块还用于若所述目标物理地址为所述故障盘中的第二物理地址,向所述计算设备反馈所述第二物理地址中所存储的数据,所述故障盘中数据写入时间在所述第一时间点之前的存储地址为第二物理地址。
  22. 根据权利要求20或21所述的装置,其特征在于,所述装置还包括:
    查询模块,用于根据所述目标物理地址,查询故障数据表,所述故障数据表用于记录所述第一物理地址;若所述目标物理地址命中所述故障数据表中记录的任一物理地址,则确定所述目标物理地址包括所述故障盘中的第一物理地址。
  23. 根据权利要求20至22任一项所述的装置,其特征在于,所述装置还包括:
    获取模块,用于将所述故障盘在故障发生时刻之前最近一次保存的地址映射表的时刻获取为所述第一时间点;
    地址区分模块,用于将所述故障盘中数据写入时间在所述第一时间点之后的物理地址作为所述第一物理地址;将所述故障盘中数据写入时间在所述第一时间点之前的物理地址作为所述第二物理地址。
  24. 根据权利要求23所述的装置,其特征在于,所述接收模块还用于接收第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;触发所述获取模块执行所述获取所述第一时间点的步骤。
  25. 根据权利要求23或24所述的装置,其特征在于,所述接收模块还用于接收第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行第一物理地址和第二物理地址的区分;
    所述发送模块还用于当支持所述目标数据处理模式,返回确认响应。
  26. 根据权利要求20至25任一项所述的装置,其特征在于,所述接收模块还用于接收第三命令,所述第三命令用于指示恢复运行;
    运行处理模块,用于根据所述第三命令的指示,恢复运行。
  27. 根据权利要求20至26任一项所述的装置,其特征在于,所述故障盘为SSD、eMMC和UFS中的任一类型的盘。
  28. 根据权利要求20至27任一项所述的装置,其特征在于,所述地址映射表为闪存转化层映射表。
  29. 根据权利要求20至28任一项所述的装置,其特征在于,所述用于指示数据读取错误的响应消息携带错误码。
  30. 一种数据重构装置,其特征在于,所述装置包括:
    发送模块,用于向磁盘阵列系统中的故障盘发送数据读取请求,所述数据读取请求携带目标逻辑地址;
    接收模块,用于接收所述故障盘响应所述数据读取请求反馈的响应消息,所述响应消息为所述目标逻辑地址所对应的目标物理地址的数据读取结果;
    重构模块,用于若所述响应消息为用于指示数据读取错误的响应消息,则对存储于所述目标物理地址的数据进行数据重构;
    写入模块,用于将重构数据写入替代盘中。
  31. 根据权利要求30所述的装置,其特征在于,所述写入模块还用于若所述响应消息为数据,将接收到的数据写入所述替代盘中。
  32. 根据权利要求30或31所述的装置,其特征在于,所述发送模块还用于向所述故障 盘发送第一命令,所述第一命令用于指示所述故障盘进入目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分。
  33. 根据权利要求30至32任一项所述的装置,其特征在于,所述发送模块还用于向所述故障盘发送第二命令,所述第二命令用于询问所述故障盘是否支持目标数据处理模式,所述目标数据处理模式用于进行物理地址的区分;
    所述发送模块还用于当接收到所述故障盘发送的确认响应时,执行向磁盘阵列系统中的故障盘发送数据读取请求的步骤。
  34. 根据权利要求30至33任一项所述的装置,其特征在于,所述发送模块还用于向所述故障盘发送第三命令,所述第三命令用于指示所述故障盘恢复运行。
  35. 根据权利要求30至34任一项所述的装置,其特征在于,所述重构模块用于:
    确定所述数据在所述磁盘阵列系统中所对应的条带,从所述磁盘阵列系统中除所述故障盘之外的磁盘中读取所述条带对应的数据;
    基于读取到的数据,对所述数据进行数据重构。
  36. 根据权利要求30至35任一项所述的装置,其特征在于,所述磁盘阵列系统为RAID。
  37. 根据权利要求30至36任一项所述的装置,其特征在于,所述磁盘阵列系统中的磁盘包括SSD、eMMC和UFS中的至少一项。
  38. 根据权利要求30至37任一项所述的装置,其特征在于,所述用于指示数据读取错误的响应消息携带错误码。
  39. 一种存储设备,其特征在于,所述存储设备包括控制器和一个或多个存储芯片,所述一个或多个存储芯片用于存储数据,所述控制器用于实现如权利要求1至权利要求10任一项所述的数据重构方法。
  40. 一种计算设备,其特征在于,所述计算设备包括处理器、存储器以及收发器,所述存储器中存储有指令,所述收发器用于接收和发送数据,当所述指令由所述处理器加载并执行时,使得所述计算设备实现如权利要求11至权利要求19任一项所述的数据重构方法。
  41. 一种磁盘阵列系统,其特征在于,包括:如权利要求40所述的计算设备以及多个如权利要求39所述的存储设备。
  42. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由设备加载并执行以实现如权利要求1至权利要求19任一项所述的数据重构方法。
PCT/CN2019/115154 2019-11-01 2019-11-01 应用于磁盘阵列系统的数据重构方法、装置及计算设备 WO2021082011A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/115154 WO2021082011A1 (zh) 2019-11-01 2019-11-01 应用于磁盘阵列系统的数据重构方法、装置及计算设备
CN201980101699.1A CN114600073A (zh) 2019-11-01 2019-11-01 应用于磁盘阵列系统的数据重构方法、装置及计算设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/115154 WO2021082011A1 (zh) 2019-11-01 2019-11-01 应用于磁盘阵列系统的数据重构方法、装置及计算设备

Publications (1)

Publication Number Publication Date
WO2021082011A1 true WO2021082011A1 (zh) 2021-05-06

Family

ID=75714739

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/115154 WO2021082011A1 (zh) 2019-11-01 2019-11-01 应用于磁盘阵列系统的数据重构方法、装置及计算设备

Country Status (2)

Country Link
CN (1) CN114600073A (zh)
WO (1) WO2021082011A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113223598A (zh) * 2021-05-31 2021-08-06 济南浪潮数据技术有限公司 一种基于io劫持的磁盘测试方法、装置、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090271657A1 (en) * 2008-04-28 2009-10-29 Mccombs Craig C Drive health monitoring with provisions for drive probation state and drive copy rebuild
CN105453180A (zh) * 2013-07-15 2016-03-30 惠普发展公司,有限责任合伙企业 重建驱动数据
CN106371947A (zh) * 2016-09-14 2017-02-01 郑州云海信息技术有限公司 一种用于raid的多故障盘数据恢复方法及其系统
CN107239233A (zh) * 2017-05-10 2017-10-10 杭州宏杉科技股份有限公司 一种磁盘阵列及基于其的数据重构方法和存储设备
CN108874321A (zh) * 2018-06-29 2018-11-23 郑州云海信息技术有限公司 一种独立冗余磁盘阵列数据重构方法、装置及设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6816950B2 (en) * 2002-05-08 2004-11-09 Lsi Logic Corporation Method and apparatus for upgrading disk drive firmware in a RAID storage system
CN101526885A (zh) * 2009-04-21 2009-09-09 杭州华三通信技术有限公司 一种提升独立磁盘冗余阵列性能的方法及其控制器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090271657A1 (en) * 2008-04-28 2009-10-29 Mccombs Craig C Drive health monitoring with provisions for drive probation state and drive copy rebuild
CN105453180A (zh) * 2013-07-15 2016-03-30 惠普发展公司,有限责任合伙企业 重建驱动数据
CN106371947A (zh) * 2016-09-14 2017-02-01 郑州云海信息技术有限公司 一种用于raid的多故障盘数据恢复方法及其系统
CN107239233A (zh) * 2017-05-10 2017-10-10 杭州宏杉科技股份有限公司 一种磁盘阵列及基于其的数据重构方法和存储设备
CN108874321A (zh) * 2018-06-29 2018-11-23 郑州云海信息技术有限公司 一种独立冗余磁盘阵列数据重构方法、装置及设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113223598A (zh) * 2021-05-31 2021-08-06 济南浪潮数据技术有限公司 一种基于io劫持的磁盘测试方法、装置、设备及介质
CN113223598B (zh) * 2021-05-31 2024-02-23 济南浪潮数据技术有限公司 一种基于io劫持的磁盘测试方法、装置、设备及介质

Also Published As

Publication number Publication date
CN114600073A (zh) 2022-06-07

Similar Documents

Publication Publication Date Title
JP6294518B2 (ja) 不揮発性メモリシステムにおける同期ミラーリング
US8862808B2 (en) Control apparatus and control method
US7831764B2 (en) Storage system having plural flash memory drives and method for controlling data storage
JP5768587B2 (ja) ストレージシステム、ストレージ制御装置およびストレージ制御方法
US20150378642A1 (en) File system back-up for multiple storage medium device
US9304685B2 (en) Storage array system and non-transitory recording medium storing control program
US20150331624A1 (en) Host-controlled flash translation layer snapshot
EP2879040B1 (en) Data storage method, data storage apparatus, and storage device
US11698728B2 (en) Data updating technology
US20130254457A1 (en) Methods and structure for rapid offloading of cached data in a volatile cache memory of a storage controller to a nonvolatile memory
US20190324859A1 (en) Method and Apparatus for Restoring Data after Power Failure for An Open-Channel Solid State Drive
US20090313617A1 (en) Method for Updating Control Program of Physical Storage Device in Storage Virtualization System and Storage Virtualization Controller and System Thereof
JP2016530637A (ja) Raidパリティストライプ再構成
US8839072B2 (en) Access control apparatus, storage apparatus, and method
US20160342476A1 (en) Solid state drive operations
TW201107981A (en) Method and apparatus for protecting the integrity of cached data in a direct-attached storage (DAS) system
JP6540334B2 (ja) システム、情報処理装置、および情報処理方法
US11487428B2 (en) Storage control apparatus and storage control method
CN116414616A (zh) 一种固态硬盘ssd故障恢复方法、ssd及系统
WO2021088367A1 (zh) 数据恢复方法及相关设备
WO2021082011A1 (zh) 应用于磁盘阵列系统的数据重构方法、装置及计算设备
CN112540869A (zh) 存储器控制器、存储装置和存储装置的操作方法
CN117149062A (zh) 一种磁带损坏数据的处理方法以及计算装置
US10901866B2 (en) Failure detection and data recovery in a storage system
US11055190B1 (en) System and method for facilitating storage system operation with global mapping to provide maintenance without a service interrupt

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: 19950254

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: 19950254

Country of ref document: EP

Kind code of ref document: A1