Data protection method and device of FLASH memory, electronic equipment and storage medium

文档序号:1891636 发布日期:2021-11-26 浏览:17次 中文

阅读说明:本技术 Flash存储器的数据保护方法、装置、电子设备及存储介质 (Data protection method and device of FLASH memory, electronic equipment and storage medium ) 是由 邓玉良 殷中云 杨彬 庄伟坚 朱晓锐 于 2021-05-17 设计创作,主要内容包括:本发明提供了一种FLASH存储器的数据保护方法,所述FLASH存储器包括多个FLASH存储单元,所述方法包括:对各FLASH存储单元进行循环擦写测试,并记录擦写次数和每次擦写的时长;根据循环擦写测试结果建立各FLASH存储单元的数据磨损函数;根据各数据磨损函数分别建立数据磨损查找表,并将各所述数据磨损查找表存进相应的FLASH存储单元中;在对各FLASH存储单元擦写时记录擦写次数,并与其自身的数据磨损查找表进行对照评估数据磨损程度,将数据从高磨损的FLASH存储单元转移到低磨损的FLASH存储单元。本发明通过预估FLASH存储单元的磨损程度,提前将数据转移到低磨损的FLASH存储单元,保证了数据的安全。(The invention provides a data protection method of a FLASH memory, wherein the FLASH memory comprises a plurality of FLASH storage units, and the method comprises the following steps: carrying out a cyclic erasing test on each FLASH storage unit, and recording the erasing times and the erasing duration of each time; establishing a data wear function of each FLASH storage unit according to the cyclic erasing test result; respectively establishing a data wear lookup table according to each data wear function, and storing each data wear lookup table into a corresponding FLASH storage unit; and recording the erasing times when each FLASH storage unit is erased, comparing with a data abrasion lookup table of the FLASH storage unit to evaluate the data abrasion degree, and transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit. The invention transfers the data to the FLASH memory unit with low abrasion in advance by estimating the abrasion degree of the FLASH memory unit, thereby ensuring the safety of the data.)

1. A data protection method of a FLASH memory, wherein the FLASH memory comprises a plurality of FLASH storage units, and the method comprises the following steps:

carrying out a cyclic erasing test on each FLASH storage unit, and recording the erasing times and the erasing duration of each time;

establishing a data wear function of each FLASH storage unit according to the cyclic erasing test result;

respectively establishing a data wear lookup table according to each data wear function, and storing each data wear lookup table into a corresponding FLASH storage unit;

and recording the erasing times when each FLASH storage unit is erased, comparing with a data abrasion lookup table of the FLASH storage unit to evaluate the data abrasion degree, and transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit.

2. The method according to claim 1, wherein the performing a cyclic erasure test on each FLASH memory cell and recording the number of erasures and the duration of each erasure specifically comprises:

selecting a plurality of sectors of the FLASH storage unit as an erasing test area, respectively carrying out a cyclic erasing test on the erasing test area of each FLASH storage unit, and recording the erasing times and the erasing duration of each erasing.

3. The method of claim 1 wherein the data wear function of each FLASH memory cell is:

P(t)=EXP(-Ct)(0<t<T1);

P(t)=EXP(-Ct2)(T1<t<T2);

wherein, P is the total erasing duration, T is the erasing times, T1 is the turning point of the function curve from the linear change region to the nonlinear change region, and T2 is a point of the function curve in the nonlinear change region.

4. The data protection method of FLASH memory according to claim 3,

the recording of the erasing times when erasing each FLASH memory unit, and the evaluation of the data wear degree by comparing with the data wear lookup table of the FLASH memory unit, and the transferring of the data from the high-wear FLASH memory unit to the low-wear FLASH memory unit specifically comprise:

and respectively recording the erasing times when erasing the DATA storage area of each FLASH storage unit, performing comparison evaluation on the DATA abrasion degree of the DATA storage area with the DATA abrasion lookup table corresponding to each FLASH storage unit, and transferring the DATA of the FLASH storage unit in the nonlinear change area to the FLASH storage unit in the linear change area.

5. A data protection apparatus for a FLASH memory, the FLASH memory including a plurality of FLASH memory cells, the apparatus comprising:

the erasing test module is used for carrying out a cyclic erasing test on each FLASH storage unit and recording the erasing times and the erasing duration of each time;

the wear function module is used for establishing a data wear function of each FLASH storage unit according to the cyclic erasing test result;

the wear table module is used for respectively establishing data wear lookup tables according to each data wear function and storing each data wear lookup table into a corresponding FLASH storage unit;

and the evaluation and transfer module is used for recording the erasing times when each FLASH storage unit is erased, comparing the erasing times with the data abrasion lookup table of the FLASH storage unit to evaluate the data abrasion degree, and transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit.

6. The data protection device of the FLASH memory according to claim 5, wherein the erasure test module is specifically configured to:

selecting a plurality of sectors of the FLASH storage unit as an erasing test area, respectively carrying out a cyclic erasing test on the erasing test area of each FLASH storage unit, and recording the erasing times and the erasing duration of each erasing.

7. The data protection device of FLASH memory according to claim 5, wherein the data wear function of each FLASH memory cell is:

P(t)=EXP(-Ct)(0<t<T1);

P(t)=EXP(-Ct2)(T1<t<T2);

wherein, P is the total erasing duration, T is the erasing times, T1 is the turning point of the function curve from the linear change region to the nonlinear change region, and T2 is a point of the function curve in the nonlinear change region.

8. The data protection device of FLASH memory of claim 7, wherein said evaluation and transfer module is specifically configured to:

and respectively recording the erasing times when erasing the DATA storage area of each FLASH storage unit, performing comparison evaluation on the DATA abrasion degree of the DATA storage area with the DATA abrasion lookup table corresponding to each FLASH storage unit, and transferring the DATA of the FLASH storage unit in the nonlinear change area to the FLASH storage unit in the linear change area.

9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 4 when executing the computer program.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.

Technical Field

The present invention relates to the field of storage technologies, and in particular, to a data protection method and apparatus for a FLASH memory, an electronic device, and a storage medium.

Background

The development of computers is always accompanied by the continuous update of storage technology, which plays an increasingly important role and gradually becomes a bottleneck restricting the overall performance of the computer. Particularly, in the era of the rise of big data and cloud storage, the performance requirement of the system on the storage is higher and higher. The outstanding performance of FLASH as a memory is excellent, and the FLASH has the advantages of low production and manufacturing cost, shock resistance and magnetism resistance of a storage medium, nonvolatile data and the like.

When the system level application is carried out, a FLASH chip is generally adopted to form a medium for data storage of the main control chip. When the wear frequency of the FLASH memory unit reaches the service life, the data loss is likely to occur. This can cause errors in the reading of data by the FLASH chip after the chip is powered up again.

Currently, the industry mainly evaluates the wear degree of a chip memory unit according to a linear region in a board-level system, but the evaluation result is often not in accordance with the actual situation, and data cannot be well protected.

Disclosure of Invention

Aiming at the defects of the prior art, the invention provides a data protection method, a data protection device, electronic equipment and a storage medium of a FLASH memory, aiming at solving the problem that the stored data is lost due to the fact that the abrasion degree of a FLASH storage unit cannot be accurately estimated.

In order to solve the technical problems, the invention adopts the following technical scheme:

in a first aspect, a method for protecting data of a FLASH memory is provided, where the FLASH memory includes a plurality of FLASH memory cells, and the method includes:

carrying out a cyclic erasing test on each FLASH storage unit, and recording the erasing times and the erasing duration of each time;

establishing a data wear function of each FLASH storage unit according to the cyclic erasing test result;

respectively establishing a data wear lookup table according to each data wear function, and storing each data wear lookup table into a corresponding FLASH storage unit;

and recording the erasing times when each FLASH storage unit is erased, comparing with a data abrasion lookup table of the FLASH storage unit to evaluate the data abrasion degree, and transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit.

Wherein, the performing a cyclic erasing test on each FLASH memory unit and recording the erasing times and the erasing duration each time specifically comprises:

selecting a plurality of sectors of the FLASH storage unit as an erasing test area, respectively carrying out a cyclic erasing test on the erasing test area of each FLASH storage unit, and recording the erasing times and the erasing duration of each erasing.

The data wear function of each FLASH storage unit is as follows:

P(t)=EXP(-Ct)(0<t<T1);

P(t)=EXP(-Ct2)(T1<t<T2);

wherein, P is the total erasing duration, T is the erasing times, T1 is the turning point of the function curve from the linear change region to the nonlinear change region, and T2 is a point of the function curve in the nonlinear change region.

Wherein, recording the erasing times when erasing each FLASH memory unit, and comparing with the data abrasion lookup table to evaluate the data abrasion degree, and transferring the data from the high-abrasion FLASH memory unit to the low-abrasion FLASH memory unit specifically comprises:

and respectively recording the erasing times when erasing the DATA storage area of each FLASH storage unit, performing comparison evaluation on the DATA abrasion degree of the DATA storage area with the DATA abrasion lookup table corresponding to each FLASH storage unit, and transferring the DATA of the FLASH storage unit in the nonlinear change area to the FLASH storage unit in the linear change area.

In a second aspect, a data protection apparatus for a FLASH memory is provided, where the FLASH memory includes a plurality of FLASH memory cells, and the apparatus includes:

the erasing test module is used for carrying out a cyclic erasing test on each FLASH storage unit and recording the erasing times and the erasing duration of each time;

the wear function module is used for establishing a data wear function of each FLASH storage unit according to the cyclic erasing test result;

the wear table module is used for respectively establishing data wear lookup tables according to each data wear function and storing each data wear lookup table into a corresponding FLASH storage unit;

and the evaluation and transfer module is used for recording the erasing times when each FLASH storage unit is erased, comparing the erasing times with the data abrasion lookup table of the FLASH storage unit to evaluate the data abrasion degree, and transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit.

Wherein, the erasing test module is specifically used for:

selecting a plurality of sectors of the FLASH storage unit as an erasing test area, respectively carrying out a cyclic erasing test on the erasing test area of each FLASH storage unit, and recording the erasing times and the erasing duration of each erasing.

The data wear function of each FLASH storage unit is as follows:

P(t)=EXP(-Ct)(0<t<T1);

P(t)=EXP(-Ct2)(T1<t<T2);

wherein, P is the total erasing duration, T is the erasing times, T1 is the turning point of the function curve from the linear change region to the nonlinear change region, and T2 is a point of the function curve in the nonlinear change region.

Wherein the evaluation and transfer module is specifically configured to:

and respectively recording the erasing times when erasing the DATA storage area of each FLASH storage unit, performing comparison evaluation on the DATA abrasion degree of the DATA storage area with the DATA abrasion lookup table corresponding to each FLASH storage unit, and transferring the DATA of the FLASH storage unit in the nonlinear change area to the FLASH storage unit in the linear change area.

In a third aspect, an electronic device is provided, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of the first aspect when executing the computer program.

In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method according to any one of the first aspect.

The invention has the beneficial effects that:

the invention can estimate the service life of the FLASH storage unit in advance by carrying out the cyclic erasing test on each FLASH storage unit, recording the erasing times and the erasing duration of each FLASH storage unit, establishing the data abrasion function of each FLASH storage unit according to the cyclic erasing test result, respectively establishing the data abrasion lookup table according to each data abrasion function, storing each data abrasion lookup table into the corresponding FLASH storage unit, recording the erasing times when each FLASH storage unit is erased, and carrying out the comparison evaluation on the data abrasion lookup table and the data abrasion degree of the data abrasion lookup table, transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit, ensuring the safety of the data, balancing the loss of each FLASH storage unit and prolonging the service life.

Drawings

The detailed structure of the invention is described in detail below with reference to the accompanying drawings

Fig. 1 is a flow chart of a data protection method of a FLASH memory according to an embodiment of the present invention;

fig. 2 is a diagram of a data wear function of a FLASH memory unit according to an embodiment of the present invention;

fig. 3 is a block diagram of a data protection apparatus of a FLASH memory according to an embodiment of the present invention;

fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

In order to explain technical contents, structural features, and objects and effects of the present invention in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.

Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.

Referring to fig. 1, fig. 1 is a flow chart of a data protection method of a FLASH memory according to an embodiment of the present invention. As shown in fig. 1, a data protection method for a FLASH memory, where the FLASH memory includes a plurality of FLASH memory cells, includes:

and step S101, performing a cyclic erasing test on each FLASH storage unit, and recording the erasing times and the erasing duration of each time.

And step S102, establishing a data wear function of each FLASH storage unit according to the cyclic erasing test result.

Specifically, the data wear function is established by fitting the sum of the erasing time and the erasing time, i.e. the total erasing time, as the ordinate.

Step S103, respectively establishing data wear lookup tables according to the data wear functions, and storing the data wear lookup tables into corresponding FLASH storage units.

Specifically, the data wear lookup table is a set of points with horizontal coordinates of natural numbers on a corresponding data wear function, and the total erasing duration corresponding to the erasing times can be quickly found by reading the data wear lookup table, so that the data wear degree of the FLASH memory unit is evaluated.

And step S104, recording the erasing times when each FLASH storage unit is erased, comparing the erasing times with the data abrasion lookup table of the FLASH storage unit to evaluate the data abrasion degree, and transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit.

The invention has the beneficial effects that:

the invention can estimate the service life of the FLASH storage unit in advance by carrying out the cyclic erasing test on each FLASH storage unit, recording the erasing times and the erasing duration of each FLASH storage unit, establishing the data abrasion function of each FLASH storage unit according to the cyclic erasing test result, respectively establishing the data abrasion lookup table according to each data abrasion function, storing each data abrasion lookup table into the corresponding FLASH storage unit, recording the erasing times when each FLASH storage unit is erased, and carrying out the comparison evaluation on the data abrasion lookup table and the data abrasion degree of the data abrasion lookup table, transferring the data from the high-abrasion FLASH storage unit to the low-abrasion FLASH storage unit, ensuring the safety of the data, balancing the loss of each FLASH storage unit and prolonging the service life.

Further, the step S101 specifically includes:

in step S1011, multiple sectors of the FLASH memory unit are selected as erase test areas, and the erase test areas of the FLASH memory units are subjected to a cyclic erase test, and the number of times of erasing and writing and the time duration of each erasing and writing are recorded.

Specifically, the FLASH memory unit comprises a BOOT memory area, a DATA memory area, an erasure test area and a DATA wear lookup table area.

Further, and referring to fig. 2, fig. 2 is a data wear function diagram of a FLASH memory cell according to an embodiment of the present invention. As shown in fig. 2, the data wear function of each FLASH memory cell is:

P(t)=EXP(-Ct)(0<t<T1);

P(t)=EXP(-Ct2)(T1<t<T2);

wherein, P is the total erasing duration, T is the erasing times, T1 is the turning point of the function curve from the linear change region to the nonlinear change region, and T2 is a point of the function curve in the nonlinear change region. In fig. 2, the actual intersection point of the function T-T2 with the data wear function is P2, and P1 is the intersection point of the function T-T2 with the wear function currently evaluated in the industry as a linear change. The performance degradation change of the FLASH memory unit in the nonlinear change area is aggravated, the data erasing time is gradually increased, and the service life of the FLASH memory unit is greatly shortened.

Further, the step S104 specifically includes:

step S1041, when erasing and writing the DATA storage area of each FLASH memory unit, respectively recording the number of erasing and writing times, and performing comparison evaluation on the DATA wear degree of the DATA storage area with the DATA wear lookup table corresponding to each FLASH memory unit, and transferring the DATA of the FLASH memory unit in the nonlinear change area to the FLASH memory unit in the linear change area.

Referring to fig. 3, fig. 3 is a diagram illustrating a data protection apparatus for a FLASH memory according to an embodiment of the present invention. As shown in fig. 3, a data protection device for a FLASH memory, the FLASH memory including a plurality of FLASH memory cells, the device includes:

and the erasing test module 10 is used for performing a cyclic erasing test on each FLASH storage unit and recording the erasing times and the erasing duration of each time.

And the wear function module 20 is used for establishing a data wear function of each FLASH storage unit according to the cyclic erasing test result.

And the wear table module 30 is configured to respectively establish data wear lookup tables according to each data wear function, and store each data wear lookup table in a corresponding FLASH storage unit.

And the evaluation and transfer module 40 is used for recording the erasing times when each FLASH storage unit is erased, comparing the erasing times with the data wear lookup table of the FLASH storage unit to evaluate the data wear degree, and transferring the data from the high-wear FLASH storage unit to the low-wear FLASH storage unit.

Further, the erasure test module 10 is specifically configured to:

selecting a plurality of sectors of the FLASH storage unit as an erasing test area, respectively carrying out a cyclic erasing test on the erasing test area of each FLASH storage unit, and recording the erasing times and the erasing duration of each erasing.

Further, the data wear function of each FLASH memory cell is:

P(t)=EXP(-Ct)(0<t<T1);

P(t)=EXP(-Ct2)(T1<t<T2);

wherein, P is the total erasing duration, T is the erasing times, T1 is the turning point of the function curve from the linear change region to the nonlinear change region, and T2 is a point of the function curve in the nonlinear change region.

Further, the evaluation and transfer module 40 is specifically configured to:

and respectively recording the erasing times when erasing the DATA storage area of each FLASH storage unit, performing comparison evaluation on the DATA abrasion degree of the DATA storage area with the DATA abrasion lookup table corresponding to each FLASH storage unit, and transferring the DATA of the FLASH storage unit in the nonlinear change area to the FLASH storage unit in the linear change area.

Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 4, an electronic device includes:

memory 301, processor 302, bus 303, and computer programs stored on memory 301 and executable on processor 302, memory 301 and processor 302 being connected via bus 303. When the processor 302 executes the computer program, the data protection method of the FLASH memory in the foregoing embodiment is implemented. Wherein the number of processors may be one or more.

The Memory 301 may be a Random Access Memory (RAM) Memory or a non-volatile Memory (non-volatile Memory), such as a magnetic disk Memory. The memory 301 is for storing executable program code, and the processor 302 is coupled to the memory 301.

Further, the present invention also provides a computer-readable storage medium, which can be disposed in the data protection device of the FLASH memory in the foregoing embodiments, and the computer-readable storage medium can be the memory in the foregoing embodiment shown in fig. 4.

The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the data protection method of the FLASH memory in the foregoing embodiments. Further, the computer-readable storage medium may be various media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RAM, a magnetic disk, or an optical disk.

The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于非易失性存储装置的错误纠正的控制验证操作的方法及非易失性存储装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!