Data refresh method and electronic device
By monitoring the temperature of NAND Flash and querying the mapping table, the retention time is determined and the data is refreshed, thus solving the problem of inaccurate data retention in NAND Flash and ensuring the reliability of data and the accuracy of retention time.
Patent Information
- Application Number
- CN202511173021.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-08-21
AI Technical Summary
In existing technologies, the retention records and calculations of data in NAND Flash are inaccurate, making it difficult to guarantee data reliability.
By monitoring the temperature of NAND Flash and obtaining the temperature sequence, and using the mapping table between temperature and retention time to query the mapping parameters, the retention time of the target data is determined, and the data is refreshed in a timely manner when the remaining retention time is lower than the update threshold.
It ensures the reliability of data in NAND Flash, ensuring that data is stored in a reliable state and avoiding data loss due to charge leakage.
Smart Images

Figure CN120673813B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of storage, in particular to a data refresh method and an electronic device. BACKGROUND
[0002] After writing data into a NAND Flash, a bit inversion phenomenon occurs. In particular, as the writing time increases, a specific offset voltage is required for reading to successfully decode. The retention of data refers to the length of time that data can remain in a correct and readable state in the NAND Flash.
[0003] In related technologies, the recording and calculation of the retention of data are inaccurate. The accuracy of the retention of data is crucial for maintaining data reliability. Therefore, how to accurately obtain the retention time of data stored in a NAND Flash is a technical problem that needs to be solved by those skilled in the art. SUMMARY
[0004] The present application provides a data refresh method and an electronic device, which can obtain the retention time of data stored in a NAND Flash, and effectively maintain the reliability of data based on the retention time.
[0005] The present application provides a data refresh method, comprising:
[0006] In the case that target data is written into a NAND Flash, the NAND Flash is temperature-monitored to obtain a temperature sequence;
[0007] Mapping parameters of different temperatures in the temperature sequence are queried from a mapping table of temperature and retention time, and the retention time of the target data is determined by using a plurality of mapping parameters;
[0008] The retention time and storage time of the target data are used to determine a remaining retention time;
[0009] In the case that the remaining retention time is lower than an update threshold, the target data is refreshed.
[0010] The present application also provides a data refresh device, comprising:
[0011] A temperature sequence acquisition module is configured to, in the case that target data is written into a NAND Flash, temperature-monitor the NAND Flash to obtain a temperature sequence;
[0012] A retention time determination module is configured to query mapping parameters of different temperatures in the temperature sequence from a mapping table of temperature and retention time, and determine the retention time of the target data by using a plurality of mapping parameters;
[0013] a remaining retention time determination module configured to determine a remaining retention time of the target data by using the retention time and a storage time of the target data;
[0014] a data refreshing module configured to refresh the target data when the remaining retention time is lower than an update threshold.
[0015] The application further provides an electronic device, comprising a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of any of the data refreshing methods.
[0016] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the data refreshing methods.
[0017] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of any of the data refreshing methods.
[0018] In the application, the inversion of the bit of the data stored in the NVM causes the threshold voltage to drift, and the threshold voltage drift is closely related to the charge leakage, especially the amount of charge leakage. The amount of charge leakage is related to both time and temperature, so a mapping table of temperature and retention time can be established in advance in the application. When the target data is written into the NVM, the temperature of the NVM is monitored to obtain a temperature sequence. Then, the mapping parameters corresponding to the temperatures in the temperature sequence are queried from the mapping table of temperature and retention time, and the retention time of the target data is determined by using a plurality of mapping parameters. In this way, the remaining retention time of the target data can be determined by using the retention time and the storage time of the target data. Finally, the target data is refreshed when the remaining retention time is lower than an update threshold.
[0019] That is, in the application, when determining whether to refresh the target data, the remaining retention time is not determined based on a retention time that is always fixed and a storage time, but after the data is written, the temperature of the NVM is monitored to obtain a temperature sequence. Then, based on the mapping relationship between temperature and retention time, the mapping parameters corresponding to the temperature values in the temperature sequence are obtained, and the retention time of the target data is determined based on a plurality of mapping parameters. That is, the retention time changes with the change of temperature, so that the retention time matches the actual accumulation of the amount of charge leakage. In this way, the target data is refreshed based on the calculated remaining retention time, which can ensure that the data is not lost and the reliability is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described below only constitute some of the embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0021] Figure 1 A flowchart of a data refresh method provided by an embodiment of the present application;
[0022] Figure 2 A mapping table construction diagram between the retention time and the temperature provided by an embodiment of the present application;
[0023] Figure 3 A retention time compensation flowchart combined with offline time provided by an embodiment of the present application;
[0024] Figure 4 A flowchart of a data refresh method combined with a wear factor provided by an embodiment of the present application;
[0025] Figure 5 A schematic diagram of a data refresh device provided by an embodiment of the present application;
[0026] Figure 6 A structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0027] Figure 7 A specific structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the protection scope of the present application.
[0029] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device.
[0030] In order to make the skilled in the art better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0031] Please refer to Figure 1 The data refreshing method provided by the embodiment of the present application comprises the following steps.
[0032] S101, in the case of writing the target data into the Nand flash, temperature monitoring is performed on the Nand flash to obtain a temperature sequence.
[0033] In the embodiment, the target data itself is not limited, i.e., the target data can be images, videos, texts, log data and various data that need to be guaranteed to be stored reliably.
[0034] After the target data is written into the Nand flash, the ambient temperature of the Nand flash can be monitored to obtain a temperature sequence.
[0035] Specifically, a temperature collection time interval can be set, and a temperature value is collected every certain time interval to obtain a temperature sequence comprising a plurality of temperature values.
[0036] S102, mapping parameters of different temperatures in the temperature sequence are queried from a mapping table of temperature and retention time, and the retention time of the target data is determined based on the plurality of mapping parameters.
[0037] Since the bit inversion of the data stored in the Nand flash causes the threshold voltage to drift, the threshold voltage drift is closely related to the charge leakage, especially the amount of charge leakage. The amount of charge leakage is related to both time and temperature. Therefore, in the embodiment of the present application, a mapping table of temperature and retention time can be established in advance.
[0038] In the mapping table, mapping parameters of different temperatures and retention times can be saved. Of course, the temperature and the retention time can also be recorded in the mapping table.
[0039] After the temperature sequence is obtained, the mapping table can be queried according to different temperatures to obtain the mapping parameters corresponding to different temperatures. Then, the retention time of the target data is calculated based on the plurality of mapping parameters. For example, the retention time of the target data can be determined by using a segmented integration method.
[0040] In an embodiment of the present application, when determining the retention time, the last recorded retention time and its corresponding timestamp, or the last recorded remaining retention time and its corresponding timestamp, can be obtained. If the last recorded retention time and timestamp are obtained, only the corresponding retention difference between the last record and the current temperature acquisition can be calculated. The calculation method of the retention difference can be to obtain the mapping parameter of the current temperature and the retention time by looking up the table, then multiply the temperature and the mapping parameter to obtain the retention difference, and based on the last recorded retention time and the newly calculated retention difference, the retention time of the matching temperature sequence can be obtained. If the last record is the remaining retention time, the remaining retention time can be corrected based on the newly calculated retention difference, so as to obtain the latest remaining retention time. That is, the way of recording the timestamp, the retention time or the remaining retention time can only look up the mapping table once based on the latest temperature value to complete the update of the retention time or the remaining retention time.
[0041] In an embodiment of the present application, the temperature monitoring of the non-flash memory is performed to obtain the temperature sequence, including: timing by using a real-time clock module which is independent and has a power supply; and periodically collecting the temperature of the non-flash memory by using the temperature sensor in the real-time clock module to obtain the temperature sequence.
[0042] Considering that the conventional timing will fail after the non-flash memory is powered off, in the present embodiment, the timing can be performed by using a real-time clock module which is independent and has a power supply, and the temperature of the non-flash memory can be periodically collected based on the temperature sensor in the real-time clock module, so as to obtain the temperature sequence. For example, for a solid state disk with a non-flash memory, an independent real-time clock module (RTC) with a backup power supply can be set, and the RTC module always keeps timing regardless of whether the SSD is in a powered-on or offline state. When the SSD is offline, the RTC continuously records the time and keeps collecting the temperature. That is, the temperature sequence can include the temperature value in the offline state. In this way, when determining the retention time based on the temperature sequence, the leakage of the electric charge in the offline state is also considered, so that the retention time is more accurate.
[0043] In an embodiment of the present application, the temperature of the non-flash memory is periodically collected to obtain the temperature sequence, including: obtaining the data accuracy when the non-flash memory is in an offline state; and collecting the temperature of the non-flash memory according to the collection period corresponding to the data accuracy to obtain the temperature sequence. Since the accuracy requirements of the retention time are different in different scenarios, when collecting the temperature in the offline state, the temperature can be collected according to the collection period corresponding to the data accuracy. For example, only a single temperature can be used to represent the temperature condition of the entire offline stage, or multiple temperatures collected at different time points can be used to represent the temperature condition of the entire offline stage.
[0044] In one specific embodiment of the present application, the mapping table is created by: writing test data into the NAND flash at different test environment temperatures, and collecting the charge leakage and threshold voltage of the memory cell, the test data being at a threshold voltage drift limit corresponding to uncorrectable errors; determining the mapping relationship between the charge leakage rate and the temperature using the test environment temperature, the charge leakage and the threshold voltage, and combining the quantitative relationship between the reaction rate constant and the temperature; determining the mapping parameters of different temperatures and retention times based on the threshold voltage drift limit, the mapping relationship, and the proportional coefficient of the threshold voltage drift and the charge leakage; and establishing the mapping table based on the mapping parameters.
[0045] In one specific embodiment of the present application, the test data is written into the NAND flash at different test environment temperatures, including: writing test data of a specified mode into a plurality of NAND flash of the same model placed in different constant temperature environments.
[0046] A temperature-dependent retention time model can be established first. For example, a relationship model between the temperature and the charge leakage rate in the NAND flash can be established according to the Arrhenius equation (i.e., the quantitative relationship between the reaction rate constant and the temperature). where k is the reaction rate constant (in this embodiment, specifically the charge leakage rate), A is the pre-exponential factor, Ea is the activation energy, k B is the Boltzmann constant, and T is the absolute temperature. The charge leakage data of the NAND flash memory cell at different temperatures can be obtained through experiments, and the A and Ea values for a specific NAND flash model can be fitted to determine the specific functional relationship k(T) between the charge leakage rate k and the temperature T.
[0047] Considering that the data retention time (t retention ) is related to the threshold voltage drift caused by charge leakage, it is assumed that the threshold voltage drift ΔV t is proportional to the charge leakage, and when ΔV t reaches a certain threshold ΔV t-threshold , the test data has uncorrectable errors, i.e., reaches retention failure. Let the initial charge of the memory cell be Q0, the charge leakage per unit time be q=k(T)Q0, and after time t, the charge leakage Q leak =qt=k(T)Q0t, and the corresponding threshold voltage drift ΔV t =αQ leak (α is the proportional coefficient). When ΔV t =ΔV t-threshold , t retentionThe function relationship with temperature T (i.e., the quantitative relationship between the reaction rate constant and the temperature): .
[0048] Specifically, please refer to Figure 2 , the implementation steps of the temperature-related retention time model are as follows.
[0049] Step 1, prepare a batch of NAND Flash memory chip samples of the same model, and place them in different constant temperature environments, covering the temperature range that the SSD may encounter in actual application, such as -20℃ to 85℃, and set a temperature point every certain temperature interval (for example, 5℃, of course, other values can also be set, such as 10℃, 1℃, etc., which can be set and adjusted according to actual precision requirements).
[0050] Step 2, perform data write operations on the NAND Flash samples at each temperature point, write test data of a specified mode (such as all 0, all 1, random data, etc.), and then use charge measurement equipment and threshold voltage detection instruments to measure the charge leakage and threshold voltage changes of the storage unit at regular intervals, and record the changes of the data over time.
[0051] Step 3, according to the measured data, substitute into the Arrhenius equation , use a nonlinear fitting algorithm (such as the least squares method) to fit A and E a values for each NAND Flash sample. Statistical analysis of multiple sets of sample data can take the average, median or mode as the A and E a parameter values of the NAND Flash of this model, thereby determining the function relationship k(T) between the charge leakage rate k and the temperature T.
[0052] Step 4, determine the threshold voltage drift ΔV t-threshold when the data has uncorrectable errors, and the proportionality coefficient α of the threshold voltage drift ΔV t and the charge leakage, combine k(T) obtained above to calculate the data retention time at different temperatures: , and store these data in a lookup table for subsequent quick query and calculation. For example, these data can be stored in the lookup table (LUT) inside the host chip of the SSD.
[0053] The retention time refers to the maximum time length that the target data can be saved while ensuring data reliability after being stored in the current location.
[0054] S103, determine the remaining retention time using the retention time and the storage time of the target data.
[0055] In the embodiment, after the target data is written, the storage time for the target data can be started, i.e., how long the target data has been written to the current position is recorded.
[0056] The remaining retention time is determined by subtracting the storage time from the retention time. It should be noted that the remaining retention time refers to the time length during which the target data can be accurately read out and continued to be stored at the current position.
[0057] S104, in the case where the remaining retention time is lower than the update threshold, refreshing the target data.
[0058] In order to ensure the safety and reliability of the data, in the embodiment, an update threshold can be set, and in the case where the remaining retention time is lower than the update threshold, the target data can be refreshed, so as to ensure that the data is not lost.
[0059] The refreshed data can be directly read out and written to the original address, or the target data can be read out and written to a new address (i.e., the target data is migrated).
[0060] In one specific embodiment of the present application, the remaining retention time is determined by using the retention time and the storage time of the target data, including: obtaining the online time after the non-flash memory stores the target data; obtaining the offline time after the non-flash memory stores the target data; calculating the retention difference in the offline state based on the mapping table; updating the retention time to the difference between the retention time and the retention difference; and determining the remaining retention time based on the updated retention time, the online time and the offline time.
[0061] In the embodiment, different states can be timed separately, i.e., the timing in the online state is called online timing, and the timing in the offline state is called offline timing. After the target data is stored, the online timing and the offline timing can be obtained according to different situations. For the offline state, the charge leakage also occurs continuously, so after the retention time is determined, the retention difference in the offline state can be calculated based on the mapping table, then the retention time is updated to the difference between the retention time and the retention difference, and then the remaining retention time is calculated based on the updated retention time, the online timing and the offline timing.
[0062] For example, before power failure, the latest determined retention time can be recorded, the offline timing and the mapping table are used to determine the corresponding retention time difference in the offline state, then the retention time recorded before the power failure is subtracted by the retention time difference, and then the online time and the offline time are subtracted, which is the remaining retention time.
[0063] Or, before power-off, the latest determined remaining retention time can be recorded, and based on offline timing and mapping table, the corresponding retention time difference in offline state can be determined, then the last recorded remaining retention time before power-off is subtracted by the retention time difference, and then subtracted by offline time, which is the current latest remaining retention time.
[0064] In a specific embodiment of the present application, it includes: determining offline time in the case of power-on of the solid state disk to which the non-flash belongs; obtaining the last saved historical retention time of the solid state disk before offline; obtaining the offline temperature sequence corresponding to the offline time; querying the mapping parameters of different temperatures in the offline temperature sequence, and determining the retention difference in the offline time by using a plurality of mapping parameters; calculating the difference value of the historical retention time and the retention difference; determining the difference value as the retention time; and using the retention time for data storage management of the solid state disk.
[0065] In the embodiment, the retention time and temperature uncertainty in offline state can be considered comprehensively. Specifically, a separate real-time clock module (RTC, Real-Time Clock) with a backup power supply is set in the SSD, and the RTC module always keeps timing whether the SSD is in power-on or offline state. When the SSD is offline, the RTC continuously records the time. Assuming that the offline time of the SSD is t offline After the SSD is powered on again, the offline time information recorded by the RTC is read by the host chip.
[0066] When the SSD is powered on each time, the current environment temperature T current is obtained by the internal temperature sensor, and the reduction amount (i.e. retention difference) of the data retention time corresponding to the temperature T retention (T) during offline is calculated according to the temperature-related retention time model t current (T) established above: Where t retention-remaining is the remaining retention time calculated according to the last power-on.
[0067] It can be assumed that the temperature during offline is constant as T current , if more accurate calculation is needed, the temperature recording function can be added in the RTC module, and the temperature is recorded once every certain time, and then the is calculated by integration: Where t1 and t2 are the start and end times of offline respectively, T(t) is the temperature function changing with time, and t retention-remaining (t) is the remaining retention time function changing with time.
[0068] Specifically, please refer to Figure 3In practical applications, offline retention time compensation can be achieved by performing the following steps.
[0069] Step 1, in the hardware design of SSD, a separate real-time clock module (RTC) can be integrated, and a backup power supply (such as a button cell) is provided to ensure that the RTC can continue to work during power failure of the SSD. The RTC is connected to the main control chip of the SSD through a communication interface such as I2C or SPI, so that the main control chip can read the time information recorded by the RTC.
[0070] Step 2, when the SSD is powered on each time, the main control chip first reads the current time t current-rtc recorded by the RTC, compares it with the RTC time t last-rtc recorded at the last power-on, and calculates the offline time:
[0071] t offline =t current-rtc -t last-rtc 。
[0072] Step 3, at the same time, the main control chip obtains the current environment temperature T current through the internally integrated temperature sensor, and according to the temperature-related retention time model t retention (T) established in the foregoing, obtains t retention (T current ) from the LUT.
[0073] Step 4, assuming that the remaining retention time of the data calculated at the last power-on is t retention-remaining-last , the reduction Δt retention-offline of the data retention time during the offline period is calculated as follows.
[0074] If the simplified assumption (the temperature during the offline period is constant as Tcurrent) is adopted, then: 。
[0075] If a more accurate calculation (considering the temperature change during the offline period) is adopted, the RTC module records the temperature T i at certain time intervals (such as 1 minute) each time (i=1, 2, ⋯, n, n is the number of temperature points recorded during the offline period), then: , where Δt i is the time interval between adjacent two temperature records, and t retention-remaining (t i ) is the remaining retention time at the corresponding time point t i (which can be estimated by linear interpolation or the like).
[0076] Step 5, the main control chip compensates the retention time according to the calculated retention difference Δt retention-offline, update the remaining Retention time t of the current data retention-remaining = t retention-remaining-last - Δt retention-offline , and record the new remaining Retention time (t retention-remaining ) and the current RTC time for the next power-on calculation.
[0077] In one specific embodiment of the present application, in the case where the remaining Retention time is lower than the update threshold, refreshing the target data includes: obtaining the number of program-erase times of the non-flash memory; determining a wear correction factor using the number of program-erase times; correcting the remaining Retention time using the wear correction factor; and refreshing the target data in the case where the corrected remaining Retention time is lower than the update threshold.
[0078] In one specific embodiment of the present application, in the case where the remaining Retention time is lower than the update threshold, refreshing the target data includes: obtaining the number of program-erase times of the non-flash memory; determining a wear correction factor using the number of program-erase times; correcting the remaining Retention time using the wear correction factor; and refreshing the target data in the case where the corrected remaining Retention time is lower than the update threshold.
[0079] That is, when considering the influence of NAND Flash wear on Retention time, the relationship between the wear degree of NAND Flash and the number of P / E cycles can be established. Let the number of P / E cycles be N, and define a wear function W(N). This function can be obtained by fitting experimental data, for example: (where a, b, and c are fitting coefficients), and the larger the value of W(N), the higher the wear degree.
[0080] A wear correction factor f(W) is introduced to adjust the data Retention time. Assuming that the higher the wear degree, the more obvious the shortening of the data Retention time, f(W) can be defined as (where β is a correction coefficient).
[0081] Correspondingly, the actual data Retention time t retention-actual after wear is: , that is, .
[0082] For reference Figure 4 In actual application, the implementation steps considering the NAND Flash wear correction factor include the following steps.
[0083] Step 1: In the main control chip of the SSD, a counter is set to record the number of P / E cycles N of the NAND Flash. After each complete Program and Erase operation of the NAND Flash, the value of the counter is incremented by 1.
[0084] Step 2, according to the wear function established before The master chip calculates the current wear degree W(N) periodically (for example, every certain number of P / E cycles, such as 100 times).
[0085] Step 3, according to the definition of the wear correction factor The current wear correction factor f(W) is calculated. The value of β can be tested by experiments. By comparing the actual data retention time with the calculated value without considering wear at different wear degrees, a suitable β is found, so that the calculated value considering the wear correction is closest to the actual situation.
[0086] Step 4, when the actual data retention time needs to be calculated, the master chip first queries tretention(Tcurrent) from the LUT according to the current environment temperature Tcurrent, and then calculates the actual data retention time tretention-actual considering wear by combining the calculated wear correction factor f(W).
[0087] Step 5, the master chip adjusts the data storage management strategy of the SSD according to the calculated tretention-actual. For example, when tretention-actual is lower than a certain threshold, the data refresh or migration operation is triggered in advance to ensure the reliability of the data.
[0088] The bit inversion of the data stored in the non-flash memory causes the threshold voltage to drift, and the threshold voltage drift is closely related to the charge leakage, especially the amount of charge leakage. The amount of charge leakage is related to both time and temperature, so in this application, a mapping table of temperature and retention time can be established in advance. In the case of writing target data into the non-flash memory, the temperature of the non-flash memory is monitored to obtain a temperature sequence. Then, the mapping parameters of different temperatures in the temperature sequence are queried from the mapping table of temperature and retention time, and the retention time of the target data is determined using a plurality of mapping parameters. In this way, the retention time and the storage time of the target data can be used to determine the remaining retention time. Finally, in the case where the remaining retention time is lower than the update threshold, the target data is refreshed.
[0089] That is, in the present application, when determining whether to refresh the target data, instead of determining the remaining retention time based on a fixed retention time and storage time, a temperature sequence is obtained by monitoring the temperature of the Nand flash after the data is written. Then, based on the mapping relationship between the temperature and the retention time, the mapping parameters corresponding to the temperature values in the temperature sequence are obtained, and the retention time of the target data is determined based on the mapping parameters. That is, the retention time changes with the change of the temperature, so that the retention time matches the actual charge leakage accumulation. In this way, the target data is refreshed based on the calculated remaining retention time, which can ensure that the data is not lost and the reliability is ensured.
[0090] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.
[0091] Please refer to Figure 5 The embodiments of the present application also provide a data refresh device, which comprises:
[0092] The temperature sequence acquisition module 101 is configured to monitor the temperature of the Nand flash when the target data is written into the Nand flash, and obtain a temperature sequence;
[0093] The retention time determination module 102 is configured to query the mapping parameters of different temperatures in the temperature sequence from a mapping table of the temperature and the retention time, and determine the retention time of the target data by using the mapping parameters.
[0094] The remaining retention time determination module 103 is configured to determine the remaining retention time by using the retention time and the storage time of the target data.
[0095] The data refresh module 104 is configured to refresh the target data when the remaining retention time is lower than the update threshold.
[0096] The device provided in the embodiment of the present application reverses the bits of the data stored in the AND flash memory, so that the threshold voltage drifts, and the threshold voltage drift is closely related to the charge leakage, especially the amount of charge leakage. The amount of charge leakage is related to both time and temperature, so a mapping table of temperature and retention time can be established in advance in the present application. In the case of writing target data into the AND flash memory, the temperature of the AND flash memory is monitored to obtain a temperature sequence. Then, the mapping parameters corresponding to the different temperatures in the temperature sequence are queried from the mapping table of temperature and retention time, and the retention time of the target data is determined by using a plurality of mapping parameters. In this way, the remaining retention time can be determined by using the retention time and the storage time of the target data. Finally, in the case that the remaining retention time is lower than the update threshold, the target data is refreshed.
[0097] That is, in the present application, when determining whether to refresh the target data, the remaining retention time is not determined based on a fixed retention time and storage time, but after the data is written, the temperature of the AND flash memory is monitored to obtain a temperature sequence. Then, based on the mapping relationship between temperature and retention time, the mapping parameters corresponding to the temperature values in the temperature sequence are obtained, and the retention time of the target data is determined based on a plurality of mapping parameters. That is, the retention time changes with the change of temperature, so that the retention time matches the actual charge leakage accumulation. In this way, the target data is refreshed based on the calculated remaining retention time, which can ensure that the data is not lost and the reliability is ensured.
[0098] In a specific embodiment of the present application, the mapping table creation module is configured to create a mapping table, including: writing test data into the AND flash memory under different test environment temperatures, and collecting the charge leakage amount and the threshold voltage of the storage unit, the test data being at a threshold voltage drift limit corresponding to an uncorrectable error; determining the mapping relationship between the charge leakage rate and the temperature by using the test environment temperature, the charge leakage amount and the threshold voltage, and combining the quantitative relationship between the reaction rate constant and the temperature; determining the mapping parameters of different temperatures and retention times based on the threshold voltage drift limit, the mapping relationship, and the proportion coefficient of the threshold voltage drift amount and the charge leakage amount; and establishing the mapping table based on the mapping parameters.
[0099] In a specific embodiment of the present application, the mapping table creation module is specifically configured to write test data of a specified mode into a plurality of AND flash memories of the same model placed in different constant temperature environments.
[0100] In a specific embodiment of the present application, the temperature sequence acquisition module is specifically configured to use an independent real-time clock module with a power supply to time; and use a temperature sensor in the real-time clock module to periodically collect the temperature of the AND flash memory to obtain a temperature sequence.
[0101] In an embodiment of the present application, the temperature sequence acquisition module is specifically configured to acquire data precision when the non-flash memory is in an offline state; and collect the temperature of the non-flash memory according to a collection period corresponding to the data precision to obtain a temperature sequence.
[0102] In an embodiment of the present application, the remaining retention time determination module is specifically configured to acquire online timing after the non-flash memory stores the target data; acquire offline timing after the non-flash memory stores the target data; calculate a retention difference in the offline state based on the mapping table; update the retention time to a difference between the retention time and the retention difference; and determine the remaining retention time based on the updated retention time, the online timing and the offline timing.
[0103] In an embodiment of the present application, the data refreshing module is specifically configured to acquire the number of program-erase times of the non-flash memory; determine a wear correction factor based on the number of program-erase times; correct the remaining retention time based on the wear correction factor; and refresh the target data when the corrected remaining retention time is lower than an update threshold.
[0104] In an embodiment of the present application, the data refreshing module is specifically configured to calculate a wear degree corresponding to the number of program-erase times based on a wear function fitted based on experimental data; and obtain the wear correction factor by multiplying the wear degree by a preset correction coefficient.
[0105] In an embodiment of the present application, the data refreshing device further comprises a hard disk power-on module configured to determine offline time when the non-flash memory is powered on; acquire a historical retention time saved last time before the solid state disk is powered off; acquire an offline temperature sequence corresponding to the offline time; query mapping parameters of different temperatures in the offline temperature sequence, and determine a retention difference in the offline time based on the mapping parameters; calculate a difference between the historical retention time and the retention difference; determine the retention time as the difference; and perform data storage management on the solid state disk based on the retention time.
[0106] The features of the embodiments of the data refreshing device can be referred to the related descriptions of the embodiments of the data refreshing method, which will not be repeated here.
[0107] Corresponding to the above method embodiments, the embodiments of the present application further provide an electronic device. The electronic device described below can be referred to the data refreshing method described above.
[0108] Referring to Figure 6 As shown in the figure, the electronic device comprises:
[0109] The memory 332 is configured to store a computer program.
[0110] The processor 322 is used to implement the steps of the data refresh method in the above method embodiment when executing a computer program.
[0111] For details, please refer to Figure 7 , Figure 7 This is a schematic diagram of the specific structure of an electronic device provided in this embodiment. The electronic device can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer programs 342 or data 344. The memory 332 can be temporary or permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the data processing device. Furthermore, the processor 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the electronic device 301.
[0112] Electronic device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0113] The steps in the data refresh method described above can be implemented by the structure of the electronic device.
[0114] Specifically, in electronic devices, the following steps can be implemented: when target data is written to non-flash memory, temperature monitoring is performed on the non-flash memory to obtain a temperature sequence; from a temperature-retention time mapping table, the mapping parameters for different temperatures in the temperature sequence are queried, and the retention time of the target data is determined using several mapping parameters; the remaining retention time is determined using the retention time and the storage time of the target data; and the target data is refreshed when the remaining retention time is lower than the update threshold.
[0115] In one specific embodiment of this application, creating a mapping table includes: writing test data into NAND flash memory at different test ambient temperatures, and collecting the charge leakage and threshold voltage of the storage cells, wherein the test data is at the threshold voltage drift limit corresponding to an uncorrectable error; using the test ambient temperature, charge leakage, and threshold voltage, and combining the quantitative relationship between the reaction rate constant and temperature, determining the mapping relationship between charge leakage rate and temperature; based on the threshold voltage drift limit, the mapping relationship, and the proportional coefficient between threshold voltage drift and charge leakage, determining the mapping parameters for different temperatures and retention times; and establishing a mapping table based on the mapping parameters.
[0116] In one embodiment of the present application, the test data is written into the non-flash memory under different test environment temperatures, comprising: writing the test data of a specified mode into the non-flash memory in different constant temperature environments.
[0117] In one embodiment of the present application, the temperature of the non-flash memory is monitored to obtain a temperature sequence, comprising: timing by using a real-time clock module which is independent and has a power supply; periodically collecting the temperature of the non-flash memory by using a temperature sensor in the real-time clock module to obtain the temperature sequence.
[0118] In one embodiment of the present application, the temperature of the non-flash memory is periodically collected to obtain a temperature sequence, comprising: obtaining data accuracy when the non-flash memory is in an offline state; collecting the temperature of the non-flash memory according to a collection period corresponding to the data accuracy to obtain the temperature sequence.
[0119] In one embodiment of the present application, the remaining retention time is determined by using the retention time and the storage timing of the target data, comprising: obtaining online timing after the non-flash memory stores the target data; obtaining offline timing after the non-flash memory stores the target data; calculating a retention difference in the offline state based on a mapping table; updating the retention time to a difference between the retention time and the retention difference; and determining the remaining retention time by using the updated retention time, the online timing and the offline timing.
[0120] In one embodiment of the present application, the target data is refreshed when the remaining retention time is lower than an update threshold, comprising: obtaining a program-erase count of the non-flash memory; determining a wear correction factor by using the program-erase count; correcting the remaining retention time by using the wear correction factor; and refreshing the target data when the corrected remaining retention time is lower than the update threshold.
[0121] In one embodiment of the present application, the wear correction factor is determined by using the program-erase count, comprising: calculating a wear degree corresponding to the program-erase count by using a wear function fitted based on experimental data; and multiplying the wear degree by a preset correction coefficient to obtain the wear correction factor.
[0122] In one embodiment of the present application, further comprising: determining offline time when the non-flash memory is powered on; obtaining a historical retention time saved last time before the solid state disk is powered off; obtaining an offline temperature sequence corresponding to the offline time; querying mapping parameters of different temperatures in the offline temperature sequence, and determining a retention difference in the offline time by using a plurality of mapping parameters; calculating a difference between the historical retention time and the retention difference; determining the difference as the retention time; and performing data storage management on the solid state disk by using the retention time.
[0123] Corresponding to the above method embodiments, the embodiments of the present application also provide a readable storage medium. The readable storage medium described below can be referred to the data refreshing method described above. The embodiments of the present application also provide a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is configured to execute the steps of any of the above data refreshing method embodiments when running.
[0124] In an example embodiment, the computer readable storage medium described above can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0125] The embodiments of the present application also provide a computer program product, and the computer program product includes a computer program. The computer program is executed by a processor to implement the steps of any of the above data refreshing method embodiments.
[0126] The embodiments of the present application also provide another computer program product, and the computer program product includes a non-volatile computer readable storage medium. The non-volatile computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the above data refreshing method embodiments.
[0127] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are performed 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 the present application.
[0128] The principles and implementation modes of the present application are described by applying specific examples. The above description of the examples is only applicable to help understand the method and core idea of the present application. It should be noted that for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. A data refresh method, characterized in that, include: When the target data is written to non-flash memory, the temperature of the non-flash memory is monitored to obtain a temperature sequence; From the temperature-retention time mapping table, query the mapping parameters for different temperatures in the temperature sequence, and use several of the mapping parameters to determine the retention time of the target data; The remaining retention time is determined using the retention time and the storage time of the target data; If the remaining retention time is lower than the update threshold, refresh the target data; Creating the mapping table includes: Under different test ambient temperatures, test data is written to non-flash memory, and the charge leakage and threshold voltage of the memory cells are collected. The test data is at the threshold voltage drift limit corresponding to an uncorrectable error. Using the test environment temperature, the charge leakage amount, and the threshold voltage, and combining the quantitative relationship between the reaction rate constant and temperature, the mapping relationship between charge leakage rate and temperature is determined; Based on the threshold voltage drift limit, the mapping relationship, and the ratio coefficient of threshold voltage drift to charge leakage, the mapping parameters for different temperatures and residence times are determined. The mapping table is established based on the mapping parameters.
2. The method according to claim 1, characterized in that, Test data was written to both NAND and non-flash memory under different test ambient temperatures, including: Test data in a specified pattern will be written to multiple identical NAND flash memory chips placed in different constant temperature environments.
3. The method according to claim 1, characterized in that, Temperature monitoring is performed on the non-flash memory to obtain a temperature sequence, including: Timing is performed using a separate, powered real-time clock module; The temperature sequence is obtained by periodically collecting the temperature of the non-flash memory using the temperature sensor in the real-time clock module.
4. The method according to claim 3, characterized in that, Periodically collect the temperature of the non-flash memory to obtain the temperature sequence, including: When the non-flash memory is offline, the accuracy of the acquired data is determined. The temperature of the non-flash memory is collected according to the acquisition period corresponding to the data accuracy to obtain the temperature sequence.
5. The method according to claim 1, characterized in that, Determining the remaining retention time using the retention time and the storage time of the target data includes: The online timing is obtained after the target data is stored in non-flash memory; Obtain the offline timing after storing the target data in non-flash memory; The retention difference in the offline state is calculated based on the mapping table; The retention time is updated to the difference between the retention time and the retention difference; The updated retention time, online timer, and offline timer are used to determine the remaining retention time.
6. The method according to claim 1, characterized in that, If the remaining retention time is lower than the update threshold, refresh the target data, including: Obtain the number of programmable and non-flash memory write cycles; The wear correction factor is determined using the number of program erase / write cycles. The remaining retention time is corrected using the wear correction factor. If the corrected remaining retention time is lower than the update threshold, refresh the target data.
7. The method according to claim 6, characterized in that, Determining the wear correction factor using the number of program erase / write cycles includes: The wear degree corresponding to the number of programming erase / write cycles is calculated using the wear function obtained by fitting experimental data. The wear correction factor is obtained by multiplying the wear level by a preset correction coefficient.
8. The method according to any one of claims 1 to 7, characterized in that, Also includes: Determine the offline time when the solid-state drive (not associated with flash memory) is powered on; Obtain the last historical retention time of the solid-state drive before it went offline; Obtain the offline temperature sequence corresponding to the offline time; Query the mapping parameters of different temperatures in the offline temperature sequence, and use several of the mapping parameters to determine the retention difference within the offline time period; Calculate the difference between the historical retention time and the retention difference; The difference is determined as the retention time; The data storage management of the solid-state drive is performed using the retention time.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data refresh method as described in any one of claims 1 to 8 when executing the computer program.
Citation Information
Patent Citations
Method for refreshing memory
KR1020150057270A