A real-time data verification test method, device and medium for solid state hard disk

By analyzing test scripts in a solid-state drive, encoding data blocks and comparing them, the problem of FIO tools' performance degradation during data verification is solved, real-time data verification of solid-state drives is realized, ensuring the integrity of data in writing, reading and Trim operations.

CN119132374BActive Publication Date: 2025-04-25SUZHOU DEGASTORAGE TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411307985.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-04-25
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

The existing solid-state drive testing tool FIO has a reduced performance when performing data verification and cannot be monitored in real time, especially in the read verification test of ultra-high-speed solid-state drives, which makes it impossible to meet the test requirements.

Method used

By parsing the configuration parameters in the test script in the solid-state drive, encoding the data blocks are encoded and written to the solid-state drive, data feature information is stored, and data feature information is compared with the read encoded data blocks in real time when reading the data, to ensure data integrity.

Benefits of technology

It realizes real-time data verification after data is written, ensures data integrity, quickly detects and corrects data errors. It is suitable for high-load conditions and meets the requirements of real-time data verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119132374B_ABST
    Figure CN119132374B_ABST
Patent Text Reader

Abstract

The present invention discloses a real-time data verification test method, device and medium for a solid-state hard disk. The method comprises parsing configuration parameters in a test script, the configuration parameters comprising a data block, a logical address and a read / write command; encoding a data block to form a coded data block, the coded data block comprising a data block and unique data feature information corresponding to the data block; writing the coded data block to a logical block address corresponding to the solid-state hard disk according to a write command and a logical address of a read / write command, and storing the data feature information in a memory of the solid-state hard disk; reading data according to a read command in a read / write command, and when data comparison verification is turned on in the configuration parameters, the data feature information in the memory is compared with the read coded data block at each read command. Through real-time data verification, the integrity of data in write, read and Trim operations is ensured, and data errors and losses are effectively detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a real-time data verification test method, device and medium for a solid state hard disk. Background Art

[0002] After the SSD is manufactured, it needs to undergo functional testing. During the test, the data written to the SSD needs to be read back and verified to verify the SSD's data storage function. In this test scenario, the mainstream testing tool currently used in the industry is FIO, which is a free and open source disk testing tool. Its data verification function is relatively basic and is mainly suitable for conventional data integrity verification.

[0003] When FIO is testing a solid-state drive, after all written data is completed, it can perform a one-time read verification on all previously written LBA (Logical Block Address) information. Two methods are usually used. One is the verify parameter. If this parameter is used, FIO will perform a read verification on all written LBAs after writing the data. The other method is not to use parameters, but to restart the test for the written data, change the write to read, and complete the data verification. When a large amount of data verification occurs, FIO will have a significant performance degradation, which will cause obvious performance problems when performing read verification tests on the latest PCIe Gen5 SSD, an ultra-high-speed solid-state drive. The speed is slow and real-time monitoring cannot be achieved, thus failing to meet the test requirements. Summary of the invention

[0004] To overcome the above disadvantages, the present invention aims to provide a real-time data verification test method, device and medium for a solid state drive. Through real-time data verification, the integrity of data in writing, reading and Trim operations is ensured, and data errors and losses are effectively detected.

[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is: a real-time data verification test method for a solid state hard disk, comprising:

[0006] Parsing configuration parameters in the test script, wherein the configuration parameters include data blocks, logical addresses, and read / write commands;

[0007] Encoding the data block to form a coded data block, the coded data block comprising the data block and unique data feature information corresponding to the data block;

[0008] Writing the encoded data block to a corresponding logical block address of the solid-state drive according to the write command and the logical address of the read / write command, and storing the data feature information in the memory of the solid-state drive;

[0009] Data is read according to the read command in the read / write command. When data comparison and verification is turned on in the configuration parameters, the data feature information in the memory is compared with the read coded data block each time the read command is executed.

[0010] The beneficial effects of the present invention are:

[0011] After the data is written to the SSD, data verification can be performed when reading the data to ensure that the written data is completely consistent with the source data. Because the read command can be inserted at any time, the written data can be immediately compared and verified by inserting the read command at any time, which can quickly detect and correct any potential data errors and ensure the integrity of the data during the writing process. Even in mixed reading and writing, data verification is implemented during the reading and writing operations. By embedding data feature information in the reading and writing process and comparing it with the read coded data block, data integrity is ensured under high load conditions.

[0012] Furthermore, the data feature information includes a feature tag, a logical address tag, a data block tag and a check code, the feature tag records the number of times the data block is written, the logical address tag records the identifier of the logical address corresponding to the data block, the data block tag is a unique identifier of the data block, and the check code records the check information of the data block.

[0013] After the data block and the superimposed characteristic mark, logical address mark, data block mark and check code are all obtained, they are written into the corresponding position of the solid-state hard disk, providing basic information for subsequent data verification and judgment.

[0014] Furthermore, the check code is obtained by encrypting the data block, the feature mark and the logical address mark through a CRC32 encryption algorithm.

[0015] Specifically, when the data feature information in the memory is compared with the read coded data block, if the comparison is consistent, the encoding of the data block is returned to form a coded data block; if the comparison is inconsistent, an error is recorded and the test is terminated.

[0016] Specifically, after the coded data block is written to the address corresponding to the solid-state drive according to the write command and the logical address of the read / write command, the corresponding feature mark is updated, and the write command list formed by all the feature marks is obtained. When comparing data, it is possible to determine whether new data has been completed and written according to the feature mark, thereby quickly determining the comparison between the old and new data.

[0017] Furthermore, when a power failure occurs during the execution of a read / write command, a power failure test scenario is initiated, specifically including:

[0018] Record the completed write commands before power failure to form a completion list;

[0019] Recording the write commands that the solid state drive has not responded to when power is off to form an unfinished list, and recording the corresponding coded data blocks in the unfinished list;

[0020] After power-on, only the write commands in the completion list are verified for data.

[0021] Furthermore, starting the power-off test scenario also includes executing the following after power-on only after data verification of the write commands in the completion list:

[0022] Restart the read / write command;

[0023] When executing the write command, if the coded data block in the unfinished list is completed, the feature flag corresponding to the coded data block is updated, and the coded data block is removed from the unfinished list.

[0024] An effective power-off protection mechanism is designed to ensure that the written data can be verified in real time in normal / abnormal power-off situations.

[0025] Furthermore, the write command includes data writing and data erasing.

[0026] The present invention also discloses a real-time data verification test device for a solid state hard disk, and the device comprises a functional module for implementing the above method.

[0027] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 The process of the first embodiment of the present invention Figure 1 ;

[0029] Figure 2 The process of the first embodiment of the present invention Figure 2 ;

[0030] Figure 3 The process of the first embodiment of the present invention Figure 3 ;

[0031] Figure 4 The structure of the coded data block in the first embodiment of the present invention;

[0032] Figure 5 The process of the first embodiment of the present invention Figure 4 ;

[0033] Figure 6This is a system block diagram of Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0034] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.

[0035] Embodiment 1

[0036] Attached Figure 1-5 A real-time data verification test method for a solid state hard disk of the present invention is shown.

[0037] See attached Figure 1 As shown, a real-time data verification test method for a solid state drive includes:

[0038] S100, parsing configuration parameters in the test script, where the configuration parameters include data blocks, logical addresses, and read / write commands.

[0039] S200: Encode a data block to form a coded data block, where the coded data block includes the data block and unique data feature information corresponding to the data block.

[0040] S300, writing the encoded data block to the logical block address corresponding to the solid state drive according to the write command and the logical address of the read / write command, and storing the data feature information in the memory of the solid state drive.

[0041] S400, reading data according to the read command in the read / write command, when the data comparison and verification is turned on in the configuration parameters, the data feature information in the memory is compared with the read coded data block at each read command.

[0042] In this embodiment, after the data is written to the SSD, data verification can be performed when reading the data to ensure that the written data is completely consistent with the source data. Because the read command can be inserted at any time, by inserting the read command at any time to instantly compare and verify the written data, any potential data errors can be quickly detected and corrected to ensure the integrity of the data during the writing process. Even in mixed reading and writing, data verification is implemented during the reading and writing operations. By embedding data feature information in the reading and writing process and comparing it with the read coded data block, data integrity is ensured under high load conditions.

[0043] In this embodiment, the configuration parameters include LBA Low (logical address low) and LBA High (logical address high), LBA Low is the low logical address of the read-write range, which can also be called the starting logical address, and LBA High is the high logical address of the read-write range, which can also be called the ending logical address. The logical address can be known through LBA Low and LBA High. The data block is Block Size (data block unit size). There are generally two data block sizes for solid-state drives, 512 bytes for a data block or 4096 bytes for a data block. Read / write commands (RW Mode) include "sequential mode", "random mode", "sequential / random mixed mode / playback", etc.

[0044] Configuration parameters also include:

[0045] Xfer Length (data transmission length): The length of the transmitted data, which refers to the transmission data length required by each read and write command, usually an integer multiple of the data block size.

[0046] Read-Write Percent: Read-write ratio. If the read ratio is 0, it means all operations are write operations; if the write ratio is 0, it means all operations are read operations; if the read-write ratio is 50, it means 50% are read operations and 50% are write operations. And so on.

[0047] Number of passes: The number of passes, applicable to sequential mode. If the number of passes is 1, it means sequential reading and writing once; if the number of passes is 2, it means sequential reading and writing twice, and so on.

[0048] Num Ops (Number of commands sent): The number of commands sent, applicable to random mode. If the number of commands sent is 100, it means that 100 read or write commands are sent as the end mark.

[0049] Alignment Boundary: used to set read and write boundary alignment requirements, such as 4K alignment, 8K alignment, and other read and write test requirements.

[0050] Tag Enable (whether to enable tag identification): used to indicate the characteristic information of the data block, for example, tag=00 represents verification of unwritten data, tag=01 represents the data written for the first time, tag=02 represents the data written for the second time, and so on.

[0051] Compare Enable (Whether to enable data comparison and verification): It is used to indicate whether to perform data comparison and verification, because the purpose of the test is very diverse. If the test case stipulates that data comparison is not required, then CompareEnable can be set to the off state, which saves the additional resource overhead caused by the CPU for data comparison and improves the reading and writing efficiency. When data comparison and verification is required, Compare Enable is set to the enabled state, and data verification is performed in real time every time a read command is executed.

[0052] Data verification is only required when the read command is enabled and data comparison verification is enabled, that is, comparing the data feature information in the memory with the read coded data block. Figure 3 As shown in the figure, when performing data verification during the reading and writing process, it is also necessary to determine whether the read / write command is a write command or a read command. If it is a read command, a read operation is issued, and then the data returned by the read command to the host computer is compared with the data feature information stored in the memory.

[0053] After writing the coded data block to the corresponding address of the solid-state drive according to the write command and logical address of the read / write command, the corresponding feature mark (Tag mark) is updated, and the write command list formed by all feature marks is generated. Figure 3 As shown, if it is a write command, the write operation is performed and the Tag information is updated.

[0054] When comparing the data feature information in the memory with the read coded data block, if the comparison is consistent, the verification process is returned to step S200 to execute the next read / write command until the reading and writing of the detection process is completed. If the comparison is inconsistent, an error is recorded and the test is terminated.

[0055] In this embodiment, the write command includes data writing and data erasing (Trim). Trim is understood as a special type of writing. After Trim, the data block in the corresponding LBA needs to be cleared to zero.

[0056] In one implementation, see Attachment Figure 4 As shown, data feature information includes feature tag (Tag), logical address tag (LBA), data block tag (Pattern) and checksum. Feature tag records the number of times the data block has been written. For example, Tag "00" means that the location has been Trim (erased) and needs to be checked for 00 data. Tag "01" means the first time the data is written, Tag "02" means the second time the data is written, and so on. In this way, according to the Tag information, whether the data has been cleared or the number of times the data has been written is recorded very clearly, which is convenient for data comparison.

[0057] The logical address tag records the identifier of the logical address corresponding to the data block. Because all data blocks inside the solid-state drive have corresponding LBA logical addresses, using LBA as an index, it is possible to clearly determine whether the data block belongs to the correct logical address during data comparison.

[0058] The data block mark is the unique identifier of the data block actually written. A correspondence table between the hard disk partition and the actual data is stored in the memory. Through the hard disk partition, the content of each data block actually written to the solid-state drive can be known, so that all written data can be verified.

[0059] The check code records the check information of the data block. The check code must ensure the accuracy of the check data and the operation speed. This achieves the purpose of accurate check without sacrificing read and write performance. In this embodiment, the check code is obtained by the CRC32 encryption algorithm for the data block, the feature mark and the logical address mark, and the check code is a 32-bit data.

[0060] The data block and the superimposed tag, LBA, pattern, and verification information have all been obtained and written to the corresponding position of the solid-state drive, providing basic information for subsequent data verification and judgment.

[0061] In one embodiment, see the attached Figure 2 As shown, when the configuration parameters do not enable data comparison and verification, the data feature information in the memory is not compared with the read coded data block during the reading process of the solid state drive.

[0062] In this embodiment, different tag number ranges can be dynamically generated according to the test size ranges. For example, when writing randomly in a small range, since the probability of each LBA being hit is higher, a larger tag number is needed to mark the number of writes; in a large range, the probability of each LBA being hit is lower, so a smaller tag number can be used to distinguish the number of writes. At this time, different capacity test requirements can be met under limited memory capacity. Through tag information, basic information for data comparison calculation can be provided for subsequent more complex data comparisons.

[0063] In this embodiment, when the data block encoding is completed and the encoded data block is written to the corresponding position of the solid-state hard disk, the solid-state hard disk will return a mark to indicate whether the completed write command is completed. When completed, the corresponding feature mark is updated, and a write command list formed by all feature marks is formed. Table 1 is a write command list, in which each box represents a tag of an LBA. For example, the tag in the data we wrote before is marked as 01, so the newly written data must be marked with a tag of 02. Here, the encoded data block with Tag=02 as the feature is started to be written. For the completed command, the Tag is marked as 02, and for the unfinished command, we will not mark the update tag. When comparing the data later, it can be determined based on the Tag information whether there is data that has been completed and written with the new Tag=02, so as to quickly determine the comparison between the new and old data.

[0064] Table 1

[0065]

[0066] In one embodiment, in the write command list of Table 1, when Tag=02 and Tag=01, different colors can be used for identification to facilitate viewing.

[0067] In one embodiment, when a power failure occurs during the execution of a read / write command, a power failure test scenario is initiated. Figure 5 , including:

[0068] S11. Record the write commands completed before power failure to form a completion list.

[0069] S12, recording the write commands that the solid state drive did not respond to when the power was off to form an unfinished list, and recording the corresponding coded data blocks in the unfinished list.

[0070] S13. After power-on, data verification is performed only on the unverified write commands in the completion list.

[0071] That is, data verification is performed on the last N completed write commands. At the same time, the LBAs contained in the unfinished commands will be removed from the verification list because it is impossible to determine whether they are actually written to the hard disk.

[0072] S14. Restart the read / write command.

[0073] S15. When executing the write command, if the coded data block in the unfinished list is completed, the feature flag corresponding to the coded data block is updated, and the coded data block is removed from the unfinished list.

[0074] In this embodiment, in the event of normal power failure / abnormal power failure, unfinished data operations can be automatically saved, and data verification can be continued after power is restored. This can perfectly verify whether the solid-state drive can meet the requirement of no data loss in various normal / abnormal power failure situations, and effectively perform abnormal power failure data protection.

[0075] Table 2 is the completed list and the uncompleted list, which records in detail which commands are sent, which commands are completed and which are not completed. The completed commands may be out of order, because the order of commands returned and sent by some protocols may not be preserved:

[0076] Table 2

[0077]

[0078] In the process of the host computer sending write commands, since the commands are completed asynchronously, there is an asynchrony between sending and returning. For example, if the host computer sends 100 commands, only 90 commands may have been returned at this time, and there are 10 commands being processed by the solid-state drive but not returned to the host computer. At this time, we call these 10 commands on the fly commands. Since it is not certain whether the on the fly commands are actually written or erased, the read commands for these LBAs cannot be compared at this time. Therefore, in this embodiment, during the execution of the read / write command, when an abnormal power failure occurs, the meaning of these unfinished commands will be recorded.

[0079] The method in this embodiment is compatible with SSDs with SATA and NVMe protocols, and is applicable to various mainstream SSD interface standards. By supporting multiple protocols, the wide applicability and flexibility of the solution are ensured, and the requirements of different application scenarios and hardware configurations can be met.

[0080] Embodiment 2

[0081] The present invention also discloses a real-time data verification test device for a solid-state hard disk, the device includes a functional module for implementing the method in Example 1, and the test device is based on an open source io_uring asynchronous architecture to complete asynchronous IO for the solid-state hard disk and perform data verification in real time.

[0082] See attached Figure 6As shown, the test device includes a parsing module, an encoding module, a test module and a comparison module, wherein the parsing module is used to parse the configuration parameters in the test script, and the encoding module encodes the data block according to the parsed configuration parameters to form a coded data block. The test module reads and writes data according to the read / write command. When it is a write command, the coded data block is written to the logical block address corresponding to the solid-state hard disk, and the data feature information is stored in the memory of the solid-state hard disk. When the data comparison and verification is turned on in the configuration parameters, the comparison module compares the data feature information in the memory with the read coded data block each time the read command is executed. Only when consistency is maintained, the data verification is qualified.

[0083] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the corresponding method embodiment, and it has the corresponding technical effects.

[0084] Embodiment 3

[0085] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the first embodiment are implemented.

[0086] In this embodiment, if the real-time data verification test method of the solid state drive is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0087] The above implementation modes are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with this technology to understand the content of the present invention and implement it, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A real-time data verification test method for a solid state drive, characterized in that: include: Parsing configuration parameters in the test script, wherein the configuration parameters include data blocks, logical addresses, and read / write commands; Encoding the data block to form a coded data block, the coded data block comprising the data block and unique data feature information corresponding to the data block; Writing the encoded data block to a corresponding logical block address of the solid-state drive according to the write command and the logical address of the read / write command, and storing the data feature information in the memory of the solid-state drive; Read data according to the read command in the read / write command, and when the data comparison and verification is turned on in the configuration parameter, compare the data feature information in the memory with the read coded data block each time the read command is executed; The data feature information includes a feature tag, a logical address tag, a data block tag and a check code. The feature tag records the number of times the data block is written, the logical address tag records the identifier of the logical address corresponding to the data block, the data block tag is a unique identifier of the data block, and the check code records the check information of the data block.

2. The real-time data verification test method of a solid state drive according to claim 1, characterized in that: The check code is obtained by using the CRC32 encryption algorithm for the data block, the feature mark and the logical address mark, and the check code is a 32-bit data.

3. The real-time data verification test method of a solid state drive according to any one of claims 1-2, characterized in that: When comparing the data feature information in the memory with the read coded data block, if the comparison is consistent, the data block is returned to be encoded to form a coded data block; if the comparison is inconsistent, an error is recorded and the test is terminated.

4. The real-time data verification test method of a solid state drive according to claim 3, characterized in that: After writing the encoded data block to the address corresponding to the solid-state hard disk according to the write command and the logical address of the read / write command, the corresponding feature mark is updated, and all the feature marks form a write command list.

5. The real-time data verification test method for a solid state drive according to any one of claims 1 to 2 or claim 4, characterized in that: During the execution of the read / write command, when a power failure occurs, the power failure test scenario is started, including: Record the completed write commands before power failure to form a completion list; Recording the write commands that the solid state drive has not responded to when power is off to form an unfinished list, and recording the corresponding coded data blocks in the unfinished list; After power-on, data verification is performed only on the unverified write commands in the completion list.

6. The real-time data verification test method of a solid state drive according to claim 5, characterized in that: Start the power-off test scenario, including executing only the data verification of the write commands in the completion list after power-on: Restart the read / write command; When executing the write command, if the coded data block in the unfinished list is completed, the feature flag corresponding to the coded data block is updated, and the coded data block is removed from the unfinished list.

7. The real-time data verification test method of a solid state drive according to claim 1, characterized in that: The write command includes data writing and data erasing.

8. A real-time data verification test device for a solid state hard disk, characterized in that: The device comprises a functional module for implementing the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for detecting read-write error of storage medium

    CN102034516A