A firmware testing method, apparatus, device, and medium for solid-state drives.
By injecting errors into the solid-state drive and judging the data recovery process, the problem of lack of proactive error handling in firmware was solved, resulting in improved code test coverage and product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
- Filing Date
- 2022-10-19
- Publication Date
- 2026-07-03
AI Technical Summary
Current solid-state drive firmware lacks proactive error handling procedures and cannot check whether the software code data recovery function is available; it only handles errors passively when they occur.
Test data was written to the solid-state drive using the FIO testing tool, and errors were injected. The data recovery process was then assessed using serial port printing and the nvme-cli tool to confirm the normality of the error handling code.
This technology enhances code inspection coverage in solid-state drive firmware testing, effectively eliminates unknown errors, improves product pass rates, and enriches firmware testing methods.
Smart Images

Figure CN115617587B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage, and more particularly to a firmware testing method, apparatus, device, and medium for solid-state drives. Background Technology
[0002] The main function of the SSD backend is to parse Flash Translation Layer (FTL) messages and operate the Nand Flash Controller (NFC) to perform corresponding operations. Currently, the main error handling in the backend focuses on FTL message assertions and ECC error handling. For example, RAID 5 error handling is based on a 31+1 method for data recovery. When reading messages, FTL reads 32 data entries at a time. The first 31 entries are read from the host, and the 32nd entry is obtained by XORing the first 31 entries. If an error occurs in one entry of the message, the erroneous data will be recovered by XORing the first 31 entries. This achieves data recovery. If the 32nd XORed entry is incorrect, the software code ignores it.
[0003] Current FTL read message error handling uses RAID XOR data recovery. The NFC core reads data from the flash memory (NAND) and then sends it to the FTL core. If a read error occurs during data reading by the FTL core, it will trigger the FTL read message error handling, which is RAID redundancy error handling. However, traditional SSD firmware only has an error handling process and no error injection process. Currently, the error handling process can only be triggered when an error occurs passively, and it is impossible to check whether the SSD software code data recovery function is available. Summary of the Invention
[0004] In view of this, it is necessary to provide a firmware testing method, apparatus, device and medium for solid-state drives to address the above technical problems.
[0005] According to a first aspect of the present invention, a firmware testing method for a solid-state drive is provided, the method comprising:
[0006] Test data was written to the solid-state drive using the testing tool FIO.
[0007] At least one error is generated and injected when the testing tool FIO reads the test data;
[0008] Determine if a data recovery process exists in the serial port printout corresponding to at least one error;
[0009] If a data recovery process corresponding to the at least one error exists, then the error handling process code in the firmware is confirmed to be normal.
[0010] If no data recovery process corresponds to the at least one error, the error handling process code in the firmware is confirmed to be abnormal.
[0011] In some embodiments, writing the test data to the solid-state drive using the testing tool FIO includes:
[0012] The testing tool FIO writes data of any size to any location in the flash memory according to a preset verification method as test data.
[0013] In some embodiments, at least one error is generated and injected when the testing tool FIO reads the test data, including:
[0014] The error injection program is triggered using a probabilistic method to inject at least one error; or
[0015] The error injection program is triggered on a timed basis to inject at least one error.
[0016] The error injection program is used to inject errors via serial port commands or the nvme-cli tool during the process of the flash controller transmitting messages to the solid-state drive flash conversion layer, so as to forcibly modify a piece of data in the message queue.
[0017] In some embodiments, triggering the error injection procedure to inject at least one error is done probabilistically, including:
[0018] Pre-set the error to read count ratio;
[0019] Before the testing tool FIO executes the reading of the test data, the number of errors is calculated using the total number of reads to be performed and the pre-set ratio of errors to reads.
[0020] During the process of reading the test data by the testing tool FIO, the error injection program is run randomly, wherein the number of times the error injection program is run is equal to the number of errors.
[0021] In some embodiments, the error injection program is triggered periodically to inject at least one error, including:
[0022] Pre-set the trigger interval time;
[0023] Calculate the time interval between the previous error-triggered program execution time and the current time.
[0024] If the time interval is greater than a preset trigger interval, the error injection procedure is run to inject an error.
[0025] In some embodiments, determining whether a data recovery process corresponding to at least one error exists in the serial port printout includes:
[0026] Determine if a data recovery process exists during serial port printing; and
[0027] Use serial port commands to query the error count and determine if the error count is the same as the number of errors generated.
[0028] In some embodiments, determining whether a data recovery process corresponding to at least one error exists in the serial port printout further includes:
[0029] If a data recovery process exists in the serial port printing and the error count is the same as the number of errors generated, then a data recovery process corresponding to the at least one error exists.
[0030] If there is no data recovery process in the serial port printing, and / or the error count is different from the number of errors generated, then there is no data recovery process corresponding to the at least one error.
[0031] According to a second aspect of the present invention, a firmware testing apparatus for a solid-state drive is provided, the apparatus comprising:
[0032] The data writing module is configured to write test data to the solid-state drive using the FIO testing tool.
[0033] An error injection module is configured to generate and inject at least one error when the test tool FIO reads the test data.
[0034] The judgment module is configured to determine whether there is a data recovery process corresponding to at least one error in the serial port printout;
[0035] The first confirmation module is configured to confirm that the error handling process code in the firmware is normal in response to the existence of a data recovery process corresponding to the at least one error.
[0036] The second configuration module is configured to confirm that the error handling process code in the firmware is abnormal in response to the absence of a data recovery process corresponding to the at least one error.
[0037] According to a third aspect of the present invention, a computer device is also provided, the computer device comprising:
[0038] At least one processor; and
[0039] The memory stores a computer program that can run on the processor, which executes the aforementioned firmware testing method for solid-state drives when executing the program.
[0040] According to a fourth aspect of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, performs the aforementioned firmware testing method for a solid-state drive.
[0041] The aforementioned firmware testing method for solid-state drives (SSDs) develops a software error injection function based on the message transmission method between FTL and NFC. During message reading, errors are randomly generated. After an error occurs, the firmware automatically enters the error handling process to recover data, effectively verifying the functionality of the SSD error handling process code. This method adds code inspection and code test coverage to SSD firmware testing, effectively eliminating unknown errors in the firmware code, improving product pass rate, and enriching the firmware testing methods for SSDs.
[0042] In addition, the present invention also provides a firmware testing device for solid-state drives, a computer device, and a computer-readable storage medium, which can achieve the above-mentioned technical effects, and will not be described in detail here. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0044] Figure 1 A flowchart illustrating a firmware testing method for a solid-state drive according to an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a firmware testing device for a solid-state drive provided in another embodiment of the present invention;
[0046] Figure 3 This is an internal structural diagram of a computer device according to another embodiment of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0048] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.
[0049] In one embodiment, please refer to Figure 1 As shown, the present invention provides a firmware testing method 100 for solid-state drives, specifically, the method includes the following steps:
[0050] Step 101: Use the testing tool FIO to write test data to the solid-state drive;
[0051] Step 102: When the testing tool FIO reads the test data, at least one error is generated and injected;
[0052] Step 103: Determine whether there is a data recovery process corresponding to at least one error in the serial port printout;
[0053] Step 104: In response to the existence of a data recovery process corresponding to the at least one error, it is confirmed that the error handling process code in the firmware is normal;
[0054] Step 105: In response to the absence of a data recovery process corresponding to the at least one error, it is confirmed that the error handling process code in the firmware is abnormal.
[0055] The aforementioned firmware testing method for solid-state drives (SSDs) develops a software error injection function based on the message transmission method between FTL and NFC. During message reading, errors are randomly generated. After an error occurs, the firmware automatically enters the error handling process to recover data, effectively verifying the functionality of the SSD error handling process code. This method adds code inspection and code test coverage to SSD firmware testing, effectively eliminating unknown errors in the firmware code, improving product pass rate, and enriching the firmware testing methods for SSDs.
[0056] In some embodiments, step 101 above, writing the test data to the solid-state drive using the testing tool FIO, includes:
[0057] The testing tool FIO writes data of any size to any location in the flash memory according to a preset verification method as test data.
[0058] In some embodiments, step 102 above, which generates and injects at least one error when the testing tool FIO reads the test data, includes:
[0059] The error injection program is triggered using a probabilistic method to inject at least one error; or
[0060] The error injection program is triggered on a timed basis to inject at least one error.
[0061] The error injection program is used to inject errors via serial port commands or the nvme-cli tool during the process of the flash controller transmitting messages to the solid-state drive flash conversion layer, so as to forcibly modify a piece of data in the message queue.
[0062] In some embodiments, triggering the error injection procedure to inject at least one error is done probabilistically, including:
[0063] Pre-set the error to read count ratio;
[0064] Before the testing tool FIO executes the reading of the test data, the number of errors is calculated using the total number of reads to be performed and the pre-set ratio of errors to reads.
[0065] During the process of reading the test data by the testing tool FIO, the error injection program is run randomly, wherein the number of times the error injection program is run is equal to the number of errors.
[0066] In some embodiments, the error injection program is triggered periodically to inject at least one error, including:
[0067] Pre-set the trigger interval time;
[0068] Calculate the time interval between the previous error-triggered program execution time and the current time.
[0069] If the time interval is greater than a preset trigger interval, the error injection procedure is run to inject an error.
[0070] In some embodiments, step 103, which involves determining whether there is a data recovery process corresponding to at least one error in the serial port printout, includes:
[0071] Determine if a data recovery process exists during serial port printing; and
[0072] Use serial port commands to query the error count and determine if the error count is the same as the number of errors generated.
[0073] In some embodiments, step 103 above, determining whether there is a data recovery process corresponding to at least one error in the serial port printing, further includes:
[0074] If a data recovery process exists in the serial port printing and the error count is the same as the number of errors generated, then a data recovery process corresponding to the at least one error exists.
[0075] If there is no data recovery process in the serial port printing, and / or the error count is different from the number of errors generated, then there is no data recovery process corresponding to the at least one error.
[0076] In another embodiment, to facilitate understanding of the present invention, the following describes in detail the implementation process of a firmware testing method for solid-state drives, using a solid-state drive (SSD) with RAID XOR error handling in its firmware as an example:
[0077] Step 1: The SSD software code supports backend error injection functionality. The error injection function can be turned on or off via serial port commands. The error injection mode is used to set how errors are injected. The default is probability-based error injection. If timed error injection is required, you need to manually input the command to switch the mode.
[0078] The probabilistic triggering method involves setting a probability value. Each time the program executes, it checks whether the random number output falls within the probability range to determine if the operation has resulted in an error. The timed triggering method involves setting a trigger count per second. The program calculates the time interval for triggering error based on the input value. Each time the program executes, it compares the difference between the last trigger time and the current time. If the difference exceeds the error-injection time interval, an error is injected.
[0079] Step 2: After enabling the error injection function, FTL can randomly inject errors when operating NFC to read messages. After disabling the error injection function, NFC will not generate errors through the error injection process when reading messages.
[0080] Step 3: Write a piece of data with FIO verification. You can write data using MD5 verification and write any size of NAND data. This will be used to generate and correct errors during subsequent data reading.
[0081] Step 4: When the error injection function is enabled, errors can be injected based on probability or time, using the serial port or nvme-cli tool.
[0082] Step 5: FIO reads the previously written data to determine if the error recovery process is normal: FIO reads the previously written data with verification, FTL operates NFC to read the data. At this time, the error injection function is enabled, and one or more errors will be randomly generated. When an error occurs when NFC sends a message to FTL, the SSD software code will enter the error handling process to recover the data. The data recovery process can be seen in the serial port printout, and the error count can be queried by entering the serial port command, thus verifying that the SSD error handling process function is available.
[0083] This embodiment presents a firmware testing method for solid-state drives (SSDs). Addressing the issue that FTL (Flash TL) message reading typically doesn't generate errors during SSD firmware testing, thus preventing the code error handling process from being tested and verified, this method develops an SSD software error injection function based on the message transmission method between FTL and NFC. When FTL operates NFC to read messages from NAND flash memory, the software code error injection function is activated. During message reading, errors will randomly occur. Upon error generation, the software code automatically enters the RAID error handling process for data recovery, recovering the erroneous data through an XOR operation. This effectively verifies the usability of the SSD error handling process code, proactively verifies the firmware code, and promptly and effectively identifies unknown problems. Furthermore, the error injection function can be enabled or disabled via command as needed, offering excellent flexibility.
[0084] In some embodiments, please refer to Figure 2 As shown, the present invention also provides a firmware testing device 200 for a solid-state drive, the device comprising:
[0085] The data writing module 201 is configured to write test data to the solid-state drive using the testing tool FIO.
[0086] Error injection module 202 is configured to generate and inject at least one error when the test tool FIO reads the test data;
[0087] Judgment module 203 is configured to determine whether there is a data recovery process corresponding to at least one error in the serial port printout;
[0088] The first confirmation module 204 is configured to confirm that the error handling process code in the firmware is normal in response to the existence of a data recovery process corresponding to the at least one error.
[0089] The second configuration module 205 is configured to confirm that the error handling process code in the firmware is abnormal in response to the absence of a data recovery process corresponding to the at least one error.
[0090] The aforementioned firmware testing device for solid-state drives (SSDs) incorporates a software error injection function developed based on the message transmission method between FTL and NFC. During message reading, errors are randomly generated. After an error occurs, the firmware automatically enters the error handling process for data recovery, effectively verifying the usability of the SSD error handling process code. This adds code checking and code test coverage to SSD firmware testing, effectively eliminating unknown errors in the firmware code, improving product pass rate, and enriching the firmware testing methods for SSDs.
[0091] In some embodiments, the data writing module 201 is further configured to:
[0092] The testing tool FIO writes data of any size to any location in the flash memory according to a preset verification method as test data.
[0093] In some embodiments, the error injection module 202 further includes:
[0094] The probability triggering module is configured to trigger the error injection program to inject at least one error using a probability-based approach; or
[0095] The timed trigger module is configured to trigger the error injection program to run in a timed manner to inject at least one error.
[0096] The error injection program is used to inject errors via serial port commands or the nvme-cli tool during the process of the flash controller transmitting messages to the solid-state drive flash conversion layer, so as to forcibly modify a piece of data in the message queue.
[0097] In some embodiments, the probability triggering module is further configured to:
[0098] Pre-set the error to read count ratio;
[0099] Before the testing tool FIO executes the reading of the test data, the number of errors is calculated using the total number of reads to be performed and the pre-set ratio of errors to reads.
[0100] During the process of reading the test data by the testing tool FIO, the error injection program is run randomly, wherein the number of times the error injection program is run is equal to the number of errors.
[0101] In some embodiments, the timed trigger module is further configured to:
[0102] Pre-set the trigger interval time;
[0103] Calculate the time interval between the previous error-triggered program execution time and the current time.
[0104] If the time interval is greater than a preset trigger interval, the error injection procedure is run to inject an error.
[0105] In some embodiments, the determining module 203 is further configured to:
[0106] Determine if a data recovery process exists during serial port printing; and
[0107] Use serial port commands to query the error count and determine if the error count is the same as the number of errors generated.
[0108] In some embodiments, the determining module 203 is further configured to:
[0109] If a data recovery process exists in the serial port printing and the error count is the same as the number of errors generated, then a data recovery process corresponding to the at least one error exists.
[0110] If there is no data recovery process in the serial port printing, and / or the error count is different from the number of errors generated, then there is no data recovery process corresponding to the at least one error.
[0111] It should be noted that specific limitations regarding the firmware testing device for solid-state drives (SSDs) can be found in the limitations of the firmware testing methods for SSDs described above, and will not be repeated here. Each module in the aforementioned firmware testing device for SSDs can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0112] According to another aspect of the present invention, a computer device is provided, which may be a server, and its internal structure diagram is shown below. Figure 3 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the firmware testing method for solid-state drives described above. Specifically, the method includes the following steps:
[0113] Test data was written to the solid-state drive using the testing tool FIO.
[0114] At least one error is generated and injected when the testing tool FIO reads the test data;
[0115] Determine if a data recovery process exists in the serial port printout corresponding to at least one error;
[0116] If a data recovery process corresponding to the at least one error exists, then the error handling process code in the firmware is confirmed to be normal.
[0117] If no data recovery process corresponds to the at least one error, the error handling process code in the firmware is confirmed to be abnormal.
[0118] In some embodiments, writing the test data to the solid-state drive using the testing tool FIO includes:
[0119] The testing tool FIO writes data of any size to any location in the flash memory according to a preset verification method as test data.
[0120] In some embodiments, at least one error is generated and injected when the testing tool FIO reads the test data, including:
[0121] The error injection program is triggered using a probabilistic method to inject at least one error; or
[0122] The error injection program is triggered on a timed basis to inject at least one error.
[0123] The error injection program is used to inject errors via serial port commands or the nvme-cli tool during the process of the flash controller transmitting messages to the solid-state drive flash conversion layer, so as to forcibly modify a piece of data in the message queue.
[0124] In some embodiments, triggering the error injection procedure to inject at least one error is done probabilistically, including:
[0125] Pre-set the error to read count ratio;
[0126] Before the testing tool FIO executes the reading of the test data, the number of errors is calculated using the total number of reads to be performed and the pre-set ratio of errors to reads.
[0127] During the process of reading the test data by the testing tool FIO, the error injection program is run randomly, wherein the number of times the error injection program is run is equal to the number of errors.
[0128] In some embodiments, the error injection program is triggered periodically to inject at least one error, including:
[0129] Pre-set the trigger interval time;
[0130] Calculate the time interval between the previous error-triggered program execution time and the current time.
[0131] If the time interval is greater than a preset trigger interval, the error injection procedure is run to inject an error.
[0132] In some embodiments, determining whether a data recovery process corresponding to at least one error exists in the serial port printout includes:
[0133] Determine if a data recovery process exists during serial port printing; and
[0134] Use serial port commands to query the error count and determine if the error count is the same as the number of errors generated.
[0135] In some embodiments, determining whether a data recovery process corresponding to at least one error exists in the serial port printout further includes:
[0136] If a data recovery process exists in the serial port printing and the error count is the same as the number of errors generated, then a data recovery process corresponding to the at least one error exists.
[0137] If there is no data recovery process in the serial port printing, and / or the error count is different from the number of errors generated, then there is no data recovery process corresponding to the at least one error.
[0138] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the firmware testing method for a solid-state drive described above, specifically including the following steps:
[0139] Test data was written to the solid-state drive using the testing tool FIO.
[0140] At least one error is generated and injected when the testing tool FIO reads the test data;
[0141] Determine if a data recovery process exists in the serial port printout corresponding to at least one error;
[0142] If a data recovery process corresponding to the at least one error exists, then the error handling process code in the firmware is confirmed to be normal.
[0143] If no data recovery process corresponds to the at least one error, the error handling process code in the firmware is confirmed to be abnormal.
[0144] In some embodiments, writing the test data to the solid-state drive using the testing tool FIO includes:
[0145] The testing tool FIO writes data of any size to any location in the flash memory according to a preset verification method as test data.
[0146] In some embodiments, at least one error is generated and injected when the testing tool FIO reads the test data, including:
[0147] The error injection program is triggered using a probabilistic method to inject at least one error; or
[0148] The error injection program is triggered on a timed basis to inject at least one error.
[0149] The error injection program is used to inject errors via serial port commands or the nvme-cli tool during the process of the flash controller transmitting messages to the solid-state drive flash conversion layer, so as to forcibly modify a piece of data in the message queue.
[0150] In some embodiments, triggering the error injection procedure to inject at least one error is done probabilistically, including:
[0151] Pre-set the error to read count ratio;
[0152] Before the testing tool FIO executes the reading of the test data, the number of errors is calculated using the total number of reads to be performed and the pre-set ratio of errors to reads.
[0153] During the process of reading the test data by the testing tool FIO, the error injection program is run randomly, wherein the number of times the error injection program is run is equal to the number of errors.
[0154] In some embodiments, the error injection program is triggered periodically to inject at least one error, including:
[0155] Pre-set the trigger interval time;
[0156] Calculate the time interval between the previous error-triggered program execution time and the current time.
[0157] If the time interval is greater than a preset trigger interval, the error injection procedure is run to inject an error.
[0158] In some embodiments, determining whether a data recovery process corresponding to at least one error exists in the serial port printout includes:
[0159] Determine if a data recovery process exists during serial port printing; and
[0160] Use serial port commands to query the error count and determine if the error count is the same as the number of errors generated.
[0161] In some embodiments, determining whether a data recovery process corresponding to at least one error exists in the serial port printout further includes:
[0162] If a data recovery process exists in the serial port printing and the error count is the same as the number of errors generated, then a data recovery process corresponding to the at least one error exists.
[0163] If there is no data recovery process in the serial port printing, and / or the error count is different from the number of errors generated, then there is no data recovery process corresponding to the at least one error.
[0164] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0165] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A firmware testing method for solid-state drives, characterized in that, The method includes: Test data was written to the solid-state drive using the testing tool FIO. At least one error is generated and injected when the testing tool FIO reads the test data; Determine if a data recovery process exists in the serial port printout corresponding to at least one error; If a data recovery process corresponding to the at least one error exists, then the error handling process code in the firmware is confirmed to be normal. If no data recovery process corresponds to the at least one error, it is confirmed that the error handling process code in the firmware is abnormal. The test data was written to the solid-state drive using the testing tool FIO, including: The test tool FIO writes data of any size to any location in the flash memory according to a preset verification method as test data; At least one error is generated and injected when the testing tool FIO reads the test data, including: The error injection program is triggered using a probabilistic method to inject at least one error; or The error injection program is triggered on a timed basis to inject at least one error. The error injection program is used to inject errors via serial port commands or the nvme-cli tool during the process of the flash controller transmitting messages to the solid-state drive flash conversion layer, so as to forcibly modify a piece of data in the message queue.
2. The firmware testing method for solid-state drives according to claim 1, characterized in that, The error injection program is triggered using a probabilistic approach to inject at least one error, including: Pre-set the error to read count ratio; Before the testing tool FIO executes the reading of the test data, the number of errors is calculated using the total number of reads to be performed and the pre-set ratio of errors to reads. During the process of reading the test data by the testing tool FIO, the error injection program is run randomly, wherein the number of times the error injection program is run is equal to the number of errors.
3. The firmware testing method for solid-state drives according to claim 1, characterized in that, The error injection program is triggered periodically to inject at least one error, including: Pre-set the trigger interval time; Calculate the time interval between the previous error-triggered program execution time and the current time. If the time interval is greater than a preset trigger interval, the error injection procedure is run to inject an error.
4. The firmware testing method for solid-state drives according to claim 1, characterized in that, Determine if a data recovery process corresponding to at least one error exists in the serial port printout, including: Determine if a data recovery process exists during serial port printing; and Use serial port commands to query the error count and determine if the error count is the same as the number of errors generated.
5. The firmware testing method for solid-state drives according to claim 4, characterized in that, Determining whether a data recovery process corresponding to at least one error exists in the serial port printout also includes: If a data recovery process exists in the serial port printing and the error count is the same as the number of errors generated, then a data recovery process corresponding to the at least one error exists. If there is no data recovery process in the serial port printing, and / or the error count is different from the number of errors generated, then there is no data recovery process corresponding to the at least one error.
6. A firmware testing device for solid-state drives, characterized in that, The device includes: The data writing module is configured to write test data to the solid-state drive using the FIO testing tool. An error injection module is configured to generate and inject at least one error when the test tool FIO reads the test data. The judgment module is configured to determine whether there is a data recovery process corresponding to at least one error in the serial port printout; The first confirmation module is configured to confirm that the error handling process code in the firmware is normal in response to the existence of a data recovery process corresponding to the at least one error. The second configuration module is configured to confirm that the error handling process code in the firmware is abnormal in response to the absence of a data recovery process corresponding to the at least one error. The test data was written to the solid-state drive using the testing tool FIO, including: The test tool FIO writes data of any size to any location in the flash memory according to a preset verification method as test data; At least one error is generated and injected when the testing tool FIO reads the test data, including: The error injection program is triggered using a probabilistic method to inject at least one error; or The error injection program is triggered on a timed basis to inject at least one error. The error injection program is used to inject errors via serial port commands or the nvme-cli tool during the process of the flash controller transmitting messages to the solid-state drive flash conversion layer, so as to forcibly modify a piece of data in the message queue.
7. A computer device, characterized in that, include: At least one processor; as well as A memory storing a computer program executable in the processor, wherein the processor, when executing the program, performs the method according to any one of claims 1-5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it performs the method described in any one of claims 1-5.