A method, apparatus, device and medium for testing a data error correction recovery function
Patent Information
- Application Number
- CN202311116918.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-08-31
AI Technical Summary
[0006]本发明的目的是提供一种数据纠错恢复功能的测试方法、装置、设备及介质,用于解决现有的测试方法只能在出现错误后才能确定数据纠错恢复功能可用的问题,以及遍历对应的数据表导致测试成本增加并对计算机闪存设备造成损伤的问题
[0106] To address the aforementioned technical problems, the present invention also provides a testing device for data error correction and recovery functions, comprising:
Smart Images

Figure CN117174154B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-volatile memory technology, and in particular to a test method, apparatus, device, and medium for data error correction and recovery functions. Background Technology
[0002] A solid-state drive (SSD) is a type of solid-state storage device made of an array of solid-state electronic storage chips. The primary storage medium in an SSD is computer flash memory, typically NAND flash memory. NAND flash memory is a non-volatile memory that retains its stored information even when power is off.
[0003] The basic storage unit of NAND Flash, a commonly used computer flash memory device, is the floating gate transistor. Due to the characteristics of the floating gate transistor, NAND Flash may experience errors such as read errors, programming failures, or erase failures during use. In essence, these errors are generally caused by factors such as charge leakage of the floating gate transistor, oxide layer aging, drift effect, overprogramming effect, read operation interference, and temperature changes.
[0004] To avoid the impact of read errors, programming failures, or erase failures on testing and subsequent use, data error correction and recovery functions are generally used to correct errors and recover data. However, existing testing methods only trigger the error handling process and use the data error correction and recovery function within the process after an error occurs. Only then can the user confirm that the data error correction and recovery function is available. Conversely, if no errors occur during the testing process, the corresponding data table can only be traversed. The process of traversing the data table can be understood as continuously overwriting the NAND Flash. Continuously overwriting the NAND Flash will increase testing costs and cause significant damage to the NAND Flash.
[0005] Given the aforementioned problems, seeking ways to promptly determine the availability of data error correction and recovery functions, reduce testing costs, and minimize damage to computer flash memory devices are issues that those skilled in the art are striving to address. Summary of the Invention
[0006] The purpose of this invention is to provide a testing method, apparatus, device, and medium for data error correction and recovery functions, which solves the problem that existing testing methods can only determine the availability of data error correction and recovery functions after an error occurs, and the problem that traversing the corresponding data table increases testing costs and damages computer flash memory devices.
[0007] To address the aforementioned technical problems, this invention provides a testing method for data error correction and recovery functions, applied to solid-state drives (SSDs). The method includes:
[0008] Receive read data command;
[0009] The computer's flash memory controller is controlled to execute read data commands in order to read the test data from the data mapping table; the data mapping table is pre-inserted with offset values that indicate the occurrence of errors, and the data mapping table stores all the test data and the mapping values that correspond one-to-one with the test data;
[0010] When the data to be tested read from the obtained offset value is correct, the data error correction and recovery function is confirmed to be available.
[0011] On the other hand, the test data read based on the offset value is obtained, including:
[0012] Set multiple preset mapping level values for the data mapping table;
[0013] The preset mapping level values and offset values are summed to obtain the summation result;
[0014] Query the corresponding test data based on the summation result.
[0015] On the other hand, when the test data obtained based on the offset value is incorrect, it also includes:
[0016] The data error correction and recovery function is confirmed to be unavailable.
[0017] Obtain the binary string of the data to be tested;
[0018] The first quantity value and the second quantity value are determined based on the binary string, where the first quantity value is the number of 0s in the binary string and the second quantity value is the number of 1s in the binary string.
[0019] The first probability value and the second probability value are obtained based on the first quantity value and the second quantity value, wherein the first probability value is the probability value that the value of the bit to be recovered in the binary string is 0, and the second probability value is the probability value that the value of the bit to be recovered in the binary string is 1.
[0020] When the first probability value is greater than the second probability value, the value of the bit to be recovered is set to 0 to facilitate data recovery of the test data;
[0021] When the second probability value is greater than the first probability value, the value of the bit to be recovered is set to 1 to facilitate data recovery of the test data.
[0022] On the other hand, before controlling the computer's flash memory controller to execute read data instructions, it also includes:
[0023] The serial port command used to monitor and characterize the data error correction and recovery function;
[0024] When a serial port command is received, the data error correction and recovery function is activated according to the serial port command;
[0025] Determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0026] If the verification data is the same as the verification output data, then the data error correction and recovery function is unavailable.
[0027] If the verification data is different from the verification output data, then the data error correction and recovery function is available.
[0028] On the other hand, when the test data obtained based on the offset value is correct, it also includes:
[0029] Logs are invoked based on serial port commands;
[0030] Obtain the error count from the logs, which represents the number of times the data error correction and recovery function was invoked.
[0031] If the error count is not 0, the data error correction and recovery function is confirmed to be available.
[0032] When the error count is 0, the data error correction and recovery function is determined to be unavailable.
[0033] On the other hand, before controlling the computer's flash memory controller to execute read data instructions, it also includes:
[0034] The standard protocol command for monitoring and characterizing data error correction and recovery functions;
[0035] When a standard protocol command is received, the data error correction and recovery function is activated according to the standard protocol command.
[0036] Determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0037] If the verification data is the same as the verification output data, then the data error correction and recovery function is unavailable.
[0038] If the verification data is different from the verification output data, then the data error correction and recovery function is available.
[0039] On the other hand, the test data read based on the offset value is obtained, including:
[0040] Three preset mapping level values are set for the data mapping table; wherein, the offset voltage value is pre-inserted in the data mapping table, and the data mapping table stores all the test data and the mapping voltage value corresponding to each test data, and the three preset mapping level values are the first preset mapping level voltage value, the second preset mapping level voltage value, and the third preset mapping level voltage value.
[0041] The first preset mapping level voltage value and the offset voltage value are summed to obtain the first summed voltage result;
[0042] Query the corresponding test data based on the first summation result;
[0043] Correspondingly, determine whether the test data corresponding to the first summed voltage result is correct;
[0044] If the test data corresponding to the first summed voltage result is correct, then the data error correction and recovery function is confirmed to be available.
[0045] If the test data corresponding to the first summed voltage result is incorrect, then the data error correction and recovery function is unavailable.
[0046] The second preset mapping level voltage value and the offset voltage value are summed to obtain the second summed voltage result;
[0047] Query the corresponding test data based on the second summation result;
[0048] Correspondingly, determine whether the test data corresponding to the second summed voltage result is correct;
[0049] If the test data corresponding to the second summed voltage result is correct, then the data error correction and recovery function is confirmed to be available.
[0050] If the test data corresponding to the second summed voltage result is incorrect, then the data error correction and recovery function is unavailable.
[0051] The third preset mapping level voltage value and the offset voltage value are summed to obtain the third summed voltage result;
[0052] Query the corresponding test data based on the third summation result;
[0053] Correspondingly, determine whether the test data corresponding to the third summed voltage result is correct;
[0054] If the test data corresponding to the third summed voltage result is correct, then the data error correction and recovery function is confirmed to be available.
[0055] If the test data corresponding to the third summed voltage result is incorrect, then the data error correction and recovery function is unavailable.
[0056] To address the aforementioned technical problems, this invention also provides a testing device for data error correction and recovery functions, applied to solid-state drives. The device includes:
[0057] The receiving module is used to receive read data commands;
[0058] The control module is used to control the computer flash memory controller to execute read data commands so as to read the test data from the data mapping table; the data mapping table is pre-inserted with offset values that represent errors, and the data mapping table stores all the test data and the mapping values that correspond one-to-one with the test data;
[0059] The first determination module is used to determine whether the data error correction and recovery function is available when the test data read from the obtained offset value is correct.
[0060] In addition, the device also includes the following modules:
[0061] On the other hand, the test data read based on the offset value is obtained, including:
[0062] The first setting module is used to set multiple preset mapping level values for the data mapping table;
[0063] The first summing module is used to sum the preset mapping level values and offset values to obtain the summing result;
[0064] The first query module is used to query the corresponding test data based on the summation result.
[0065] On the other hand, when the test data obtained based on the offset value is incorrect, it also includes:
[0066] The second determination module is used to determine that the data error correction and recovery function is unavailable.
[0067] The first acquisition module is used to acquire the binary string of the data to be tested;
[0068] The third determining module is used to determine the first quantity value and the second quantity value based on the binary string, wherein the first quantity value is the number of 0 occurrences in the binary string and the second quantity value is the number of 1 occurrences in the binary string;
[0069] The module is used to obtain a first probability value and a second probability value based on a first quantity value and a second quantity value, wherein the first probability value is the probability value that the value of the bit to be recovered in the binary string is 0, and the second probability value is the probability value that the value of the bit to be recovered in the binary string is 1.
[0070] The second setting module is used to set the value of the bit to be recovered to 0 when the first probability value is greater than the second probability value, so as to facilitate data recovery of the test data.
[0071] The third setting module is used to set the value of the bit to be recovered to 1 when the second probability value is greater than the first probability value, so as to facilitate data recovery of the test data.
[0072] On the other hand, before controlling the computer's flash memory controller to execute read data instructions, it also includes:
[0073] The first monitoring module is used to monitor the serial port command that indicates the activation of the data error correction and recovery function.
[0074] The first activation module is used to activate the data error correction and recovery function according to the serial port command when a serial port command is received.
[0075] The first judgment module is used to determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0076] The fourth determination module is used to determine that the data error correction and recovery function is unavailable if the verification data is the same as the verification output data.
[0077] The fifth determination module is used to determine if the data correction and recovery function is available if the verification data is different from the verification output data.
[0078] On the other hand, when the test data obtained based on the offset value is correct, it also includes:
[0079] The calling module is used to retrieve the log based on serial port commands;
[0080] The second acquisition module is used to obtain the error count, which represents the number of times the data error correction and recovery function has been called, from the log.
[0081] The sixth determination module is used to determine whether the data error correction and recovery function is available when the error count is not 0.
[0082] The seventh determination module is used to determine that the data error correction and recovery function is unavailable when the error count is 0.
[0083] On the other hand, before controlling the computer's flash memory controller to execute read data instructions, it also includes:
[0084] The second monitoring module is used to monitor and characterize the standard protocol commands that enable the data error correction and recovery function.
[0085] The second activation module is used to activate the data error correction and recovery function according to the standard protocol command when a standard protocol command is received.
[0086] The second judgment module is used to determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0087] The eighth determination module is used to determine that the data error correction and recovery function is unavailable if the verification data is the same as the verification output data.
[0088] The ninth module is used to determine if the data correction and recovery function is available if the verification data is different from the verification output data.
[0089] On the other hand, the test data read based on the offset value is obtained, including:
[0090] The fourth setting module is used to set three preset mapping level values for the data mapping table. The data mapping table is pre-inserted with offset voltage values, and the data mapping table stores all the data to be tested and the mapping voltage values corresponding to the data to be tested one by one. The three preset mapping level values are the first preset mapping level voltage value, the second preset mapping level voltage value, and the third preset mapping level voltage value.
[0091] The second summing module is used to sum the first preset mapping level voltage value and the offset voltage value to obtain the first summed voltage result;
[0092] The second query module is used to query the corresponding test data based on the first summation result;
[0093] Correspondingly, the third judgment module is used to determine whether the test data corresponding to the first summed voltage result is correct;
[0094] If the test data corresponding to the first summed voltage result is correct, the tenth determination module is triggered to determine whether the data error correction and recovery function is available.
[0095] If the test data corresponding to the first summed voltage result is incorrect, the eleventh determination module is triggered to determine that the data error correction and recovery function is unavailable.
[0096] The third summing module is used to sum the second preset mapping level voltage value and the offset voltage value to obtain the second summed voltage result.
[0097] The third query module is used to query the corresponding test data based on the second summation result;
[0098] Correspondingly, the fourth judgment module is used to determine whether the test data corresponding to the second summed voltage result is correct;
[0099] If the test data corresponding to the second summed voltage result is correct, the twelfth determination module is triggered to determine whether the data error correction and recovery function is available.
[0100] If the test data corresponding to the second summed voltage result is incorrect, the thirteenth determination module is triggered to determine that the data error correction and recovery function is unavailable.
[0101] The fourth summing module is used to sum the third preset mapping level voltage value and the offset voltage value to obtain the third summed voltage result;
[0102] The fourth query module is used to query the corresponding test data based on the summation result of the third module;
[0103] Correspondingly, the fifth judgment module is used to determine whether the test data corresponding to the third summed voltage result is correct;
[0104] If the test data corresponding to the third summed voltage result is correct, the fourteenth determination module is triggered to determine whether the data error correction and recovery function is available.
[0105] If the test data corresponding to the third summed voltage result is incorrect, the fifteenth determination module is triggered to determine that the data error correction and recovery function is unavailable.
[0106] To address the aforementioned technical problems, the present invention also provides a testing device for data error correction and recovery functions, comprising:
[0107] Memory, used to store computer programs;
[0108] A processor is used to direct computer programs to implement test methods for data error correction and recovery functions.
[0109] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the test method for all the aforementioned data error correction and recovery functions.
[0110] This invention provides a testing method for data error correction and recovery functionality, applied to solid-state drives (SSDs). The method includes: receiving a read data command; controlling a computer flash memory controller to execute the read data command to read test data from a data mapping table; pre-inserting offset values representing errors into the data mapping table, and storing all test data and corresponding mapping values for each test data in the data mapping table; determining that the data error correction and recovery functionality is available when the test data read based on the offset values is correct. Since the pre-inserted offset values represent the values representing errors, the data error correction and recovery functionality must be enabled to obtain the correct test data. This directly confirms the availability of the data error correction and recovery functionality. Furthermore, the testing process does not require traversing the corresponding data table or continuously overwriting the computer flash memory device, thereby reducing testing costs and minimizing damage to the computer flash memory device.
[0111] The present invention also provides a test device, equipment and medium for data error correction and recovery function, with the same effect as above. Attached Figure Description
[0112] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments 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 drawings can be obtained based on these drawings without creative effort.
[0113] Figure 1 This is a flowchart of a test method for data error correction and recovery function provided in an embodiment of the present invention;
[0114] Figure 2 This is a structural diagram of a test device for data error correction and recovery function provided in an embodiment of the present invention;
[0115] Figure 3 This is a structural diagram of a test device for data error correction and recovery function provided in an embodiment of the present invention. Detailed Implementation
[0116] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0117] The core of this invention is to provide a testing method, apparatus, device, and medium for data error correction and recovery functions, which can directly determine the availability of data error correction and recovery functions, and does not require traversing the corresponding data table during the testing process, and continuously covers the computer flash memory device, thereby reducing testing costs and reducing damage to the computer flash memory device.
[0118] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0119] Figure 1 A flowchart of a test method for data error correction and recovery function provided in an embodiment of the present invention is shown below. Figure 1 As shown, the test method for this data error correction and recovery function is applied to solid-state drives, and the method includes:
[0120] S10: Receive read data command;
[0121] It should be noted that the read data command instructs the computer's flash memory controller to read the mapping value from the data mapping table stored in the solid-state drive equipped with non-volatile flash memory, and read the corresponding data according to the mapping value. The data read according to the mapping value is called the test data. It should be understood that the test data is not necessarily correct data.
[0122] In addition, in this embodiment, the solid-state drive is provided with a computer flash memory device and a computer flash memory controller that are interconnected, and may also be provided with another computer flash memory device for storing a data mapping table.
[0123] S11: Control the computer flash memory controller to execute a read data instruction so as to read the test data from the data mapping table; the data mapping table is pre-inserted with offset values that indicate the occurrence of errors, and the data mapping table stores all the test data and the mapping values that correspond one-to-one with the test data;
[0124] Therefore, it can be seen that the computer flash memory controller instructs the execution of various received instructions, but the computer flash memory controller does not have control functions; in addition, in this embodiment, the data mapping table can be composed of multiple read voltage values, and correspondingly, the offset value mentioned above is the offset voltage value, the mapping value is the mapping voltage value, and the offset voltage value does not correspond to the data to be tested.
[0125] S12: When the data to be tested read from the offset value is correct, the data error correction and recovery function is confirmed to be available;
[0126] After reading the corresponding test data based on the mapping value and offset value, it is necessary to determine whether the read test data is correct. If the test data is correct, it means that the correct test data can only be obtained after the data error correction and recovery function is enabled, and the data error correction and recovery function is definitely available at this time. If the test data is incorrect, it means that the data error correction and recovery function is not enabled, so the obtained test data is still incorrect, and the data error correction and recovery function is definitely unavailable at this time.
[0127] In this embodiment, since the pre-inserted offset value is the value that indicates the error, in order to obtain the correct corresponding test data, the data error correction and recovery function must be enabled to obtain the correct test data. This directly confirms that the data error correction and recovery function is available, and there is no need to traverse the corresponding data table during the test process to continuously overwrite the computer flash memory device, thereby reducing the test cost and reducing the damage to the computer flash memory device.
[0128] Based on the above embodiments, in some embodiments, it is also necessary to obtain the test data read based on the offset value, and the specific steps include:
[0129] Set multiple preset mapping level values for the data mapping table;
[0130] The preset mapping level values and offset values are summed to obtain the summation result;
[0131] Query the corresponding test data based on the summation result.
[0132] In order to conduct comprehensive testing on multiple test data sets and accurately determine whether the data error correction and recovery function is available, multiple preset mapping level values are set for the data mapping table. The number of preset mapping level values is not specifically limited to a fixed number and can be customized according to the volume of the test data and the specific settings of the data mapping table to suit the implementation scenario.
[0133] Since the offset value represents the value that has an error, when the offset value is added to the preset mapping level value, the data corresponding to the summation result is also incorrect data. If the data error correction and recovery function is available, the final data obtained is correct data. At this time, it can be confirmed that the data error correction and recovery function is available in this embodiment.
[0134] Additionally, the log can be accessed via serial port commands. The log stores various parameters related to confirming the availability of the data error correction and recovery function. The error count, representing the number of times the data error correction and recovery function has been called, is retrieved from all relevant parameters. This error count directly indicates how many times the data error correction and recovery function has been used. Specifically, when the error count is not 0, the data error correction and recovery function is confirmed to be available; when the error count is 0, the function is confirmed to be unavailable; and when the error count is 1, the function has been used once.
[0135] Specifically, in this embodiment, the data mapping table is limited to a Fixed Read Table (FRT). The FRT is a table composed of the offset values of the optimal read voltage determined based on the data retention time and the number of programming cycles of the computer flash memory device. When reading data from the computer flash memory, the computer flash controller determines the optimal read voltage by consulting the FRT table and reads the data in stages, thereby reducing the probability of errors and achieving the purpose of error correction and data recovery.
[0136] Three preset mapping level values are set for the data mapping table; wherein, the offset voltage value is pre-inserted in the data mapping table, and the data mapping table stores all the test data and the mapping voltage value corresponding to each test data, and the three preset mapping level values are the first preset mapping level voltage value, the second preset mapping level voltage value, and the third preset mapping level voltage value.
[0137] The first preset mapping level voltage value and the offset voltage value are summed to obtain the first summed voltage result;
[0138] Query the corresponding test data based on the first summation result;
[0139] Correspondingly, determine whether the test data corresponding to the first summed voltage result is correct;
[0140] If the test data corresponding to the first summed voltage result is correct, then the data error correction and recovery function is confirmed to be available.
[0141] If the test data corresponding to the first summed voltage result is incorrect, then the data error correction and recovery function is unavailable.
[0142] It should be noted that if the error is not recorded on the reference corresponding to the voltage value of the first preset mapping level, the error will be recorded again on the reference corresponding to the voltage value of the second preset mapping level.
[0143] The second preset mapping level voltage value and the offset voltage value are summed to obtain the second summed voltage result;
[0144] Query the corresponding test data based on the second summation result;
[0145] Correspondingly, determine whether the test data corresponding to the second summed voltage result is correct;
[0146] If the test data corresponding to the second summed voltage result is correct, then the data error correction and recovery function is confirmed to be available.
[0147] If the test data corresponding to the second summed voltage result is incorrect, then the data error correction and recovery function is unavailable.
[0148] It should be noted that if the error is not recorded on the reference corresponding to the voltage value of the second preset mapping level, the error will be recorded again on the reference corresponding to the voltage value of the third preset mapping level.
[0149] The third preset mapping level voltage value and the offset voltage value are summed to obtain the third summed voltage result;
[0150] Query the corresponding test data based on the third summation result;
[0151] Correspondingly, determine whether the test data corresponding to the third summed voltage result is correct;
[0152] If the test data corresponding to the third summed voltage result is correct, then the data error correction and recovery function is confirmed to be available.
[0153] If the test data corresponding to the third summed voltage result is incorrect, then the data error correction and recovery function is unavailable.
[0154] In this embodiment, since the pre-inserted offset voltage value is the value that indicates an error, in order to obtain the correct corresponding test data, the data error correction and recovery function must be enabled to obtain the correct test data. This directly confirms that the data error correction and recovery function is available, and there is no need to traverse the data mapping table during the test process to continuously cover the computer flash memory device, thereby reducing the test cost and reducing damage to the computer flash memory device.
[0155] Based on the above embodiments, in some embodiments, when the test data obtained based on the offset value is incorrect, the method further includes:
[0156] The data error correction and recovery function is confirmed to be unavailable.
[0157] Obtain the binary string of the data to be tested;
[0158] The first quantity value and the second quantity value are determined based on the binary string, where the first quantity value is the number of 0s in the binary string and the second quantity value is the number of 1s in the binary string.
[0159] The first probability value and the second probability value are obtained based on the first quantity value and the second quantity value, wherein the first probability value is the probability value that the value of the bit to be recovered in the binary string is 0, and the second probability value is the probability value that the value of the bit to be recovered in the binary string is 1.
[0160] When the first probability value is greater than the second probability value, the value of the bit to be recovered is set to 0 to facilitate data recovery of the test data;
[0161] When the second probability value is greater than the first probability value, the value of the bit to be recovered is set to 1 to facilitate data recovery of the test data.
[0162] This embodiment uses the aforementioned binary string as an example for illustration:
[0163] When the binary string of the test data is 0111110x, the x-bit is set as the bit to be recovered. For the binary string 0111110x, the first probability value is 2, and the second probability value is 4. Correspondingly, the first probability value is determined as [first probability value / (first probability value + second probability value)] × 100% = [2 / (2 + 4)] × 100% ≈ 33.33%; the second probability value is determined as [second probability value / (first probability value + second probability value)] × 100% = [4 / (2 + 4)] × 100% ≈ 66.66%. Therefore, the second probability value is greater than the first probability value. At this point, the value of the bit to be recovered is set to 0, and the binary string of the test data is 01111100.
[0164] It should be noted that, in order to recover the test data, when the data error correction and recovery function is unavailable, other data recovery methods are used. One such method is to use low-density parity checking to recover the test data. Alternatively, data can be recovered using a Redundant Array of Independent Disks (RAID). If all other data recovery methods fail to recover the data, then the data is permanently unrecoverable.
[0165] In addition, in order to enable or disable the data error correction and recovery function according to user needs, the following operations need to be performed before the computer's flash memory controller executes the read data command:
[0166] The serial port command used to monitor and characterize the data error correction and recovery function;
[0167] When a serial port command is received, the data error correction and recovery function is activated according to the serial port command;
[0168] Determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0169] If the verification data is the same as the verification output data, then the data error correction and recovery function is unavailable.
[0170] If the verification data is different from the verification output data, then the data error correction and recovery function is available.
[0171] In this embodiment, the serial port command can also be set as an instruction to disable the data error correction and recovery function, and the user can set whether to enable or disable the data error correction and recovery function according to their needs.
[0172] The user can also enable or disable the data error correction and recovery function according to their needs through the following operations:
[0173] The standard protocol command for monitoring and characterizing data error correction and recovery functions;
[0174] When a standard protocol command is received, the data error correction and recovery function is activated according to the standard protocol command.
[0175] Determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0176] If the verification data is the same as the verification output data, then the data error correction and recovery function is unavailable.
[0177] If the verification data is different from the verification output data, then the data error correction and recovery function is available.
[0178] In this embodiment, the standard protocol command (NVME CLI command) can be used to view other settings information of the disk corresponding to the Non-Volatile Memory Host Controller Interface Specification (NVMHCIS, NVMe). The Non-Volatile Memory Host Controller Interface Specification (NVMHCIS, NVMe) can also be set as an instruction to disable the data error correction and recovery function, and can be configured to enable or disable the data error correction and recovery function according to user needs.
[0179] It should also be noted that before receiving read data commands, a checksum-enabled data entry is first written to the Gutian hard drive using a testing tool (FIO). This checksum-enabled data is written to the solid-state drive using MD5 checksum, and is used to correct and recover data in case of errors during subsequent data read verification through the data error correction and recovery function. Additionally, by detecting and controlling the kernel ring buffer, it can help users understand the system's boot information and determine if there are any timeouts or disk loss records.
[0180] In the above embodiments, the testing method for the data error correction and recovery function has been described in detail. This invention also provides embodiments corresponding to the testing device for the data error correction and recovery function. It should be noted that this invention describes the embodiments of the device from two perspectives: one based on functional modules, and the other based on hardware.
[0181] Figure 2 This is a structural diagram of a test device for data error correction and recovery function provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the present invention also provides a test device for data error correction and recovery function, applied to a solid-state drive, the device comprising:
[0182] Receiver module 20 is used to receive read data commands;
[0183] The control module 21 is used to control the computer flash memory controller to execute read data instructions so as to read the test data from the data mapping table; the data mapping table is pre-inserted with offset values that represent errors, and the data mapping table stores all the test data and the mapping values that correspond one-to-one with the test data;
[0184] The first determining module 22 is used to determine that the data error correction and recovery function is available when the test data read from the obtained offset value is correct.
[0185] In addition, the device also includes the following modules:
[0186] In some embodiments, obtaining the test data read based on the offset value includes:
[0187] The first setting module is used to set multiple preset mapping level values for the data mapping table;
[0188] The first summing module is used to sum the preset mapping level values and offset values to obtain the summing result;
[0189] The first query module is used to query the corresponding test data based on the summation result.
[0190] In some embodiments, when the acquired test data read based on the offset value is incorrect, the method further includes:
[0191] The second determination module is used to determine whether the data error correction and recovery function is unavailable.
[0192] The first acquisition module is used to acquire the binary string of the data to be tested.
[0193] The third determining module is used to determine the first quantity value and the second quantity value based on the binary string, wherein the first quantity value is the number of 0 occurrences in the binary string and the second quantity value is the number of 1 occurrences in the binary string;
[0194] The module is used to obtain a first probability value and a second probability value based on a first quantity value and a second quantity value, wherein the first probability value is the probability value that the value of the bit to be recovered in the binary string is 0, and the second probability value is the probability value that the value of the bit to be recovered in the binary string is 1.
[0195] The second setting module is used to set the value of the bit to be recovered to 0 when the first probability value is greater than the second probability value, so as to facilitate data recovery of the test data.
[0196] The third setting module is used to set the value of the bit to be recovered to 1 when the second probability value is greater than the first probability value, so as to facilitate data recovery of the test data.
[0197] In some embodiments, before controlling the computer flash memory controller to execute read data instructions, the method further includes:
[0198] The first monitoring module is used to monitor the serial port command that indicates the activation of the data error correction and recovery function.
[0199] The first activation module is used to activate the data error correction and recovery function according to the serial port command when a serial port command is received.
[0200] The first judgment module is used to determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0201] The fourth determination module is used to determine that the data error correction and recovery function is unavailable if the verification data is the same as the verification output data.
[0202] The fifth determination module is used to determine if the data correction and recovery function is available if the verification data is different from the verification output data.
[0203] In some embodiments, when the test data obtained based on the offset value is correct, the method further includes:
[0204] The calling module is used to retrieve the log based on serial port commands;
[0205] The second acquisition module is used to obtain the error count, which represents the number of times the data error correction and recovery function has been called, from the log.
[0206] The sixth determination module is used to determine whether the data error correction and recovery function is available when the error count is not 0.
[0207] The seventh determination module is used to determine that the data error correction and recovery function is unavailable when the error count is 0.
[0208] In some embodiments, before controlling the computer flash memory controller to execute read data instructions, the method further includes:
[0209] The second monitoring module is used to monitor and characterize the standard protocol commands that enable the data error correction and recovery function.
[0210] The second activation module is used to activate the data error correction and recovery function according to the standard protocol command when a standard protocol command is received.
[0211] The second judgment module is used to determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function. The verification data is the data that indicates that an error has occurred.
[0212] The eighth determination module is used to determine that the data error correction and recovery function is unavailable if the verification data is the same as the verification output data.
[0213] The ninth module is used to determine if the data correction and recovery function is available if the verification data is different from the verification output data.
[0214] In some embodiments, obtaining the test data read based on the offset value includes:
[0215] The fourth setting module is used to set three preset mapping level values for the data mapping table. The data mapping table is pre-inserted with offset voltage values, and the data mapping table stores all the data to be tested and the mapping voltage values corresponding to the data to be tested one by one. The three preset mapping level values are the first preset mapping level voltage value, the second preset mapping level voltage value, and the third preset mapping level voltage value.
[0216] The second summing module is used to sum the first preset mapping level voltage value and the offset voltage value to obtain the first summed voltage result;
[0217] The second query module is used to query the corresponding test data based on the first summation result;
[0218] Correspondingly, the third judgment module is used to determine whether the test data corresponding to the first summed voltage result is correct;
[0219] If the test data corresponding to the first summed voltage result is correct, the tenth determination module is triggered to determine whether the data error correction and recovery function is available.
[0220] If the test data corresponding to the first summed voltage result is incorrect, the eleventh determination module is triggered to determine that the data error correction and recovery function is unavailable.
[0221] The third summing module is used to sum the second preset mapping level voltage value and the offset voltage value to obtain the second summed voltage result.
[0222] The third query module is used to query the corresponding test data based on the second summation result;
[0223] Correspondingly, the fourth judgment module is used to determine whether the test data corresponding to the second summed voltage result is correct;
[0224] If the test data corresponding to the second summed voltage result is correct, the twelfth determination module is triggered to determine whether the data error correction and recovery function is available.
[0225] If the test data corresponding to the second summed voltage result is incorrect, the thirteenth determination module is triggered to determine that the data error correction and recovery function is unavailable.
[0226] The fourth summing module is used to sum the third preset mapping level voltage value and the offset voltage value to obtain the third summed voltage result;
[0227] The fourth query module is used to query the corresponding test data based on the summation result of the third module;
[0228] Correspondingly, the fifth judgment module is used to determine whether the test data corresponding to the third summed voltage result is correct;
[0229] If the test data corresponding to the third summed voltage result is correct, the fourteenth determination module is triggered to determine whether the data error correction and recovery function is available.
[0230] If the test data corresponding to the third summed voltage result is incorrect, the fifteenth determination module is triggered to determine that the data error correction and recovery function is unavailable.
[0231] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.
[0232] Figure 3 This is a structural diagram of a test device for data error correction and recovery function provided in an embodiment of the present invention, as shown below. Figure 3 As shown, a test device for data error correction and recovery function includes:
[0233] Memory 30 is used to store computer programs;
[0234] The processor 31 is used to execute a computer program to implement the steps of the test method for the data error correction and recovery function mentioned in the above embodiments.
[0235] The test equipment for the data error correction and recovery function provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0236] The processor 31 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 31 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 31 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 31 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 31 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0237] The memory 30 may include one or more computer-readable storage media, which may be non-transitory. The memory 30 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 30 is used to store at least the following computer program, which, after being loaded and executed by the processor 31, is capable of implementing the relevant steps of the data error correction and recovery function test method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 30 may also include an operating system and data, and the storage method may be temporary or permanent. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, the data error correction and recovery function test method.
[0238] In some embodiments, the test equipment for data error correction and recovery functions may further include a display screen, input / output interfaces, communication interfaces, a power supply, and a communication bus.
[0239] Those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the test equipment for data error correction and recovery functions, and may include more or fewer components than shown.
[0240] The test device for data error correction and recovery function provided in this embodiment of the invention includes a memory 30 and a processor 31. When the processor 31 executes the program stored in the memory 30, it can implement the test method for data error correction and recovery function.
[0241] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps described in the above method embodiments.
[0242] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0243] The foregoing has provided a detailed description of the testing method, apparatus, device, and medium for data error correction and recovery functions provided by this invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the claims of this invention.
[0244] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A test method for data error correction and recovery function, characterized in that, Applied to solid-state drives, the method includes: Receive read data command; The computer flash memory controller is controlled to execute the read data instruction in order to read the test data from the data mapping table; the data mapping table is pre-inserted with offset values that indicate the occurrence of errors, and the data mapping table stores all the test data and the mapping values that correspond one-to-one with the test data; When the data to be tested obtained based on the offset value is correct, the data error correction and recovery function is confirmed to be available. When the test data obtained based on the offset value is incorrect, it is determined that the data error correction and recovery function is unavailable; Obtain the binary string of the data to be tested; A first quantity value and a second quantity value are determined based on the binary string, wherein the first quantity value is the number of 0 occurrences in the binary string, and the second quantity value is the number of 1 occurrences in the binary string; A first probability value and a second probability value are obtained based on the first quantity value and the second quantity value, wherein the first probability value is the probability value that the value of the bit to be recovered in the binary string is 0, and the second probability value is the probability value that the value of the bit to be recovered in the binary string is 1. When the first probability value is greater than the second probability value, the value of the bit to be recovered is set to 0 to facilitate data recovery of the data to be tested. When the second probability value is greater than the first probability value, the value of the bit to be recovered is set to 1 so as to facilitate data recovery of the test data.
2. The test method for data error correction and recovery function according to claim 1, characterized in that, Obtaining the test data read based on the offset value includes: Multiple preset mapping level values are set for the data mapping table; The preset mapping level values and the offset values are summed to obtain the summation result; The corresponding test data is retrieved based on the summation result.
3. The test method for data error correction and recovery function according to claim 1 or 2, characterized in that, Before the control computer flash memory controller executes the read data instruction, it also includes: The monitoring characterizes the serial port command that enables the data error correction and recovery function; When the serial port command is received, the data error correction and recovery function is activated according to the serial port command; Determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function, wherein the verification data is data that indicates the occurrence of the error; If the verification data is the same as the verification output data, then the data error correction and recovery function is determined to be unavailable. If the verification data is different from the verification output data, then the data error correction and recovery function is determined to be available.
4. The test method for data error correction and recovery function according to claim 3, characterized in that, When the test data obtained based on the offset value is correct, the method further includes: According to the serial port command call log; Obtain the error count, representing the number of times the data error correction and recovery function was called, from the log. When the error count is not 0, the data error correction and recovery function is determined to be available; When the error count is 0, the data error correction and recovery function is determined to be unavailable.
5. The test method for data error correction and recovery function according to claim 3, characterized in that, Before the control computer flash memory controller executes the read data instruction, it also includes: The standard protocol command used to monitor and characterize the data error correction and recovery function; When the standard protocol command is received, the data error correction and recovery function is activated according to the standard protocol command; Determine whether the pre-generated verification data is the same as the verification output data obtained after executing the data error correction and recovery function, wherein the verification data is data that indicates the occurrence of the error; If the verification data is the same as the verification output data, then the data error correction and recovery function is determined to be unavailable. If the verification data is different from the verification output data, then the data error correction and recovery function is determined to be available.
6. The test method for data error correction and recovery function according to claim 1, characterized in that, Obtaining the test data read based on the offset value includes: Three preset mapping level values are set for the data mapping table; wherein, the offset voltage value is pre-inserted into the data mapping table, and the data mapping table stores all the data to be tested and the mapping voltage value corresponding one-to-one with the data to be tested, and the three preset mapping level values are respectively the first preset mapping level voltage value, the second preset mapping level voltage value, and the third preset mapping level voltage value. The first preset mapping level voltage value and the offset voltage value are summed to obtain the first summed voltage result; Based on the first summation result, query the corresponding test data; Correspondingly, it is determined whether the test data corresponding to the first summed voltage result is correct; If the test data corresponding to the first summed voltage result is correct, then the data error correction and recovery function is determined to be available; If the test data corresponding to the first summed voltage result is incorrect, then the data error correction and recovery function is determined to be unavailable; The second preset mapping level voltage value and the offset voltage value are summed to obtain a second summed voltage result; Query the corresponding test data based on the second summation result; Correspondingly, it is determined whether the test data corresponding to the second summed voltage result is correct; If the test data corresponding to the second summed voltage result is correct, then the data error correction and recovery function is determined to be available; If the test data corresponding to the second summed voltage result is incorrect, then the data error correction and recovery function is determined to be unavailable; The third preset mapping level voltage value and the offset voltage value are summed to obtain the third summed voltage result; Based on the third summation result, query the corresponding test data; Correspondingly, it is determined whether the test data corresponding to the third summed voltage result is correct; If the test data corresponding to the third summed voltage result is correct, then the data error correction and recovery function is determined to be available; If the test data corresponding to the third summed voltage result is incorrect, then the data error correction and recovery function is determined to be unavailable.
7. A testing device for data error correction and recovery function, characterized in that, The device, applied to solid-state drives, includes: The receiving module is used to receive read data commands; The control module is used to control the computer flash memory controller to execute the read data instruction so as to read the test data from the data mapping table; the data mapping table is pre-inserted with offset values that indicate the occurrence of errors, and the data mapping table stores all the test data and the mapping values that correspond one-to-one with the test data; The first determining module is used to determine that the data error correction and recovery function is available when the data to be tested read based on the offset value is correct. When the test data obtained based on the offset value is incorrect, it also includes: The second determining module is used to determine that the data error correction and recovery function is unavailable; The first acquisition module is used to acquire the binary string of the data to be tested; The third determining module is used to determine a first quantity value and a second quantity value based on the binary string, wherein the first quantity value is the number of 0 occurrences in the binary string, and the second quantity value is the number of 1 occurrences in the binary string; The module is configured to obtain a first probability value and a second probability value based on the first quantity value and the second quantity value, wherein the first probability value is the probability value that the value of the bit to be recovered in the binary string is 0, and the second probability value is the probability value that the value of the bit to be recovered in the binary string is 1. The second setting module is used to set the value of the bit to be recovered to 0 when the first probability value is greater than the second probability value, so as to facilitate data recovery of the test data. The third setting module is used to set the value of the bit to be recovered to 1 when the second probability value is greater than the first probability value, so as to facilitate data recovery of the test data.
8. A test device for data error correction and recovery function, characterized in that, include: Memory, used to store computer programs; A processor, used to execute the computer program to implement the steps of the test method for the data error correction and recovery function as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the test method for the data error correction and recovery function as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Software and hardware combined fault injection device and method for EDAC
CN114756423A
Firmware testing method and device for solid state disk, equipment and medium
CN115617587A