Method for rapidly migrating data at RAID (redundant array of independent disks) level
Direct access to the FTL table entries of the SSD through the RAID card and modify the mapping relationship, solving the problem of slow data migration speed in the existing technology, achieving fast RAID-level migration, and improving the reliability and efficiency of the system.
Patent Information
- Application Number
- CN202510821063.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-19
AI Technical Summary
During the data migration process, the existing technology occupies CPU and interface resources when moving through the host, resulting in slow transmission speed and affecting user services.
Direct access to the FTL inside the SSD through the RAID card, modify the mapping relationship of FTL table entries, use invalid addresses to migrate data, and quickly refresh FTL through custom NVMe commands to reduce data transfer.
It greatly shortens the switching time of RAID mode, reduces resource usage, and improves system reliability and data migration speed.
Smart Images

Figure CN120335730A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of SSD data migration, and particularly to a method for rapid migration of data RAID levels. Background Art
[0002] RAID (Redundant Array of Independent Disks), namely redundant array of independent disks, is simply referred to as "disk array". It is to form a large disk system by combining multiple independent disks together, so as to achieve better storage performance and higher reliability than a single disk. Among them, RAID0 and RAID1 are more commonly used in the system disk. The function of RAID0 is striping, which combines multiple disks together to form a large-capacity storage. When we want to write data, the data will be divided into N parts and the read and write of N disks will be realized independently. Then these N parts of data will be written to the disks simultaneously and concurrently, so the execution performance is very high; the function of RAID1 is backup. When writing data to the disk, the same data will be written to the disk twice without difference, and written to the working disk and the mirror disk respectively. If any disk is damaged, the data can be restored based on the other disk, and the data reliability is very strong, but the performance will be somewhat lost.
[0003] During the use process, users will select the RAID type to be used according to requirements such as reliability and performance. At the same time, if the requirements change, there is also the possibility of dynamically modifying the RAID type, such as adjusting the high-reliability RAID1 configuration to the high-performance RAID0 configuration, or other adjustments.
[0004] When the user adjusts the RAID mode, the RAID card or software RAID will currently perform the following operations: RAID1->RAID0 (2 disks). After splitting the storage space into stripes, the data of the even stripes will be written to the first member disk in sequence, and the data of the odd stripes will be written to the second member disk.
[0005] A solid state disk (SSD, Solid State Disk or Solid State Drive for short), also known as a solid state drive, is a hard disk made of a solid state electronic storage chip array, and currently mainly uses NAND Flash.
[0006] Inside the SSD, there are an SSD controller, DRAM, NAND, etc. The commands sent by the host are first sent to the SSD controller. The SSD controller queries the FTL (Flash Translation Table) entries in the DRAM according to the address that the host needs to access, converts the logical address (LBA) accessed by the host into the physical address (PBA) of the backend NAND, and accesses the specific NAND chip according to the PBA, so as to realize data reading and writing.
[0007] The function of the FTL is internal address mapping in the SSD, which is dynamically refreshed according to the internal algorithm and generally cannot be accessed by the host.
[0008] In the prior art, during the data migration process, the data is basically moved through the host. Taking a 960GB SSD as an example, 960GB of data needs to be read out and 960GB of data needs to be written. The current actual time taken reaches the hour level, occupying CPU and interface resources. During this period, the upper-layer services need to be paused, which has a great impact on the user services.
[0009] There is an urgent need for a new migration method that can solve the above problems. Summary of the Invention
[0010] A method for rapid migration of data RAID levels proposed by the present invention solves the problem that during the prior data migration process, when moving through the host, it occupies CPU and interface resources and causes slow transmission speed.
[0011] The technical solution of the present invention is implemented as follows: A method for rapid migration of data RAID levels, which involves a RAID card and a solid-state drive SSD for storing data. The SSD includes a controller, DRAM, and NAND. The DRAM includes an FTL (Flash Translation Table). The controller stores the data in the NAND by modifying the mapping relationship of the FTL table entries, including the following steps: S1: The host switches the mode through the RAID card; S2: After receiving the mode switching instruction and completing the switching preparation, the RAID card sends an FTL read / write command to the SSD; S3: The RAID card directly accesses the FTL inside the SSD through the interface and completes the modification of the FTL table entries, modifying the address mapping relationship; S4: After confirming that the FTL modification is completed, the RAID card reports the completion status to the host to complete the RAID level migration.
[0012] Among them, the command interfaces in S3 include the following two specific implementation methods: 1. Implementation through IO write operation: Use the command written in the invalid address as the entry of the FTL; when the RAID card issues a write command to this invalid address, the SSD directly maps to the FTL area for actual access inside; 2. Implementation by a custom configuration for the NVMe SSD: Configure the SSD through a custom NVMe command, and map the operation to the FTL area, then the FTL can be refreshed through the configuration.
[0013] Preferably, the step S2 further includes a backup operation, and the original FTL is backed up before writing a new FTL instruction.
[0014] Furthermore, the specific ways to access the FTL in the step S2 include: A: The RAID card sends FTL write commands to Disk0 and Disk1 respectively according to the mode switch instruction, and refreshes the FTL table entries one by one; B: The RAID card sends a command to switch from RAID1 to RAID0, where the first parameter RAID10 represents switching from RAID1 to RAID0, and the second parameter represents whether the local disk is Disk0 or Disk1; after receiving the command, the SSD determines how to refresh the FTL according to whether it is Disk0 or Disk1; C: Set a pointer *FTLe pointing to the RAID card memory, and the *FTLe stores the entire FTL content that needs to be written to the SSD; all the files in the RAID card memory are refreshed to the FTL of the SSD through this pointer.
[0015] Preferably, a CRC check or an ECC check is set in the process of writing the FTL in the step S2 to check the command and data, and the command is written after the check passes.
[0016] Preferably, S4 further includes a check after writing. After the write operation is completed, a read operation is performed, and the written data is compared with the data in the command. After the data is consistent, the RAID card returns an execution completion status to report to the host.
[0017] A method for fast migration of data RAID levels disclosed by the present invention realizes the modification of the LBA-PBA mapping relationship by customizing the FTL write interface; realizes the RAID mode switch by modifying the FTL table entries, thereby reducing the resource occupation during the RAID mode switch, greatly reducing the data migration amount, shortening the switching time; and significantly improving the system reliability. Description of the Drawings
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0019] Figure 1 : RAID card switching rule diagram. Specific implementation manner
[0020] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention. Specific implementation manner one In this embodiment, the solid-state drive SSD has a capacity of 960 GB and is split in units of 512 Bytes. Each unit is assigned an LBA. For a 480 GB SSD, its LBA addresses range from 0 to 937703087, and larger LBA addresses are invalid addresses that are generally not accessed by users. The host performs mode switching through the RAID card; the RAID card is connected to the SSD. Through the IO write operation, an invalid address, such as LBA 937703100, is used as the entry of the FTL. When the RAID card issues a write command for LBA 937703100, the SSD internally maps to the FTL area for actual access and read / write of the FTL. The FTL specifically represents the mapping relationship between the LBA logical address and the PBA physical address; the RAID card directly accesses the FTL inside the SSD according to the received mode switching instruction and completes the modification of the FTL table entries to modify the address mapping relationship; for a 480 GB SSD, after writing data to 937500 LBAs starting from this address, the entire FTL can be refreshed; As Figure 1 shown in the RAID card switching rule diagram, the RAID card sends Write FTL commands to Disk0 and Disk1 respectively according to the switching rules to refresh the FTL table entries one by one; Disk0: WriteFTL(1, 2); where 1 represents LBA1 and 2 represents PBA2. WriteFTL(2, 4); WriteFTL(3, 6); WriteFTL(4, 8);...; Disk1: WriteFTL(0, 1); WriteFTL(1, 3); WriteFTL(2, 5); WriteFTL(3, 7); WriteFTL(4, 9);...; The above write operations continue until the maximum address of the maximum capacity of the RAID group.
[0022] The RAID card can also directly send a command to switch from RAID1 to RAID0: The first parameter RAID10 represents switching from RAID1 to RAID0; the second parameter represents whether this disk is Disk0 or Disk1; after receiving the command, the SSD determines how to refresh the FTL in the SSD based on whether it is Disk0 or Disk1. Disk0: WriteFTL(1, 2); where 1 represents LBA1 and 2 represents PBA2. WriteFTL(2, 4); WriteFTL(3, 6); WriteFTL(4, 8);... If the disk is Disk1, perform the following operations (same as the above scheme): WriteFTL(0, 1); WriteFTL(1, 3); WriteFTL(2, 5); WriteFTL(3, 7); WriteFTL(4, 9);... It is also possible to flush all the files in the RAID card memory to the FTL of the SSD through this interface according to the entire FTL content to be written to the SSD stored in the pointer *FTLe pointing to the RAID card memory.
[0023] Through three ways of accessing the FTL, after the host directly modifies the address mapping relationship in the FTL through the RAID card and confirms the completion of the FTL modification, the RAID card modifies the SSD according to the feedback FTL command. After the SSD completes the modification, the RAID card reports the completion status to the host to complete the RAID level migration. In this embodiment, unlike the prior art where the host writes and updates the FTL through the SSD controller, the data transfer speed is greatly improved.
[0024] Among them, the NVMe type SSD can be customized through NVMe commands, such as Set Feature. Among them, Feature ID 00~85h has been defined, and 86h~BFh are reserved Set Feature IDs. By configuring the Set Feature ID to configure the SSD, the operation is mapped to the FTL area, and the FTL can be refreshed through the configuration, thereby realizing the rapid transfer of data. Specific Embodiment 2 The FTL determines the internal data mapping relationship of the SSD. If written incorrectly, it will cause data errors. Therefore, the writing of the FTL needs to ensure absolute correctness. Based on the specific embodiment 1, a backup operation is added. Before writing a new FTL instruction, the original FTL is backed up. If the FTL is written incorrectly, it can be restored to the initial state by rolling back the version, avoiding errors caused by the fast writing of the FTL. Specific Embodiment 3 Based on the specific embodiment 2, that is, each time the FTL is written, CRC check or ECC check is set to check the commands and data, and the commands are written after the check passes. After the write check, after the write operation is completed, a read operation is performed, and the written data is compared with the data in the command. After the data is consistent, the RAID card returns the execution completion status to the host.
[0027] On the premise of ensuring the data transfer speed, ensure the security and stability of the migration.
[0028] Of course, without departing from the spirit and essence of the present invention, those skilled in the art should be able to make various corresponding changes and modifications according to the present invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for rapid migration of data RAID levels, which relates to a RAID card and a solid-state drive SSD for storing data. The SSD includes a controller, DRAM, and NAND. The DRAM includes a FTL, and the controller stores data in the NAND by modifying the mapping relationship of the FTL table entries. It is characterized in that: It includes the following steps: S1: The host performs mode switching through the RAID card; S2: After the RAID card receives the mode switching instruction and finishes the switching preparation, it sends FTL read / write commands to the SSD; S3: The RAID card directly accesses the FTL inside the SSD through the interface, completes the modification of the FTL entries, and modifies the address mapping relationship; S4: After confirming that the FTL modification is completed, the RAID card reports the completion status to the host to complete the RAID level migration.
2. The method for quickly migrating a data RAID level according to claim 1, wherein: The command interface in S3 includes the following two specific implementation methods:
1. Implementation through IO write operation: Use the command written within the invalid address as the entry of the FTL. When the RAID card issues a write command to this invalid address, the SSD directly maps to the FTL area for actual access; 2. Implementation for NVMe-based SSDs through custom configuration: Configure the SSD through custom NVMe commands, and the operations are mapped to the FTL area, so that the FTL can be refreshed through configuration.
3. The method for quickly migrating a data RAID level according to claim 2, characterized in that: The step S2 also includes a backup operation, that is, the original FTL is backed up before writing new FTL instructions.
4. A method for rapid migration of a data RAID level according to any one of claims 1 to 3, characterized in that: The specific ways to access the FTL in the step S2 include: A: The RAID card sends FTL write commands to Disk0 and Disk1 respectively according to the mode switching instruction, and refreshes the FTL entries one by one; B: The RAID card sends a command to switch from RAID1 to RAID0, where the first parameter RAID10 represents switching from RAID1 to RAID0, and the second parameter represents whether this disk is Disk0 or Disk1. After receiving the command, the SSD determines how to refresh the FTL according to whether it is Disk0 or Disk1; C: Set a pointer *FTLe pointing to the memory of the RAID card, and the *FTLe stores the entire FTL content that needs to be written to the SSD. All the files in the memory of the RAID card are refreshed to the FTL of the SSD through this pointer.
5. A method for rapid migration of data RAID levels according to claim 4, characterized in that: During the process of writing the FTL in the step S2, CRC check or ECC check is set to check the commands and data, and the commands are written after the check passes.
6. A method for rapid migration of data RAID levels according to claim 5, characterized in that: The S4 also includes verification after writing. After the write operation is completed, a read operation is performed, and the written data is compared with the data in the command. After the data is consistent, the RAID card returns the execution completion status to the host.
Citation Information
Patent Citations
Method for mapping disk array of solid hard disk and solid hard disk
CN102830942A
Apparatus, system and method for determining a configuration parameter for solid-state storage media
CN102890621A
Intra-device data protection in a RAID array
CN103339609A
Data recovery method, system and device in storage system
CN111104056A
Self-adaptive FTL algorithm of solid state disk
CN111177034A