Method for optimizing data retention ability of NAND flash memory, electronic device and storage medium

By updating the firmware program through detection time and temperature, the data retention capability of NAND flash memory is optimized, and the problem of insufficient data retention capability in high and low temperature environments in NAND flash is solved, and the accuracy of data reading is improved.

CN119621418BActive Publication Date: 2025-06-24ARTMEM TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510162652.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-06-24
Estimated Expiration
2045-02-14

AI Technical Summary

Technical Problem

The existing NAND flash has high and low temperature cross-temperature reading and writing environments, and the data retention ability of firmware is weak, especially when reading at low temperature after high temperature programming, it is easy to cause data reading failure.

Method used

Optimize the data retention capability of NAND flash memory by updating the firmware program by detecting time and temperature. The specific method includes determining the detection time when the embedded multimedia card is switched from the working state to the sleep state, and detecting the error correction code ECC of the firmware program when the preset time threshold is reached, obtaining the detection temperature, and controlling the firmware program to refresh or keep it unchanged according to the temperature scene division information.

Benefits of technology

Improves the data retention capability of NAND flash memory and enhances the accuracy of data reading, especially when reading at low temperatures after high temperature programming, reducing the risk of data reading failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621418B_ABST
    Figure CN119621418B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method for optimizing the data retention ability of a NAND flash memory, an electronic device, and a computer-readable storage medium. The method includes: determining a detection time when an embedded multimedia card switches from a working state to a sleep state; detecting an error correction code (ECC) of a firmware program when the detection time reaches a preset time threshold; obtaining a detection temperature when the ECC reaches a preset detection threshold; and controlling the firmware program to perform a refresh process or remain unchanged according to the detection temperature and preset temperature scenario division information. According to the solution of the embodiment of the present invention, it is possible to update the firmware program by combining the detection time and the detection temperature, improve the data retention ability of the NAND flash memory, and thus can well improve the accuracy of subsequent data reading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly relates to a method for optimizing the data retention ability of NAND flash memory, an electronic device, and a computer-readable storage medium. Background Art

[0002] As the capacity of NAND flash memory increases, the manufacturing process has been well optimized. Although the cost has been reduced, for some TLC (Triple-Level Cell, each cell stores 3 bits of data) and QLC (Quad-Level Cell, each cell stores 4 bits of data) NANDs, their data retention ability for firmware in high and low temperature cross-temperature read and write environments has weakened. Especially in the scenario of high-temperature programming and low-temperature reading, due to physical characteristics, the data retention of firmware in high-temperature scenarios is poor, which easily leads to all backups being programmed in high-temperature scenarios, and when the temperature drops to low temperature, it triggers a read data failure. Summary of the Invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art.

[0004] To this end, the present invention proposes a method for optimizing the data retention ability of NAND flash memory, which can update the firmware program by combining the detection time and the detection temperature, improve the data retention ability of NAND flash memory, and thus can well improve the accuracy of subsequent data reading.

[0005] The present invention also proposes an electronic device applying the above method for optimizing the data retention ability of NAND flash memory.

[0006] The present invention also proposes a computer-readable storage medium applying the above method for optimizing the data retention ability of NAND flash memory.

[0007] The method for optimizing the data retention ability of NAND flash memory according to the first aspect embodiment of the present invention is applied to an embedded multimedia card. The embedded multimedia card includes a controller and a NAND flash memory. The controller is connected to the NAND flash memory. The NAND flash memory includes a plurality of data blocks, and at least one firmware program is stored in each data block. The method includes:

[0008] Determining the detection time when the embedded multimedia card switches from the working state to the sleep state;

[0009] Detecting the error correction code ECC of the firmware program when the detection time reaches a preset time threshold;

[0010] Obtaining the detection temperature when the ECC reaches a preset detection threshold;

[0011] Control the firmware program to perform a refresh process or remain unchanged according to the detected temperature and the preset temperature scenario division information;

[0012] Wherein, the detection time is obtained according to a preset ECC setting value, and the preset ECC setting value includes a plurality of ECC thresholds that decrease in sequence and the difference between adjacent ones decreases in sequence.

[0013] According to some embodiments of the present invention, the detection time is obtained in the following manner:

[0014] Obtain a first ECC threshold, a second ECC threshold, a third ECC threshold, a fourth ECC threshold, and a fifth ECC threshold; wherein, the ECC setting value includes the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold, and the fifth ECC threshold;

[0015] Determine a first firmware detection time according to the first ECC threshold; and, determine a second firmware detection time according to the second ECC threshold and the first ECC threshold; and, determine a third firmware detection time according to the third ECC threshold and the second ECC threshold; and, determine a fourth firmware detection time according to the fourth ECC threshold and the third ECC threshold; and, determine a fifth firmware detection time according to the fifth ECC threshold and the fourth ECC threshold; wherein, the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time, and the first firmware detection time decrease in sequence, and the detection time includes the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time, and the first firmware detection time.

[0016] According to some embodiments of the present invention, the temperature scenario division information includes a first temperature threshold and a second temperature threshold, the first temperature threshold is smaller than the second temperature threshold, and the control of the firmware program to perform a refresh process or remain unchanged according to the detected temperature and the preset temperature scenario division information includes:

[0017] When the detected temperature satisfies the first scenario and there is only one firmware program programmed in the normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged; wherein, the first scenario is that the detected temperature continuously remains lower than the first temperature threshold;

[0018] When the detected temperature meets the second scenario, the third scenario, and the sixth scenario, perform a refresh process on the corresponding firmware program; wherein, the second scenario is that the detected temperature continuously stays between the first temperature threshold and the second temperature threshold, the third scenario is that the detected temperature continuously exceeds the second temperature threshold, and the sixth scenario is that the detected temperature continuously exceeds the first temperature threshold.

[0019] According to some embodiments of the present invention, the controlling the firmware program to perform a refresh process or remain unchanged according to the detected temperature and the preset temperature scenario division information includes:

[0020] When the detected temperature meets the fourth scenario and the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged; wherein, the fourth scenario is that the detected temperature continuously stays below the second temperature threshold;

[0021] When the detected temperature meets the fourth scenario and the detected temperature is higher than the first temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged.

[0022] According to some embodiments of the present invention, the controlling the firmware program to perform a refresh process or remain unchanged according to the detected temperature and the preset temperature scenario division information includes:

[0023] When the detected temperature meets the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in a low temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program; wherein, the fifth scenario includes that the detected temperature is less than the first temperature threshold, the detected temperature is between the first temperature threshold and the second temperature threshold, and the detected temperature is greater than the second temperature threshold;

[0024] When the detected temperature meets the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program;

[0025] When the detected temperature meets the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged.

[0026] According to some embodiments of the present invention, controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and preset temperature scenario division information includes:

[0027] When the detected temperature satisfies the fourth scenario and the detected temperature is lower than the first temperature threshold, and there is not only one firmware program programmed in the normal temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program;

[0028] When the detected temperature satisfies the fourth scenario and the detected temperature is higher than the first temperature threshold, and there is not only one firmware program programmed in the low temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program.

[0029] According to some embodiments of the present invention, controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and preset temperature scenario division information includes:

[0030] When the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are not at least two firmware programs programmed in the low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged;

[0031] When the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed in the normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged;

[0032] When the detected temperature satisfies the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is not only one firmware program programmed in the low temperature environment in the NAND flash memory, perform a refresh process on the firmware program.

[0033] According to some embodiments of the present invention, after detecting the error correction code ECC of the firmware program when the detected time reaches a preset time threshold, the method further includes:

[0034] When the ECC does not reach the preset detection threshold, control the corresponding firmware program to remain unchanged.

[0035] An electronic device according to an embodiment of the second aspect of the present invention includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the method for optimizing the data retention ability of the NAND flash memory as described above is implemented.

[0036] A computer-readable storage medium according to an embodiment of the third aspect of the present invention stores computer-executable instructions, and when the computer-executable instructions are executed by a control processor, the method for optimizing the data retention ability of a NAND flash memory as described above is implemented.

[0037] The method for optimizing the data retention ability of a NAND flash memory according to an embodiment of the present invention has at least the following beneficial effects: In the process of optimizing the data retention ability of a NAND flash memory, first, when the embedded multimedia card switches from the working state to the sleep state, the detection time is determined; and when the detection time reaches a preset time threshold, the error correction code (ECC) of the firmware program is detected and processed; when the ECC reaches a preset detection threshold, the detection temperature is obtained; and finally, according to the detection temperature and the preset temperature scenario division information, the firmware program is controlled to perform a refresh process or remain unchanged. Through the above technical solution, the firmware program can be updated by combining the detection time and the detection temperature, improving the data retention ability of the NAND flash memory, and thus the accuracy of subsequent data reading can be well improved.

[0038] Other features and advantages of the present invention will be described in the subsequent description, and part of them will be obvious from the description, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in the description, the claims, and the drawings. Description of the Drawings

[0039] The drawings are used to provide a further understanding of the technical solutions of the present disclosure, and constitute a part of the description. They are used to explain the technical solutions of the present disclosure together with the embodiments of the present disclosure, and do not constitute a limitation to the technical solutions of the present disclosure.

[0040] Figure 1 is a flowchart of a method for optimizing the data retention ability of a NAND flash memory provided by an embodiment of the present invention;

[0041] Figure 2 is a schematic diagram of the storage method of the firmware program in the NAND flash memory provided by an embodiment of the present invention;

[0042] Figure 3 is a schematic diagram of the firmware program boot process provided by an embodiment of the present invention;

[0043] Figure 4 is a flowchart of determining the detection time provided by an embodiment of the present invention;

[0044] Figure 5 is a flowchart of determining the detection timing of the firmware program provided by a specific embodiment of the present invention;

[0045] Figure 6 It is a schematic diagram of ECC threshold division provided by a specific embodiment of the present invention;

[0046] Figure 7 It is Figure 1 a sub - flowchart of step S400 in

[0047] Figure 8 a sub - flowchart of step S400 when the detected temperature meets the fourth scenario;

[0048] Figure 9 a sub - flowchart of step S400 when the detected temperature meets the fifth scenario;

[0049] Figure 10 Another sub - flowchart of step S400 when the detected temperature meets the fourth scenario;

[0050] Figure 11 Another sub - flowchart of step S400 when the detected temperature meets the fifth scenario;

[0051] Figure 12 It is a flowchart of processing the firmware program according to ECC provided by an embodiment of the present invention;

[0052] Figure 13 It is a schematic diagram of scenario division provided by a specific embodiment of the present invention;

[0053] Figure 14 It is a schematic diagram of processing the firmware program according to temperature provided by a specific embodiment of the present invention;

[0054] Figure 15 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0055] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0056] In the description of the present invention, the meaning of several is one or more, the meaning of multiple is more than two, greater than, less than, exceeding, etc. are understood as not including the number itself, above, below, within, etc. are understood as including the number itself. If there is a description of first and second, it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.

[0057] In the description of the present invention, unless otherwise clearly defined, terms such as "setting", "installing", "connecting", etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.

[0058] The present invention provides a method for optimizing the data retention ability of a NAND flash memory, an electronic device, and a computer-readable storage medium. The method includes: during the process of optimizing the data retention ability of the NAND flash memory, first, when the embedded multimedia card switches from the working state to the sleep state, the detection time is determined; and when the detection time reaches a preset time threshold, the error correction code (ECC) of the firmware program is detected and processed; when the ECC reaches a preset detection threshold, the detection temperature is obtained; and finally, the firmware program can be processed according to the detection temperature and the preset temperature scenario division information. Through the above technical solution, the firmware program can be updated by combining the detection time and the detection temperature, improving the data retention ability of the NAND flash memory, and thus can well improve the accuracy of subsequent data reading.

[0059] The following further elaborates on the embodiments of the present invention with reference to the accompanying drawings.

[0060] As Figure 1 shown, the flowchart of the method for optimizing the data retention ability of a NAND flash memory provided by an embodiment of the present invention. The method is applied to an embedded multimedia card, which includes a controller and a NAND flash memory. The controller is connected to the NAND flash memory, and the NAND flash memory includes multiple data blocks, and at least one firmware program is stored in each data block. The method includes but is not limited to steps S100, S200, S300, and S400:

[0061] Step S100: When the embedded multimedia card switches from the working state to the sleep state, determine the detection time;

[0062] Step S200: When the detection time reaches a preset time threshold, detect the error correction code (ECC) of the firmware program;

[0063] Step S300: When the ECC reaches a preset detection threshold, obtain the detection temperature;

[0064] Step S400: Control the firmware program to be refreshed or remain unchanged according to the detection temperature and the preset temperature scenario division information.

[0065] It should be noted that in the process of optimizing the data retention ability of NAND flash memory, first, when the embedded multimedia card switches from the working state to the sleep state, the detection time is determined; and when the detection time reaches the preset time threshold, the error correction code (ECC) of the firmware program is detected and processed; when the ECC reaches the preset detection threshold, the detection temperature is obtained; finally, according to the detection temperature and the preset temperature scenario division information, the firmware program can be controlled to perform a refresh process or remain unchanged. Through the above technical solution, the firmware program can be updated by combining the detection time and the detection temperature, improving the data retention ability of the NAND flash memory, thereby well improving the accuracy of subsequent data reading.

[0066] It is worth noting that an embedded multimedia card (eMMC) is a storage solution that packages NAND flash memory chips and control chips together; embedded multimedia cards are mainly applied in the fields of mobile devices, embedded systems, consumer electronics, and automotive electronics.

[0067] It is worth noting that the embedded multimedia card includes a controller and NAND flash memory. The controller is connected to the NAND flash memory. The NAND flash memory includes multiple data blocks, and at least one firmware program is stored in each data block; exemplarily, in the actual application of NAND flash memory, a multi-backup form is always adopted. In this solution, at least a four-backup form is adopted, that is, 4 blks (data blocks) are used to store the firmware program (a single blk may store multiple backups). Under the statistics of the specifications of numerous NAND flash memories, for blk0 in the NAND flash memories provided by each manufacturer, it is always necessary to ensure that it is a good data block; based on this, the most critical boot information is put into blk0 in multiple backup forms, and blk0 and the other three blks each store at least one complete firmware program, as Figure 2 shown. The specific location is saved by the boot information, and the specific location of the boot information is selected after analyzing the characteristics of NAND flash memories on the market during the actual application process.

[0068] It should be noted that currently, for eMMC, in order to save costs, often one controller is used to adapt to NAND flash memories from more manufacturers. As Figure 3As shown, it is the ordinary firmware program boot process. During the boot process of the firmware program, the eMMC powers on and first reads the firmware program from the boot-rom. However, different manufacturers require different adapted firmware programs. That is to say, for the controller, the boot-rom needs to boot up the firmware programs of different manufacturers. Since the firmware program is stored in the NAND flash memory, the data retention capabilities of different NAND flash memories are inconsistent. In order to adapt to more NAND flash memories at the boot-rom stage, without increasing the hardware cost, it is often impossible to add a complex rereading mechanism. Moreover, the eMMC has certain requirements for the boot time of the boot-rom, and it is even more impossible to use software decoding and other methods to enhance the ability to boot the firmware program. Especially in the scenario of high-temperature programming and low-temperature reading, due to physical characteristics, the data retention of the firmware program in the high-temperature scenario is poor, and it is easy to have all backups programmed in the high-temperature scenario. When the temperature drops to low temperature, it is very likely to trigger a data reading failure. Therefore, to solve this problem, the embodiments of the present invention provide a method for optimizing the data retention ability of the NAND flash memory, aiming at avoiding refreshing the data or refreshing all the data only when relatively serious errors occur in different extreme temperature environments, so as to enhance the data retention ability. The embodiments of the present invention can well enhance the possibility of successfully booting the firmware program through multiple backup forms.

[0069] It should be noted that after the eMMC switches from the working state to the sleep state, the detection time will be determined; when it is determined that the detection time reaches the preset time threshold, the error correction code ECC of the firmware program will be detected and processed; among them, ECC is a technology used to detect and correct errors in the data storage and transmission process. In the eMMC, the ECC technology plays a crucial role to ensure the integrity and reliability of the data. When the ECC of the firmware program reaches the preset detection threshold, the temperature of the current environment will be detected and processed to obtain the detected temperature; finally, the firmware program will be processed according to the detected temperature and the preset temperature scenario division information; in extreme temperature cases, if a relatively high ECC error occurs, the firmware program will be selectively refreshed at different temperatures.

[0070] In addition, in one embodiment, as Figure 4 shown, the detection time can be obtained through but not limited to the following steps:

[0071] Step S110, obtain the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold, and the fifth ECC threshold;

[0072] Step S120: Determine the first firmware detection time according to the first ECC threshold; and determine the second firmware detection time according to the second ECC threshold and the first ECC threshold; and determine the third firmware detection time according to the third ECC threshold and the second ECC threshold; and determine the fourth firmware detection time according to the fourth ECC threshold and the third ECC threshold; and determine the fifth firmware detection time according to the fifth ECC threshold and the fourth ECC threshold.

[0073] It should be noted that in the process of determining the detection time, first obtain the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold, and the fifth ECC threshold; then determine the first firmware detection time according to the first ECC threshold, determine the second firmware detection time according to the second ECC threshold and the first ECC threshold, determine the third firmware detection time according to the third ECC threshold and the second ECC threshold, determine the fourth firmware detection time according to the fourth ECC threshold and the third ECC threshold, and determine the fifth firmware detection time according to the fifth ECC threshold and the fourth ECC threshold. Determining the detection time according to different ECC thresholds can make the detection timing of the firmware program more appropriate and reasonable.

[0074] It is worth noting that the detection time is obtained according to a preset ECC setting value, and the preset ECC setting value includes multiple ECC thresholds that decrease in sequence and the difference between adjacent two decreases in sequence. In the embodiment of the present invention, the ECC setting value includes the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold, and the fifth ECC threshold. The fifth ECC threshold, the fourth ECC threshold, the third ECC threshold, the second ECC threshold, and the first ECC threshold decrease in sequence, and the difference between adjacent two of the fifth ECC threshold, the fourth ECC threshold, the third ECC threshold, the second ECC threshold, and the first ECC threshold decreases in sequence; and the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time, and the first firmware detection time decrease in sequence; the detection time includes the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time, and the first firmware detection time.

[0075] Exemplarily, such as Figure 5As shown in the figure, the working state of the eMMC can be generally divided into a sleep state and a working state. When in the working state, a timer is used for timing. When switching from the working state to the sleep state and the time reaches the set time, the firmware program will be detected. If it is found that the ECC exceeds a certain threshold, it will be further determined whether to perform a refresh according to the temperature condition. The key point here lies in the setting of the time for detecting the firmware program and the ECC threshold. If the detection is too frequent, it will affect the operation efficiency of the firmware and increase power consumption; if the detection frequency is too low, the opportunity to refresh the firmware program will be missed. Through the analysis of MTBF (Mean Time between Failures) during the data retention experiment, the time and the Ecc threshold are divided into five levels. Assuming that a complete error is 1, then as Figure 6 shown, where A, B, C, D, and E represent the thresholds at each stage of the ECC, and (E - D) > (D - C) > (C - B) > (B - A). t1, t2, t3, t4, and t5 are the detection times, which decrease in turn. When the value of Ecc is in the E - D segment, it is considered that the firmware program needs to be refreshed at this time.

[0076] In addition, in one embodiment, as Figure 7 shown, the temperature scenario division information includes a first temperature threshold and a second temperature threshold, and the first temperature threshold is smaller than the second temperature threshold. According to the detected temperature and the preset temperature scenario division information, the firmware program can be processed, which may include but is not limited to step S410 and step S420.

[0077] Step S410, when the detected temperature meets the first scenario and there is only one firmware program programmed in the normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged; where the first scenario is that the detected temperature continuously remains lower than the first temperature threshold;

[0078] Step S420, when the detected temperature meets the second scenario, the third scenario, and the sixth scenario, perform a refresh process on the corresponding firmware program; where the second scenario is that the detected temperature continuously remains between the first temperature threshold and the second temperature threshold, the third scenario is that the detected temperature continuously remains higher than the second temperature threshold, and the sixth scenario is that the detected temperature continuously remains higher than the first temperature threshold.

[0079] It should be noted that in the embodiments of the present invention, being lower than the first temperature threshold is considered low temperature, being between the first temperature threshold and the second temperature threshold is considered normal temperature, and being higher than the second temperature threshold is considered high temperature. That is, in the above embodiments, the first scenario is a low - temperature scenario, the second scenario is a normal - temperature scenario, the third scenario is a high - temperature scenario, and the sixth scenario is a normal - temperature and high - temperature switching scenario.

[0080] It should be noted that during the process of processing the firmware program according to the detected temperature and the preset temperature scenario division information, when the detected temperature meets the first scenario and there is only one firmware program programmed in the normal temperature environment in the NAND flash memory, the corresponding firmware program will be controlled to remain unchanged; wherein, the first scenario is that the detected temperature continuously drops below the first temperature threshold. When the detected temperature meets the second scenario, the third scenario, and the sixth scenario, the corresponding firmware program will be refreshed; wherein, the second scenario is that the detected temperature continuously lies between the first temperature threshold and the second temperature threshold, the third scenario is that the detected temperature continuously exceeds the second temperature threshold, and the sixth scenario is that the detected temperature continuously exceeds the first temperature threshold. Through the above technical solution, a relatively reasonable firmware program refresh process can be achieved in scenarios of low temperature, normal temperature, high temperature, or the switch between normal temperature and high temperature, thereby enhancing the data retention ability of the NAND flash memory.

[0081] In addition, in one embodiment, as Figure 8 shown, processing the firmware program according to the detected temperature and the preset temperature scenario division information may include, but is not limited to, step S430 and step S440.

[0082] Step S430, when the detected temperature meets the fourth scenario, the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in the normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged; wherein, the fourth scenario is that the detected temperature continuously drops below the second temperature threshold;

[0083] Step S440, when the detected temperature meets the fourth scenario, the detected temperature is higher than the first temperature threshold, and there is only one firmware program programmed in the low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged.

[0084] It should be noted that during the process of processing the firmware program according to the detected temperature and the preset temperature scenario division information, when the detected temperature meets the fourth scenario, the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in the normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged; wherein, the fourth scenario is that the detected temperature continuously drops below the second temperature threshold; when the detected temperature meets the fourth scenario, the detected temperature is higher than the first temperature threshold, and there is only one firmware program programmed in the low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged. Through the above technical solution, a relatively reasonable firmware program refresh process can be achieved in the scenario of switching between low temperature and normal temperature, thereby enhancing the data retention ability of the NAND flash memory.

[0085] In addition, in one embodiment, as Figure 9As shown, processing the firmware program according to the detected temperature and the preset temperature scenario division information may include, but is not limited to, step S450, step S460, and step S470.

[0086] Step S450, when the detected temperature meets the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in a low-temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program; wherein, the fifth scenario includes the detected temperature being less than the first temperature threshold, the detected temperature being between the first temperature threshold and the second temperature threshold, and the detected temperature being greater than the second temperature threshold.

[0087] Step S460, when the detected temperature meets the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in a normal-temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program.

[0088] Step S470, when the detected temperature meets the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is only one firmware program programmed in a low-temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged.

[0089] It should be noted that during the process of processing the firmware program according to the detected temperature and the preset temperature scenario division information, when the detected temperature meets the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in a low-temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program; wherein, the fifth scenario includes the detected temperature being less than the first temperature threshold, the detected temperature being between the first temperature threshold and the second temperature threshold, and the detected temperature being greater than the second temperature threshold; when the detected temperature meets the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in a normal-temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program; when the detected temperature meets the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is only one firmware program programmed in a low-temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged. Through the above technical solution, it is possible to achieve a more reasonable refresh process of the firmware program in scenarios of low-temperature, normal-temperature, and high-temperature switching, and improve the data retention ability of the NAND flash memory.

[0090] In addition, in an embodiment, as Figure 10 shown, processing the firmware program according to the detected temperature and the preset temperature scenario division information may include, but is not limited to, step S480 and step S490.

[0091] Step S480: When the detected temperature meets the fourth scenario, the detected temperature is lower than the first temperature threshold, and there is not only one firmware program programmed in the normal temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program;

[0092] Step S490: When the detected temperature meets the fourth scenario, the detected temperature is higher than the first temperature threshold, and there is not only one firmware program programmed in the low temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program.

[0093] It should be noted that during the process of processing the firmware program according to the detected temperature and the preset temperature scenario division information, when the detected temperature meets the fourth scenario, the detected temperature is lower than the first temperature threshold, and there is not only one firmware program programmed in the normal temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program; when the detected temperature meets the fourth scenario, the detected temperature is higher than the first temperature threshold, and there is not only one firmware program programmed in the low temperature environment in the NAND flash memory, perform a refresh process on the corresponding firmware program; through the above technical solution, it is also possible to achieve a more reasonable firmware program refresh process in the scenario of switching between low temperature and normal temperature, and improve the data retention ability of the NAND flash memory.

[0094] In addition, in one embodiment, as Figure 11 shown, processing the firmware program according to the detected temperature and the preset temperature scenario division information may include, but is not limited to, Step S500, Step S510, and Step S520.

[0095] Step S500: When the detected temperature meets the fifth scenario, the detected temperature is lower than the first temperature threshold, and there are not at least two firmware programs programmed in the low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged;

[0096] Step S510: When the detected temperature meets the fifth scenario, the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed in the normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged;

[0097] Step S520: When the detected temperature meets the fifth scenario, the detected temperature is higher than the second temperature threshold, and there is not only one firmware program programmed in the low temperature environment in the NAND flash memory, perform a refresh process on the firmware program.

[0098] It should be noted that, during the process of processing the firmware program according to the detected temperature and the preset temperature scenario division information, when the detected temperature meets the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are not at least two firmware programs programmed in the low-temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged; when the detected temperature meets the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed in the normal-temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged; when the detected temperature meets the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is not only one firmware program programmed in the low-temperature environment in the NAND flash memory, the firmware program is refreshed. Through the above technical solution, it is also possible to achieve a more reasonable firmware program refresh process in the scenarios of switching between low temperature, normal temperature, and high temperature, and improve the data retention ability of the NAND flash memory.

[0099] In addition, in one embodiment, as Figure 12 shown, when the detection time reaches the preset time threshold, after detecting the error correction code ECC of the firmware program, it may further include but is not limited to step S210.

[0100] Step S210, when the ECC does not reach the preset detection threshold, control the corresponding firmware program to remain unchanged.

[0101] It should be noted that when the detection time reaches the preset time threshold, after detecting the error correction code ECC of the firmware program, when the ECC does not reach the preset detection threshold, control the corresponding firmware program to remain unchanged. Detecting and processing the ECC of the firmware program and processing the firmware program based on the ECC make the processing of the firmware program more reasonable.

[0102] Exemplarily, as Figure 13 shown, the temperature is classified into: low temperature, normal temperature, and high temperature, where the temperature range of normal temperature is defined as A°C - B°C here. The basic principle of the solution of the embodiment of the present application is that electrons have different active states at different temperatures, that is, when programming the NAND flash memory at different temperatures, the distribution voltage of electrons is also different, and at different temperatures, within the same time, the speed of change of the distribution voltage of electrons is also different. By the eMMC making dot records of the temperature during the working time, the current scenario is judged: 1. Long-term low temperature; 2. Long-term normal temperature; 3. Long-term high temperature; 4. Switching between low temperature and normal temperature states; 5. Switching between low temperature, normal temperature, and high temperature states; 6. Switching between normal temperature and high temperature states.

[0103] As Figure 14As shown, for scenes 2, 3, and 6, when a backup is detected to have a problem, you can choose to refresh this backup without any restrictions. For scenes 1 and 4, and in a low temperature environment, when a backup is detected to have a problem, if this backup is currently the only backup programmed in a normal temperature environment, it will not be refreshed, otherwise it will be refreshed. For scene 4, in a normal temperature environment, when a backup is detected to have a problem, if this backup is currently the only backup programmed in a low temperature environment, it will not be refreshed, otherwise it will be refreshed. For scene 5, in a low temperature environment, when a backup is detected to have a problem, it should be ensured that after the refresh, the backup programmed at low temperature is less than or equal to 2. In a normal temperature environment, when a backup is detected to have a problem, it should be ensured that after the refresh, the backup programmed at normal temperature is less than or equal to 2. In a high temperature environment, when a backup is detected to have a problem, if this backup is currently the only backup programmed in a low temperature environment, it will not be refreshed, otherwise it will be refreshed. For scenarios 5 and 6, if the current trend is from high temperature to normal temperature, the backups that have been updated at high temperature should be updated again to ensure that most of the backups are programmed at normal temperature. In order to prevent the temperature from fluctuating around B℃, resulting in the state switching back and forth and increasing the number of erase / programming times of the NAND flash memory, the temperature is switched in the following way. When the temperature rises from a low temperature to B+5℃, it is considered to be a high temperature environment. When the temperature drops from a high temperature to B-5℃ and below, it is considered to have returned to normal temperature. Among them, ±5℃ is a variable offset. Targeted modifications are made according to the usage scenarios of different users. Similarly, the judgment of low temperature and normal temperature is also the same.

[0104] The embodiment of the present invention is aimed at the characteristics of NAND flash memory, and avoids the situation that the firmware program must go through a complex rereading process to read correctly. Through the embodiment of the present invention, the integrity of the firmware program can be effectively monitored. When a problem occurs in one of the backups, the software process can be optimized to avoid high-temperature programming or low-temperature programming in all firmware program backups. When it is programmed at high and low temperatures, if the temperature slowly changes to another extreme when the power is off, it is possible to read the firmware program error at this temperature, and it can be read normally when it returns to the programming temperature. Therefore, it is particularly important to reprogram the wrong firmware program at the right time. The embodiment of the present invention uses time and temperature as factors affecting data retention capacity, so that data refresh can be more reasonable. The embodiment of the present invention can also reduce the number of times NAND flash memory is erased / programmed, extend the service life of NAND, and be more suitable for switching back and forth between extreme conditions of low temperature and high temperature.

[0105] In some embodiments of the present invention, Figure 15As shown in the figure, an embodiment of the present invention further provides an electronic device 700, including: a memory 720, a processor 710, and a computer program stored on the memory 720 and executable on the processor 710. When the processor 710 executes the computer program, it implements the method for optimizing the data retention ability of NAND flash memory in the above embodiments. For example, it executes the Figure 1 method steps S100 to S400 in Figure 4 method steps S110 to S120 in Figure 7 method steps S410 to S420 in Figure 8 method steps S430 to S440 in Figure 9 method steps S450 to S470 in Figure 10 method steps S480 to S490 in Figure 11 method steps S500 to S520 in Figure 12 and method step S210 in

[0106] In some embodiments of the present invention, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, which are executed by a processor or a controller, for example, executed by a processor in the above device embodiments, so that the above processor can execute the method for optimizing the data retention ability of NAND flash memory in the above embodiments. For example, it executes the Figure 1 method steps S100 to S400 in Figure 4 method steps S110 to S120 in Figure 7 method steps S410 to S420 in Figure 8 method steps S430 to S440 in Figure 9 method steps S450 to S470 in Figure 10 method steps S480 to S490 in Figure 11 method steps S500 to S520 in Figure 12 and method step S210 in

[0107] Those of ordinary skill in the art will understand that all or some of the steps and systems disclosed in the above methods can be implemented as software, firmware, hardware, and their appropriate combinations. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or can be implemented as hardware, or can be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.

[0108] The above is a specific description of the preferred embodiment of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present invention.

Claims

1. A method for optimizing the data retention capability of NAND flash memory, characterized in that: Applied to an embedded multimedia card, the embedded multimedia card includes a controller and a NAND flash memory, the controller is connected to the NAND flash memory, the NAND flash memory includes a plurality of data blocks, each data block stores at least one firmware program, the method includes: When the embedded multimedia card switches from a working state to a dormant state, determining a detection time; When the detection time reaches a preset time threshold, detecting an error correction code (ECC) of the firmware program; When the ECC reaches a preset detection threshold, obtaining a detection temperature; According to the detected temperature and the preset temperature scene division information, controlling the firmware program to be refreshed or remain unchanged; The detection time is obtained according to a preset ECC setting value, and the preset ECC setting value includes a plurality of ECC thresholds that decrease in sequence and the difference between two adjacent ones decreases in sequence; The temperature scene division information includes a first temperature threshold and a second temperature threshold, the first temperature threshold is smaller than the second temperature threshold, and the controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information includes: When the detected temperature satisfies a first scenario and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; wherein the first scenario is that the detected temperature is continuously lower than the first temperature threshold; When the detected temperature satisfies the second scenario, the third scenario and the sixth scenario, the corresponding firmware program is refreshed; wherein the second scenario is that the detected temperature is continuously between the first temperature threshold and the second temperature threshold, the third scenario is that the detected temperature is continuously higher than the second temperature threshold, and the sixth scenario is that the detected temperature is continuously higher than the first temperature threshold.

2. The method for optimizing the data retention capability of NAND flash memory according to claim 1, characterized in that: The detection time is obtained by: Obtaining a first ECC threshold, a second ECC threshold, a third ECC threshold, a fourth ECC threshold, and a fifth ECC threshold; wherein the ECC setting value includes the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold, and the fifth ECC threshold; A first firmware detection time is determined according to the first ECC threshold; and a second firmware detection time is determined according to the second ECC threshold and the first ECC threshold; and a third firmware detection time is determined according to the third ECC threshold and the second ECC threshold; and a fourth firmware detection time is determined according to the fourth ECC threshold and the third ECC threshold; and a fifth firmware detection time is determined according to the fifth ECC threshold and the fourth ECC threshold; wherein the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time decrease in sequence, and the detection time includes the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time.

3. The method for optimizing the data retention capability of NAND flash memory according to claim 1, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies a fourth scenario and the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; wherein the fourth scenario is that the detected temperature is continuously lower than the second temperature threshold; In the case that the detected temperature satisfies the fourth scenario and the detected temperature is higher than the first temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged.

4. The method for optimizing the data retention capability of NAND flash memory according to claim 1, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; wherein the fifth scenario includes that the detected temperature is lower than the first temperature threshold, the detected temperature is between the first temperature threshold and the second temperature threshold, and the detected temperature is higher than the second temperature threshold; When the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, refreshing the corresponding firmware programs; When the detected temperature satisfies the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged.

5. The method for optimizing the data retention capability of NAND flash memory according to claim 3, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies the fourth scenario and the detected temperature is lower than the first temperature threshold, and when there is more than one firmware program programmed in a normal temperature environment in the NAND flash memory, refreshing the corresponding firmware program; When the detected temperature satisfies the fourth scenario and is higher than the first temperature threshold, and when there is more than one firmware program programmed in a low-temperature environment in the NAND flash memory, a refresh process is performed on the corresponding firmware program.

6. The method for optimizing the data retention capability of NAND flash memory according to claim 4, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are not at least two firmware programs programmed in a low temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; When the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; When the detected temperature satisfies the fifth scenario and is higher than the second temperature threshold, and when there is more than one firmware program programmed in a low-temperature environment in the NAND flash memory, the firmware program is refreshed.

7. The method for optimizing the data retention capability of NAND flash memory according to claim 1, characterized in that: In the case where the detection time reaches a preset time threshold, after detecting the error correction code ECC of the firmware program, the method further includes: In the case that the ECC does not reach a preset detection threshold, the corresponding firmware program is controlled to remain unchanged.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for optimizing the data retention capability of a NAND flash memory as claimed in any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium storing computer-executable instructions, characterized in that: When the computer executable instructions are executed by the control processor, the method for optimizing the data retention capability of NAND flash memory as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • ECC (Error Correction Code)-based flash memory particle repeated screening method, controller and medium

    CN116994631A