Data hardening methods, apparatus, devices and media for non-volatile memory

By monitoring and rewriting the initial error correction code of non-volatile memory in low-temperature environments, and filtering and hardening the successfully corrected data blocks, the problem of data reading errors in low-temperature environments was solved, improving data accuracy and extending memory life.

CN119440420BActive Publication Date: 2026-01-06FIBOCOM AUTO INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411626544.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2026-01-06
Estimated Expiration
2044-11-13

AI Technical Summary

Technical Problem

In low-temperature environments, the data read accuracy of non-volatile memory decreases. Existing temperature control and timed refresh mechanisms are costly and affect memory lifespan, failing to meet the needs of modern communication modules.

Method used

Monitor the ambient temperature, obtain the initial error correction code of the data block in the non-volatile memory, filter out the target data block that has been successfully corrected, and rewrite the target data into the data block for data hardening.

Benefits of technology

Improve data read accuracy, reduce data rewrite frequency, and extend memory life in low-temperature environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440420B_ABST
    Figure CN119440420B_ABST
Patent Text Reader

Abstract

This application discloses a data hardening method, apparatus, device, and medium for non-volatile memory, relating to the field of memory technology. The method includes: monitoring whether the current ambient temperature is lower than a first preset threshold; if the current ambient temperature is lower than the first preset threshold, obtaining the initial error correction code for each data block in the non-volatile memory; performing correction code verification on each data block based on the initial error correction code to select target data blocks from the data blocks whose initial error correction codes indicate successful correction; reading the target data stored in the target data block and rewriting the target data into the target data block to complete the data hardening of the target data block. Through the above scheme, this application can improve the accuracy of reading data stored in non-volatile memory in low-temperature environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of memory technology, and in particular to methods, apparatus, devices and media for data hardening of non-volatile memory. Background Technology

[0002] Non-volatile memory (NDRAM) offers higher data storage density, faster read / write speeds, and lower power consumption. For example, NAND Flash memory is a type of NDRAM based on NAND (NOT AND) technology. Currently, NDRAM may experience data corruption during prolonged read operations at low temperatures. This corruption is primarily due to inherent defects in the characteristics of NDRAM. Each time data in NDRAM is read, electrons are depleted. When these electrons decrease to a certain level, the data level will flip. For instance, a data logic level above 0.9V is high, and below 0.9V is low. When electrons decrease and the data voltage drops below 0.9V, the data level will flip from 1 to 0, leading to data read errors. This trend is significantly accelerated at low temperatures (e.g., -40 degrees Celsius).

[0003] Traditional workarounds often involve temperature control or timed refresh mechanisms, but these solutions are costly and may affect the lifespan of non-volatile memory, making them unsuitable for modern communication modules.

[0004] In summary, improving the accuracy of reading data stored in non-volatile memory under low-temperature conditions is a problem that needs to be solved in this field. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for data hardening of non-volatile memory, improving the accuracy of reading data stored in non-volatile memory in low-temperature environments. The specific solution is as follows:

[0006] In a first aspect, this application discloses a data hardening method for non-volatile memory, comprising:

[0007] Monitor whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, obtain the initial error correction code of each data block in the non-volatile memory.

[0008] Based on the initial error correction code, each of the data blocks is checked for correction codes in order to select the target data blocks from each of the data blocks whose initial error correction codes indicate successful correction.

[0009] Read the target data stored in the target data block and rewrite the target data into the target data block to complete the data hardening of the target data block.

[0010] Optionally, the step of performing correction code verification on each of the data blocks based on the initial error correction code to filter out target data blocks from each of the data blocks whose correction codes indicate successful correction includes:

[0011] The current data block is determined from each data block in the non-volatile memory, and it is determined whether the initial error correction code of the current data block indicates successful correction.

[0012] If the initial error correction code of the current data block indicates successful correction, then the current data block is determined to be the target data block;

[0013] Determine whether all of the data blocks have undergone correction code verification;

[0014] If there is a data block that has not been checked for correction codes, then the next data block is determined from each of the data blocks in the non-volatile memory, and the next data block is updated to the current data block. Then, the process jumps back to the step of determining whether the initial error correction code of the current data block indicates successful correction.

[0015] If all the data blocks are verified using correction codes, the data hardening process for the non-volatile memory ends.

[0016] Optionally, determining the current data block as the target data block if the initial error correction code of the current data block indicates successful correction includes:

[0017] If the initial error correction code of the current data block indicates that the current data block has an error correction and indicates that the correction was successful, then the number of error corrections indicated by the initial error correction code is determined.

[0018] Determine whether the number of error corrections is greater than a preset correction threshold. If the number of error corrections is greater than the preset correction threshold, then determine that the current data block is the target data block.

[0019] Optionally, after determining whether the initial error correction code of the current data block indicates successful correction, the method further includes:

[0020] If the initial error correction code of the current data block indicates that the current data block does not have error correction, then the current data block is determined to be a non-target data block, and then the process jumps back to the step of determining whether all data blocks have undergone error correction code verification.

[0021] Optionally, reading the target data stored in the target data block and rewriting the target data into the target data block includes:

[0022] Obtain the number of consecutive error corrections and repairs of the target data block from the current log file of the target data block, and determine whether the number of consecutive error corrections and repairs is greater than a second preset threshold.

[0023] If the number of consecutive error correction repairs is not greater than the second preset threshold, then the target data stored in the target data block is read and the target data is rewritten into the target data block;

[0024] If the number of consecutive error corrections exceeds the second preset threshold, the data hardening process for the target data block is terminated, the target data block is determined to be a faulty data block, and the alarm information of the generated faulty data block is reported.

[0025] Optionally, after rewriting the target data into the target data block, the method further includes:

[0026] Obtain the rewritten error correction code of the target data block;

[0027] If the rewritten error correction code indicates that there is no error correction for the target data block, then the number of consecutive error correction repairs for the target data block is updated to 0 to obtain a new number of consecutive error correction repairs, so as to complete the data hardening of the target data block;

[0028] If the rewritten error correction code indicates successful correction, the number of consecutive error corrections for the target data block is increased to obtain a new number of consecutive error corrections, and then the process jumps back to the step of determining whether the number of consecutive error corrections is greater than the second preset threshold.

[0029] Optionally, the data hardening method for the non-volatile memory further includes:

[0030] Record various log information for each of the data blocks and generate a current log file for each of the data blocks containing various log information; wherein, the log information includes the total number of correction code verifications, the number of times the initial error correction code indicates successful correction, the number of times the error correction code is generated after rewriting, the result after the last correction code verification, the temperature value when data hardening is completed, and the temperature value when the data hardening process is terminated.

[0031] Fault analysis is performed on the current log file based on the faulty data block, and fault repair is performed on the faulty data block based on the analysis results.

[0032] Secondly, this application discloses a data hardening device for non-volatile memory, comprising:

[0033] The error correction code acquisition module is used to monitor whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, the module acquires the initial error correction code of each data block in the non-volatile memory.

[0034] The data block filtering module is used to perform correction code verification on each of the data blocks based on the initial error correction code, so as to filter out the target data blocks from each of the data blocks whose initial error correction code indicates successful correction;

[0035] The data hardening module is used to read the target data stored in the target data block and rewrite the target data into the target data block to complete the data hardening of the target data block.

[0036] Thirdly, this application discloses an electronic device, comprising:

[0037] Memory, used to store computer programs;

[0038] A processor is configured to execute the computer program to implement the steps of the aforementioned disclosed data hardening method for non-volatile memory.

[0039] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned data hardening method for non-volatile memory.

[0040] The beneficial effects of this application are as follows: This application monitors whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, the initial error correction code of each data block in the non-volatile memory is obtained; the correction code of each data block is verified based on the initial error correction code to select the target data block whose initial error correction code indicates successful correction from each data block; the target data stored in the target data block is read and the target data is rewritten into the target data block to complete the data hardening of the target data block. Therefore, this application, when the current ambient temperature is below the first preset threshold (i.e., in a low-temperature environment), obtains the initial error correction codes of each data block in the non-volatile memory, and then performs a data rewrite operation on the data blocks whose initial error correction codes indicate successful correction. In other words, it selects the target data blocks from the data blocks whose initial error correction codes indicate successful correction, reads the target data stored in the target data blocks, and rewrites the target data into the target data blocks. It is understandable that the initial error correction code indicating successful correction indicates, on the one hand, that the data in the target data block is correct after correction, and on the other hand, that the physical performance of the target data block is currently poor and requires data hardening. Therefore, based on this, the data read from the target data block is correct, and the data rewritten to the target data block is also correct. Performing a data rewrite operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring data integrity. Thus, even when reading data stored in the non-volatile memory in a low-temperature environment, the accuracy of data reading is guaranteed, and each data hardening operation is necessary to minimize the number of data rewrites and reduce the lifespan of the non-volatile memory due to data re-damage. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application 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 embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0042] Figure 1 This is a flowchart of a data hardening method for non-volatile memory disclosed in this application;

[0043] Figure 2 This is a specific temperature reading diagram disclosed in this application;

[0044] Figure 3 This is a schematic diagram of a specific data hardening process disclosed in this application;

[0045] Figure 4This is a schematic diagram of a specific status acquisition process disclosed in this application;

[0046] Figure 5 This is a schematic diagram illustrating a specific log file reading method disclosed in this application;

[0047] Figure 6 This is a schematic diagram of a specific data hardening process for a non-volatile memory disclosed in this application;

[0048] Figure 7 This is a schematic diagram of a data hardening device for a non-volatile memory disclosed in this application;

[0049] Figure 8 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0050] The technical solutions of the embodiments of this application 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 scope of protection of the present invention.

[0051] Non-volatile memory (NDRAM) offers higher data storage density, faster read / write speeds, and lower power consumption. For example, NAND Flash memory is a type of NDRAM based on NAND (NOT AND) technology. Currently, NDRAM may experience data corruption during prolonged read operations at low temperatures. This corruption is primarily due to inherent defects in the characteristics of NDRAM. Each time data in NDRAM is read, electrons are depleted. When these electrons decrease to a certain level, the data level will flip. For instance, a data logic level above 0.9V is high, and below 0.9V is low. When electrons decrease and the data voltage drops below 0.9V, the data level will flip from 1 to 0, leading to data read errors. This trend is significantly accelerated at low temperatures (e.g., -40 degrees Celsius).

[0052] Traditional workarounds often involve temperature control or timed refresh mechanisms, but these solutions are costly and may affect the lifespan of non-volatile memory, making them unsuitable for modern communication modules.

[0053] Therefore, this application provides a data hardening scheme for non-volatile memory, which improves the accuracy of reading data stored in non-volatile memory in low-temperature environments.

[0054] See Figure 1As shown in the figure, this application discloses a data hardening method for non-volatile memory, including:

[0055] Step S11: Monitor whether the current ambient temperature is lower than the first preset threshold. If the current ambient temperature is lower than the first preset threshold, obtain the initial error correction code of each data block in the non-volatile memory.

[0056] Non-volatile memory monitors the current ambient temperature upon power-on, for example... Figure 2 The diagram illustrates a specific temperature reading method. It allows opening a temperature file and reading temperature values ​​to monitor the current ambient temperature and determine if it is below a first preset threshold, such as -40 degrees Celsius. If the current ambient temperature is below the first preset threshold, the latest log file (log) is loaded from the non-volatile memory. This log file records various log information. Further, for example… Figure 3 The diagram illustrates a specific data hardening process. It calls the driver interface to obtain the initial error correction code (ECC) for each data block in the non-volatile memory. ECC technology is used to detect and correct errors in data transmission or storage. It achieves automatic error detection and repair by adding redundant information to the data. When a bit error occurs during data transmission or storage, ECC encoding can detect the location of the error and automatically correct it to ensure data integrity and reliability. Therefore, the obtained error correction code can characterize whether the corresponding data block has error correction and, if so, whether the correction was successful. Data blocks without error correction are considered undamaged data blocks.

[0057] Step S12: Perform correction code verification on each of the data blocks based on the initial error correction code, so as to select the target data blocks from each of the data blocks whose initial error correction codes indicate successful correction.

[0058] In this embodiment, the step of performing correction code verification on each data block based on the initial error correction code to select target data blocks from each data block whose initial error correction code indicates successful correction includes: determining the current data block from each data block in the non-volatile memory, and determining whether the initial error correction code of the current data block indicates successful correction; if the initial error correction code of the current data block indicates successful correction, then determining the current data block as the target data block; determining whether all data blocks have undergone correction code verification; if there is a data block that has not undergone correction code verification, then determining the next data block from each data block in the non-volatile memory, updating the next data block to the current data block, and then jumping back to the step of determining whether the initial error correction code of the current data block indicates successful correction; if all data blocks have undergone correction code verification, then ending the data hardening process of the non-volatile memory.

[0059] It is understandable that data blocks without error correction are data blocks without damage, and data blocks without damage do not need to be data hardened. Data blocks with damage need to be data hardened, but since some data blocks are too damaged to be successfully corrected, they do not need to be data hardened. Therefore, the target data blocks in this embodiment are data blocks with error correction and successfully corrected. Each data block needs to be identified as a target data block. If the current data block is a target data block (meaning the initial error correction code indicates successful correction), then data hardening is performed on the target data block. This involves reading the target data stored in the target data block and rewriting it back into the target data block. Further, it is determined whether all data blocks have undergone correction code verification. If any data blocks have not undergone correction code verification, the next data block is then subjected to the verification process. For example, the data blocks can be sorted to obtain their sequence numbers. Based on the sequence number, it is determined whether the current data block is the last data block. If not, it indicates that some data blocks have not undergone correction code verification; if it is the last data block, it indicates that no data blocks have not undergone correction code verification. This process continues until all target data blocks have completed correction code verification and data hardening.

[0060] In this embodiment, determining the current data block as the target data block if the initial error correction code of the current data block indicates successful correction includes: if the initial error correction code of the current data block indicates that the current data block has error correction and the correction is successful, then determining the number of error corrections indicated by the initial error correction code; determining whether the number of error corrections is greater than a preset correction threshold; if the number of error corrections is greater than the preset correction threshold, then determining the current data block as the target data block. Based on the initial error correction code, if it is found that the current data block has error correction and the correction is successful, but there are still too many ECC errors, that is, the number of error corrections indicated by the initial error correction code is greater than the preset correction threshold, it is considered that the data in this block may be corrupted, and a rewriting operation is required for the corrupted data block.

[0061] In this embodiment, after determining whether the initial error correction code of the current data block indicates successful correction, the method further includes: if the initial error correction code of the current data block indicates that the current data block does not have error correction, then the current data block is determined to be a non-target data block, and then the process jumps back to the step of determining whether all data blocks have undergone error correction code verification. It can be understood that if the initial error correction code of the current data block indicates that the current data block does not have error correction, it means that the current data block is a normal data block and is not damaged; therefore, data hardening is not required, i.e., the current data block is a non-target data block.

[0062] Step S13: Read the target data stored in the target data block and rewrite the target data into the target data block to complete the data hardening of the target data block.

[0063] For example Figure 4 The diagram illustrates a specific status acquisition process. Users or the system can obtain the current status through the node value / tmp / sbl_protect_state of the temporary partition protection status file, thereby determining whether it is in the process of repair. When the file does not exist or the node value is 0, it is not running; when the node value is 1, it is running; and when the node value is 2, it is refreshing a certain data block.

[0064] In this embodiment, reading the target data stored in the target data block and rewriting the target data into the target data block includes: obtaining the number of consecutive error correction and repairs of the target data block from the current log file of the target data block, and determining whether the number of consecutive error correction and repairs is greater than a second preset threshold; if the number of consecutive error correction and repairs is not greater than the second preset threshold, then reading the target data stored in the target data block and rewriting the target data into the target data block; if the number of consecutive error correction and repairs is greater than the second preset threshold, then terminating the data hardening process of the target data block, determining that the target data block is a faulty data block, and reporting the alarm information of the generated faulty data block. Before rewriting the target data block, it is necessary to determine whether the number of consecutive error correction and repairs exceeds the second preset threshold. Error correction and repair refers to performing ECC error correction and repair on the data block each time. After each data rewrite, the data block needs to be checked by ECC to see if it still needs repair. If so, ECC error correction and repair will be automatically performed on the data block. If the number of consecutive error correction and repairs exceeds the second preset threshold, it means that the data block is faulty and is not suitable for data rewriting. In other words, data hardening cannot repair the physical damage. It is identified as a faulty data block, and an alarm message for the faulty data block is reported so that maintenance personnel can repair it. If the number of consecutive error correction and repairs does not exceed the second preset threshold, it means that although the target data block is damaged, the physical damage can be repaired through data hardening. Therefore, the data rewrite process can be performed on the target data block to complete the data hardening.

[0065] In this embodiment, after rewriting the target data into the target data block, the method further includes: obtaining the rewritten error correction code of the target data block; if the rewritten error correction code indicates that the target data block does not have error correction, then the continuous error correction repair count of the target data block is updated to 0 to obtain a new continuous error correction repair count, so as to complete the data hardening of the target data block; if the rewritten error correction code indicates that the correction is successful, then the continuous error correction repair count of the target data block is increased to obtain a new continuous error correction repair count, and then the process jumps back to the step of determining whether the continuous error correction repair count is greater than the second preset threshold. ECC verification is performed on the target data block after data rewriting to obtain the rewritten error correction code of the target data block. If the rewritten error correction code indicates that there is no error correction in the target data block, it means that the damage of the target data block has been well repaired and no further ECC error correction is needed. In this case, the continuous error correction count of the target data block is updated to 0 to obtain a new continuous error correction count, thus completing the data hardening of the target data block. If the rewritten error correction code indicates that the correction was successful, it means that ECC error correction was still performed on the rewritten target data block. Therefore, the continuous error correction count of the target data block is increased by 1 to obtain a new continuous error correction count. Then, the process jumps back to the step of determining whether the continuous error correction count is greater than the second preset threshold until the rewritten error correction code indicates that there is no error correction in the target data block or the continuous error correction count is greater than the second preset threshold.

[0066] In this embodiment, the method further includes: recording various log information of each data block and generating a current log file for each data block containing various log information; wherein, the log information includes the total number of correction code verifications, the number of times the initial error correction code indicates successful correction, the number of times the error correction code is generated after rewriting, the result after the last correction code verification, the temperature value when data hardening is completed, and the temperature value when the data hardening process is terminated; and performing fault analysis based on the current log file of the faulty data block to repair the faulty data block according to the obtained analysis results. When the ambient temperature is below a first preset threshold, the ECC verification process begins to harden the target data block and triggers the recording of various log information for each data block. This generates a current log file for each data block containing various log information, including the total number of correction code verifications, the number of successful initial error correction codes, the number of error correction codes generated after rewriting, the result of the last correction code verification, the temperature value when data hardening was completed, and the temperature value when the data hardening process was terminated. Further, it may include the total number of checks on non-volatile memory, the total number of ECC checks for each data block, the total number of errors reported for each data block, the total number of repairs for each data block, the total number of errors reported after the last repair for each data block, the result of the last ECC check for each data block, the temperature value of the last check, and whether an ECC check was triggered during the last execution of the data hardening program. The current log file is generated based on this log information. To prevent the log file (Log) from growing indefinitely, the log file is designed as a binary file that only records historically important information; the content is not easily readable. Figure 5 The diagram illustrates a specific log file reading process. Opening the log file and using the "Read Log" use case can parse the file into a readable format and output it to the console. Based on the current log file containing the faulty data block, fault analysis is performed to repair the faulty data block according to the analysis results.

[0067] The beneficial effects of this application are as follows: This application monitors whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, the initial error correction code of each data block in the non-volatile memory is obtained; the correction code of each data block is verified based on the initial error correction code to select the target data block whose initial error correction code indicates successful correction from each data block; the target data stored in the target data block is read and the target data is rewritten into the target data block to complete the data hardening of the target data block. Therefore, this application, when the current ambient temperature is below the first preset threshold (i.e., in a low-temperature environment), obtains the initial error correction codes of each data block in the non-volatile memory, and then performs a data rewrite operation on the data blocks whose initial error correction codes indicate successful correction. In other words, it selects the target data blocks from the data blocks whose initial error correction codes indicate successful correction, reads the target data stored in the target data blocks, and rewrites the target data into the target data blocks. It is understandable that the initial error correction code indicating successful correction indicates, on the one hand, that the data in the target data block is correct after correction, and on the other hand, that the physical performance of the target data block is currently poor and requires data hardening. Therefore, based on this, the data read from the target data block is correct, and the data rewritten to the target data block is also correct. Performing a data rewrite operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring data integrity. Thus, even when reading data stored in the non-volatile memory in a low-temperature environment, the accuracy of data reading is guaranteed, and each data hardening operation is necessary to minimize the number of data rewrites and reduce the lifespan of the non-volatile memory due to data re-damage.

[0068] The following is based on Figure 6 Taking a specific data hardening process diagram of a non-volatile memory as an example, this application will be described accordingly. The current ambient temperature is read, and various log information is recorded to generate a log file; it is determined whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, then based on the data block number, correction codes are sequentially checked on each data block in the non-volatile memory to determine the target data block that needs to be rewritten. The specific process is as follows:

[0069] 1) Determine whether all data blocks have undergone correction code verification. If any data block has not undergone correction code verification, proceed to step 2). If all data blocks have undergone correction code verification, proceed to step 12).

[0070] 2) Identify data block i from the data blocks of the non-volatile memory, obtain the initial error correction code (ECC) of data block i, record the result of the last check after power-on, and increment the total number of ECC checks for data block i by 1.

[0071] 3) Determine whether the initial error correction code of data block i indicates successful correction;

[0072] 4) If the initial error correction code of data block i does not indicate successful correction and there is no error correction, it means that data block i does not need to be hardened. Therefore, data block i+1 is determined from the data blocks of the non-volatile memory, and then the process jumps to step 1).

[0073] 5) If the initial error correction code of data block i indicates successful correction, then increment the total number of corrections for data block i by 1, and also increment the number of corrections based on the last correction by 1.

[0074] 6) Determine whether the number of consecutive error corrections n is greater than the second preset threshold. The second preset threshold is, for example, 3. It can be understood that if it is the first time to perform correction and repair, the number of consecutive error corrections n will be 0 at this time.

[0075] 7) If the number of consecutive error corrections for data block i is not greater than the second preset threshold, then read the target data stored in data block i, rewrite the target data into data block i, and then proceed to step 9).

[0076] 8) If the number of consecutive error corrections for data block i exceeds the second preset threshold, the data hardening process for data block i is terminated, and data block i is determined to be a faulty data block. The alarm information of the generated faulty data block is reported, and then data block i+1 is determined from each data block in the non-volatile memory. Then, the process jumps to step 1).

[0077] 9) Determine whether the error correction code after rewriting data block i indicates that data block i does not have error correction;

[0078] 10) If the error correction code indicates that there is no error correction for data block i after rewriting, then update the consecutive error correction repair count of data block i to 0 to obtain a new consecutive error correction repair count, so as to complete the data hardening of data block i. Then, determine data block i+1 from each data block in the non-volatile memory, and then jump to step 1).

[0079] 11) If the error correction code indicates that data block i has an error correction and the correction is successful after rewriting, then increase the consecutive error correction repair count of data block i by 1 to obtain a new consecutive error correction repair count, and then jump to step 6).

[0080] 12) End the data hardening process for non-volatile memory.

[0081] See Figure 7 As shown in the figure, this application discloses a data hardening device for non-volatile memory, including:

[0082] The correction code acquisition module 11 is used to monitor whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, the initial error correction code of each data block in the non-volatile memory is acquired.

[0083] The data block filtering module 12 is used to perform correction code verification on each of the data blocks based on the initial error correction code, so as to filter out the target data blocks whose correction is successfully represented by the initial error correction code from each of the data blocks;

[0084] The data hardening module 13 is used to read the target data stored in the target data block and rewrite the target data into the target data block to complete the data hardening of the target data block.

[0085] The beneficial effects of this application are as follows: This application monitors whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, the initial error correction code of each data block in the non-volatile memory is obtained; the correction code of each data block is verified based on the initial error correction code to select the target data block whose initial error correction code indicates successful correction from each data block; the target data stored in the target data block is read and the target data is rewritten into the target data block to complete the data hardening of the target data block. Therefore, this application, when the current ambient temperature is below the first preset threshold (i.e., in a low-temperature environment), obtains the initial error correction codes of each data block in the non-volatile memory, and then performs a data rewrite operation on the data blocks whose initial error correction codes indicate successful correction. In other words, it selects the target data blocks from the data blocks whose initial error correction codes indicate successful correction, reads the target data stored in the target data blocks, and rewrites the target data into the target data blocks. It is understandable that the initial error correction code indicating successful correction indicates, on the one hand, that the data in the target data block is correct after correction, and on the other hand, that the physical performance of the target data block is currently poor and requires data hardening. Therefore, based on this, the data read from the target data block is correct, and the data rewritten to the target data block is also correct. Performing a data rewrite operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring data integrity. Thus, even when reading data stored in the non-volatile memory in a low-temperature environment, the accuracy of data reading is guaranteed, and each data hardening operation is necessary to minimize the number of data rewrites and reduce the lifespan of the non-volatile memory due to data re-damage.

[0086] Furthermore, embodiments of this application also provide an electronic device. Figure 8This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0087] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data hardening method for non-volatile memory executed by the electronic device disclosed in any of the foregoing embodiments.

[0088] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0089] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), 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 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0090] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0091] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the data hardening method for non-volatile memory executed by the electronic device as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.

[0092] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned data hardening method for non-volatile memory. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0093] The various embodiments in this 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.

[0094] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly in hardware, software modules executed by a processor, or a combination of both. The software module may be located in random access memory (RAM), memory, read-only memory (ROM), electrically programmable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), register, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the art.

[0095] Finally, it should be noted that in this document, 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.

[0096] The above provides a detailed description of the data hardening method, apparatus, device, and medium for non-volatile memory provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A data hardening method for a non-volatile memory, characterized by, The method comprises the steps of: monitoring whether a current environment temperature is lower than a first preset threshold value, and if the current environment temperature is lower than the first preset threshold value, obtaining an initial error correction code of each data block in a non-volatile memory; performing error correction code checking on each data block based on the initial error correction code to screen a target data block from each data block, wherein the initial error correction code of the target data block represents successful correction; reading target data stored in the target data block, and rewriting the target data into the target data block to complete data hardening of the target data block; the step of performing error correction code checking on each data block based on the initial error correction code to screen a target data block from each data block, wherein the initial error correction code of the target data block represents successful correction, comprises the steps of: determining a current data block from each data block in a non-volatile memory, and judging whether the initial error correction code of the current data block represents successful correction; if the initial error correction code of the current data block represents successful correction, determining that the current data block is a target data block; judging whether all the data blocks have been subjected to error correction code checking; if there is a data block that has not been subjected to error correction code checking, determining a next data block from each data block in the non-volatile memory, updating the next data block as the current data block, and then returning to the step of judging whether the initial error correction code of the current data block represents successful correction; if all the data blocks have been subjected to error correction code checking, ending the data hardening process of the non-volatile memory.

2. The data hardening method of nonvolatile memory according to claim 1, wherein, if the initial error correction code of the current data block represents that the current data block has error correction and represents successful correction, determining the number of error corrections represented by the initial error correction code; judging whether the number of error corrections is greater than a preset correction threshold value, and if the number of error corrections is greater than the preset correction threshold value, determining that the current data block is a target data block. after the step of judging whether the initial error correction code of the current data block represents successful correction, further comprising the steps of:

3. The data hardening method of nonvolatile memory according to claim 1, wherein, if the initial error correction code of the current data block represents that the current data block has no error correction, determining that the current data block is a non-target data block, and then returning to the step of judging whether all the data blocks have been subjected to error correction code checking. the step of reading target data stored in the target data block and rewriting the target data into the target data block, comprises the steps of:

4. The data hardening method of nonvolatile memory according to claim 1, wherein, obtaining a number of consecutive error correction repairs of the target data block from a current log file of the target data block, and judging whether the number of consecutive error correction repairs is greater than a second preset threshold value; if the number of consecutive error correction repairs is not greater than the second preset threshold value, reading target data stored in the target data block and rewriting the target data into the target data block. ​ If the number of consecutive error correction repairs is greater than the second preset threshold, a data reinforcement process for the target data block is terminated, the target data block is determined as a faulty data block, and alarm information of the generated faulty data block is reported.

5. The data hardening method of nonvolatile memory according to claim 4, wherein, After the target data is rewritten into the target data block, the method further includes: acquiring an error correction code after rewriting of the target data block; if the error correction code after rewriting indicates that there is no error correction for the target data block, the number of consecutive error correction repairs for the target data block is updated to 0 to obtain a new number of consecutive error correction repairs, so as to complete data reinforcement of the target data block; if the error correction code after rewriting indicates that the correction is successful, the number of consecutive error correction repairs for the target data block is increased to obtain a new number of consecutive error correction repairs, and then the step of judging whether the number of consecutive error correction repairs is greater than the second preset threshold is re-jumped.

6. The data hardening method of nonvolatile memory according to claim 4, wherein, Further comprising: recording various log information of each data block and generating a current log file of each data block containing various log information, wherein the log information includes a total number of error correction code checks, a number of times that the initial error correction code indicates that the correction is successful, a number of times that the error correction code after rewriting is generated, a result after the last error correction code check, a temperature value when the data reinforcement is completed, and a temperature value when the data reinforcement process is terminated; performing fault analysis based on the current log file of the faulty data block to repair the faulty data block according to the obtained analysis result.

7. A data hardening apparatus for a non-volatile memory, comprising: Comprising: an error correction code acquisition module configured to monitor whether a current environment temperature is lower than a first preset threshold, and if the current environment temperature is lower than the first preset threshold, acquire an initial error correction code of each data block in a non-volatile memory; a data block screening module configured to perform error correction code check on each data block based on the initial error correction code, so as to screen a target data block whose initial error correction code indicates that the correction is successful from each data block; a data reinforcement module configured to read target data stored in the target data block and rewrite the target data into the target data block, so as to complete data reinforcement of the target data block; the data block screening module is specifically configured to: determine a current data block from each data block of a non-volatile memory and judge whether the initial error correction code of the current data block indicates that the correction is successful; if the initial error correction code of the current data block indicates that the correction is successful, the current data block is determined as a target data block; and judge whether all the data blocks have performed error correction code check; if there is a data block that has not performed error correction code check, a next data block is determined from each data block of the non-volatile memory, the next data block is updated as the current data block, and then the step of judging whether the initial error correction code of the current data block indicates that the correction is successful is re-jumped; if all the data blocks have performed error correction code check, the data reinforcement process of the non-volatile memory is ended.

8. An electronic device, comprising: Comprising: a memory configured to save a computer program; A processor for executing the computer program to implement the steps of the data hardening method of the non-volatile memory as claimed in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, A computer program product for storing a computer program; wherein the computer program, when executed by a processor, implements the steps of the data hardening method of the non-volatile memory as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A memory device for recovering data by using a temperature equalization data recovery method

    CN109358984A

  • Method and device for generating trial and error table of nonvolatile memory

    CN112331254A