Flash memory data processing method and system based on filling position variability
By introducing random pairing relationships between data partitions and redundant partitions in flash memory devices, and flexibly filling the verification code, the problem of data cracking risks and error detection capabilities reduced due to data partition consistency is solved, and the security and error detection capabilities of flash memory devices are improved.
Patent Information
- Application Number
- CN202510222895.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, when the data storage amount is large, data partition consistency leads to the generation of a large number of identical verification data, which increases the risk of data being cracked and reduces the error detection capability.
The random pairing relationship between data partition and redundant partition is introduced, the encoding group is determined through the random pairing strategy, and the verification code is flexibly filled in the redundant partition to improve the probability of differential distribution of the verification code.
It effectively reduces the risk of data being cracked, improves the security and error detection capabilities of flash memory devices, and enhances the flexibility and applicability of data filling methods in redundant areas.
Smart Images

Figure CN120255793A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of flash memory technology, and particularly relates to a flash memory data processing method and system based on the variability of filling positions. Background Art
[0002] The data filled in the redundant area of the flash page of a flash memory device is usually very important data, such as the error correction code for the valid data in the data area of the flash page.
[0003] Currently, for the data in the data area, the flash memory device uses a check and error correction algorithm for the user area data to generate check data for data integrity, accuracy verification and error correction. The check data is correspondingly filled into a fixed area of the redundant area. In the case of a large amount of stored data, there may be a situation where the data partitions of many flash pages storing data are the same, resulting in a large amount of the same check data. For example, many data partitions filled with consistent invalid data due to insufficient valid data written to the flash page in the data partition will generate the same check data, which will increase the risk of the flash memory device data being cracked and reduce the error detection ability. Summary of the Invention
[0004] This application discloses a flash memory data processing method and system based on the variability of filling positions, in order to improve the security and error detection ability of the flash memory device. In addition, the variability of the position where the check code is filled into the redundant partition is used as the design concept of the check code filling in the solution of this application, making the data filling method in the redundant area more flexible and more applicable.
[0005] In the first aspect, this application provides a flash memory data processing method based on the variability of filling positions, which is applied to a flash memory device. The method includes:
[0006] Determine one or more coding groups according to the coding of multiple data blocks and the coding of multiple first redundant blocks of the first flash page;
[0007] Determine the second data in the data partition indicated by the data block coding in at least one coding group according to the distribution relationship of the first data to be written to the first flash page relative to the multiple data partitions of the first flash page;
[0008] Create a check code for the second data according to the second data and the corresponding coding group;
[0009] Fill the check code in the first redundant partition indicated by the first redundant block coding of the coding group.
[0010] In the second aspect, this application provides a flash memory data processing system, including a flash memory device and a host communicatively connected to the flash memory device. The flash memory device includes a first flash page;
[0011] The flash memory device is used to execute the steps in any of the methods in the first aspect.
[0012] It can be seen that in the embodiments of the present application, compared with the current mechanism that only calculates the check code based on data, the present application creatively introduces the random pairing relationship between the data partition and the redundant partition to increase the probability of differential distribution of the check code, thereby effectively reducing a large number of duplicate check codes caused by data consistency, which is beneficial to reducing the risk of data being cracked and improving the security and error detection ability of the flash memory device. In addition, the present application's solution takes the variability of the position where the check code is filled into the redundant partition as the design concept of check code filling, making the data filling method in the redundant area more flexible and more applicable. Description of the Drawings
[0013] Figure 1 It is a schematic structural diagram of a flash memory device 1 provided by an embodiment of the present application.
[0014] Figure 2 It is a schematic processing flow diagram of a flash memory data processing method based on the variability of the filling position provided by an embodiment of the present application.
[0015] Figure 3 It is the first example distribution state of the data partition and the first redundant partition provided by an embodiment of the present application;
[0016] Figure 4 It is the second example distribution state of the data partition and the first redundant partition provided by an embodiment of the present application;
[0017] Figure 5 It is the third example distribution state of the data partition and the first redundant partition provided by an embodiment of the present application;
[0018] Figure 6 It is a schematic diagram of a flash memory data processing system 100 provided by an embodiment of the present application. Detailed Embodiments
[0019] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part 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 of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0020] In the description and claims of this application and the above-mentioned drawings, terms such as "first" and "second" are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0021] Reference to "embodiment" herein means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase appears in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0022] The "and / or" in the embodiments of this application describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone; A and B exist simultaneously; B exists alone. Among them, A and B can be singular or plural.
[0023] In the embodiments of this application, the symbol " / " can represent an "or" relationship between the associated objects before and after. In addition, the symbol " / " can also represent a division sign, that is, perform a division operation. For example, A / B can represent A divided by B.
[0024] The "at least one (item)" or its similar expression in the embodiments of this application refers to any combination of these items, including any combination of a single item (item) or plural items (items), and refers to one or more, and plural refers to two or more. For example, at least one (item) of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.
[0025] The "equal to" in the embodiments of this application can be used in combination with "greater than" and is applicable to the technical solutions adopted when it is greater than, or can also be used in combination with "less than" and is applicable to the technical solutions adopted when it is less than. When "equal to" is used in combination with "greater than", it is not used in combination with "less than"; when "equal to" is used in combination with "less than", it is not used in combination with "greater than".
[0026] Currently, for the data in the data area, the flash memory device uses an error correction algorithm for the user area data to generate check data for data integrity, accuracy verification, and error correction. The corresponding check data is filled into a fixed area of the redundant area. In the case of a large amount of stored data, there may be a situation where the data partitions of many flash pages storing data in the flash memory device are consistent, resulting in a large amount of identical check data. For example, many data partitions that fill in consistent invalid data due to insufficient valid data written to the flash page in the data partition will generate the same check data. This will increase the risk of the flash memory device data being cracked and reduce the error detection ability.
[0027] To solve the above problems, the present application provides a flash memory data processing method and system based on the variability of the filling position. Compared with the current mechanism that only calculates the check code based on the data, the present application creatively introduces a random pairing relationship between the data partition and the redundant partition to increase the probability of differential distribution of the check code, thereby effectively reducing a large number of duplicate check codes caused by data consistency, which is beneficial to reducing the risk of data being cracked and improving the security and error detection ability of the flash memory device. In addition, the present application's solution takes the variability of the position where the check code is filled into the redundant partition as the design concept of check code filling, making the data filling method in the redundant area more flexible and more applicable.
[0028] The following describes the solution of the present application with reference to the accompanying drawings.
[0029] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of a flash memory device 1 provided by an embodiment of the present application. As Figure 1 shown, the flash memory device 1 includes the flash memory controller 10, the flash memory cache module 30, and the flash memory storage module 50. The flash memory controller 10 writes data to the flash memory storage module 50 or reads data from the flash memory storage module 50 through the flash memory cache module 30. The flash memory storage module 50 includes flash pages 51, and the flash pages 51 include a data area 511 and a redundant area 512.
[0030] Among them, the data that can be stored in the data area 511 includes but is not limited to: (1) User data, including text files, image files, audio files, video files, and various application program data, etc. (2) Management information: including the status information of the flash memory block to which the flash memory page belongs, such as whether the block is a bad block, the erasure count record, etc. The flash memory controller can use this information to perform operations such as bad block management and wear leveling, so as to improve the service life and reliability of the flash memory. For example, record the erasure count of each flash memory block. When the erasure count of a certain block approaches its life limit, the flash memory controller can take corresponding measures, such as migrating the data to other healthy blocks. (3) Address mapping information, including the mapping information from the logical address to the physical address of the storage block of the flash memory device. (4) File system-related data, including the metadata of the file system, such as file allocation table (FAT) information, directory structure information, etc.
[0031] The data that can be stored in the redundant area 512 includes but is not limited to: (1) ECC check data: The ECC check data is used to check and correct the data in the data area to ensure the accuracy and integrity of the data. (2) Other auxiliary information, such as address index information, etc.
[0032] As Figure 2 shown, the schematic diagram of the processing flow of a flash memory data processing method based on the variability of the filling position provided by the embodiment of the present application can be applied to a flash memory device 1 as Figure 1 shown. The method includes the following steps:
[0033] Step 201, the flash memory device determines one or more coding groups according to the multiple data block codes and the multiple first redundant block codes of the first flash memory page;
[0034] In a specific implementation, the determining one or more coding groups according to the multiple data block codes and the multiple first redundant block codes includes: adopting a random pairing strategy to pair one or more of the multiple data block codes with the multiple first redundant block codes to obtain one or more coding groups.
[0035] Among them,
[0036] Among them, for the case of determining a single coding group, the flash memory device can select a single data block code and configure a first redundant block code for the selected single data block code.
[0037] Among them, for the case of determining multiple coding groups, the flash memory device can configure a first redundant block code for each data block code. A single coding group includes a single data block code and a single first redundant block code. The elements in any two coding groups are different, and the data block codes included in the multiple coding groups are the multiple data block codes.
[0038] It can be seen that in this example, the flash memory device can improve the unpredictability of the pairing pattern according to the encoding of multiple data blocks of the first flash page and the encoding of multiple first redundant blocks, reducing the possibility of subsequent check code patterns being cracked.
[0039] Among them, the data area of the flash page can be divided into multiple data partitions according to the first preset partitioning strategy. The flash memory controller can sequentially write the first data into multiple flash memory storage units of the flash page under the constraint conditions of the multiple data partitions. For the data partitions that are not fully written, the flash memory controller can use the invalid data filling method to fill the remaining flash memory storage units.
[0040] In a possible example, the first preset partitioning strategy is: determining the data type of the first data; querying a partition configuration table according to the data type to obtain the corresponding partition configuration, where the partition configuration table includes the corresponding relationship between the data type and the partition configuration; and determining the partition status of the data area of the first flash page according to the partition configuration.
[0041] Among them, the data type includes, for example, user data, mapping table data, and bad block table data. The user data includes, for example, any one of the following: text data, picture data, and audio data.
[0042] Among them, the partition configuration can be designed according to the service requirement characteristics corresponding to the data type of the first data. The following takes the mapping data of the mapping table as an example for illustration:
[0043] Taking a flash memory device with the first data being mapping table data, including 160 flash blocks, each flash block containing 32 flash pages, and each flash page having a size of 16x1024 bytes as an example. Its total capacity is 160x32x16x1024 = 80M (1024x1024). Design of the FMT of L2P (Logical Address to Physical Address mapping): The calculation of LBA (Logical Address) and PPA (Flash Page Address) uses 4 bytes.
[0044] In this way, the size of the FMT table is 160x32x4, that is, 20480 bytes, so at least 1.25 flash pages are required to store it.
[0045] The flash memory device can divide the data of these 1.25 flash memory pages into 5 blocks, namely mapped data block 1, mapped data block 2, mapped data block 3, mapped data block 4, and mapped data block 5. The first flash memory page stores 3 blocks, namely mapped data block 1, mapped data block 2, and mapped data block 3, and the second flash memory page stores 2 blocks, namely mapped data block 4 and mapped data block 5. Thus, it can be known that the partition configuration of the data area of the first flash memory page is data partition 1 (storing mapped data block 1), data partition 2 (storing mapped data block 2), data partition 3 (storing mapped data block 3), and data partition 4 (filled with invalid data), and the partition configuration of the data area of the second flash memory page is data partition 1, data partition 2, and data partition 3 (filled with invalid data).
[0046] It can be seen that in this example, the flash memory device can query the partition configuration table according to the data type of the first data to quickly obtain the partition status of the data area.
[0047] In this possible example, the second preset partition policy is to determine the partition of the redundant area according to the partition status of the data area of the first flash memory page.
[0048] Among them, the relationship between the number of the first redundant partitions for filling redundant codes in multiple redundant partitions and the number of multiple data partitions divided in the data area can include the following situations:
[0049] Situation (1) As Figure 3 shown, the number of data partitions is the same as the number of the first redundant partitions;
[0050] Situation (2) As Figure 4 shown, the number of data partitions is greater than the number of the first redundant partitions. Specifically, the number of data partitions storing valid data is the same as the number of the first redundant partitions. In this case, through the static constraint relationship of the number of the first redundant partitions, the data partitions storing valid data in the data area can be quickly indicated, and dedicated check codes are no longer created for the data partitions filled with only invalid data. At the same time, due to the dynamic distribution characteristics of valid data and invalid data in the data partitions, the first redundant partitions in the redundant area also dynamically follow and adapt. The redundant area needs to characterize the distribution of the redundant area in specific redundant partitions. In this way, the flash register can timely learn about the partition distribution of the current redundant area by reading the data information of the specific redundant partitions.
[0051] Situation (3) As Figure 5As shown, the number of data partitions is greater than the number of first redundant partitions, and the number of first redundant partitions is 1. That is, for the first data in the data area, the flash memory controller only randomly selects the second data of a single data partition to calculate and fill the check code, and this check code is used to verify the accuracy of the entire data of the first data. Although a certain degree of accuracy is sacrificed, since the calculation amount and quantity of the check code are greatly reduced, it can better improve the algorithm efficiency and space utilization rate.
[0052] In specific implementation, the flash memory device can pre - construct the correspondence between the data type of the first data and these three quantity allocation situations. For example, for image data in user data, situation (3) can be adapted; for audio data in user data, situation (2) can be adapted; for mapping table mapping data, situation (1) can be adapted, etc.
[0053] It can be seen that in this example, the flash memory device can dynamically adapt to the data type of the first data and the actual partition status of the data area, and better meet the comprehensive requirements of data processing.
[0054] In a possible example, the multiple data blocks are encoded from the data area of the first flash page after being divided and encoded according to a first preset partitioning strategy; the multiple first redundant blocks are encoded as the partition encoding in the multiple redundant block encodings of the redundant area of the first flash page, and the multiple redundant block encodings are obtained after the redundant area is divided and encoded according to a second preset partitioning strategy;
[0055] The redundant block encoding further includes a second redundant block encoding, and the second redundant partition indicated by the second redundant block encoding is used to fill at least one of the following data: error correction code, block status information, encryption information.
[0056] In specific implementation, for the multiple data partitions obtained by dividing the data area of the first flash page according to the first preset partitioning strategy, a first encoding algorithm is used to encode the relative positions of the blocks of the multiple data partitions to obtain multiple data block encodings;
[0057] For the multiple redundant partitions obtained by dividing the redundant area of the first flash page according to the second preset partitioning strategy, a second encoding algorithm is used to encode the relative positions of the blocks of the multiple redundant partitions to obtain multiple redundant block encodings. The multiple redundant block encodings include the first redundant block encoding of the redundant partition for storing the check code, and also include the second redundant block encoding of the redundant partition for storing one or more of the data such as error correction code, block status information, and encryption information.
[0058] For the first encoding algorithm of the data area, for example, according to the size of the flash page data area, it is divided into N data partitions of equal size, where N is a positive integer. For example, if the data area size is 4KB, it can be divided into 16 data partitions of 256 bytes each. An encoding algorithm based on the relative position and size weighting of the data partitions is adopted. Calculate the starting offset of each data partition. The starting offset d_offseti of the i-th data partition is: d_offseti = i × partition size. The calculation formula for the encoding value d_c_k of the data block encoding in data partition i is:
[0059] d_c_k = d_offseti × α1 + i × α2,
[0060] where the weight coefficient α1 is used to represent the influence of the starting position of the data partition on the encoding result, and the weight coefficient α2 represents the influence of the relative position of the data partition on the encoding result.
[0061] For the second encoding algorithm of the redundant area, for example, the redundant area is divided into K redundant partitions according to different functional requirements, where K is a positive integer. For example, it can be divided into a first redundant partition for filling check codes, a second redundant partition for filling flash management information, and a third redundant partition for filling logical mapping information. The size of each redundant partition is determined according to the actual requirements of the information it carries. A hybrid encoding algorithm based on hashing and weighting is adopted. Calculate the relative position offset of each redundant block. The relative position offset r_offset_k of the k-th redundant block is r_offset_k = Σx k1 where xi is the size of redundant partition i. In addition, other relevant information of the redundant partition, such as the block type, is used as the input of the hash function (such as MD5 or SHA-1), and a hash value hash_value with a fixed length (such as 128 bits) is calculated for the input information. The calculation formula for the redundant block encoding value r_c_k of redundant partition k is: i r_c_k = hash_value × β1 + r_offset_k × β2 + k × β3,
[0062] where the weight coefficient β1 is used to represent the influence of the information characteristics contained in the hash value on the encoding result, the weight coefficient β2 is used to represent the influence of the relative position of the redundant partition on the encoding result, and the weight coefficient β3 is used to represent the influence of the serial number order of the redundant partition on the encoding result, and encoding is performed by comprehensively considering various characteristics of the redundant partition. At the same time, in order to establish a basic correspondence relationship with the data area, the corresponding data partition number or related data area characteristic information can be included in the information of the redundant block. In this way, when needed, the relevant part of the data area can be found through the encoding of the redundant block and the associated information contained therein.
[0063]
[0064] After calculating the redundant block encoding values of the redundant partitions, find the corresponding first redundant block encoding according to the block type of the redundant partition filled with the parity check code.
[0065] It can be seen that in this example, the flash memory device first partitions the data area and the redundant area according to their respective partitioning strategies, and then encodes them respectively according to the characteristics of the partitioned data partition and redundant partition to obtain their respective corresponding block encodings, making the calculated encoding results have sufficient differences. This difference can further support the degree of difference in the parity check code calculation results, thereby effectively reducing the probability of generating the same parity check code and improving the security and error detection ability of the flash memory device.
[0066] Step 202, the flash memory device determines the second data of the data partition indicated by the data block encoding in at least one encoding group according to the distribution relationship of the first data to be written into the first flash page with respect to multiple data partitions of the first flash page;
[0067] Combined with the example of the mapping table above, if the partition configuration of the data area of the first flash page is data partition 1 (storing mapping data block 1), data partition 2 (storing mapping data block 2), data partition 3 (storing mapping data block 3), and data partition 4 (filling with invalid data), then data partition 1 corresponds to data block encoding 1, data partition 2 corresponds to data block encoding 2, data partition 3 corresponds to data block encoding 3, and data partition 4 corresponds to data block encoding 4. If at least one encoding group is a single encoding group and the data block encoding in this single encoding group is 2, then the second data of the data partition indicated is mapping data block 2.
[0068] In a possible example, the determining the second data of the data partition indicated by the data block encoding in at least one encoding group according to the distribution relationship of the first data to be written into the first flash page with respect to multiple data partitions of the first flash page includes: judging whether the data partition indicated by the data block encoding in the currently processed encoding group is full according to the distribution relationship;
[0069] If it is judged that it is not full, fill the idle units of the data partition to obtain the second data;
[0070] If it is judged that it is full, determine the data of the data partition as the second data.
[0071] Among them, the at least one encoding group may be an encoding group determined by the flash memory device according to the number of check codes to be created this time. For example, if the flash memory device determines that only a single check code needs to be created for the data in the data area of the first flash page, then the at least one encoding group is a single encoding group at this time. If the flash memory device determines that the data in the data area of the first flash page needs to create check codes in one-to-one correspondence with the data partitions, then the at least one encoding group is multiple encoding groups at this time, and a single encoding group includes a single data block encoding and a single first redundant block encoding. The elements in any two encoding groups are different, and the data block encodings included in the multiple encoding groups are the multiple data block encodings.
[0072] In specific implementations, in some flash memory products, the partition configuration of the data area of the flash page may be unified for data of specific data types. In this case, due to the randomness of the size of the first data to be written, there may be a situation where the data partitions in some of the first data written are not filled.
[0073] It can be seen that in this example, for the data writing status of the data partition, the flash memory device can finely detect and identify it and fill the corresponding data partition by filling with invalid data, avoiding the instability problem caused by the unfilled data in the flash page.
[0074] Step 203, the flash memory device creates a check code for the second data according to the second data and the corresponding encoding group;
[0075] Among them, the corresponding encoding group, that is, the data block encoding of the data partition where the second data is located, is in this encoding group
[0076] In a possible example, creating the check code for the second data according to the second data and the corresponding encoding group includes: concatenating the second data, the data block encoding in the corresponding encoding group, and the redundant block encoding in the encoding group to obtain a third data; using the third data as the input of a check code calculation function for processing to obtain the check code for the second data.
[0077] Among them, the check code calculation function includes any one of the following: cyclic redundancy check function, hash check function, parity check function.
[0078] It can be seen that in this example, since the third data is obtained by concatenating the second data, the data block encoding, and the redundant block encoding, and the data block encodings and redundant block encodings of different data partitions are different, the difference of the input information of different data partitions as the check code calculation function is increased, and thus the difference probability of the check code as the calculation result is increased, which is beneficial to reducing the risk of data being cracked and improving the security and error detection ability of the flash memory device.
[0079] In another possible example, creating a check code for the second data according to the second data and the corresponding coding group includes: concatenating the second data and the redundant block coding in the corresponding coding group to obtain a fourth data; using the fourth data as the input of a check code calculation function and processing it to obtain the check code for the second data.
[0080] It can be seen that in this example, only concatenating the redundant block coding reduces the algorithm complexity and improves the algorithm efficiency. At the same time, it can also achieve the effect of differentiating the input data of the check code function to a certain extent, thereby differentiating the check code.
[0081] Step 204, the flash memory device fills the check code in the first redundant partition indicated by the first redundant block coding of the coding group.
[0082] It can be seen that in the embodiments of the present application, compared with the current mechanism of calculating check codes only based on data, the present application creatively introduces the random pairing relationship between data partitions and redundant partitions to increase the probability of differential distribution of check codes, thereby effectively reducing a large number of duplicate check codes caused by data consistency, which is beneficial to reducing the risk of data being cracked and improving the security and error detection ability of the flash memory device. In addition, the design concept of the present application's solution is to make the position where the check code is filled in the redundant partition variable, making the data filling method in the redundant area more flexible and more applicable.
[0083] In a possible example, the method further includes: reading the second data in the data partition of the data area of the first flash page; querying a metadata relationship table according to the data block coding of the data partition to obtain the corresponding first redundant block coding; reading the first check code in the first redundant partition indicated by the first redundant block coding; generating a second check code according to the read second data, the data block coding, and the first redundant block coding; and determining the integrity of the read second data or the first data according to the comparison result between the first check code and the second check code.
[0084] It can be seen that in this example, based on the first check code filled in the redundant area, the flash memory device can determine the integrity of the first data or the second data according to the comparison result between the calculated second check code and the first check code during the relevant data operation stage.
[0085] Such as Figure 6As shown in the figure, an embodiment of the present application further provides a flash memory data processing system 100, which includes a flash memory device 1 and a host 2. The host 2 communicates with a flash memory controller 10 of the flash memory device 1. The flash memory device 1 includes a flash memory controller 10, a flash memory cache module 30, and a flash memory storage module 50. The flash memory storage module 50 includes a first flash memory page 52, and the first flash memory page 52 includes a data area 521 and a redundant area 522. Among them,
[0086] The flash memory controller 10 is configured to determine one or more coding groups according to a plurality of data block codes and a plurality of first redundant block codes of the first flash memory page; and determine second data of a data partition indicated by the data block code in at least one coding group according to the distribution relationship between the first data to be written into the first flash memory page and the plurality of data partitions of the first flash memory page; and create a check code for the second data according to the second data and the corresponding coding group; and fill the check code in a first redundant partition indicated by the first redundant block code of the coding group.
[0087] Among them, the first data may be data sent by the host to the flash memory controller.
[0088] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0089] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0090] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above-mentioned unit division is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, and the indirect coupling or communication connection of the device or unit may be in an electrical or other form.
[0091] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0092] In addition, in each embodiment of the present application, the functional units may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0093] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the above methods in each embodiment of the present application. The aforementioned memory includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks or optical disks and other media that can store program codes.
[0094] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory. The memory can include: flash drives, read-only memories (abbreviation: ROM), random access memories (abbreviation: RAM), magnetic disks or optical disks, etc.
[0095] The above has introduced the embodiments of the present application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A flash memory data processing method based on the variability of filling positions, characterized in that, Applied to a flash memory device, the method includes: Determining one or more coding groups according to a plurality of data block encodings and a plurality of first redundant block encodings of a first flash memory page; Determining second data of a data partition indicated by a data block encoding in at least one coding group according to a distribution relationship of first data to be written to the first flash memory page with respect to a plurality of data partitions of the first flash memory page; Creating a check code for the second data according to the second data and the corresponding coding group; Filling the check code in a first redundant partition indicated by a first redundant block encoding of the coding group.
2. The method according to claim 1, wherein The determining one or more coding groups according to a plurality of data block encodings and a plurality of first redundant block encodings of a first flash memory page includes: Adopting a random pairing strategy to pair one or more of the plurality of data block encodings with the plurality of first redundant block encodings to obtain one or more coding groups.
3. The method according to claim 2, characterized in that, The plurality of data block encodings are obtained after the data area of the first flash memory page is divided and encoded according to a first preset partitioning strategy; The plurality of first redundant block encodings are partition encodings among a plurality of redundant block encodings of a redundant area of the first flash memory page, and the plurality of redundant block encodings are obtained after the redundant area is divided and encoded according to a second preset partitioning strategy; The redundant block encoding further includes a second redundant block encoding, and the second redundant partition indicated by the second redundant block encoding is used to fill at least one of the following data: error correction code, block status information, encryption information.
4. The method according to claim 3, characterized in that, The first preset partitioning strategy is: Determining the data type of the first data; Querying a partition configuration table according to the data type to obtain a corresponding partition configuration, where the partition configuration table includes a correspondence between the data type and the partition configuration; Determining the partition status of the data area of the first flash memory page according to the partition configuration.
5. The method according to claim 4, wherein The second preset partitioning strategy is to determine the partitioning of the redundant area according to the partition status of the data area of the first flash memory page.
6. The method according to any one of claims 1-5, characterized in that, The creating a check code for the second data according to the second data and the corresponding coding group includes: Concatenating the second data, the data block encoding in the corresponding coding group, and the redundant block encoding in the coding group to obtain third data; Processing the third data as an input of a check code calculation function to obtain the check code for the second data.
7. The method according to claim 6, characterized in that, The check code calculation function includes any one of the following: cyclic redundancy check function, hash check function, parity check function.
8. The method according to claim 7, characterized in that, The determining second data of a data partition indicated by a data block encoding in at least one coding group according to a distribution relationship of first data to be written to the first flash memory page with respect to a plurality of data partitions of the first flash memory page includes: Judging whether the data partition indicated by the data block encoding in the currently processed coding group is full according to the distribution relationship; If it is judged that it is not full, filling the idle cells of the data partition to obtain the second data; If it is judged that it is full, determining the data of the data partition as the second data.
9. The method according to any one of claims 1-5, characterized in that, The method further includes: Reading the second data of the data partition of the data area of the first flash memory page; Query the metadata relationship table according to the data block encoding of the data partition to obtain the corresponding first redundant block encoding; Read the first check code in the first redundant partition indicated by the first redundant block encoding; Generate a second check code according to the read second data, the data block encoding, and the first redundant block encoding; Determine the integrity of the read second data or the first data according to the comparison result of the first check code and the second check code.
10. A flash memory data processing system, characterized in that, It includes a flash memory device and a host communicatively connected to the flash memory device, the flash memory device includes a first flash page; the flash memory device is configured to execute the steps in any one of claims 1-9.
Citation Information
Patent Citations
Memory system and operation method of memory system
CN111475327A
Data storage device and non-volatile memory control method
CN112099985A
Data writing method, distributed storage system, equipment and storage medium
CN115268786A
Data writing method, data writing device, electronic equipment and readable storage medium
CN118885115A
Method for storing check code in memory and its device
CN1480953A