Flash memory data security storage method and device, electronic equipment and storage medium

By dividing the flash memory into ordinary and enhanced storage areas and using a target write mode to store data of different security levels, the problems of low data security and low read efficiency in flash memory are solved, achieving higher storage security and read efficiency.

CN120803370BActive Publication Date: 2025-12-23ARTMEM TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511254700.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-12-23
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

In existing technologies, flash memory data security is not high, and it is inefficient when reading data with different security levels.

Method used

The physical pages of the flash memory are divided into ordinary storage areas and enhanced storage areas to store data with different security levels. The target write mode is determined according to the type of flash memory. In particular, multi-level cell flash memory adopts a single-bit write mode to increase the number of data states in the enhanced storage area and reduce the bit error rate.

Benefits of technology

It improves the storage security and reading efficiency of flash memory data, reduces encoding and decoding complexity and reading latency, and enhances the reliability of data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803370B_ABST
    Figure CN120803370B_ABST
Patent Text Reader

Abstract

The application discloses a flash memory data security storage method and device, an electronic device and a storage medium, and relates to the technical field of flash memories. The method comprises the following steps: dividing a physical page in a data block of a flash memory into a normal storage area and an enhanced storage area; the enhanced storage area is used for storing first flash memory data, and the normal storage area is used for storing second flash memory data; the security level of the first flash memory data is higher than that of the second flash memory data; when the first flash memory data is stored, a target write mode is determined according to the type of the flash memory; wherein the target write mode is used for determining the number of data states in the enhanced storage area; when the type of the flash memory is a multi-layer storage unit flash memory, the target write mode is determined to be a single-bit write mode; the number of data states in the enhanced storage area is less than that in the normal storage area; and the first flash memory data to be stored is written into the enhanced storage area according to the target write mode. The method is beneficial to improving the storage security of flash memory data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of flash memory, and in particular to a flash memory data security storage method and device, an electronic device, and a storage medium. BACKGROUND

[0002] NAND Flash, also known as flash memory, is a widely used storage chip at present, and has excellent characteristics such as high speed and non-volatility. The internal part of the flash memory NAND Flash is to store data by storing electric charges, that is, the internal part of the flash memory NAND Flash actually represents data in the form of stored electric charges. In actual use, due to changes in various internal and external conditions, the number of stored electric charges will change, which will cause an increase in the number of data errors in the flash memory and a decrease in the security of the flash memory data. The same physical page of the flash memory may store different types of data, and these data have different functions and different security levels. The conventional data storage method does not consider the different requirements of the flash memory data in the page, but stores the flash memory data according to a unified security strength. It can be seen that the security of the conventional data storage method is not high, and in addition, different reading modes need to be switched when reading different flash memory data in the same page, which will cause a decrease in reading efficiency. Therefore, how to simply and efficiently improve the storage security of the flash memory data is a technical problem to be solved. SUMMARY

[0003] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, the present application provides a flash memory data security storage method and device, an electronic device, and a storage medium, which can use the ordinary storage area and the enhanced storage area divided in a physical page to respectively store flash memory data of different security levels, thereby improving the storage security of the flash memory data.

[0004] In a first aspect, an embodiment of the present application provides a flash memory data security storage method, including:

[0005] dividing a physical page in a data block of a flash memory into an ordinary storage area and an enhanced storage area; wherein the ordinary storage area and the enhanced storage area each include data pages of different types; the number and types of the data pages are determined by the type of the flash memory; the type of the flash memory is a multi-layer storage unit flash memory, or a three-layer storage unit flash memory, or a four-layer storage unit flash memory; the enhanced storage area is used to store first flash memory data, and the ordinary storage area is used to store second flash memory data; the security level of the first flash memory data is higher than that of the second flash memory data;

[0006] When the first flash data is stored, a target write mode is determined according to a type of the flash memory; wherein the target write mode is used to determine a number of data states in the enhanced storage area; the number of data states in the enhanced storage area is less than a number of data states in the normal storage area; when the type of the flash memory is a multi-layer storage unit flash, the target write mode is determined as a single-bit write mode;

[0007] The first flash data to be stored is written into the enhanced storage area according to the target write mode.

[0008] In a second aspect, an embodiment of the present application provides a flash data secure storage device, comprising at least one processor and a memory connected with the at least one processor in communication; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the flash data secure storage method according to any one of the embodiments of the first aspect.

[0009] In a third aspect, an embodiment of the present application provides an electronic device comprising the flash data secure storage device according to the embodiments of the second aspect.

[0010] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium storing computer executable instructions for causing a computer to perform the flash data secure storage method according to any one of the embodiments of the first aspect.

[0011] The embodiment of the present application comprises the following steps: first, dividing the physical pages in the data block of the flash memory into a normal storage area and an enhanced storage area; wherein, the normal storage area and the enhanced storage area both comprise different types of data pages; the number and type of the data pages are determined by the type of the flash memory; the type of the flash memory is a multi-layer storage unit flash memory, or a three-layer storage unit flash memory, or a four-layer storage unit flash memory; the enhanced storage area is used for storing first flash data, and the normal storage area is used for storing second flash data; the security level of the first flash data is higher than that of the second flash data; by dividing the physical pages in the data block of the flash memory into the normal storage area and the enhanced storage area, a space foundation is laid for subsequent regional storage of flash data with different security levels; then, when the first flash data is stored, a target write mode is determined according to the type of the flash memory; wherein, the target write mode is used to determine the number of data states in the enhanced storage area; the number of data states in the enhanced storage area is less than that in the normal storage area; when the type of the flash memory is a multi-layer storage unit flash memory, the target write mode is determined as a single-bit write mode; finally, the first flash data to be stored is written into the enhanced storage area according to the target write mode; the first flash data with a high security level is stored in the enhanced storage area according to the target write mode, so that the storage capacity in the enhanced storage area is reduced; by using the property of the flash memory that the storage capacity is exchanged for data storage reliability, the storage security of the flash data is further improved. That is to say, the scheme of the embodiment of the present application can store flash data with different security levels in the normal storage area and the enhanced storage area divided in the physical pages, which is beneficial to improve the storage security of the flash data.

[0012] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims. BRIEF DESCRIPTION OF DRAWINGS

[0013] Figure 1 is a structure schematic diagram of a flash memory provided by an embodiment of the present application;

[0014] Figure 2 is a flowchart of a flash data security storage method provided by an embodiment of the present application;

[0015] Figure 3 is a structure schematic diagram of a flash memory provided by an embodiment of the present application; Figure 2 is a flowchart of a specific method of step S130 in the method;

[0016] Figure 4 is a comparison schematic diagram of the storage states of the three-bit write mode and the single-bit write mode provided by an embodiment of the present application;

[0017] Figure 5 is a comparison diagram of the storage state of the three-bit write mode and the two-bit write mode provided by an embodiment of the present application;

[0018] Figure 6 is a hardware structure diagram of the flash data secure storage device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and embodiments.

[0020] It should be understood that, in the description of the present application, the orientation description, such as the orientation or position relationship indicated by up, down, front, back, left, right and the like, is based on the orientation or position relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element indicated must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application.

[0021] It should be noted that, in the description of the present application, although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that in the flowchart. In the description of the present application, the meaning of several is one or more, and the meaning of multiple is two or more. The description of “first”, “second” is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of indicated technical features.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.

[0023] First, some terms involved in the present application are explained:

[0024] Multi-Level Cell flash (MLC): each physical cell stores 2 bits, corresponding to 4 voltage levels. In order to split the 2 bits into independent logical pages, MLC further subdivides the same cell into two logical pages: the least significant bit page (LSB Page) and the most significant bit page (MSB Page).

[0025] Triple-Level Cell flash (TLC): also commonly referred to as TLC NAND. A TLC NAND flash device has 3 bits of data per cell, LSB (Least Significant Bit), CSB (Central Significant Bit), and MSB (Most Significant Bit). In a TLC (3 bit / cell) flash, a single physical cell is split into 3 logical pages. There are 3 types of pages, LSB Page, CSB Page, and MSB Page, based on the type of data stored. Most TLCs use one pass programming, where the LSB / CSB / MSB are programmed together. The low bit corresponds to the LSB, the middle bit corresponds to the CSB, and the high bit corresponds to the MSB.

[0026] Quad-Level Cell flash (QLC): Each physical cell holds 4 bits, so 16 different voltage levels are needed. Quad-Level Cell flash includes: Least Significant Bit Page (LSB Page), Next Least Significant Bit Page (CSB Page), Next Most Significant Bit (MSB Page), and Most Significant Bit Page (TSB Page).

[0027] The application provides a flash data security storage method, a flash data security storage device, an electronic device and a computer readable storage medium, and relates to the technical field of flash memory. The method comprises the following steps: dividing a physical page in a data block of a flash memory into a normal storage area and an enhanced storage area; the enhanced storage area is used for storing first flash data, and the normal storage area is used for storing second flash data; the security level of the first flash data is higher than that of the second flash data; when the first flash data is stored, a target write mode is determined according to the type of the flash memory; wherein the target write mode is used for determining the number of data states in the enhanced storage area; the number of data states in the enhanced storage area is less than that in the normal storage area; and the first flash data to be stored is written into the enhanced storage area according to the target write mode. The application is beneficial to improving the storage security of flash data.

[0028] The embodiments of the application will be further described below with reference to the drawings.

[0029] As shown in Figure 1 , Figure 1Fig. 1 is a structural diagram of a flash memory provided by an embodiment of the present application; the flash memory comprises a plurality of data blocks; each data block comprises a plurality of physical pages; each physical page comprises: a normal storage area and an enhanced storage area.

[0030] Those skilled in the art can understand that the system structure shown in the figure does not constitute a limitation on the embodiments of the present application, and can comprise more or fewer components than shown in the figure, or combine certain components, or different component arrangements.

[0031] The system embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.

[0032] Those skilled in the art can understand that the system architecture and application scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of system architecture and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0033] Based on the above system structure, the following proposes various embodiments of the flash data secure storage method of the present application.

[0034] In a first aspect, as shown in the figure, the flash data secure storage method can include but is not limited to steps S110 to S130. Figure 2

[0035] Step S110: dividing the physical pages in the data block of the flash memory into a normal storage area and an enhanced storage area; wherein the normal storage area and the enhanced storage area each comprise: different types of data pages; the number and type of data pages are determined by the type of the flash memory; the type of the flash memory is: a multi-layer storage cell flash memory, or a three-layer storage cell flash memory, or a four-layer storage cell flash memory; the enhanced storage area is used to store first flash data, and the normal storage area is used to store second flash data, the security level of the first flash data is higher than that of the second flash data.

[0036] Step S120: when storing the first flash data, determining a target write mode according to the type of the flash memory; wherein the target write mode is used to determine the number of data states in the enhanced storage area; the number of data states in the enhanced storage area is less than the number of data states in the normal storage area; when the type of the flash memory is a multi-layer storage cell flash memory, the target write mode is determined to be a single-bit write mode.

[0037] ​Step S130: writing the first flash data to be stored into the enhanced storage area according to the target write mode.

[0038] Further explanation of step S110.

[0039] Specifically, the type of the flash memory to which the flash data security storage method of the present application is applied includes multi-layer storage unit flash memory, three-layer storage unit flash memory, and four-layer storage unit flash memory. The number and type of data pages are determined by the type of the flash memory.

[0040] Specifically, when the type of the flash memory device is four-layer storage unit flash memory, the different types of data pages included in the four-layer storage unit flash memory include the most significant bit data page, the next most significant bit data page, the next least significant bit data page, and the least significant bit data page; a total of four types of data pages.

[0041] Specifically, when the type of the flash memory device is three-layer storage unit flash memory, the different types of data pages included in the three-layer storage unit flash memory include the most significant bit data page, the middle significant bit data page, and the least significant bit data page; a total of three types of data pages.

[0042] Specifically, when the type of the flash memory device is multi-layer storage unit flash memory, the different types of data pages included in the multi-layer storage unit flash memory include the most significant bit data page and the least significant bit data page; a total of two types of data pages.

[0043] It can be understood that different manufacturers need different data to be securely stored, and therefore, in practice, the flash data to be stored can be the first flash data with a higher security level or the second flash data with a lower security level, which can be determined by the user according to actual conditions. In an embodiment, the user can identify the first flash data and the second flash data using different security level flags according to actual needs, and then write the first flash data into the corresponding data enhanced area and the second flash data into the corresponding normal storage area according to the different security level flags. Alternatively, different write instructions can be used to write the first flash data into the corresponding data enhanced area and the second flash data into the corresponding normal storage area. Therefore, the present application does not specifically limit how to write the first flash data and the second flash data into the corresponding areas of the physical page.

[0044] Further explanation of step S120.

[0045] Specifically, the target write mode includes a single-bit write mode and a two-bit write mode. In the single-bit write mode, the number of data states in the enhanced storage area is 2; and in the two-bit write mode, the number of data states in the enhanced storage area is 4.

[0046] According to some embodiments of the present application, the step S120 of determining the target write mode according to the type of the flash memory comprises: when the type of the flash memory is a multi-layer storage unit flash memory, determining the target write mode as a single-bit write mode; when the type of the flash memory is a three-layer storage unit flash memory, determining the target write mode as a single-bit write mode or a two-bit write mode; and when the type of the flash memory is a four-layer storage unit flash memory, determining the target write mode as a single-bit write mode or a two-bit write mode. Thus, the target write mode of the data enhancement area is determined, which provides a reference for subsequent writing of the first flash data with a higher security level into the data enhancement area.

[0047] According to some embodiments of the present application, as shown in Figure 3 Further explanation of the step S130 is given, and the step S130 of writing the first flash data to be stored into the enhancement storage area according to the target write mode comprises but is not limited to the steps S131 and S132.

[0048] The step S131 of obtaining the first flash data to be stored.

[0049] The step S132 of writing the first flash data to be stored into the enhancement storage area when the target write mode is a single-bit write mode, so that the number of data states in the enhancement storage area is 2.

[0050] For example, as shown in Table 1 and Figure 4 For the TLC type of flash memory, the two data states in the enhancement storage area under the single-bit write mode are 111 and 101.

[0051] According to some embodiments of the present application, as shown in Figure 3 Further explanation of the step S130 is given, and the step S130 of writing the first flash data to be stored into the enhancement storage area according to the target write mode comprises but is not limited to the steps S131 and S133.

[0052] The step S131 of obtaining the first flash data to be stored.

[0053] The step S133 of writing the first flash data to be stored into the enhancement storage area when the target write mode is a two-bit write mode, so that the number of data states in the enhancement storage area is 4.

[0054] For example, as shown in Table 2 and Figure 5 For the TLC type of flash memory, the four data states in the enhancement storage area under the two-bit write mode are 111, 001, 010 and 100.

[0055] It can be understood that step S131 and step S132 are one embodiment of step S130, and step S131 and step S133 are another embodiment of step S130.

[0056] It should be noted that the normal write mode of the enhanced storage area is determined by the type of the flash memory. Specifically, when the type of the flash memory is: multi-layer storage unit flash, the normal write mode of the enhanced storage area is: two-bit write mode; when the type of the flash memory is: three-layer storage unit flash, the normal write mode of the enhanced storage area is: three-bit write mode; when the type of the flash memory is: four-layer storage unit flash, the normal write mode of the enhanced storage area is: four-bit write mode.

[0057] By step S130, the write mode of the enhanced storage area is switched from the normal write mode to the target write mode, so that the number of corresponding data states in the target write mode is less than the number of corresponding data states in the normal write mode. By reducing the data storage capacity of the flash memory, the data storage security is improved.

[0058] According to some embodiments of the present application, after the first flash data to be stored is written into the enhanced storage area according to the target write mode, the flash data security storage method further comprises: in the case of reading the first flash data from the enhanced storage area, determining the reading mode according to the target write mode; reading the first flash data from the enhanced storage area according to the reading mode. To ensure that the stored first flash data can be correctly read.

[0059] Through steps S110 to S130, first, the physical pages in the data block of the flash memory are divided into a normal storage area and an enhanced storage area; wherein the normal storage area and the enhanced storage area each include: different types of data pages; the number and type of data pages are determined by the type of the flash memory; the type of the flash memory is: a multi-layer storage cell flash memory, or a three-layer storage cell flash memory, or a four-layer storage cell flash memory; the enhanced storage area is used to store first flash data, and the normal storage area is used to store second flash data, the security level of the first flash data is higher than that of the second flash data; by dividing the physical pages in the data block of the flash memory into the normal storage area and the enhanced storage area, a space foundation is laid for subsequent regional storage of flash data of different security levels; then, when storing the first flash data, a target write mode is determined according to the type of the flash memory; wherein the target write mode is used to determine the number of data states in the enhanced storage area; the number of data states in the enhanced storage area is less than the number of data states in the normal storage area; the type of the flash memory is a multi-layer storage cell flash memory, and the target write mode is determined to be a single-bit write mode; finally, the first flash data to be stored is written into the enhanced storage area according to the target write mode; the first flash data with a high security level is stored in the data enhanced area according to the target write mode, so that the storage capacity in the data enhanced area is reduced, and the property of the flash memory that the storage capacity is exchanged for data storage reliability is utilized, to further improve the storage security of the flash data. That is to say, the scheme of the embodiment of the application can utilize the normal storage area and the enhanced storage area divided in the physical pages to respectively store flash data of different security levels, which is conducive to improving the storage security of the flash data.

[0060] It needs to be emphasized that the existing data security storage mode usually sets different check code rates for different areas in a page, and sets more check bits for the enhanced storage area and fewer check bits for the ordinary storage area. This mode sets different security attributes by adjusting the code rates of different code words in a physical page. However, such a data security storage mode has the following defects: first, the coding and decoding are complex: different coding methods are set for a physical page, and the page length and check bit length also need to be matched, and the coding mode used by different code words also needs to be recorded, which significantly increases the coding and decoding complexity and also increases the complexity of flash memory data management; second, the read delay is increased: the existing data security storage mode does not reduce the error code rate, and a high error code rate will increase the decoding delay, which is not suitable for some scenarios that require fast data recovery. The present application switches the write mode of the enhanced storage area from the normal write mode to the target write mode, so that the number of data states corresponding to the target write mode is less than the number of data states corresponding to the normal write mode; and the threshold voltage of these bits is increased, which significantly reduces the error code rate. Compared with the prior art, the present application has the following advantages: first, the coding and decoding complexity is low: the present application does not change the original ECC coding mode, and all code words in a physical page use the same coding method; second, the read delay is significantly reduced: in one embodiment, the storage unit of the enhanced storage area is switched from the multi-bit write mode to the single-bit write mode, the data security is improved, the error code rate is reduced, and the data recovery efficiency is greatly improved, which reduces the read delay.

[0061] According to some embodiments of the present application, after the physical page in the data block of the flash memory is divided into the ordinary storage area and the enhanced storage area, the flash data security storage method further includes but is not limited to steps S210 to S220.

[0062] Step S210: when storing the second flash data, determining a normal write mode according to the type of the flash memory; wherein the normal write mode is used to determine the number of data states in the ordinary storage area.

[0063] Step S220: writing the second flash data to be stored into the ordinary storage area according to the normal write mode.

[0064] According to some embodiments of the present application, step S210 is further explained, wherein determining the normal write mode according to the type of the flash memory includes: when the type of the flash memory is a multi-layer storage unit flash memory, determining the normal write mode as a two-bit write mode; when the type of the flash memory is a three-layer storage unit flash memory, determining the normal write mode as a three-bit write mode; and when the type of the flash memory is a four-layer storage unit flash memory, determining the normal write mode as a four-bit write mode.

[0065] Specifically, for the multi-layer storage unit flash memory, the regular write mode adopted when writing the second flash data into the normal storage area is the two-bit write mode; the target write mode adopted when writing the first flash data into the enhanced storage area is the single-bit write mode.

[0066] Specifically, for the three-layer storage unit flash memory, the regular write mode adopted when writing the second flash data into the normal storage area is the three-bit write mode; the target write mode adopted when writing the first flash data into the enhanced storage area is the single-bit write mode or the two-bit write mode.

[0067] Specifically, for the four-layer storage unit flash memory, the regular write mode adopted when writing the second flash data into the normal storage area is the four-bit write mode; the target write mode adopted when writing the first flash data into the enhanced storage area is the single-bit write mode or the two-bit write mode.

[0068] By steps S210 to S220, the second flash data with a lower security level is stored into the normal storage area in the regular write mode, so as to realize the partition storage and store the flash data with different security levels respectively, which is beneficial to improve the storage security of the flash data.

[0069] Taking a TLC block of a TLC type flash memory as an example, the flash data security storage method provided by the embodiments of the present application is specifically explained.

[0070] Step S301, for the TLC type flash memory, data in a physical block block is erased.

[0071] Step S302, when writing a certain physical page in the block, the space of the physical page is divided into a normal storage area and an enhanced storage area.

[0072] Step S303, when writing the normal storage area, the second flash data with a lower security level is written into the normal storage area according to the normal TLC data regular write mode (i.e. the three-bit write mode). In the three-bit write mode, the storage state in the normal storage area is as shown in Table 1.

[0073] Table 1

[0074]

[0075] Step S304, when writing the enhanced storage area, the LSB page, the CSB page and the MSB page of the TLC are written according to a certain rule, that is, the LSB page is written first, then the CSB page, and finally the MSB page. When the target writing mode is the single-bit writing mode, the first flash data with a higher security level is written into the enhanced storage area according to the single-bit writing mode, wherein the CSB page writes normal data, and the LSB page and the MSB page in the enhanced storage area write 0xff data. That is to say, the user data to be actually stored is written to the CSB page; and before writing the CSB page, the LSB page to which the same cell belongs is written with all 0xFF (i.e., "empty" or "1" state); and the corresponding MSB page is also filled with 0xFF (i.e., "empty" or "1" state). Thus, of the three pages of the whole memory cell Cell, only the CSB page is real data, and the other two pages are "placeholder empty values". When the LSB page and the MSB page are written with "1" state in the single-bit writing mode, the storage state in the enhanced storage area is as shown in Table 2.

[0076] Table 2

[0077]

[0078] Step S304, when reading the data stored in the normal storage area, the data is read according to the normal TLC block data reading method.

[0079] Step S305, when reading the data stored in the enhanced storage area, the TLC block is switched to the SLC state to read the data stored in the enhanced storage area. Since the data stored in the enhanced storage area is stored by using the single-bit writing mode, the error code rate is greatly reduced, and the data can be quickly recovered without re-reading.

[0080] Another example is taken to a TLC type flash memory TLC block to specifically explain the flash data security storage method provided by the embodiment of the application.

[0081] The above steps S301 to S303 are also performed. Step S306, when writing the enhanced storage area, the LSB page, the CSB page and the MSB page of the TLC are written according to a certain rule, that is, the LSB page is written first, then the CSB page, and finally the MSB page. When the target writing mode is the two-bit writing mode, the first flash data with a higher security level is written into the enhanced storage area according to the two-bit writing mode, wherein under the same memory cell (Cell), the LSB page and the MSB page write the user data to be actually stored, and the CSB page writes the data stored in the LSB page and the MSB page after performing the exclusive OR operation; thus, as shown in Table 3, there are four data states in the two-bit writing mode, which are 111, 001, 010 and 100. Figure 5 ​

[0082] It should be noted that, Figure 5 The TLC flash memory of 3bit mode in the upper part can store eight data states, which are converted into the pMLC flash memory of 2bit mode based on the XOR operation. It can be seen that the pMLC flash memory improves the reliability of data storage at the cost of sacrificing 1 / 3 storage capacity.

[0083] In summary, in the embodiment of the present application, the physical page is divided into a normal storage area and an enhanced storage area, and the write mode of the enhanced storage area is switched from a conventional write mode to a target write mode, so that the number of corresponding data states in the target write mode is less than the number of corresponding data states in the conventional write mode. By reducing the data storage capacity of the flash memory, the data storage security is improved. By sacrificing the storage capacity of the flash memory, the reliability and security of data storage are improved; the enhanced storage area stores important first flash data with high security level, and the reading efficiency of the enhanced storage area is also effectively improved.

[0084] As shown in Figure 6 The present application also provides a flash data secure storage device, which comprises:

[0085] The processor 601 can be implemented in the form of a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute related programs to implement the technical solutions provided by the embodiments of the present application;

[0086] The memory 602 can be implemented in the form of a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 602 and are called and executed by the processor 601 to implement the flash data secure storage method of the embodiments of the present application;

[0087] The input / output interface 603 is used to realize information input and output;

[0088] The communication interface 604 is used to realize the communication interaction between the device and other devices. The communication can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);

[0089] a bus 605 for communicating information between the various components (e.g., the processor 601, the memory 602, the input / output interface 603, and the communication interface 604) of the device;

[0090] The processor 601, the memory 602, the input / output interface 603, and the communication interface 604 are communicatively connected with each other through the bus 605.

[0091] The embodiments of the present application also provide an electronic device, which comprises the flash data security storage device as above.

[0092] The embodiments of the present application also provide a storage medium, which is a computer readable storage medium, and stores a computer program. The computer program is executed by a processor to implement the flash data security storage method as above.

[0093] The memory is a non-transitory computer readable storage medium, and can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and the remote memory can be connected to the processor through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, and the units described as separate components can or can not be physically separated, and can be implemented in one place or distributed on multiple network units. According to actual needs, some or all of the modules can be selected to achieve the purpose of the embodiments.

[0094] As will be appreciated by one of ordinary skill in the art, all or some steps, systems of the above-disclosed methods can be implemented as software, firmware, hardware, or any suitable combination thereof. Some or all of the 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 as hardware, or as an integrated circuit, such as an application- specific integrated circuit. Such software can be distributed on computer readable media, which can comprise computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of 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 technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and includes any information delivery media.

[0095] The above description is that of the preferred embodiments of the present application. Various modifications and changes can be made thereto without departing from the spirit and scope of the application, which is defined by the appended claims. Any and all such modifications are intended to be included within the scope of the present application as defined in the following claims.

Claims

1. A method for securely storing data in a flash memory, the method comprising: The method comprises the following steps: dividing physical pages in a data block of a flash memory into a normal storage area and an enhanced storage area; wherein the normal storage area and the enhanced storage area each comprise data pages of different types; the number and types of the data pages are determined by the type of the flash memory; the type of the flash memory is a multi-layer storage cell flash memory, or a three-layer storage cell flash memory, or a four-layer storage cell flash memory; the enhanced storage area is used to store first flash data, and the normal storage area is used to store second flash data; the security level of the first flash data is higher than that of the second flash data; when storing the first flash data, determining a target write mode according to the type of the flash memory; wherein the target write mode is used to determine the number of data states in the enhanced storage area; the number of data states in the enhanced storage area is less than that in the normal storage area; when the type of the flash memory is a multi-layer storage cell flash memory, the target write mode is determined to be a single-bit write mode; writing the first flash data to be stored into the enhanced storage area according to the target write mode; wherein the target write mode is determined according to the type of the flash memory, further comprising: when the type of the flash memory is a three-layer storage cell flash memory, the target write mode is determined to be a single-bit write mode or a two-bit write mode; when the type of the flash memory is a four-layer storage cell flash memory, the target write mode is determined to be a single-bit write mode or a two-bit write mode.

2. The flash data secure storage method of claim 1, wherein, The writing of the first flash data to be stored into the enhanced storage area according to the target write mode comprises: obtaining the first flash data to be stored; when the target write mode is the single-bit write mode, the first flash data to be stored is written into the enhanced storage area, so that the number of data states in the enhanced storage area is 2.

3. The flash data secure storage method of claim 1, wherein, The writing of the first flash data to be stored into the enhanced storage area according to the target write mode comprises: obtaining the first flash data to be stored; when the target write mode is the two-bit write mode, the first flash data to be stored is written into the enhanced storage area, so that the number of data states in the enhanced storage area is 4.

4. The flash data secure storage method of claim 1, wherein, After the first flash data to be stored is written into the enhanced storage area according to the target write mode, the method further comprises: in the case of reading the first flash data from the enhanced storage area, determining a reading mode according to the target write mode; reading the first flash data from the enhanced storage area according to the reading mode.

5. The flash data secure storage method of claim 1, wherein, After the physical pages in the data block of the flash memory are divided into the normal storage area and the enhanced storage area, the method further comprises: when storing the second flash data, determining a regular write mode according to the type of the flash memory; wherein the regular write mode is used to determine the number of data states in the normal storage area; writing the second flash data to be stored into the normal storage area according to the regular write mode.

6. The flash data secure storage method of claim 5, wherein, The determining the normal write mode according to the type of the flash memory comprises: when the type of the flash memory is multi-layer memory cell flash, determining the normal write mode as two-bit write mode; when the type of the flash memory is three-layer memory cell flash, determining the normal write mode as three-bit write mode; when the type of the flash memory is four-layer memory cell flash, determining the normal write mode as four-bit write mode.

7. A flash memory data secure storage apparatus, characterized by, The flash data security storage device comprises at least one processor and a memory connected with the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the flash data security storage method according to any one of claims 1 to 6.

8. An electronic device, comprising: The flash data security storage device according to claim 7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions for causing a computer to execute the flash data security storage method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Partition configuration method, data storage management method and device

    CN115599293A