Data storage method, system and equipment and storage medium
By configuring storage disks of different granularity in the storage array, separating the storage service data and integrity verification data, the problems of silent errors and shortening of storage disk life in the prior art are solved, and efficient data protection and processing are achieved.
Patent Information
- Application Number
- CN202411742615.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, data is prone to silent errors during transmission of storage systems, and commercial-grade SSD disks do not support flexible data + DIF granular configurations, resulting in low data protection efficiency and shortened storage disk life.
By configuring the first storage disk and the second storage disk to different granularity, the service data is stored in the logical block of the first storage disk, and the integrity verification data is stored in the logical block of the second storage disk, each second logic block corresponds to at least one first logic block.
It realizes the separation of storage service data and integrity verification data, reduces the operating frequency of a single storage disk, extends the service life of the storage disk, and improves data processing speed, supporting end-to-end data protection.
Smart Images

Figure CN119690340A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data storage, and in particular to a data storage method, system, device and storage medium. Background Art
[0002] Storage arrays have become an important storage device in the current digital economy infrastructure construction (computing power, storage power, and transportation capacity), and their application scope is becoming increasingly wide, especially at the enterprise level.
[0003] Enterprise-level applications have high requirements for data reliability. However, when data is transmitted in the storage system, it passes through multiple components, multiple transmission channels, and complex software processing. An error in any link may cause data errors. And this error is generally not detected immediately. Instead, the data is discovered to be wrong when the application accesses the data. This kind of error that is difficult to detect at the moment the data error occurs is called a silent error. In order to meet the enterprise's requirements for data reliability, end-to-end data protection needs to be implemented.
[0004] In the prior art, DIF (Data Integrity Field) is usually used to achieve end-to-end data protection. The main steps include: the host sends the target data and DIF to the storage array through the network, and after the NVMe-OF controller receives the relevant data, it parses the check data CRC1 in DIF. At the same time, the NVMe-OF controller uses the same CRC method to calculate the check data CRC2 of the protected data, and compares CRC1 and CRC2 for consistency. If they are inconsistent, it means that the data is wrong and the data is discarded.
[0005] End-to-end data protection is not only reflected in writing, but also in reading back. The target data and DIF sent from the host need to be saved so that the storage device can perform another verification when the target data is read back. Then, the target data needs to be transmitted back to the host together with the DIF. The host will perform another verification based on the target data and DIF to ensure that the received target data is correct. Therefore, from writing to reading, the host can verify at each node because the DIF and data are sent and received together, so errors can be discovered in time to avoid silent errors, thereby achieving end-to-end data protection.
[0006] One of the foundations for supporting end-to-end data protection is that DIF data can be stored. However, commercial-grade SSDs generally do not support flexible (data + DIF) granularity configurations such as (512B+8B) / (4KiB+64B) / 168KiB+128B) within the disk. Summary of the invention
[0007] In view of this, embodiments of the present application provide a data storage method, system, device and storage medium, which can effectively solve the problems of low efficiency in reading and writing data integrity fields and affecting the life of storage disks.
[0008] In a first aspect, an embodiment of the present application provides a data storage method, which is applicable to a storage array controller, wherein the storage array includes a plurality of storage disks, and the method includes:
[0009] respectively configuring the granularity of the first storage disk and the second storage disk;
[0010] storing the service data in the data unit sent by the host in the first logic block of the first storage disk;
[0011] The integrity check data in the data unit is stored in a second logic block of the second storage disk; wherein each of the second logic blocks corresponds to at least one of the first logic blocks.
[0012] In some embodiments, storing the integrity check data in the data unit to the second logic block of the second storage disk includes:
[0013] Determine a second target logical address according to a first target logical address corresponding to the first logical block and according to a preset disk address mapping relationship between the first storage disk and the second storage disk;
[0014] According to the second target logical address, the corresponding integrity check data is written into a second logical block corresponding to the second storage disk.
[0015] In some embodiments, determining the second target logical address according to a preset disk address mapping relationship between the first storage disk and the second storage disk includes:
[0016] The first target logical address is divided by a preset data capacity ratio to obtain the second target logical address; wherein the data capacity ratio is a ratio of the lengths of the business data and the integrity check data in the data unit.
[0017] In some embodiments, if the storage array is configured in a redundant mode, each redundant group includes a plurality of first storage disks, and the second logic block stored in the second storage disk includes:
[0018] Determine a corresponding second target logical address according to a first target virtual logical address corresponding to the first logical block and according to a preset disk address mapping relationship between the first storage disk and the second storage disk;
[0019] According to the second target logical address, the corresponding integrity check data is written into a second logical block corresponding to the second storage disk.
[0020] In some embodiments, determining the corresponding second target logical address according to a preset disk address mapping relationship between the first storage disk and the second storage disk includes:
[0021] The first target virtual logical address is divided by a preset data capacity ratio to obtain the second target logical address, wherein the data capacity ratio is a ratio of the lengths of the business data and the integrity check data in the data unit.
[0022] In some embodiments, the method further comprises:
[0023] The logical addresses of the first storage array formed by the first storage disks are mapped to virtual logical addresses; wherein the logical addresses of the multiple first logical blocks in each stripe are mapped to continuous virtual logical addresses in the order of the stripes in the redundant group.
[0024] In some embodiments, each of the second logic blocks corresponds to at least one of the first logic blocks and further includes:
[0025] A ratio of a total capacity of the at least one first logical block to a capacity of the second logical block is equal to a data capacity ratio.
[0026] In some embodiments, the method further comprises:
[0027] Before storing the business data and the integrity check data in the storage array, the business data in the data unit is cached in the business cache space, and the corresponding integrity check data is cached in the check cache space; wherein the controller memory of the storage array controller includes the business cache space and the check cache space.
[0028] In some embodiments, storing the service data in the data unit sent by the host to the first logic block of the first storage disk includes:
[0029] Sending a first write data command to a first storage disk controller;
[0030] The first write data command is used to instruct the first storage disk to read the service data from the service cache space using a direct memory access technology;
[0031] The step of storing the integrity check data in the data unit to the second logic block of the second storage disk includes:
[0032] Sending a second write data command to the second storage disk controller;
[0033] The second write data command is used to instruct the second storage disk to read the integrity check data from the check cache space using direct memory access technology.
[0034] In a second aspect, an embodiment of the present application provides a storage array system, including: a storage array controller and a storage array; the storage array includes a first storage disk and a second storage disk;
[0035] The storage array controller is used to implement the data storage method provided in the first aspect of the present application.
[0036] In a third aspect, an embodiment of the present application provides a terminal device, the terminal device comprising a processor and a memory, the memory storing a computer program, and the processor being used to execute the computer program to implement a data storage method provided in the first aspect of the present application.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed on a processor, it implements a data storage method provided in the first aspect of the present application.
[0038] The embodiments of the present application have the following beneficial effects:
[0039] The present application first configures the first storage disk and the second storage disk to have different granularities; stores the business data in the data unit sent by the host to the first logical block of the first storage disk; stores the integrity check data in the data unit to the second logical block of the second storage disk; wherein each second logical block corresponds to at least one first logical block. In the prior art, the present application stores the integrity check data and business data in separate disks. On the one hand, if the second storage disk is damaged, the second storage disk can be replaced without affecting the use of the first storage disk. On the other hand, separate disk storage can flexibly use first logical blocks and second logical blocks of different granularities to store business data and integrity check data, thereby improving the data processing speed. This makes up for the lack of end-to-end data integrity function supported by commercial-grade data disks, and expands the application of commercial-grade disks in enterprise-level scenarios. The first storage disk uses a commercial-grade storage disk, and the second storage disk can use an enterprise-level storage disk with higher reliability and longer life, so as to obtain the most cost-effective enterprise-level application array solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A structural block diagram of a storage array system according to an embodiment of the present application is shown;
[0042] Figure 2 A flow chart showing a data storage method according to an embodiment of the present application is shown;
[0043] Figure 3 An application scenario diagram of the data storage method according to an embodiment of the present application is shown;
[0044] Figure 4 A schematic diagram of a storage array of a data storage method according to an embodiment of the present application is shown;
[0045] Figure 5 Another application scenario diagram of the data storage method according to an embodiment of the present application is shown;
[0046] Figure 6 A schematic diagram showing a disk address mapping relationship of a data storage method according to an embodiment of the present application;
[0047] Figure 7 A schematic diagram showing the mapping relationship between virtual logical addresses and stripes in the data storage method according to an embodiment of the present application.
[0048] Description of main component symbols:
[0049] 100 - storage array controller; 200 - storage array; 210 - first storage disk; 220 - second storage disk; 300 - host. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0051] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0052] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0053] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0054] In the existing DIF storage solution, the protected target data and DIF are stored together, and the storage disk needs to support end-to-end data integrity function. For example, after receiving a write command carrying DIF data, the protected data and DIF are stored separately after performing integrity check, and the disk needs to be formatted into 512+8B, 4Ki+64B and other modes. Disks that do not support this function need to use the method of piecing together multiple DIFs of target data or filling invalid data to meet the minimum granularity before they can be written to the disk. If the capacity ratio of target data and DIF is 64:1, it means that it is necessary to wait for the DIFs of 64 target data to be pieced together before they can be written to the disk. When reading a certain target data, all 64 DIFs need to be read out for integrity check. Therefore, the existing DIF storage method is very inconvenient in reading and writing, and has low read and write efficiency. And because the storage unit storing DIF data is read much more frequently than the storage unit storing data, the service life of the storage disk will be shortened due to severe write amplification.
[0055] The embodiment of the present application provides a DIF storage solution that can solve the above problems. The following is a detailed description of some implementation methods of the present application in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0056] Figure 1A structural block diagram of a storage array system of an embodiment of the present application is shown. Exemplarily, the storage array system includes: a storage array controller 100 and a storage array 200. The storage array controller 100 is connected to a host 300 for communication. The host 300 is used to send a data stream corresponding to a read and write access command to the storage array controller 100, and the data stream includes business data and integrity check data. Specifically, the data stream includes a plurality of data units. The data unit includes a business field and a DIF field. Exemplarily, the business field includes a timestamp, an identifier, a data value, a sequence number, a device status, etc. The data integrity field is mainly used to ensure the integrity and correctness of the data.
[0057] The storage array controller 100 is used to implement a data storage method provided by the present application to store DIF integrity check data and read and write data to the storage array 200 .
[0058] Further, the storage array 200 includes a first storage disk 210 and a second storage disk 220. The granularity of the first storage disk 210 and the second storage disk 220 are configured respectively. The logical address space of the first storage disk 210 is formatted into logical blocks according to the first granularity to obtain a plurality of first logical blocks. The logical address space of the second storage disk 220 is formatted into logical blocks according to the second granularity to obtain a plurality of second logical blocks. The first granularity and the second granularity can be configured to be the same or different, and naturally, the granularity of the first logical block and the second logical block can be the same or different. In the embodiment of the present application, the DIF integrity check data is stored in the second storage disk 220, and the service data is stored in the first storage disk 210. The length ratio of the service data and the integrity check data in the data unit in the embodiment of the present application is referred to as the data capacity ratio. For example, the storage format of the service data and the integrity check data in the data unit is (512B+8B), (4KiB data+64B) or 16KiB+128B). Thus, the data capacity ratio is 64:1. Under normal circumstances, if the first storage disk LB (Logic Block) is formatted as X, then the DIF SSD (the second storage disk 220 is also called DIF SSD) logical block is formatted as X / 64. However, mainstream SSDs generally do not support formatting with a granularity below 512B. Therefore, the second granularity of the DIF SSD can be 512B.
[0059] Exemplarily, the data SSD disk (also referred to as the first storage disk 210) is formatted as 4KiB / 8KiB, and the first logical block is 4KiB / 8KiB. The DIF disk is formatted as 512B, and the second logical block is 512B. Therefore, it is only necessary to form a group of 8 / 4 first logical blocks, corresponding to one second logical block of a DIF SSD disk, thereby satisfying the capacity ratio relationship of 64:1.
[0060] The data storage method is described below in conjunction with some specific embodiments.
[0061] Figure 2 A flow chart of a data storage method according to an embodiment of the present application is shown. Exemplarily, the data storage method comprises the following steps:
[0062] S100, respectively configure the granularity of the first storage disk 210 and the second storage disk 220. For example, the granularity of the first storage disk 210 is 4KiB and the granularity of the second storage disk 220 is 512B, or the granularity of the first storage disk 210 is 8KiB and the granularity of the second storage disk 220 is 512B.
[0063] S200 , storing the business data in the data unit sent by the host 300 into the first logical block of the first storage disk 210 .
[0064] S300, storing the integrity check data in the data unit to the second logic block of the second storage disk 220; wherein each second logic block corresponds to at least one first logic block. Exemplarily, if the granularity of the first storage disk 210 is 4KiB and the second storage disk 220 is 512B, then one second logic block corresponds to 8 first logic blocks. If the granularity of the first storage disk 210 is 8KiB and the second storage disk 220 is 512B, then one second logic block corresponds to 4 first logic blocks.
[0065] It can be understood that in this application, a read / write command sent by the host 300 will be split into two read / write commands to access two storage disks, namely, access the first storage disk 210 (data SSD disk) and the second storage disk 220 (DIF SSD disk) respectively.
[0066] In the prior art, business data and integrity verification data are mixedly stored, and the integrity verification data can be stored in any SSD disk in the storage array 200. The operation frequency of the integrity verification data is relatively high, and the resulting write amplification problem affects the service life of each SSD disk. In the trial embodiment of the present application, business data and integrity verification data are stored in separate disks, and the integrity verification data is stored separately in the DIF SSD disk to avoid the high operation frequency of the DIF SSD disk affecting the life of all storage disks. In the present application, when the DIF disk is damaged, only the DIF disk needs to be replaced, without replacing all storage disks. At the same time, a smaller granularity is configured for the DIF disk, which also reduces the operation frequency of the DIF disk and reduces the write amplification during use. The various data SSD disks in the storage array 200 in the present application constitute a first storage disk array. The present application can store business data vertically in each data SSD disk, and can also store it horizontally in the first storage disk array in stripes.
[0067] For example, when the business data is stored in a data SSD disk in a longitudinal storage manner, such as Figure 3 As shown, the data stream sent by the host 300 includes multiple data units. The length ratio of the service data and the integrity check data in the data unit is 64:1, for example, 4KiB:64B. The DIF SSD disk logical block is formatted as 512B. One logical block can store the integrity check data of 8 data units (8*64B=512B), and the data SSD disk logical block is formatted as 4KiB. Eight 4KiB logical blocks in the data SSD disk correspond to one 512B logical block in the DIF SSD disk.
[0068] The parsed data units are stored one by one, and the 4KiB of business data in the first data unit is stored in the first logical block of the data SSD disk, and the corresponding 64B of integrity verification data is temporarily stored in the cache as the first data segment; the 4KiB of business data in the second data unit is stored in the second logical block of the data SSD disk, and the corresponding 64B of integrity verification data is temporarily stored in the cache as the second data segment. Similarly, the 4KiB of business data in the eighth data unit is stored in the eighth logical block of the data SSD disk, and the corresponding 64B of integrity verification data is temporarily stored in the cache as the eighth data segment. When the integrity verification data combination of multiple data units in the cache together meets the logical block size of the DIF SSD disk (512B in this embodiment), the multiple integrity verification data are written together into the first logical block of the DIF SSD disk.
[0069] Exemplarily, when the service data is stored in the first storage disk array in a horizontal storage manner, a row in the first storage disk array composed of each data SSD disk is used as a stripe. Exemplarily, if the redundancy mode is 6+2, that is, there are 8 members in a redundancy group, each redundant stripe includes 6 data blocks + 2 check blocks, such as Figure 4 As shown, SSD1-SSD8 is a redundant group, and one row in the redundant group is a stripe. In each stripe, 6 LB blocks are data blocks, which are used to store the service data sent by the host 300; 2 LB blocks are check blocks, which are used to store the check data encoded according to the 6 service data. In the event of an error in any LB block in the redundant group, data can be recovered through the other 7 LB blocks (the 6+2 configuration can achieve data recovery of up to 2 LB blocks in the redundant group at the same time).
[0070] If the storage array node supports redundancy, a stripe in the redundancy group can be mapped to a logical block in a DIF SSD disk. Figure 5As shown, for example, each data unit in the data stream includes 4KiB of business data and 64B of integrity check data. The parsed data units are stored one by one, and the 4KiB of business data in the first data unit is stored in the first logical block in the first stripe of the first storage disk array, and the corresponding 64B of integrity check data is temporarily stored in the cache as the first data segment; the 4KiB of business data in the second data unit is stored in the second logical block in the first stripe, and the corresponding 64B of integrity check data is temporarily stored in the cache as the second data segment. Similarly, after the writing of the 6 logical blocks in the stripe is completed, the EC algorithm is used to calculate the check data and write it into the remaining 2 logical blocks of the stripe to form redundant protection. At the same time, the same EC algorithm needs to be used to generate 2 redundant check data for the corresponding 6 integrity check data in the cache to form redundant protection within the disk for the integrity check data, and store it in the first logical block in the DIF SSD disk.
[0071] Further, in order to facilitate reading of the business data and the corresponding integrity check data, in step S300, storing the integrity check data in the data unit to the second logic block of the second storage disk 220 includes:
[0072] S311, determining a second target logical address according to the first target logical address corresponding to the first logical block and according to a preset disk address mapping relationship between the first storage disk 210 and the second storage disk 220. The disk address mapping relationship is a mapping relationship between a first target logical address for storing business data and a second target logical address for storing integrity check data.
[0073] S312, according to the second target logical address, write the corresponding integrity check data into the second logical block corresponding to the second storage disk 220. It can be understood that when writing, the second target address is determined according to the disk address mapping relationship for writing, and when reading, the second target address is also determined according to the disk address mapping relationship for reading.
[0074] Exemplarily, in step S311, determining the second target logical address according to the preset disk address mapping relationship between the first storage disk 210 and the second storage disk 220 includes:
[0075] The first target logical address is divided by a preset data capacity ratio to obtain the second target logical address; wherein the data capacity ratio is the length ratio of the service data and the integrity check data in the data unit. Figure 6 As shown, in the longitudinal storage mode, for example, the addresses of the eight logical blocks in the data SSD disk are LBA0-LBA32767, and the address of one logical block in the DIFSSD disk is LBA '0-LBA ' 511. Among them, LBA0 / 64=LBA ' 0, LBA4096 / 64 = LBA ' 64, LBA8192 / 64=LBA ' 128. Further, in order to quickly calculate the logical address in the corresponding DIF SSD disk, the present application adopts a circuit module to realize the automatic calculation of the second target logical address.
[0076] Further, if the storage array 200 is configured in a redundant mode, each redundant group includes a plurality of first storage disks 210, and the second logic block stored in the second storage disk 220 includes:
[0077] S321 : Determine a corresponding second target logical address according to a first target virtual logical address corresponding to the first logical block and a preset disk address mapping relationship between the first storage disk 210 and the second storage disk 220 .
[0078] S322: Write the corresponding integrity check data into a second logical block corresponding to the second storage disk 220 according to the second target logical address.
[0079] Further, in step S321, determining the corresponding second target logical address according to the preset disk address mapping relationship between the first storage disk 210 and the second storage disk 220 includes:
[0080] The first target virtual logical address is divided by a preset data capacity ratio to obtain the second target logical address, wherein the data capacity ratio is a ratio of the lengths of the business data and the integrity check data in the data unit.
[0081] In one embodiment, the method further comprises:
[0082] The logical addresses of the first storage array formed by each first storage disk 210 are mapped to virtual logical addresses; wherein the logical addresses of the first logical blocks in each stripe are mapped to continuous virtual logical addresses in the order of the stripes in the redundancy group. Figure 7 As shown, continuous virtual logical addresses virtual_LBA0-virtual_LBA15 are obtained. The service data and integrity check data are stored sequentially according to the mapped virtual logical address virtual_LBA, and virtual_LBA / 64 corresponding to the service data can automatically calculate the LBA for storing the integrity check data in the DIF SSD disk.
[0083] Furthermore, in order to efficiently store data, each of the second logic blocks corresponds to at least one of the first logic blocks and further includes:
[0084] The ratio of the total capacity of the at least one first logic block to the capacity of one second logic block is equal to the data capacity ratio, that is, the integrity check data of multiple logic blocks are stored in one second logic block.
[0085] Furthermore, the method further comprises:
[0086] Before storing the service data and the integrity check data in the storage array 200, the service data in the data unit is cached in the service cache space, and the corresponding integrity check data is cached in the check cache space; wherein the controller memory of the storage array controller 100 includes the service cache space and the check cache space. The controller memory is used for the storage array controller 100 to cache data. In the embodiment of the present application, the controller memory is divided into the service cache space and the check cache space.
[0087] Furthermore, storing the service data in the data unit sent by the host 300 in the first logic block of the first storage disk 210 includes:
[0088] S221, sending a first write data command to the controller of the first storage disk 210;
[0089] S222, the first write data command is used to instruct the first storage disk 210 controller to read the business data from the business cache space using direct memory access technology.
[0090] The step of storing the integrity check data in the data unit to the second logic block of the second storage disk 220 includes:
[0091] S341, sending a second write data command to the second storage disk controller;
[0092] S342, the second write data command is used to instruct the second storage disk controller to read the integrity check data from the check cache space using direct memory access technology.
[0093] In one implementation, storing the service data in the data unit sent by the host 300 in the first logic block of the first storage disk 210 includes:
[0094] If the length of the business data in the data unit in the data stream is smaller than the capacity of the first logical block, the business data in multiple data units are combined in a preset order to obtain a business data group equal to the capacity of the first logical block, and the business data group is stored in the first storage disk 210.
[0095] For example, each data unit in the data stream includes 4KiB of service data and 64B of integrity check data. The first storage disk 210 uses 8KiB granularity for logical block formatting, and the size of a logical block in the first storage disk 210 is 8KiB. The service data in the two data units are combined into one piece according to the receiving order in the data stream to obtain an 8KiB service data combination. The service data combination is stored in an 8KiB logical block.
[0096] The step of storing the integrity check data in the data unit to the second logic block of the second storage disk 220 includes:
[0097] If the length of the integrity check data in the data unit in the data stream is less than the capacity of the second logical block, the integrity check data in multiple data units are combined in the preset order to obtain an integrity check data group equal to the capacity of the second logical block, and stored in the second storage disk 220 according to the integrity check data group.
[0098] The data storage method of the present application is introduced below with reference to an example of writing data, including the following steps:
[0099] S410, the host 300 sends a data stream corresponding to a write data command to the NVME controller.
[0100] S420: The NVME controller parses the data stream and divides the write data command into two write commands, for example, a first write data command and a second write data command.
[0101] S430, the NVME controller parses the business data in the data unit according to the first write data command, and performs CRC check on the business data to obtain CRC check data, and compares the CRC check data with the integrity check data in the parsed data unit. If the results are consistent, the business data is cached into the business cache space; the NVME controller caches the integrity check data in the parsed data unit into the check cache space according to the second write data command.
[0102] S440, the NVME controller determines a second target logical address for storing integrity check data in the DIF SSD disk according to the first target logical address of the data SSD disk to be accessed carried in the write data command. For example, the first target logical address is divided by 64 to obtain the second target logical address.
[0103] S450, the NVME controller sends a first write data command to the first storage disk controller in the storage array 200, and sends a second write data command to the second storage disk 220, wherein the first write data command includes the address of the business data in the business cache space and the first target logical address; the second write data command includes the address of the integrity check data in the check cache space and the second target logical address.
[0104] S460, the first storage disk controller uses direct memory access technology (DMA) to read the service data in the service cache space. The second storage disk controller uses direct memory access technology to read the integrity check data stored in the check cache space.
[0105] The data storage method of the present application is introduced below with reference to an example of reading data, including the following steps:
[0106] S510, the host 300 sends a read data command to the NVME controller.
[0107] S520: The NVME controller parses the read data command and divides the read data command into two read commands, for example, a first read data command and a second read data command.
[0108] S530, the NVME controller allocates cache space in the business cache space for the first read data command to prepare the cached business data to be read, and allocates cache space in the verification cache space for the second read data command to prepare the cached integrity verification data to be read.
[0109] S540, the NVME controller determines a second target logical address for storing integrity check data in the DIF SSD disk according to the first target logical address of the data SSD disk to be accessed carried in the read data command. For example, the first target logical address is divided by 64 to obtain the second target logical address.
[0110] S550, the NVME controller sends a first read data command to the first storage disk controller in the storage array 200, and sends a second read data command to the second storage disk 220, wherein the first read data command includes the address of the cache space allocated for the first read command and the first target logical address; the second read data command includes the address of the cache space allocated for the second read command and the second target logical address.
[0111] S560: The first storage disk controller reads the service data in the first storage disk 210 according to the first target logical address.
[0112] The second storage disk controller reads the integrity check data in the second storage disk 220 according to the second target logical address.
[0113] The first storage disk controller performs a CRC check on the read business data, and compares the check result with the integrity check data read by the second storage disk controller. If the two results are consistent, the business data is cached in the business cache space, and the corresponding integrity check data is cached in the check cache space. The present application saves the business data and integrity check data separately, and sets the granularity of the data SSD disk and the DIF SSD disk respectively, thereby reducing the complexity of storing and reading the integrity check data due to the inability to set multiple granularities in a single storage disk. The present application saves the integrity check data separately to avoid the high read and write frequency of the integrity check data affecting the life of all storage disks. When the DIF SSD disk is damaged, only the DIF SSD disk needs to be replaced without replacing all storage disks. The data SSD disk uses a commercial-grade storage disk, and the DIF SSD disk can use an enterprise-level storage disk with higher reliability and longer life, so as to obtain the most cost-effective enterprise-level application array solution.
[0114] A schematic diagram of a structure of a data storage device according to an embodiment of the present application. Exemplarily, the data storage device comprises: a granularity configuration module, a business data storage module and a verification data storage module.
[0115] A granularity configuration module, used to configure the granularity of the first storage disk 210 and the second storage disk 220 respectively, wherein the first storage disk and the second storage disk can be configured to have the same or different granularities;
[0116] A service data storage module, used for storing the service data in the data unit sent by the host 300 into the first logic block of the first storage disk 210;
[0117] The verification data storage module is used to store the integrity verification data in the data unit to the second logic block of the second storage disk 220; wherein each of the second logic blocks corresponds to at least one of the first logic blocks.
[0118] It can be understood that the device of this embodiment corresponds to the data storage method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0119] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the functions of each module in the above-mentioned data storage method or the above-mentioned data storage device.
[0120] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0121] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0122] The present application also provides a computer-readable storage medium for storing the computer program used in the above-mentioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0123] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0124] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0125] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0126] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A data storage method, characterized in that: Applicable to a storage array controller, the storage array includes a plurality of storage disks, the method includes: respectively configuring the granularity of the first storage disk and the second storage disk; storing the service data in the data unit sent by the host in the first logic block of the first storage disk; The integrity check data in the data unit is stored in a second logic block of the second storage disk; wherein each of the second logic blocks corresponds to at least one of the first logic blocks.
2. The data storage method according to claim 1, characterized in that: The step of storing the integrity check data in the data unit to the second logic block of the second storage disk includes: Determine a second target logical address according to a first target logical address corresponding to the first logical block and according to a preset disk address mapping relationship between the first storage disk and the second storage disk; According to the second target logical address, the corresponding integrity check data is written into a second logical block corresponding to the second storage disk.
3. The data storage method according to claim 2, characterized in that: The determining the second target logical address according to the preset disk address mapping relationship between the first storage disk and the second storage disk comprises: The first target logical address is divided by a preset data capacity ratio to obtain the second target logical address; wherein the data capacity ratio is a ratio of the lengths of the business data and the integrity check data in the data unit.
4. The data storage method according to claim 1, characterized in that: If the storage array is configured in a redundant mode, each redundant group includes a plurality of first storage disks, and storing the integrity check data in a second logic block of the second storage disk includes: Determine a corresponding second target logical address according to a first target virtual logical address corresponding to the first logical block and according to a preset disk address mapping relationship between the first storage disk and the second storage disk; According to the second target logical address, the corresponding integrity check data is written into a second logical block corresponding to the second storage disk.
5. The data storage method according to claim 4, characterized in that: The determining the corresponding second target logical address according to the preset disk address mapping relationship between the first storage disk and the second storage disk comprises: The first target virtual logical address is divided by a preset data capacity ratio to obtain the second target logical address, wherein the data capacity ratio is a ratio of the lengths of the business data and the integrity check data in the data unit.
6. The data storage method according to claim 4, characterized in that: The method further comprises: The logical addresses of the first storage array formed by the first storage disks are mapped into virtual logical addresses; wherein the logical addresses of the plurality of first logical blocks in each stripe are mapped into continuous virtual logical addresses in the order of the stripes in the redundant group.
7. The data storage method according to claim 4, characterized in that: Each of the second logic blocks corresponds to at least one of the first logic blocks and further includes: A ratio of a total capacity of the at least one first logical block to a capacity of the second logical block is equal to a data capacity ratio.
8. The data storage method according to claim 1, characterized in that: The method further comprises: Before storing the business data and the integrity check data in the storage array, the business data in the data unit is cached in the business cache space, and the corresponding integrity check data is cached in the check cache space; wherein the controller memory of the storage array controller includes the business cache space and the check cache space.
9. The data storage method according to claim 8, characterized in that: The step of storing the service data in the data unit sent by the host in the first logic block of the first storage disk includes: Sending a first write data command to a first storage disk controller; The first write data command is used to instruct the first storage disk to read the service data from the service cache space using a direct memory access technology; The step of storing the integrity check data in the data unit to the second logic block of the second storage disk includes: Sending a second write data command to the second storage disk controller; The second write data command is used to instruct the second storage disk to read the integrity check data from the check cache space using direct memory access technology.
10. A storage array system, characterized in that: include: A storage array controller and a storage array; the storage array comprises a first storage disk and a second storage disk; The storage array controller is used to implement the data storage method described in any one of claims 1-9.
11. A terminal device, characterized in that: The terminal device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the data storage method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The device stores a computer program, which, when executed on a processor, implements the data storage method according to any one of claims 1 to 9.