Data hardening method and apparatus for non-volatile memory, and device and medium

By monitoring the initial error correction codes of non-volatile memory under low-temperature conditions, and filtering and rewriting successfully corrected data blocks, the problem of data read errors under low-temperature conditions was solved, improving data accuracy and extending memory life.

WO2026103032A1PCT designated stage Publication Date: 2026-05-21FIBOCOM AUTO INC
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
FIBOCOM AUTO INC
Filing Date
2025-04-29
Publication Date
2026-05-21

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 non-volatile memory, filter out the target data blocks that have been successfully corrected, and rewrite the target data into the data blocks for data hardening.

Benefits of technology

It improves the accuracy of data reading from non-volatile memory in low-temperature environments, reduces the number of data rewrites, and extends memory lifespan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025091935_21052026_PF_FP_ABST
    Figure CN2025091935_21052026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are a data hardening method and apparatus for a non-volatile memory, and a device and a medium. The method comprises: monitoring whether a current ambient temperature is lower than a first preset threshold, and if the current ambient temperature is lower than the first preset threshold, acquiring initial error correction codes of data blocks in a non-volatile memory; on the basis of the initial error correction codes, performing correction code verification on the data blocks, so as to screen the data blocks to select a target data block, the initial error correction code of which represents successful correction; and reading target data stored in the target data block, and rewriting the target data into the target data block, so as to complete data hardening for the target data block.
Need to check novelty before this filing date? Find Prior Art

Description

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

[0001] Citation of relevant applications

[0002] This disclosure claims the entire benefits of Chinese Patent Application No. 202411626544.9, filed on November 13, 2024, with the State Intellectual Property Office of the People's Republic of China, entitled "Data Hardening Method, Apparatus, Device and Medium for Non-Volatile Memory", the entire contents of which are incorporated herein by reference.

[0003] field

[0004] This disclosure generally relates to the field of memory technology, and more specifically to methods, apparatus, devices and media for data hardening of non-volatile memory.

[0005] background

[0006] 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).

[0007] Current traditional avoidance methods often rely solely on temperature control or timed refresh mechanisms, but these solutions are costly and may affect the lifespan of non-volatile memory, making them unsuitable for the needs of modern communication modules.

[0008] 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.

[0009] Overview

[0010] In a first aspect, this disclosure provides a method for data hardening of non-volatile memory, including:

[0011] 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.

[0012] Based on the initial error correction code, each of the data blocks is verified using a correction code to select target data blocks from the data blocks whose initial error correction code indicates successful correction; and

[0013] 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.

[0014] In some implementations, 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 the data blocks whose initial error correction codes indicate successful correction includes:

[0015] 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.

[0016] 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;

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

[0018] 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.

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

[0020] In some implementations, 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:

[0021] 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.

[0022] 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.

[0023] In some implementations, after determining whether the initial error correction code of the current data block indicates successful correction, the method further includes:

[0024] 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.

[0025] In some implementations, reading the target data stored in the target data block and rewriting the target data into the target data block includes:

[0026] 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.

[0027] 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;

[0028] 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.

[0029] In some implementations, after rewriting the target data into the target data block, the method further includes:

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

[0031] 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;

[0032] 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.

[0033] In some embodiments, the data hardening method for the non-volatile memory further includes:

[0034] Record various log information for each of the data blocks and generate a current log file for each data block containing the 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 was 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

[0035] 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.

[0036] Secondly, this disclosure provides a data hardening device for non-volatile memory, comprising:

[0037] The error correction code acquisition module is configured 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.

[0038] The data block filtering module is configured 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 the data blocks whose correction codes indicate successful correction; and

[0039] The data hardening module is configured 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.

[0040] Thirdly, this disclosure provides an electronic device comprising:

[0041] Memory, configured to store computer programs;

[0042] A processor configured to execute the computer program to implement the data hardening method for non-volatile memory as described in this disclosure.

[0043] Fourthly, this disclosure provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the data hardening method for non-volatile memory described in this disclosure.

[0044] In some implementations, when the current ambient temperature is below a first preset threshold (i.e., in a low-temperature environment), the initial error correction codes of each data block in the non-volatile memory are obtained. Then, data rewriting operations are performed on the data blocks whose initial error correction codes indicate successful correction. In other words, target data blocks whose initial error correction codes indicate successful correction are selected from the data blocks. The target data stored in the target data blocks is read and rewritten. It can be understood that since the initial error correction code indicates successful correction, it means that the data in the target data block is correct after correction, and it also means that the physical performance of the target data block is poor at this time and data hardening is required. Therefore, the data read from the target data block is correct, and the data rewritten to the target data block is also correct. The data rewriting operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring data integrity. So 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 is necessary to minimize the number of data rewrites and reduce the lifespan of the non-volatile memory due to data re-damage.

[0045] Brief description of the attached figures

[0046] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0047] Figure 1 is a flowchart of a data hardening method for a non-volatile memory according to an embodiment of the present disclosure;

[0048] Figure 2 is a schematic diagram of temperature reading according to an embodiment of the present disclosure;

[0049] Figure 3 is a schematic diagram of a data hardening process according to an embodiment of the present disclosure;

[0050] Figure 4 is a schematic diagram of the status acquisition process according to an embodiment of the present disclosure;

[0051] Figure 5 is a schematic diagram of log file reading according to an embodiment of the present disclosure;

[0052] Figure 6 is a schematic diagram of the data hardening process of a non-volatile memory according to an embodiment of the present disclosure;

[0053] Figure 7 is a schematic diagram of a data hardening device for a non-volatile memory according to an embodiment of the present disclosure; and

[0054] Figure 8 is a structural diagram of an electronic device according to an embodiment of the present disclosure.

[0055] Detailed Explanation

[0056] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this disclosure.

[0057] 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).

[0058] Current traditional avoidance methods often rely solely on temperature control or timed refresh mechanisms, but these solutions are costly and may affect the lifespan of non-volatile memory, making them unsuitable for the needs of modern communication modules.

[0059] To this end, this disclosure 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.

[0060] Referring to Figure 1, this disclosure provides a data hardening method for non-volatile memory, including:

[0061] 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.

[0062] 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 corrections have been successfully achieved by the initial error correction code; and

[0063] 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.

[0064] Upon power-on, the non-volatile memory monitors the current ambient temperature. For example, as shown in Figure 2, a temperature reading diagram can be created. Temperature files can be opened and temperature values ​​read 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) of the non-volatile memory is loaded. This log file records various log information. Further, as shown in Figure 3, a specific data hardening process diagram, 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 whether the correction was successful. Data blocks without error correction are considered undamaged data blocks.

[0065] In some implementations, the step of 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 code indicates successful correction includes: determining the current data block from the data blocks 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 the data blocks 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.

[0066] 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.

[0067] In some implementations, determining the current data block as a 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 a 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.

[0068] In some implementations, 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 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 corrupted; therefore, data hardening is not required, i.e., the current data block is a non-target data block.

[0069] For example, Figure 4 shows 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.

[0070] In some implementations, 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.

[0071] In some implementations, 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 updating the continuous error correction repair count of the target data block to 0 to obtain a new continuous error correction repair count, thereby completing the data hardening of the target data block; if the rewritten error correction code indicates that the correction is successful, then increasing the continuous error correction repair count of the target data block to obtain a new continuous error correction repair count, and then jumping back to the step of determining whether the continuous error correction repair count is greater than a 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.

[0072] In some implementations, the method further includes: recording various log information for each of the data blocks and generating a current log file for each of the data blocks containing the 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 current 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 times the initial error correction code indicates successful correction, the number of times error correction codes were 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. Furthermore, it may also 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 when the data hardening program was executed last time. The current log file is generated based on this log information. To prevent the log file from growing indefinitely, the log file is designed as a binary file that only records historically important information. The content is not easy to understand. For example, Figure 5 shows a specific log file reading diagram. When the log file is opened, 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 of the faulty data block, fault analysis is performed to repair the faulty data block according to the analysis results.

[0073] In some implementations, when the current ambient temperature is below a first preset threshold (i.e., in a low-temperature environment), the initial error correction codes of each data block in the non-volatile memory are obtained. Then, data rewriting operations are performed on the data blocks whose initial error correction codes indicate successful correction. In other words, target data blocks whose initial error correction codes indicate successful correction are selected from the data blocks. The target data stored in the target data blocks is read and rewritten. It can be understood that since the initial error correction code indicates successful correction, it means that the data in the target data block is correct after correction, and it also means that the physical performance of the target data block is poor at this time and data hardening is required. Therefore, the data read from the target data block is correct, and the data rewritten to the target data block is also correct. The data rewriting operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring data integrity. So 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 is necessary to minimize the number of data rewrites and reduce the lifespan of the non-volatile memory due to data re-damage.

[0074] The following uses the data hardening process diagram of non-volatile memory shown in Figure 6 as an example to illustrate this disclosure. The current ambient temperature is read, and various log information is recorded to generate a log file. It is then 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, correction codes are sequentially checked on each data block in the non-volatile memory based on the data block number to determine the target data block that needs to be rewritten. The specific process is as follows:

[0075] 1) Determine whether all data blocks have been verified by correction codes. If there are data blocks that have not been verified by correction codes, proceed to step 2). If all data blocks have been verified by correction codes, proceed to step 12).

[0076] 2) Identify data block i from each data block in 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.

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

[0078] 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).

[0079] 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.

[0080] 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 is 0 at this time.

[0081] 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);

[0082] 8) If the number of consecutive error correction repairs of data block i is greater than 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).

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

[0084] 10) If the error correction code indicates that there is no error correction for data block i after rewriting, then update the number of consecutive error correction repairs for data block i to 0, obtain a new number of consecutive error correction repairs, 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).

[0085] 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 number of consecutive error correction repairs for data block i, that is, increment the number of consecutive error correction repairs by 1 to obtain a new number of consecutive error correction repairs, and then jump to step 6).

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

[0087] Referring to Figure 7, this disclosure provides a data hardening apparatus for non-volatile memory, comprising:

[0088] The correction code acquisition module 11 is configured 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.

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

[0090] The data hardening module 13 is configured 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.

[0091] In some implementations, when the current ambient temperature is below a first preset threshold (i.e., in a low-temperature environment), the initial error correction codes of each data block in the non-volatile memory are obtained. Then, data rewriting operations are performed on the data blocks whose initial error correction codes indicate successful correction. In other words, target data blocks whose initial error correction codes indicate successful correction are selected from the data blocks. The target data stored in the target data blocks is read and rewritten. It can be understood that since the initial error correction code indicates successful correction, it means that the data in the target data block is correct after correction, and it also means that the physical performance of the target data block is poor at this time and data hardening is required. Therefore, the data read from the target data block is correct, and the data rewritten to the target data block is also correct. The data rewriting operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring data integrity. So 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 is necessary to minimize the number of data rewrites and reduce the lifespan of the non-volatile memory due to data re-damage.

[0092] This disclosure also provides electronic devices. FIG8 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content of the figure should not be construed as limiting the scope of use of this disclosure.

[0093] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. 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 configured to store a computer program, which is loaded and executed by the processor 21 to implement the aforementioned data hardening method for non-volatile memory executed by an electronic device according to this disclosure.

[0094] In some implementations, power supply 23 is configured to provide operating voltage to various hardware devices on the electronic device; 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 disclosure, and is not specifically limited here; input / output interface 25 is configured 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.

[0095] In some implementations, processor 21 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 21 may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). Processor 21 may also include a main processor and a coprocessor. The main processor is a processor configured to process data in the wake-up state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor configured to process data in the standby state. In some embodiments, processor 21 may integrate a GPU (Graphics Processing Unit), which is configured to be responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 21 may also include an AI (Artificial Intelligence) processor configured to handle computational operations related to machine learning.

[0096] In some implementations, the memory 22 serves as a carrier for resource storage and may be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon include an operating system 221, computer programs 222, and data 223, etc., and the storage method may be temporary storage or permanent storage.

[0097] In some implementations, the operating system 221 is used to manage and control 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 221 can be Windows, Unix, Linux, etc. The computer program 222 may include, in addition to 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, a computer program 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.

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

[0099] 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.

[0100] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in connection 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 disclosure. The steps of the methods or algorithms described in connection 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.

[0101] 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.

[0102] The foregoing has provided a detailed description of a data hardening method, apparatus, device, and medium for non-volatile memory provided by this disclosure. Specific examples have been used to illustrate the principles and implementation methods of this disclosure. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this disclosure. 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 this disclosure. Therefore, the content of this specification should not be construed as a limitation of this disclosure.

Claims

1. A data hardening method for non-volatile memory, comprising: 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. 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. as well as 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.

2. The data hardening method for non-volatile memory as described in claim 1, wherein 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: 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. 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; Determine whether all of the data blocks have undergone correction code verification; 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. If all the data blocks are verified using correction codes, the data hardening process for the non-volatile memory ends.

3. The data hardening method for non-volatile memory as described in claim 2, wherein 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 includes: 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. 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.

4. The data hardening method for non-volatile memory as described in claim 2 or 3, wherein 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.

5. The data hardening method for non-volatile memory according to any one of claims 1 to 4, wherein reading the target data stored in the target data block and rewriting the target data into the target data block comprises: 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. 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; 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.

6. The data hardening method for non-volatile memory as described in claim 5, wherein after rewriting the target data into the target data block, it further includes: Obtain the rewritten error correction code of the target data block; 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; 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.

7. The data hardening method for non-volatile memory as described in claim 5 or 6, further comprising: Record various log information for each of the data blocks and generate a current log file for each data block containing the 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 was 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 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.

8. A data hardening device for non-volatile memory, comprising: The error correction code acquisition module is configured 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. The data block filtering module is configured 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; as well as The data hardening module is configured 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.

9. Electronic equipment, including: Memory, configured to store computer programs; A processor configured to execute the computer program to implement the data hardening method for non-volatile memory as described in any one of claims 1 to 7.

10. A computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the data hardening method of the non-volatile memory according to any one of claims 1 to 7.