WO2023279906A1 - 一种数据处理方法、装置、设备及可读存储介质 - Google Patents

一种数据处理方法、装置、设备及可读存储介质 Download PDF

Info

Publication number
WO2023279906A1
WO2023279906A1 PCT/CN2022/097620 CN2022097620W WO2023279906A1 WO 2023279906 A1 WO2023279906 A1 WO 2023279906A1 CN 2022097620 W CN2022097620 W CN 2022097620W WO 2023279906 A1 WO2023279906 A1 WO 2023279906A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
nodes
memory
blocks
target
Prior art date
Application number
PCT/CN2022/097620
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 深圳大普微电子科技有限公司
Publication of WO2023279906A1 publication Critical patent/WO2023279906A1/zh
Priority to US18/407,611 priority Critical patent/US20240143188A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0688Non-volatile semiconductor memory arrays

Definitions

  • the present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and readable storage medium.
  • Common data reliability protection methods can only tolerate up to two DIE failures in the storage disk. If there are more DIE failures, the data will not be recoverable and data will be easily lost.
  • Common data reliability protection methods such as: XOR algorithm, RAID (Redundant Arrays of Independent Disks, disk array) 5, RAID6, etc.
  • the XOR algorithm and RAID5 can only tolerate one DIE failure in the disk
  • RAID6 can only tolerate two DIE failures in the disk.
  • DIE is also called LUN, which is a technical term in nand flash
  • DIE/LUN is the basic unit for receiving and executing flash memory commands.
  • the purpose of the present application is to provide a data processing method, device, device and readable storage medium, so as to protect data reliability for large-capacity storage disks.
  • the specific plan is as follows:
  • the present application provides a data processing method applied to solid-state hard drives, including:
  • n memory nodes If the target data occupies n memory nodes in the memory, then determine the n memory nodes as n data nodes;
  • EC algorithm engine uses the EC algorithm engine to calculate the verification data of the target data, and after using m memory nodes to store the verification data, determine the m memory nodes as m verification nodes; the values of n and m are preset In the EC attribute of the current SSD;
  • said using the EC algorithm engine to calculate the verification data of the target data, and using m memory nodes to store the verification data includes:
  • the EC algorithm engine After transmitting the n data nodes to the EC algorithm engine, so that the EC algorithm engine calculates the verification data based on the n data nodes, and applies for the m memory nodes to the memory, Writing the verification data into the m memory nodes.
  • the arranging the n data nodes and the m check nodes into a linked list according to the arrangement order includes:
  • it also includes:
  • the step of determining the currently available data block group is performed.
  • said determining the currently available data block groups includes:
  • the target value is equal to the number of DIEs in the current solid-state disk, then select a data block in each DIE of the current solid-state disk; or if the target value is less than the number of DIEs in the current solid-state disk, select Select DIEs of the target value in the hard disk, and select a data block in each selected DIE;
  • marking n user data blocks and m check data blocks in the target value data blocks includes:
  • n data blocks are marked as user data blocks.
  • marking n user data blocks and m check data blocks in the target value data blocks includes:
  • it also includes:
  • the step of querying the sequence of the n user data blocks and the m check data blocks in the data block group is performed.
  • it also includes:
  • the target data occupies less than n memory nodes in the memory, wait to receive new data sent by the host, so as to supplement the target data with the new data, so that the target data is in the memory Occupies n memory nodes.
  • it also includes:
  • n memory nodes If waiting for the new data to time out, supplement the target data with all-zero data, so that the target data occupies n memory nodes in the memory, and perform the determination of the n memory nodes as n steps of data nodes.
  • the configuration process of the EC attribute of the current solid-state hard disk includes:
  • the target value is: the sum of n and m;
  • the target value is not greater than the number of DIEs in the current solid-state disk, the difference between the target value and m is recorded as n;
  • n and m are transmitted to the EC algorithm engine, so that the EC algorithm engine determines an encoding matrix according to n and m, so as to configure the EC attribute of the current solid state disk.
  • it also includes:
  • it also includes:
  • Reading data in each data block included in the recoverable combination and transmitting the read data to the EC algorithm engine, so that the EC algorithm decodes the read data to obtain a decoding result;
  • Verify the decoding result if the verification is passed, read the target data based on the decoding result; otherwise, select n data blocks that can be read normally from the data block group to form different Repeated resumable combined steps occur;
  • the present application provides a data processing device applied to a solid-state hard disk, including:
  • a cache module configured to receive target data sent by the host, and write the target data into memory
  • a data node determining module configured to determine the n memory nodes as n data nodes if the target data occupies n memory nodes in the memory
  • a check node determination module configured to use the EC algorithm engine to calculate the check data of the target data, and after using m memory nodes to store the check data, determine the m memory nodes as m check nodes;
  • the values of n and m are preset in the EC attribute of the current SSD;
  • a data block group query module configured to determine a currently available data block group, and query the arrangement order of n user data blocks and m check data blocks in the data block group;
  • an arrangement module configured to arrange the n data nodes and the m check nodes into a linked list according to the arrangement order
  • a storage module configured to, based on the linked list, correspondingly write the data in the n data nodes into the n user data blocks, and correspondingly write the data in the m check nodes into the m checksums test data block to store the target data.
  • the present application provides an electronic device, including:
  • a processor configured to execute the computer program to implement the data processing method disclosed above.
  • the present application provides a readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the aforementioned disclosed data processing method is implemented.
  • the present application provides a data processing method applied to solid-state hard drives, including: receiving the target data sent by the host, and writing the target data into the memory; if the target data occupies the n memory nodes, then determine the n memory nodes as n data nodes; use the EC algorithm engine to calculate the verification data of the target data, use m memory nodes to store the verification data, and then m memory nodes are determined as m check nodes; the values of n and m are preset in the EC attribute of the current SSD; determine the currently available data block group, and query n user data in the data block group
  • the order of arrangement of the block and the m check data blocks according to the order of arrangement, the n data nodes and the m check nodes are arranged into a linked list; based on the linked list, the n data nodes are Data is correspondingly written into the n user data blocks, and data in the m check nodes is correspondingly written into the m check data blocks, so as
  • this application uses the EC algorithm for data reliability protection for solid-state hard disks. Since the number m of check data blocks in the EC algorithm is configurable, this application can tolerate 1, 2, 3, or even more data blocks in the disk. DIE failure, not easy to lose data, has enough flexibility, suitable for protecting large-capacity storage disks. At the same time, this application places the data on the disk correspondingly according to the arrangement order of n user data blocks and m verification data blocks in the currently available data block group, which can ensure the randomness of the verification data in the disk, that is: it can It is possible to store verification data in each DIE in the disk, thereby further protecting data from loss.
  • a data processing device, device, and readable storage medium provided by the present application also have the above-mentioned technical effects.
  • Fig. 1 is a flow chart of a data processing method disclosed in the present application
  • FIG. 2 is a schematic diagram of the composition and structure of a solid-state hard disk disclosed in the present application
  • Fig. 3 is a schematic diagram of a data processing device disclosed in the present application.
  • FIG. 4 is a schematic diagram of an electronic device disclosed in the present application.
  • FIG. 5 is a flow chart of EC attribute configuration of a solid-state hard disk disclosed in the present application.
  • Fig. 6 is a schematic diagram of a block group disclosed in the present application.
  • Fig. 7 is a block group schematic diagram after randomly disrupting each data block in the block group shown in Fig. 6;
  • FIG. 8 is a schematic diagram of a linked list disclosed in the present application.
  • Fig. 9 is a writing flowchart disclosed in the present application.
  • FIG. 10 is a read flow chart disclosed in the present application.
  • this application provides a data processing scheme that can protect data reliability for large-capacity storage disks.
  • the embodiment of the present application discloses a data processing method applied to a solid-state hard disk, including:
  • S101 Receive target data sent by the host, and write the target data into memory.
  • the memory is composed of multiple memory nodes, and the size of the memory node is the smallest unit required by a solid state disk (SSD) to write data. Therefore, when the target data is written into the memory, it is written according to the size of the memory node.
  • the size of a memory node is the size of a page.
  • n and m are preset in the EC attribute of the current solid state disk.
  • the EC (Erasure Code) algorithm is a relatively flexible and configurable encoding and decoding algorithm, which can set the number of check data blocks according to different business scenarios, and configure the corresponding encoding matrix accordingly.
  • the encoding matrix is multiplied by the data vector to complete the encoding.
  • the original data can be obtained by inverting the encoding matrix and multiplying by the vector composed of valid data and check data, and data recovery is completed.
  • a memory node for storing data sent by the host is called a data node
  • a memory node for storing verification data is called a check node. That is: the data node and the check node are both memory nodes in the memory, but the memory node storing the data sent by the host is called a data node, and the memory node storing the check data is called a check node.
  • S104 Determine the currently available data block group, and query the arrangement order of n user data blocks and m check data blocks in the data block group.
  • a data block group includes n+m data blocks, that is, n user data blocks and m check data blocks. These n+m data blocks belong to different DIEs in the SSD.
  • a solid state disk may include multiple DIEs, such as DIE0-DIEp in Figure 2; each DIE includes multiple data blocks (blocks), such as: block0-blockq belonging to DIE0; each data block includes multiple pages.
  • block0 in each DIE can be selected to form a data block group
  • the data block group includes: DIE0-block0, DIE1-block0, ..., DIEp-block0, a total of p+1 data blocks.
  • data blocks in the data block group are used as user data blocks and which data blocks are used as check data blocks, this depends on the values of n and m, and the location of the check data blocks.
  • the user data block is used to store data sent by the host, and the check data block is used to store check data.
  • n and m are preset in the EC attribute of the current solid-state hard disk, and the position of the verification data block is required to be as random as possible, so that each DIE may store the verification data.
  • m data blocks can be randomly selected in "DIE0-block0, DIE1-block0, ..., DIEp-block0" as the verification data block. After selection, the verification data The location of the chunks is recorded as metadata.
  • the n data nodes and m check nodes are arranged into a linked list according to the arrangement order, so that the n data nodes and m check nodes are connected with the n user nodes in the currently available data block group.
  • the data block is aligned with the m verification data blocks one by one, so that the data can be placed on the disk.
  • m check data blocks are arranged at the end of n user data blocks, then in the linked list, m check nodes are also arranged at the end of n data nodes.
  • m check nodes are in one-to-one correspondence with m check data blocks
  • n data nodes are in one-to-one correspondence with n user data blocks, which facilitates data transfer from memory to disk. That is: write the data in each node in the linked list into the corresponding data block.
  • arranging n data nodes and m check nodes into a linked list according to the order of arrangement includes: arranging m check nodes at the end of n data nodes to obtain a linked list.
  • this embodiment uses the EC algorithm for data reliability protection for solid-state hard disks. Since the number m of check data blocks in the EC algorithm is configurable, this application can tolerate 1, 2, 3, or even more data blocks in the disk. Multiple DIE failures, less data loss, and sufficient flexibility, suitable for protecting large-capacity storage disks. At the same time, this embodiment makes the data correspond to the disk according to the arrangement order of n user data blocks and m verification data blocks in the currently available data block group, which can ensure the randomness of the verification data in the disk, that is: It is possible to store verification data in each DIE in the disk, thereby further protecting data from loss.
  • the m memory nodes storing the verification data need to additionally apply to the memory, and this application action can be executed by a solid-state disk or by an EC algorithm engine.
  • the EC algorithm engine is used to calculate the verification data of the target data
  • m memory nodes are used to store the verification data, including:
  • the SSD applies m memory nodes to the memory, and the SSD transmits n data nodes and m memory nodes to the EC algorithm engine, so that the EC algorithm engine can calculate the verification data based on the n data nodes, and the EC algorithm engine will verify the data Write m memory nodes;
  • the SSD transmits n data nodes to the EC algorithm engine, so that the EC algorithm engine calculates the verification data based on the n data nodes.
  • the EC algorithm engine After the EC algorithm engine applies for m memory nodes from the memory, the EC algorithm engine writes the verification data into m memory nodes.
  • the target data after storing the target data, it also includes: updating the L2P mapping table, and releasing n data nodes and m check nodes, so as to release the memory space of the solid-state disk.
  • the L2P mapping table is a table recording a mapping relationship between a logical address (Logical Block Address) and a physical address (Physics Block Address).
  • Logical Block Address logical Address
  • Physical Block Address Physical Address
  • any node in the linked list that is: any node in the n data nodes and m check nodes
  • perform the determination of the currently available data Block group and query the arrangement order of n user data blocks and m verification data blocks in the data block group; arrange n data nodes and m verification nodes into a linked list according to the order of arrangement; based on the linked list, n
  • Each data block in the data block group originally used to write the target data can be recycled by using the garbage collection mechanism of the solid state disk.
  • re-finding an available data block group includes the following two situations:
  • Situation 1 There are currently available data block groups that can be used directly. At this time, you can directly select the currently available data block group, and query the arrangement order of n user data blocks and m verification data blocks in the data block group ;Arrange n data nodes and m check nodes into a linked list according to the order of arrangement; based on the linked list, write the data in n data nodes into n user data blocks, and write the data in m check nodes into Import m verification data blocks to store the target data.
  • the target value is equal to the number of DIEs in the current SSD, select a data block in each DIE of the current SSD; or if the target value is less than the number of DIEs in the current SSD, select the target in the current SSD value DIEs, and select a data block in each DIE selected;
  • marking n user data blocks and m verification data blocks in the target value data blocks includes: randomly selecting m data blocks in the target value data blocks to mark as verification data blocks , and the remaining n data blocks are marked as user data blocks.
  • marking n user data blocks and m verification data blocks in the target value data blocks includes: randomly arranging the target value data blocks according to the identification information of the DIE to which each data block belongs, and obtaining the target value Sequence; mark the m consecutive data blocks in the target sequence as check data blocks, and mark the remaining n data blocks as user data blocks.
  • the target data occupies less than n memory nodes in the memory, it waits to receive new data sent by the host to supplement the target data with new data, so that the target data occupies n memory nodes in the memory node. If the target data occupies more than n memory nodes in the memory after supplementing the target data with new data, execute S102-S106 for the first n memory nodes, and continue to wait for the new data sent by the host to supplement the remaining memory nodes. That is: as long as there are enough n memory nodes storing data, S102-S106 will be executed.
  • n memory nodes as n data nodes
  • use the EC algorithm engine to calculate the target
  • For the verification data of the data after using m memory nodes to store the verification data, determine the m memory nodes as m verification nodes; the values of n and m are preset in the EC attribute of the current SSD; data block group, and query the arrangement order of n user data blocks and m check data blocks in the data block group; arrange n data nodes and m check nodes into a linked list according to the order; based on the linked list, the The step of writing the data in the n data nodes into n user data blocks correspondingly, and writing the data in the m check nodes into m check data blocks correspondingly, so as to store the target data.
  • all-zero data is meaningless data. These all-zero data also participate in the calculation of the verification data, but the corresponding physical address is not recorded in the L2P mapping table when it is actually placed, so there will be no read operation hit .
  • the configuration process of the EC attribute of the current solid-state hard disk includes:
  • the target value is: the sum of n and m;
  • the target value is not greater than the number of DIEs in the current SSD, record the difference between the target value and m as n; transmit n and m to the EC algorithm engine, so that the EC algorithm engine determines the encoding matrix according to n and m, to configure the EC properties of the current SSD.
  • the target value and m can be flexibly configured based on the number of DIEs in the disk, that is, m can take values of 1, 2, 3 (preferred), 4, etc., so 1, 2, 3, 4, etc. in the disk can be tolerated. Even more DIE failures, not easy to lose data, with enough flexibility, suitable for protecting large capacity storage disks.
  • a data processing device provided in an embodiment of the present application is introduced below, and a data processing device described below and a data processing method described above may refer to each other.
  • the embodiment of the present application discloses a data processing device, which is applied to a solid-state hard disk, including:
  • a cache module 301 configured to receive target data sent by the host, and write the target data into memory
  • the verification node determination module 303 is used to calculate the verification data of the target data by using the EC algorithm engine, and after using the m memory nodes to store the verification data, determine the m memory nodes as m verification nodes; the selection of n and m The value is preset in the EC attribute of the current SSD;
  • a data block group query module 304 configured to determine the currently available data block group, and query the arrangement order of n user data blocks and m check data blocks in the data block group;
  • An arrangement module 305 configured to arrange n data nodes and m check nodes into a linked list according to the order of arrangement;
  • the storage module 306 is configured to write the data in the n data nodes into n user data blocks correspondingly, and write the data in the m check nodes into m check data blocks correspondingly based on the linked list, so as to store the target data.
  • check node determination module is specifically used for:
  • the n data nodes are transmitted to the EC algorithm engine, so that the EC algorithm engine calculates the verification data based on the n data nodes, and after applying for m memory nodes to the memory, writes the verification data into the m memory nodes.
  • the arrangement module is specifically used for:
  • it also includes:
  • the execution module is used to update the L2P mapping table and release n data nodes and m check nodes.
  • it also includes:
  • the reselection module is used to perform the step of determining the currently available data block group if data writing in any node in the linked list fails.
  • the data block group query module includes: a construction unit;
  • Building units include:
  • the calculation subunit is used to calculate the sum of n and m to obtain the target value if there is currently no available data block group;
  • Select a subunit which is used to select a data block in each DIE of the current SSD if the target value is equal to the number of DIEs in the current SSD; or if the target value is less than the number of DIEs in the current SSD, select a data block in Select target value DIEs in the current SSD, and select a data block in each selected DIE;
  • the marking subunit is used to mark n user data blocks and m check data blocks in the target value data blocks, and determine the arrangement order of n user data blocks and m check data blocks, so as to obtain the currently available Data block group.
  • the marking subunit is specifically used for:
  • the marking subunit is specifically used for:
  • the target value data blocks are randomly arranged to obtain the target sequence
  • the data block group query module includes: a selection unit;
  • the selection unit is used specifically for:
  • the step of querying the sequence of the n user data blocks and the m check data blocks in the data block group is executed.
  • it also includes:
  • the waiting module is used to wait for receiving new data sent by the host if the target data occupies less than n memory nodes in the memory, so as to supplement the target data with new data, so that the target data occupies n memory nodes in the memory.
  • it also includes:
  • Waiting for a timeout module used to supplement the target data with all-zero data if waiting for new data to time out, so that the target data occupies n memory nodes in the memory, and executes the process of determining the n memory nodes as n data nodes step.
  • it also includes a configuration module, which is used to configure the EC attribute of the current solid-state hard disk, and the configuration module includes:
  • the receiving unit is configured to receive a command for configuring EC attributes sent by the host;
  • the analysis unit is used to analyze the command to obtain the target value and m;
  • the target value is: the sum of n and m;
  • a calculation unit used to record the difference between the target value and m as n if the target value is not greater than the number of DIEs in the current solid-state disk;
  • the configuration unit is configured to transmit n and m to the EC algorithm engine, so that the EC algorithm engine determines a coding matrix according to n and m, so as to configure the EC attribute of the current solid state disk.
  • the configuration module also includes:
  • the notification unit is configured to return a notification message that EC attribute configuration fails if the target value is greater than the number of DIEs in the current solid-state disk.
  • a reading module specifically for:
  • Verify the decoding result if the verification is passed, read the target data based on the decoding result; otherwise, perform the step of selecting n data blocks that can be read normally from the data block group to form a recoverable combination without repetition ;
  • this embodiment provides a data processing device, which can tolerate 1, 2, 3, or even more DIE failures in the disk, is not easy to lose data, has sufficient flexibility, and is suitable for protecting large-capacity storage. plate. At the same time, the randomness of the verification data in the disk can be guaranteed, that is, it is possible to store the verification data in each DIE in the disk, thereby further protecting data from loss.
  • An electronic device provided by an embodiment of the present application is introduced below, and the electronic device described below and the data processing method and apparatus described above may refer to each other.
  • an electronic device including:
  • Memory 401 used to store computer programs
  • the processor 402 is configured to execute the computer program, so as to implement the method disclosed in any of the foregoing embodiments.
  • a readable storage medium provided by an embodiment of the present application is introduced below, and a readable storage medium described below and a data processing method, device, and device described above may refer to each other.
  • a readable storage medium is used to store a computer program, wherein when the computer program is executed by a processor, the data processing method disclosed in the foregoing embodiments is implemented. Regarding the specific steps of the method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.
  • namespace (Chinese: name space, alias: name space, name space) represents the range of storage space where an identifier is visible.
  • a solid state drive can create multiple namespaces. The EC attributes of different namespaces can be different.
  • the EC attribute is recorded as EC-1; similarly, if three check blocks are set, the EC attribute is recorded as EC-3, and so on.
  • the stripe size (the total number of data blocks in a data block group) can be configured as 32 or other, and the stripe size only needs to be no larger than the total number of DIEs in the solid state disk.
  • the host configures EC properties through the VU command.
  • the host modifies or specifies the EC attribute of a namespace by issuing the VU command.
  • VU commands are generally considered to be: CLI (CLI is a standard set of command lines in the linux system: Command Line Interface).
  • the SSD After the SSD receives the command to configure EC attributes, it will first check the validity of the parameters. That is: determine whether the number of DIEs in the disk is greater than or equal to the block group size (ie: the total number of data blocks in a data block group, that is: the sum of n+m specified by the command), if the number of DIEs in the disk is less than the block group size, return parameter configuration failure to the host. If the number of DIEs in the disk is greater than or equal to the size of the block group, it is judged whether the number of redundant columns specified by the command (that is, the value of m) meets the requirements (in general, the value of m is preferably 3). It can be seen that the validity check of the parameters is to check whether the value of m specified by the command (that is, the EC protection level in Figure 5) and whether the size of the block group meets the preset requirements.
  • the block group size ie: the total number of data blocks in a data block group, that is: the sum of n
  • the parameter check fails, it will return the parameter configuration failure to the host, and set the namespace cannot undertake IO.
  • the parameter check is successful, set the number of redundant columns of the EC algorithm engine to generate a coding matrix, and then set the size and composition structure of the block group, the sequence of data blocks, etc. according to the parameters specified by the command, and then start reading and writing.
  • the number of DIEs in the disk is smaller than the size of the block group, it does not comply with the rule that all blocks in the block group are distributed on different DIEs.
  • a block group may take out two blocks from a die, and the failure of this die will affect the data of the two blocks, which is easy to lose data, which is contrary to the data protection principle of the EC algorithm. Therefore, the number of DIEs in the disk must be greater than or equal to the size of the block group.
  • n the number of blocks used to store user data
  • m the number of blocks used to store verification data
  • DIE0-DIE31 Assuming that a total of 32 DIEs, DIE0-DIE31, are selected from DIE0-DIEp shown in Figure 2, a block is selected from each of the 32 DIEs. Then the block group shown in Figure 6 can be obtained.
  • D0B0 means: block0 on DIE0
  • D1B1 means: block1 on DIE1, and so on.
  • each DIE may be read, so that some DIEs are not always idle;
  • EC-2 takes any two blocks in a block group to store verification data, such as D0B0 and D4B8 in Figure 6. At this time, additional metadata is required to record which blocks in the block group are verification blocks, which will lead to too much metadata and inconvenient management.
  • the last m blocks in a block group are used to store verification data.
  • the last two blocks in a block group are the EC-2 checksum data blocks.
  • the order of all blocks in the block group is randomly broken up. After random dispersal, the last m verification data blocks in different block groups will be randomly distributed in each DIE, thereby improving disk performance.
  • the size of each write request issued by the cache is fixed at the size of a wordline (that is, the size of a memory node). Organize the memory nodes occupied by each write request in the form of a linked list. When the number of nodes in the linked list reaches n, no new nodes will be added to the linked list.
  • n As shown in Figure 8, after the number of nodes in the linked list reaches n, add m memory nodes behind the linked list, and then transfer all nodes on the linked list to the EC algorithm engine, so that the EC algorithm engine can calculate the verification data, And write the verification data into m memory nodes.
  • the m memory nodes are P0-Pm-1 in FIG. 8 .
  • Date0-Daten-1 is the memory node occupied by the data to be written received from the cache
  • P0-Pm-1 is the verification data encoded by the EC algorithm for all the data in Date0-Daten-1.
  • the L2P mapping table is updated, and then the corresponding memory nodes are released. That is: release each node in the linked list shown in FIG. 8 .
  • the memory node used to store the verification data is additionally requested by the writing process, so it is necessary to increase the step of releasing the memory node.
  • the memory node used to store user data will automatically delete the dirty data node when calling back the cache, so there is no need to add additional steps to release the memory node.
  • the corresponding physical address in the L2P mapping table is composed as follows:
  • bgId indicates the Id of the block group
  • dieId and blockId indicate the real die Id and block Id of the block contained in the block group
  • pageId indicates that the data is located on the page number above the Id of this block
  • auOff indicates that the data falls on Which au is on the page. There are multiple au in a page.
  • the physical address corresponding to the LBA is updated according to the above physicalAddr_t to form an L2P mapping table.
  • FIG. 9 for the flow chart of writing IO.
  • the write IO process after receiving the cache data, it is judged whether a new block group needs to be allocated. The basis of the judgment is to check whether there is currently an available block group for writing user data. Therefore, a new block group needs to be allocated only after a block group of the system is full.
  • For the rules of assigning block groups refer to the relevant introduction of the above "Setting block groups”.
  • the data on a node in the linked list is written into a page in a data block.
  • the next linked list is written to the next page of the corresponding data block of the block group.
  • reading data is the reverse process of writing data. Query the corresponding L2P mapping table to obtain that the data to be read belongs to the corresponding position on the corresponding block in the corresponding block group, and then issue a read operation to the NAND FLASH. If there is no abnormality in the NAND, the read data will be directly returned to the caller .
  • n blocks cannot be selected in the block group, it will directly return to the front-end to fail to read, EC recovery fails, and the process ends.
  • n blocks can be selected in the block group, read the data in the n blocks. If all the n blocks are successfully read, all the successfully read data will be sent to the EC algorithm engine for decoding; otherwise, another n blocks will be selected for re-reading.
  • n blocks in the block group can no longer be selected for rereading, the return value is set to err and returned to the front end, EC recovery fails, and the process ends.
  • this embodiment can configure different EC levels according to user requirements, and can effectively provide data reliability protection levels flexibly for different user scenarios, with very high flexibility and configurability; it can allow more DIE failures, The reliability is higher, and the performance and service life of SSD can be improved to a greater extent.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other Any other known readable storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Detection And Correction Of Errors (AREA)

Abstract

一种数据处理方法、装置、设备及可读存储介质。本申请针对固态硬盘使用EC算法进行数据可靠性保护,由于EC算法中的校验数据块的个数m可配置,故本申请可容忍盘内更多DIE故障,不易丢失数据,具有足够的灵活度,适用于保护大容量存储盘。同时,本申请按照当前可用的数据块组中的n个用户数据块和m个校验数据块的排列顺序使数据对应落盘,能够保障校验数据在盘内的随机性,也就是:可以使盘内各个DIE中都有可能存储校验数据,从而进一步保护数据不丢失。相应地,本申请提供的一种数据处理装置、设备及可读存储介质,也同样具有上述技术效果。

Description

一种数据处理方法、装置、设备及可读存储介质
本申请要求于2021年07月09日提交至中国专利局、申请号为202110779968.9、发明名称为“一种数据处理方法、装置、设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别涉及一种数据处理方法、装置、设备及可读存储介质。
背景技术
目前,常用的数据可靠性保护方法最多只能容忍存储盘内有2个DIE故障,有更多DIE故障时会导致数据无法恢复,容易丢数据。常用的数据可靠性保护方法如:异或算法、RAID(Redundant Arrays of Independent Disks,磁盘阵列)5、RAID6等。其中,异或算法和RAID5仅能容忍盘内有1个DIE故障,RAID6仅能容忍盘内有2个DIE故障。其中,DIE也称为LUN,是nand flash里的技术术语,DIE/LUN是接收和执行闪存命令的基本单元。
而当前随着盘存储容量的增大,盘内DIE的个数越来越多,导致出现故障的DIE的概率也随之增大。一旦出现1个或2个DIE故障,就需要进行数据恢复,会耗费大量的存储算力。可见,现有的数据可靠性保护方法不够灵活,在用于保护大容量存储盘时,容易导致数据丢失,且容易频繁执行的数据恢复流程会耗费大量存储算力。
因此,如何针对大容量存储盘进行数据可靠性保护,是本领域技术人员需要解决的问题。
发明内容
有鉴于此,本申请的目的在于提供一种数据处理方法、装置、设备及可读存储介质,以针对大容量存储盘进行数据可靠性保护。其具体方案如下:
第一方面,本申请提供了一种数据处理方法,应用于固态硬盘,包括:
接收主机发送的目标数据,并将所述目标数据写入内存;
若所述目标数据在所述内存中占用n个内存节点,则将所述n个内存节点确定为n个数据节点;
利用EC算法引擎计算所述目标数据的校验数据,利用m个内存节点存储所述校验数据后,将所述m个内存节点确定为m个校验节点;n和m的取值预设于当前固态硬盘的EC属性中;
确定当前可用的数据块组,并查询所述数据块组中的n个用户数据块和m个校验数据块的排列顺序;
按照所述排列顺序将所述n个数据节点和所述m个校验节点排列为链表;
基于所述链表,将所述n个数据节点中的数据对应写入所述n个用户数据块,将所述m个校验节点中的数据对应写入所述m个校验数据块,以存储所述目标数据。
优选地,所述利用EC算法引擎计算所述目标数据的校验数据,利用m个内存节点存储所述校验数据,包括:
向所述内存申请所述m个内存节点;
将所述n个数据节点和所述m个内存节点传输至所述EC算法引擎,以使所述EC算法引擎基于所述n个数据节点计算所述校验数据,并将所述校验数据写入所述m个内存节点;
将所述n个数据节点传输至所述EC算法引擎,以使所述EC算法引擎基于所述n个数据节点计算所述校验数据,并向所述内存申请所述m个内存节点后,将所述校验数据写入所述m个内存节点。
优选地,所述按照所述排列顺序将所述n个数据节点和所述m个校验节点排列为链表,包括:
将所述m个校验节点排列在所述n个数据节点的尾部,以得到所述链表。
优选地,所述存储所述目标数据之后,还包括:
更新L2P映射表,并释放所述n个数据节点和所述m个校验节点。
优选地,还包括:
若所述链表中的任一个节点中的数据写入失败,则执行所述确定当前可用的数据块组的步骤。
优选地,所述确定当前可用的数据块组,包括:
若当前没有可用的数据块组,则计算n与m之和,得到目标值;
若所述目标值等于当前固态硬盘中的DIE个数,则在当前固态硬盘的每个DIE中选择一个数据块;或若所述目标值小于当前固态硬盘中的DIE个数,则在当前固态硬盘中选择所述目标值个DIE,并在所选择的每个DIE中选择一个数据块;
在所述目标值个数据块中标记n个用户数据块和m个校验数据块,并确定n个用户数据块和m个校验数据块的排列顺序,以得到当前可用的数据块组。
优选地,所述在所述目标值个数据块中标记n个用户数据块和m个校验数据块,包括:
在所述目标值个数据块中随机选择m个数据块标记为校验数据块,剩余n个数据块标记为用户数据块。
优选地,所述在所述目标值个数据块中标记n个用户数据块和m个校验数据块,包括:
按照各个数据块所属DIE的标识信息随机排列所述目标值个数据块,得到目标序列;
将所述目标序列中连续的m个数据块标记为校验数据块,剩余n个数据块标记为所述用户数据块。
优选地,还包括:
若当前有可用的数据块组,则执行所述查询所述数据块组中的n个用户数据块和m个校验数据块的排列顺序的步骤。
优选地,还包括:
若所述目标数据在所述内存中占用小于n个内存节点,则等待接收所述主机发送的新数据,以用所述新数据补充所述目标数据,使所述目标数据在所述内存中占用n个内存节点。
优选地,还包括:
若等待所述新数据超时,则用全零数据补充所述目标数据,以使所述 目标数据在所述内存中占用n个内存节点,并执行所述将所述n个内存节点确定为n个数据节点的步骤。
优选地,当前固态硬盘的EC属性的配置过程,包括:
接收主机发送的配置EC属性的命令;
解析所述命令得到目标值和m;所述目标值为:n与m之和;
若所述目标值不大于当前固态硬盘中的DIE个数,则将所述目标值与m的差值记为n;
将n和m传输至所述EC算法引擎,以使所述EC算法引擎根据n和m确定编码矩阵,以配置当前固态硬盘的EC属性。
优选地,还包括:
若所述目标值大于当前固态硬盘中的DIE个数,则返回EC属性配置失败的通知消息。
优选地,还包括:
若首次读取所述目标数据失败,则查询所述数据块组;
从所述数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合;
读取所述可恢复组合包括的各个数据块中的数据,将所读取的数据传输至所述EC算法引擎,以使所述EC算法对所读取的数据进行解码,得到解码结果;
校验所述解码结果,若校验通过,则基于所述解码结果读取所述目标数据;否则,执行从所述数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合的步骤;
若从所述数据块组中无法选择出不发生重复的可恢复组合,则返回所述目标数据读取失败的通知消息。
第二方面,本申请提供了一种数据处理装置,应用于固态硬盘,包括:
缓存模块,用于接收主机发送的目标数据,并将所述目标数据写入内存;
数据节点确定模块,用于若所述目标数据在所述内存中占用n个内存节点,则将所述n个内存节点确定为n个数据节点;
校验节点确定模块,用于利用EC算法引擎计算所述目标数据的校验 数据,利用m个内存节点存储所述校验数据后,将所述m个内存节点确定为m个校验节点;n和m的取值预设于当前固态硬盘的EC属性中;
数据块组查询模块,用于确定当前可用的数据块组,并查询所述数据块组中的n个用户数据块和m个校验数据块的排列顺序;
排列模块,用于按照所述排列顺序将所述n个数据节点和所述m个校验节点排列为链表;
存储模块,用于基于所述链表,将所述n个数据节点中的数据对应写入所述n个用户数据块,将所述m个校验节点中的数据对应写入所述m个校验数据块,以存储所述目标数据。
第三方面,本申请提供了一种电子设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序,以实现前述公开的数据处理方法。
第四方面,本申请提供了一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述公开的数据处理方法。
通过以上方案可知,本申请提供了一种数据处理方法,应用于固态硬盘,包括:接收主机发送的目标数据,并将所述目标数据写入内存;若所述目标数据在所述内存中占用n个内存节点,则将所述n个内存节点确定为n个数据节点;利用EC算法引擎计算所述目标数据的校验数据,利用m个内存节点存储所述校验数据后,将所述m个内存节点确定为m个校验节点;n和m的取值预设于当前固态硬盘的EC属性中;确定当前可用的数据块组,并查询所述数据块组中的n个用户数据块和m个校验数据块的排列顺序;按照所述排列顺序将所述n个数据节点和所述m个校验节点排列为链表;基于所述链表,将所述n个数据节点中的数据对应写入所述n个用户数据块,将所述m个校验节点中的数据对应写入所述m个校验数据块,以存储所述目标数据。
可见,本申请针对固态硬盘使用EC算法进行数据可靠性保护,由于EC算法中的校验数据块个数m可配置,故本申请可容忍盘内1个、2个、3个、甚至更多DIE故障,不易丢数据,具有足够的灵活度,适用于保护大容量存储盘。同时,本申请按照当前可用的数据块组中的n个用户数据块和m个校验数据块的排列顺序使数据对应落盘,能够保障校验数据在盘 内的随机性,也就是:可以使盘内各个DIE中都有可能存储校验数据,从而进一步保护数据不丢失。
相应地,本申请提供的一种数据处理装置、设备及可读存储介质,也同样具有上述技术效果。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请公开的一种数据处理方法流程图;
图2为本申请公开的一种固态硬盘的组成结构示意图;
图3为本申请公开的一种数据处理装置示意图;
图4为本申请公开的一种电子设备示意图;
图5为本申请公开的一种固态硬盘的EC属性配置流程图;
图6为本申请公开的一种block group示意图;
图7为将图6所示的block group中各个数据块随机打乱后的block group示意图;
图8为本申请公开的一种链表示意图;
图9为本申请公开的一种写流程图;
图10为本申请公开的一种读流程图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
目前,现有的数据可靠性保护方法不够灵活,在用于保护大容量存储盘时,容易导致数据丢失,且容易频繁执行的数据恢复流程会耗费大量存储算力。为此,本申请提供了一种数据处理方案,能够针对大容量存储盘 进行数据可靠性保护.
参见图1所示,本申请实施例公开了一种数据处理方法,应用于固态硬盘,包括:
S101、接收主机发送的目标数据,并将目标数据写入内存。
通常情况下,内存由多个内存节点组成,内存节点的大小是固态硬盘(Solid State Disk,SSD)要求写数据的最小单位。因此将目标数据写入内存时,按照内存节点的大小进行写入。内存节点的大小即一个页(page)的大小。
S102、若目标数据在内存中占用n个内存节点,则将n个内存节点确定为n个数据节点。
S103、利用EC算法引擎计算目标数据的校验数据,利用m个内存节点存储校验数据后,将m个内存节点确定为m个校验节点。
其中,n和m的取值预设于当前固态硬盘的EC属性中。
其中,EC(Erasure Code)算法是一种较为灵活的可配置编解码算法,可以根据不同的业务场景设置校验数据块的个数,并据此配置相应的编码矩阵。在写数据的流程中,编码矩阵乘以数据向量完成编码。在读遇到错误的时候,通过对编码矩阵求逆,乘以有效数据和校验数据组成的向量,即可得到原始数据,完成数据恢复。
在本实施例中,用于存储主机所发送数据的内存节点被称为数据节点,用于存储校验数据的内存节点被称为校验节点。也就是:数据节点和校验节点都是内存中的内存节点,只是将存有主机所发送数据的内存节点称为数据节点,而将存有校验数据的内存节点称为校验节点。
S104、确定当前可用的数据块组,并查询数据块组中的n个用户数据块和m个校验数据块的排列顺序。
需要说明的是,一个数据块组包括n+m个数据块,即:n个用户数据块和m个校验数据块。这n+m个数据块属于固态硬盘中的不同DIE。
固态硬盘的组成结构可参见图2。一个固态硬盘可以包括多个DIE,如图2中的DIE0~DIEp;每个DIE包括多个数据块(block),如:属于DIE0的block0~blockq;每个数据块包括多个page。
结合图2所示,可以选每个DIE中的block0组成一个数据块组,该数据块组包括:DIE0-block0、DIE1-block0、……、DIEp-block0,共p+1个数据块。当然,也可以从p+1个DIE中任选小于p+1个DIE后,再在所选择的每个DIE中选择一个数据块,以组成数据块组。可见,n与m之和不大于盘内DIE的个数,即n+m≤p+1。
至于数据块组中哪几个数据块作为用户数据块,哪几个数据块作为校验数据块,这取决于n和m的取值,以及校验数据块的位置。用户数据块用于存储主机所发送数据,校验数据块用于存储校验数据。
其中,n和m的取值预设于当前固态硬盘的EC属性中,而校验数据块的位置要求尽可能随机,以使各个DIE都有可能存储校验数据。为了使校验数据块的位置尽可能随机,可以在“DIE0-block0、DIE1-block0、……、DIEp-block0”中随机选择m个数据块作为校验数据块,选择后,将校验数据块的位置作为元数据进行记录。
通常情况下,为了保证校验数据块位置的随机性,又便于确定其位置,可以先随机排列一个数据块组中的所有数据块获得相应序列后,规定序列中的后m个数据块、或序列中的前m个数据块,或序列中间连续的m个数据块作为校验数据块。这样可实现:在不同数据块组内,校验数据块的位置总是一样,但实际上不同数据块组内的校验数据块分布于不同DIE中。
S105、按照排列顺序将n个数据节点和m个校验节点排列为链表。
S106、基于链表,将n个数据节点中的数据对应写入n个用户数据块,将m个校验节点中的数据对应写入m个校验数据块,以存储目标数据。
在本实施例中,按照排列顺序将n个数据节点和m个校验节点排列为链表,是为了使n个数据节点和m个校验节点,与当前可用的数据块组中的n个用户数据块和m个校验数据块一一对齐,以便将数据落盘。
例如:在当前可用的数据块组中,m个校验数据块排列在n个用户数据块的尾部,那么在链表中,也使m个校验节点排列在n个数据节点的尾部。这样一来,m个校验节点与m个校验数据块一一对应,而n个数据节点与n个用户数据块一一对应,便于将数据从内存落盘。也即:将链表中各个节点中的数据写入相应数据块中。
在一种具体实施方式中,按照排列顺序将n个数据节点和m个校验节 点排列为链表,包括:将m个校验节点排列在n个数据节点的尾部,以得到链表。
可见,本实施例针对固态硬盘使用EC算法进行数据可靠性保护,由于EC算法中的校验数据块个数m可配置,故本申请可容忍盘内1个、2个、3个、甚至更多DIE故障,不易丢失数据,具有足够的灵活度,适用于保护大容量存储盘。同时,本实施例按照当前可用的数据块组中的n个用户数据块和m个校验数据块的排列顺序使数据对应落盘,能够保障校验数据在盘内的随机性,也就是:可以使盘内各个DIE中都有可能存储校验数据,从而进一步保护数据不丢失。
基于上述实施例,需要说明的是,存储校验数据的m个内存节点需要额外向内存申请,该申请动作可由固态硬盘执行,也可由EC算法引擎执行。
因此在一种具体实施方式中,利用EC算法引擎计算目标数据的校验数据,利用m个内存节点存储校验数据,包括:
固态硬盘向内存申请m个内存节点,固态硬盘将n个数据节点和m个内存节点传输至EC算法引擎,以使EC算法引擎基于n个数据节点计算校验数据,EC算法引擎将校验数据写入m个内存节点;
固态硬盘将n个数据节点传输至EC算法引擎,以使EC算法引擎基于n个数据节点计算校验数据,EC算法引擎向内存申请m个内存节点后,EC算法引擎将校验数据写入m个内存节点。
基于上述实施例,需要说明的是,存储目标数据之后,还包括:更新L2P映射表,并释放n个数据节点和m个校验节点,以释放固态硬盘的内存空间。
其中,L2P映射表为记录逻辑地址(Logical Block Address)与物理地址(Physics Block Address)映射关系的表。具体可参照现有相关技术。
基于上述实施例,需要说明的是,若链表中的任一个节点(即:n个 数据节点和m个校验节点中的任一个节点)中的数据写入失败,则执行确定当前可用的数据块组,并查询数据块组中的n个用户数据块和m个校验数据块的排列顺序;按照排列顺序将n个数据节点和m个校验节点排列为链表;基于链表,将n个数据节点中的数据对应写入n个用户数据块,将m个校验节点中的数据对应写入m个校验数据块,以存储目标数据的步骤。也就是:重新找一个可用的数据块组完成目标数据的写入。原来用于写入目标数据的数据块组中的各个数据块,可利用固态硬盘的垃圾回收机制进行回收。
其中,重新找一个可用的数据块组包括如下两种情况:
情况一:当前已有可用的数据块组可以直接用,此时可直接选择出当前可用的数据块组,并查询数据块组中的n个用户数据块和m个校验数据块的排列顺序;按照排列顺序将n个数据节点和m个校验节点排列为链表;基于链表,将n个数据节点中的数据对应写入n个用户数据块,将m个校验节点中的数据对应写入m个校验数据块,以存储目标数据。
情况二:当前没有可用的数据块组可以直接用,需要构建新的数据块组。那么构建新的数据块组的过程包括:
计算n与m之和,得到目标值;
若目标值等于当前固态硬盘中的DIE个数,则在当前固态硬盘的每个DIE中选择一个数据块;或若目标值小于当前固态硬盘中的DIE个数,则在当前固态硬盘中选择目标值个DIE,并在所选择的每个DIE中选择一个数据块;
在目标值个数据块中标记n个用户数据块和m个校验数据块,并确定n个用户数据块和m个校验数据块的排列顺序,以得到当前可用的数据块组。
在一种具体实施方式中,在目标值个数据块中标记n个用户数据块和m个校验数据块,包括:在目标值个数据块中随机选择m个数据块标记为校验数据块,剩余n个数据块标记为用户数据块。
在一种具体实施方式中,在目标值个数据块中标记n个用户数据块和m个校验数据块,包括:按照各个数据块所属DIE的标识信息随机排列目标值个数据块,得到目标序列;将目标序列中连续的m个数据块标记为校 验数据块,剩余n个数据块标记为用户数据块。
基于上述实施例,需要说明的是,若目标数据在内存中占用小于n个内存节点,则等待接收主机发送的新数据,以用新数据补充目标数据,使目标数据在内存中占用n个内存节点。若用新数据补充目标数据后目标数据在内存中占用了超过n个内存节点,则先针对前n个内存节点执行S102-S106,对于剩下的内存节点继续等待主机发送的新数据进行补充。也即:只要凑够n个存有数据的内存节点,就执行S102-S106。
其中,若等待新数据超时,则用全零数据补充目标数据,以使目标数据在内存中占用n个内存节点,并执行将n个内存节点确定为n个数据节点;利用EC算法引擎计算目标数据的校验数据,利用m个内存节点存储校验数据后,将m个内存节点确定为m个校验节点;n和m的取值预设于当前固态硬盘的EC属性中;确定当前可用的数据块组,并查询数据块组中的n个用户数据块和m个校验数据块的排列顺序;按照排列顺序将n个数据节点和m个校验节点排列为链表;基于链表,将n个数据节点中的数据对应写入n个用户数据块,将m个校验节点中的数据对应写入m个校验数据块,以存储目标数据的步骤。
需要说明的是,全零数据即无意义的数据,这些全零数据也参与计算校验数据,但其在实际落盘时L2P映射表中不记录对应的物理地址,故不会有读操作命中。
基于上述实施例,需要说明的是,当前固态硬盘的EC属性的配置过程,包括:
接收主机发送的配置EC属性的命令;
解析命令得到目标值和m;目标值为:n与m之和;
若目标值不大于当前固态硬盘中的DIE个数,则将目标值与m的差值记为n;将n和m传输至EC算法引擎,以使EC算法引擎根据n和m确定编码矩阵,以配置当前固态硬盘的EC属性。
若目标值大于当前固态硬盘中的DIE个数,则返回EC属性配置失败的通知消息。
可见,目标值和m可基于盘内的DIE个数进行灵活配置,也即m可取值1、2、3(优选)、4等,故可容忍盘内1个、2个、3个、甚至更多DIE故障,不易丢失数据,具有足够的灵活度,适用于保护大容量存储盘。
基于上述实施例,需要说明的是,还包括:
若首次读取目标数据失败,则表明存储目标数据的数据块组中有几个数据块故障,则查询该数据块组;从该数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合;读取可恢复组合包括的各个数据块中的数据,将所读取的数据传输至EC算法引擎,以使EC算法对所读取的数据进行解码,得到解码结果;校验解码结果,若校验通过,则基于解码结果读取目标数据,并将恢复所得数据返回给发起读请求的应用;否则,执行从数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合的步骤;若从数据块组中无法选择出不发生重复的可恢复组合,则返回目标数据读取失败的通知消息。
可见,只要一个数据块组中有任意n个能够被正常读取数据的数据块,就可以恢复要读取的数据,从而保护数据不丢失。
下面对本申请实施例提供的一种数据处理装置进行介绍,下文描述的一种数据处理装置与上文描述的一种数据处理方法可以相互参照。
参见图3所示,本申请实施例公开了一种数据处理装置,应用于固态硬盘,包括:
缓存模块301,用于接收主机发送的目标数据,并将目标数据写入内存;
数据节点确定模块302,用于若目标数据在内存中占用n个内存节点,则将n个内存节点确定为n个数据节点;
校验节点确定模块303,用于利用EC算法引擎计算目标数据的校验数据,利用m个内存节点存储校验数据后,将m个内存节点确定为m个校验节点;n和m的取值预设于当前固态硬盘的EC属性中;
数据块组查询模块304,用于确定当前可用的数据块组,并查询数据块组中的n个用户数据块和m个校验数据块的排列顺序;
排列模块305,用于按照排列顺序将n个数据节点和m个校验节点排列为链表;
存储模块306,用于基于链表,将n个数据节点中的数据对应写入n个用户数据块,将m个校验节点中的数据对应写入m个校验数据块,以存储目标数据。
在一种具体实施方式中,校验节点确定模块具体用于:
向内存申请m个内存节点;
将n个数据节点和m个内存节点传输至EC算法引擎,以使EC算法引擎基于n个数据节点计算校验数据,并将校验数据写入m个内存节点;
将n个数据节点传输至EC算法引擎,以使EC算法引擎基于n个数据节点计算校验数据,并向内存申请m个内存节点后,将校验数据写入m个内存节点。
在一种具体实施方式中,排列模块具体用于:
将m个校验节点排列在n个数据节点的尾部,以得到链表。
在一种具体实施方式中,还包括:
执行模块,用于更新L2P映射表,并释放n个数据节点和m个校验节点。
在一种具体实施方式中,还包括:
重选模块,用于若链表中的任一个节点中的数据写入失败,则执行确定当前可用的数据块组的步骤。
在一种具体实施方式中,数据块组查询模块包括:构建单元;
构建单元包括:
计算子单元,用于若当前没有可用的数据块组,则计算n与m之和,得到目标值;
选择子单元,用于若目标值等于当前固态硬盘中的DIE个数,则在当前固态硬盘的每个DIE中选择一个数据块;或若目标值小于当前固态硬盘中的DIE个数,则在当前固态硬盘中选择目标值个DIE,并在所选择的每个DIE中选择一个数据块;
标记子单元,用于在目标值个数据块中标记n个用户数据块和m个校 验数据块,并确定n个用户数据块和m个校验数据块的排列顺序,以得到当前可用的数据块组。
在一种具体实施方式中,标记子单元具体用于:
在目标值个数据块中随机选择m个数据块标记为校验数据块,剩余n个数据块标记为用户数据块。
在一种具体实施方式中,标记子单元具体用于:
按照各个数据块所属DIE的标识信息随机排列目标值个数据块,得到目标序列;
将目标序列中连续的m个数据块标记为校验数据块,剩余n个数据块标记为用户数据块。
在一种具体实施方式中,数据块组查询模块包括:选择单元;
选择单元具体用于:
若当前有可用的数据块组,则执行查询数据块组中的n个用户数据块和m个校验数据块的排列顺序的步骤。
在一种具体实施方式中,还包括:
等待模块,用于若目标数据在内存中占用小于n个内存节点,则等待接收主机发送的新数据,以用新数据补充目标数据,使目标数据在内存中占用n个内存节点。
在一种具体实施方式中,还包括:
等待超时模块,用于若等待新数据超时,则用全零数据补充目标数据,以使目标数据在内存中占用n个内存节点,并执行将所述n个内存节点确定为n个数据节点的步骤。
在一种具体实施方式中,还包括配置模块,用于配置当前固态硬盘的EC属性,配置模块包括:
接收单元,用于接收主机发送的配置EC属性的命令;
解析单元,用于解析命令得到目标值和m;目标值为:n与m之和;
计算单元,用于若目标值不大于当前固态硬盘中的DIE个数,则将目标值与m的差值记为n;
配置单元,用于将n和m传输至EC算法引擎,以使EC算法引擎根据n和m确定编码矩阵,以配置当前固态硬盘的EC属性。
在一种具体实施方式中,配置模块还包括:
通知单元,用于若目标值大于当前固态硬盘中的DIE个数,则返回EC属性配置失败的通知消息。
在一种具体实施方式中,还包括读取模块,具体用于:
若首次读取目标数据失败,则查询数据块组;
从数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合;
读取可恢复组合包括的各个数据块中的数据,将所读取的数据传输至EC算法引擎,以使EC算法对所读取的数据进行解码,得到解码结果;
校验解码结果,若校验通过,则基于解码结果读取目标数据;否则,执行从数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合的步骤;
若从数据块组中无法选择出不发生重复的可恢复组合,则返回目标数据读取失败的通知消息。
其中,关于本实施例中各个模块、单元更加具体的工作过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。
可见,本实施例提供了一种数据处理装置,该装置可容忍盘内1个、2个、3个、甚至更多DIE故障,不易丢数据,具有足够的灵活度,适用于保护大容量存储盘。同时,能够保障校验数据在盘内的随机性,也就是:可以使盘内各个DIE中都有可能存储校验数据,从而进一步保护数据不丢失。
下面对本申请实施例提供的一种电子设备进行介绍,下文描述的一种电子设备与上文描述的一种数据处理方法及装置可以相互参照。
参见图4所示,本申请实施例公开了一种电子设备,包括:
存储器401,用于保存计算机程序;
处理器402,用于执行所述计算机程序,以实现上述任意实施例公开的方法。
下面对本申请实施例提供的一种可读存储介质进行介绍,下文描述的 一种可读存储介质与上文描述的一种数据处理方法、装置及设备可以相互参照。
一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述实施例公开的数据处理方法。关于该方法的具体步骤可以参考前述实施例中公开的相应内容,在此不再进行赘述。
按照本申请提供的方案,可设计实现如下实施例。
一、配置固态硬盘的EC属性。
基于固态硬盘创建namespace或者在namespace未存有数据的情况下进行EC属性的配置和修改。namespace(中文:名字空间,别名:命名空间、名称空间)是表示着一个标识符可见的存储空间范围。一个固态硬盘可以创建多个namespace。不同namespace的EC属性可不同。
一般地,若设置1个校验块,则EC属性记为EC-1;同理,若设置3个校验块,则EC属性记为EC-3,其他以此类推。分条大小(一个数据块组中的数据块总数目)可配置为32或其他,分条大小只需不大于固态硬盘中的DIE总数即可。
请参见图5,主机通过VU命令配置EC属性。主机通过下VU命令修改或指定一个namespace的EC属性。VU命令一般被认为是:CLI(CLI是linux系统里面标准的一套命令行:Command Line Interface)。
在固态硬盘接收到配置EC属性的命令之后,首先会做参数的合法性检查。即:判断盘内DIE的数量是否大于等于block group大小(即:一个数据块组中的数据块总数目,也就是:命令所指定的n+m之和),如果盘内DIE数量小于block group大小,则返回参数配置失败给主机。如果盘内DIE数量大于等于block group大小,则判断命令所指定的冗余列的数量(即m的取值)是否满足要求(一般情况下m取值优选为3)。可见,参数的合法性检查即:检查命令所指定的m取值(即图5中的EC保护级别),以及block group大小是否符合预设要求。
参数检查失败,则返回参数配置失败给主机,并设置该namespace不能承接IO。参数检查成功之后,则设置EC算法引擎的冗余列数生成编码矩阵,然后根据命令所指定的参数设置block group的大小及组成结构、数 据块顺序等,就可以开始进行读写。
其中,如果盘内DIE数量小于block group大小,则不符合block group里面所有的block都分布在不同的DIE上这条规则。在这种场景下,一个block group可能从某一个die上取出两个block,那么这一个DIE失效了就会影响两个block的数据,容易丢失数据,与EC算法的数据保护原则相悖。因此盘内DIE数量需要大于等于block group大小。
二、设置block group。
参见图2所示,假设p≥32,根据block group里面所有的block都分布在不同的DIE上这条规则选取其中32(n+m=32)个DIE上的block组成一个block group。其中,n表示用于存储用户数据的block的数量,m表示用于存储校验数据的block的数量。
如果设置冗余列数量为1(即:m=1),那么n=31,EC属性记为EC-1。如果设置冗余列数量为2(即:m=2),那么n=30,EC属性记为EC-2。m的值设置得越高,一个block group里面能够允许同时坏的block个数就越多,数据就越不容易丢。但是也有一个坏处,就是在一个block group内,存储的校验数据量大于用户数据量,导致硬盘空间利用率降低。硬盘空间利用率=n/(m+n)。
假设从图2所示的DIE0~DIEp中选择DIE0~DIE31共32个DIE,从这32个DIE的每个DIE上都选择一个block。那么可得到如图6所示的block group。在图6中,D0B0表示:DIE0上的block0,D1B1表示:DIE1上的block1,其他以此类推。
为了系统性能和可靠性的考量,使一个block group里面的m个校验block分布在不同的DIE上面,这样做会带来两个好处:
1、每个DIE上都存储用户数据和校验数据,在读场景中各个DIE都有可能被读到,不至于某些DIE一直处于空闲状态;
2、各个DIE被读的次数会趋于一个平均值,那么所有的block的使用寿命会基本一致。
以EC-2为例,取一个block group里面任意两个block存储校验数据,比如取图6中的D0B0和D4B8。此时需要额外的元数据记录这个block group里面哪些block是校验block,这样会导致元数据过多不便管理。
为了更好地管理校验数据块的分布,规定:在一个block group里面最后m个block用于存放校验数据。例如:当采用EC-2时,那么在一个block group里面的最后两个block就是EC-2的校验数据块。
但为了保证不同block group里的校验数据块分布在不同DIE上,将block group里面的所有block的顺序随机打散。经过随机打散之后,不同block group里的最后m个校验数据块就会随机分布在各个DIE,从而提高盘的性能。
将图6所示的block group中的各个block随机打散后,获得如图7所示block group,并规定图7所示block group的后m个block用于存放校验数据。假设针对图7所示block group而言,EC属性为EC-2,n+m=32,那么前30个block存储用户数据,后2个block存储校验数据。
三、写数据过程。
在SSD系统中约定:cache每次下发写请求的size固定为一个wordline大小(即一个内存节点的大小)。将每个写请求所占用的内存节点以链表的形式组织在一起,当此链表的节点个数达到n的时候,不再为此链表添加新的节点。
如果链表的节点个数没有达到n个,则继续等待后续IO的到来;如果超过10s的时间,还没有凑齐n个,则申请一定的全零数据节点凑齐n个。
如图8所示,链表的节点个数达到n之后,在这个链表后面加上m个内存节点,然后将此链表上的所有节点传入EC算法引擎,让EC算法引擎计算得到校验数据,并将校验数据写入m个内存节点。m个内存节点即图8中的P0-Pm-1。在图8中,Date0-Daten-1是从cache接收到的待写入数据占用的内存节点,P0-Pm-1则是Date0-Daten-1中所有数据经过EC算法编码后的校验数据。
获得如图8所示的链表后,将链表中的每个节点上的数据写入当前可用的block group里面的每个block,由此完成写操作。其中,Date0-Daten-1里的数据写入block group里的用户数据块,P0-Pm-1里的数据写入block group里的校验数据块。
若当前没有可用的block group或链表中的任一个节点上的数据写入失败,则构建新的block group,构建方法参照上述“设置block group”的相 关介绍。
只有当链表上所有节点的数据都完整的写入之后,更新L2P映射表,然后释放对应的内存节点。即:释放图8所示的链表中的每个节点。其中,用于存储校验数据的内存节点是写流程额外申请的,因此需要增加释放该内存节点的步骤。而用于存储用户数据的内存节点会在回调cache时自动删除其中的脏数据节点,因此无需额外增加释放该内存节点的步骤。
其中,L2P映射表里面对应的物理地址组成如下:
Figure PCTCN2022097620-appb-000001
其中,bgId表示block group的Id,dieId和blockId表示这个block group里面包含的block所在的真实的die的Id和block的Id,pageId表示这个数据位于此block的Id上面page号,auOff表示数据落在page里面的哪个au上面。一个page里面有多个au。
每个LBA写完成之后,根据上述的physicalAddr_t更新LBA对应的物理地址,以形成L2P映射表。
根据上述,写IO的流程图请参见图9。在写IO流程中,当接收到cache的数据之后,判断是否需要新分配block group,判断的依据是查询当前是否有用于写用户数据的可用block group。因此当系统的一个block group被写满了之后才需要分配一个新的block group。分配block group的规则参照上述“设置block group”的相关介绍。
若有可用的block group时,即可获知应该写数据到哪个block group上,之后凑好链表,将凑好的链表中的各个节点上的数据依次写到这个block group的各个数据块。
其中,链表中的一个节点上的数据写入一个数据块里的一个page。当该链表的各个节点写入完成后,下一个链表写入该block group的相应数据 块的下一个page。例如:block group里有2个数据块,这两个数据块都包括10个page,那么首次使用block group时,写入这两个数据块的第一个page,下一次使用block group时,写入这两个数据块的第二个page,即:page的标识递增一。
四、读数据过程。
由于在一个block group里面只有n个block存储的是用户数据,因此在读的场景中在一个block group里面只有n个block工作(m个校验数据block在没有出现读失败的场景下不需要读)。
请参见图10,读数据是写数据过程的逆过程。查询对应的L2P映射表就能获取到要读的数据属于对应block group里面对应block上面的对应位置,然后对NAND FLASH下发读操作,如果NAND无异常,则读上来的数据直接返回给调用者。
如果在读NAND的过程中读失败,此时需要确定要读数据所属的block group里面的n个block(包括校验列),基于这n个block还原得到正确的用户数据。
若读失败,则将读失败的block标记为坏块,并查询该块所属的block group里的所有block,从该block group里选n个block(不包括读失败的block)。
如果该block group里面不能够选取到n个block,则直接返回前端读失败,EC恢复失败,流程结束。
如果该block group里面能够选取到n个block,则读取这n个block里的数据。如果这n个block全部读成功,则将所有读成功的数据发送到EC算法引擎做解码;否则再次选取另外n个block进行重读。
等待EC算法引擎解码完成之后,将得到的数据做一次数据一致性校验,如果校验成功,则将返回值设置为ok,返回给前端,EC恢复成功,流程结束。如果校验失败,则再次选取另外n个block进行重读。
如果block group里面不再能选取n个block进行重读,则将返回值设置为err,返回给前端,EC恢复失败,流程结束。
可见,本实施例可根据用户的需求配置不同的EC级别,能有效的针对不同用户场景灵活的提供数据可靠性保护级别,具有非常高的灵活性和 可配置性;能够允许更多DIE失效,可靠性更高,能够更大程度的提高SSD的性能,以及使用寿命。
本申请涉及的“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法或设备固有的其它步骤或单元。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的可读存储介质中。
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (16)

  1. 一种数据处理方法,其特征在于,应用于固态硬盘,包括:
    接收主机发送的目标数据,并将所述目标数据写入内存;
    若所述目标数据在所述内存中占用n个内存节点,则将所述n个内存节点确定为n个数据节点;
    利用EC算法引擎计算所述目标数据的校验数据,若利用m个内存节点存储所述校验数据后,将所述m个内存节点确定为m个校验节点;n和m的取值预设于当前固态硬盘的EC属性中;
    确定当前可用的数据块组,并查询所述数据块组中的n个用户数据块和m个校验数据块的排列顺序;
    按照所述排列顺序将所述n个数据节点和所述m个校验节点排列为链表;
    基于所述链表,将所述n个数据节点中的数据对应写入所述n个用户数据块,将所述m个校验节点中的数据对应写入所述m个校验数据块,以存储所述目标数据。
  2. 根据权利要求1所述的方法,其特征在于,所述利用EC算法引擎计算所述目标数据的校验数据,利用m个内存节点存储所述校验数据,包括:
    向所述内存申请所述m个内存节点;
    将所述n个数据节点和所述m个内存节点传输至所述EC算法引擎,以使所述EC算法引擎基于所述n个数据节点计算所述校验数据,并将所述校验数据写入所述m个内存节点;
    将所述n个数据节点传输至所述EC算法引擎,以使所述EC算法引擎基于所述n个数据节点计算所述校验数据,并向所述内存申请所述m个内存节点后,将所述校验数据写入所述m个内存节点。
  3. 根据权利要求1所述的方法,其特征在于,所述按照所述排列顺序将所述n个数据节点和所述m个校验节点排列为链表,包括:
    将所述m个校验节点排列在所述n个数据节点的尾部,以得到所述链表。
  4. 根据权利要求1所述的方法,其特征在于,所述存储所述目标数据之后,还包括:
    更新L2P映射表,并释放所述n个数据节点和所述m个校验节点。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,还包括:
    若所述链表中的任一个节点中的数据写入失败,则执行所述确定当前可用的数据块组的步骤。
  6. 根据权利要求5所述的方法,其特征在于,所述确定当前可用的数据块组的步骤,包括:
    若当前没有可用的数据块组,则计算n与m之和,得到目标值;
    若所述目标值等于当前固态硬盘中的DIE个数,则在当前固态硬盘的每个DIE中选择一个数据块;或若所述目标值小于当前固态硬盘中的DIE个数,则在当前固态硬盘中选择所述目标值个DIE,并在所选择的每个DIE中选择一个数据块;
    在所述目标值个数据块中标记n个用户数据块和m个校验数据块,并确定n个用户数据块和m个校验数据块的排列顺序,以得到当前可用的数据块组。
  7. 根据权利要求6所述的方法,其特征在于,所述在所述目标值个数据块中标记n个用户数据块和m个校验数据块,包括:
    在所述目标值个数据块中随机选择m个数据块标记为校验数据块,剩余的n个数据块则标记为用户数据块;
    或者
    按照各个数据块所属DIE的标识信息随机排列所述目标值个数据块,得到目标序列;
    将所述目标序列中连续的m个数据块标记为校验数据块,剩余n个数据块标记为所述用户数据块。
  8. 根据权利要求5所述的方法,其特征在于,还包括:
    若当前有可用的数据块组,则选择当前可用的数据块组后,执行所述查询所述数据块组中的n个用户数据块和m个校验数据块的排列顺序的步骤。
  9. 根据权利要求1至4任一项所述的方法,其特征在于,还包括:
    若所述目标数据在所述内存中占用小于n个内存节点,则等待接收所述主机发送的新数据,以用所述新数据补充所述目标数据,使所述目标数据在所述内存中占用n个内存节点。
  10. 根据权利要求9所述的方法,其特征在于,还包括:
    若等待所述新数据超时,则用全零数据补充所述目标数据,以使所述目标数据在所述内存中占用n个内存节点,并执行所述将所述n个内存节点确定为n个数据节点的步骤。
  11. 根据权利要求1至4任一项所述的方法,其特征在于,当前固态硬盘的EC属性的配置过程,包括:
    接收主机发送的配置EC属性的命令;
    解析所述命令得到目标值和m;所述目标值为:n与m之和;
    若所述目标值不大于当前固态硬盘中的DIE个数,则将所述目标值与m的差值记为n;
    将n和m传输至所述EC算法引擎,以使所述EC算法引擎根据n和m确定编码矩阵,以配置当前固态硬盘的EC属性。
  12. 根据权利要求11所述的方法,其特征在于,还包括:
    若所述目标值大于当前固态硬盘中的DIE个数,则返回EC属性配置失败的通知消息。
  13. 根据权利要求1至4任一项所述的方法,其特征在于,还包括:
    若首次读取所述目标数据失败,则查询所述数据块组;
    从所述数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合;
    读取所述可恢复组合包括的各个数据块中的数据,将所读取的数据传输至所述EC算法引擎,以使所述EC算法对所读取的数据进行解码,得到解码结果;
    校验所述解码结果,若校验通过,则基于所述解码结果读取所述目标数据;否则,执行从所述数据块组中选择n个能够被正常读取数据的数据块,组成不发生重复的可恢复组合的步骤;
    若从所述数据块组中无法选择出不发生重复的可恢复组合,则返回所述目标数据读取失败的通知消息。
  14. 一种数据处理装置,其特征在于,应用于固态硬盘,包括:
    缓存模块,用于接收主机发送的目标数据,并将所述目标数据写入内存;
    数据节点确定模块,用于若所述目标数据在所述内存中占用n个内存节点,则将所述n个内存节点确定为n个数据节点;
    校验节点确定模块,用于利用EC算法引擎计算所述目标数据的校验数据,利用m个内存节点存储所述校验数据后,将所述m个内存节点确定为m个校验节点;n和m的取值预设于当前固态硬盘的EC属性中;
    数据块组查询模块,用于确定当前可用的数据块组,并查询所述数据块组中的n个用户数据块和m个校验数据块的排列顺序;
    排列模块,用于按照所述排列顺序将所述n个数据节点和所述m个校验节点排列为链表;
    存储模块,用于基于所述链表,将所述n个数据节点中的数据对应写入所述n个用户数据块,将所述m个校验节点中的数据对应写入所述m个校验数据块,以存储所述目标数据。
  15. 一种电子设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序,以实现如权利要求1至13任一项所述的方法。
  16. 一种可读存储介质,其特征在于,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至13任一项所述的方法。
PCT/CN2022/097620 2021-07-09 2022-06-08 一种数据处理方法、装置、设备及可读存储介质 WO2023279906A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/407,611 US20240143188A1 (en) 2021-07-09 2024-01-09 Data processing method and apparatus, device, and readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110779968.9 2021-07-09
CN202110779968.9A CN113419684B (zh) 2021-07-09 2021-07-09 一种数据处理方法、装置、设备及可读存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/407,611 Continuation US20240143188A1 (en) 2021-07-09 2024-01-09 Data processing method and apparatus, device, and readable storage medium

Publications (1)

Publication Number Publication Date
WO2023279906A1 true WO2023279906A1 (zh) 2023-01-12

Family

ID=77721682

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/097620 WO2023279906A1 (zh) 2021-07-09 2022-06-08 一种数据处理方法、装置、设备及可读存储介质

Country Status (3)

Country Link
US (1) US20240143188A1 (zh)
CN (1) CN113419684B (zh)
WO (1) WO2023279906A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113419684B (zh) * 2021-07-09 2023-02-24 深圳大普微电子科技有限公司 一种数据处理方法、装置、设备及可读存储介质
CN114297737A (zh) * 2021-12-28 2022-04-08 深圳大普微电子科技有限公司 一种数据保护方法、固态硬盘控制器及固态硬盘
CN116644071B (zh) * 2023-06-08 2024-04-05 中国长江三峡集团有限公司 一种物资编码管理方法、装置、计算机设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984607A (zh) * 2013-02-08 2014-08-13 华为技术有限公司 分布式存储的方法、装置和系统
WO2018028107A1 (zh) * 2016-08-07 2018-02-15 成都信息工程大学 一种阵列式存储系统的编码容错方法
US20200174708A1 (en) * 2017-08-10 2020-06-04 Huawei Technologies Co., Ltd. Data Access Method, Apparatus, and System
CN111400083A (zh) * 2020-03-17 2020-07-10 上海七牛信息技术有限公司 数据存储方法及系统、存储介质
CN111818124A (zh) * 2020-05-29 2020-10-23 平安科技(深圳)有限公司 数据存储方法、装置、电子设备及介质
CN113419684A (zh) * 2021-07-09 2021-09-21 深圳大普微电子科技有限公司 一种数据处理方法、装置、设备及可读存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9921910B2 (en) * 2015-02-19 2018-03-20 Netapp, Inc. Virtual chunk service based data recovery in a distributed data storage system
CN107844268B (zh) * 2015-06-04 2021-09-14 华为技术有限公司 一种数据分发方法、数据存储方法、相关装置以及系统
JP6526235B2 (ja) * 2016-11-25 2019-06-05 華為技術有限公司Huawei Technologies Co.,Ltd. データチェック方法および記憶システム
CN107908499B (zh) * 2017-11-02 2021-03-05 华为技术有限公司 一种数据校验方法及装置
WO2019119311A1 (zh) * 2017-12-20 2019-06-27 华为技术有限公司 一种数据存储的方法、装置和系统
CN110502365B (zh) * 2019-07-11 2024-03-01 平安科技(深圳)有限公司 数据存储及恢复的方法、装置及计算机设备
JP2021064283A (ja) * 2019-10-16 2021-04-22 富士通株式会社 ストレージ制御装置およびプログラム
CN111273862A (zh) * 2020-01-16 2020-06-12 上海依图网络科技有限公司 数据存储方法及其装置、可读介质和系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984607A (zh) * 2013-02-08 2014-08-13 华为技术有限公司 分布式存储的方法、装置和系统
WO2018028107A1 (zh) * 2016-08-07 2018-02-15 成都信息工程大学 一种阵列式存储系统的编码容错方法
US20200174708A1 (en) * 2017-08-10 2020-06-04 Huawei Technologies Co., Ltd. Data Access Method, Apparatus, and System
CN111400083A (zh) * 2020-03-17 2020-07-10 上海七牛信息技术有限公司 数据存储方法及系统、存储介质
CN111818124A (zh) * 2020-05-29 2020-10-23 平安科技(深圳)有限公司 数据存储方法、装置、电子设备及介质
CN113419684A (zh) * 2021-07-09 2021-09-21 深圳大普微电子科技有限公司 一种数据处理方法、装置、设备及可读存储介质

Also Published As

Publication number Publication date
CN113419684A (zh) 2021-09-21
US20240143188A1 (en) 2024-05-02
CN113419684B (zh) 2023-02-24

Similar Documents

Publication Publication Date Title
WO2023279906A1 (zh) 一种数据处理方法、装置、设备及可读存储介质
US20210103388A1 (en) Storage system managing metadata, host system controlling storage system, and storage system operating method
US11662915B2 (en) Parity in a vast storage system using alternate memory
US10417124B2 (en) Storage system that tracks mapping to a memory module to be detached therefrom
CN106708425B (zh) 分布式多模存储管理
KR101758544B1 (ko) 비휘발성 메모리 시스템에서의 동기 미러링
CN108089951B (zh) 存储系统中的加速数据恢复
US9430329B2 (en) Data integrity management in a data storage device
US20090271659A1 (en) Raid rebuild using file system and block list
US20060156059A1 (en) Method and apparatus for reconstructing data in object-based storage arrays
US10108359B2 (en) Method and system for efficient cache buffering in a system having parity arms to enable hardware acceleration
WO2014056381A1 (zh) 数据冗余实现方法及装置
US7849258B2 (en) Storage apparatus and data verification method for the same
US11340986B1 (en) Host-assisted storage device error correction
US12081526B2 (en) Data storage device data recovery using remote network storage
CN112513804B (zh) 一种数据处理方法及装置
WO2014190501A1 (zh) 数据恢复方法、存储设备和存储系统
WO2019210844A1 (zh) 存储设备异常检测方法及装置、分布式存储系统
TW201225109A (en) Memory storage device, memory controller thereof, and method for programming data thereof
US20070106925A1 (en) Method and system using checksums to repair data
CN115981572A (zh) 数据一致性验证方法、装置、电子设备及可读存储介质
JP2009294901A (ja) ストレージ装置及び障害復旧方法
US12008254B2 (en) Deduplication of storage device encoded data
US20090300309A1 (en) Storage apparatus
CN113168288B (zh) 便利i/o故障处置的方法、计算机系统和设备

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE