CN117492663B - Memory and data processing method thereof - Google Patents

Memory and data processing method thereof Download PDF

Info

Publication number
CN117492663B
CN117492663B CN202311841649.1A CN202311841649A CN117492663B CN 117492663 B CN117492663 B CN 117492663B CN 202311841649 A CN202311841649 A CN 202311841649A CN 117492663 B CN117492663 B CN 117492663B
Authority
CN
China
Prior art keywords
mapping
data
mapping table
mapping data
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311841649.1A
Other languages
Chinese (zh)
Other versions
CN117492663A (en
Inventor
胡天超
王守磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Kangxinwei Storage Technology Co Ltd
Original Assignee
Hefei Kangxinwei Storage Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Kangxinwei Storage Technology Co Ltd filed Critical Hefei Kangxinwei Storage Technology Co Ltd
Priority to CN202311841649.1A priority Critical patent/CN117492663B/en
Publication of CN117492663A publication Critical patent/CN117492663A/en
Application granted granted Critical
Publication of CN117492663B publication Critical patent/CN117492663B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention provides a memory and a data processing method thereof, wherein the memory comprises: a flash memory block; a master, the master comprising: the system comprises a first storage unit, a second storage unit and a processing unit, wherein the processing unit is configured to acquire the ratio of the number of the mapping data written in the second storage unit to the maximum writing amount, and execute the brushing processing of the mapping data or stop the brushing processing of the mapping data according to the comparison result of the ratio and a start threshold and the comparison result of the ratio and a stop threshold; the processing unit is further configured to poll all the secondary mapping tables, and write mapping data in the secondary mapping tables into the corresponding tertiary mapping tables according to a comparison result of the secondary mapping tables and preset conditions. The memory and the data processing method thereof provided by the invention optimize the brushing mode of the mapping data so as to perfect the optimizing mode of write amplification.

Description

Memory and data processing method thereof
Technical Field
The present invention relates to the field of storage, and in particular, to a memory and a data processing method thereof.
Background
The storage medium of the memory is a flash memory block (NAND flash), which is a nonvolatile storage medium. Under the condition of power failure, the data can be stored in the storage medium in a mode of storing charge, so that the data is not lost when the power is off. The lifetime of a flash block is calculated by write amplification. A smaller write amplification means a longer lifetime of the flash block, and therefore it is necessary to optimize the write amplification of the flash block. At present, the write amplification of a flash memory block is not perfect, and the improvement exists.
Disclosure of Invention
The invention aims to provide a memory and a data processing method thereof, which optimize a brushing mode of mapping data so as to perfect an optimizing mode of write amplification.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the present invention provides a memory comprising:
a flash memory block provided with a three-level mapping table therein configured to store mapping data;
the host computer, the electrical connection is in host computer with the flash memory piece, is configured to according to the host computer data of host computer, the mapping data that generates corresponds, the host computer includes:
the first storage unit is internally provided with a first-level mapping table and is configured to write the mapping data;
the second storage unit is internally provided with a second-level mapping table and is configured to write the mapping data; and
the processing unit is configured to acquire the ratio of the number of the mapping data written in the second storage unit to the maximum writing amount, and execute the brushing processing of the mapping data or stop the brushing processing of the mapping data according to the comparison result of the ratio and the starting threshold and the comparison result of the ratio and the stopping threshold;
the processing unit is further configured to poll all the secondary mapping tables, and write mapping data in the secondary mapping tables into the corresponding tertiary mapping tables according to a comparison result of the secondary mapping tables and preset conditions.
In an embodiment of the present invention, the processing unit is configured to generate corresponding mapping data in response to the host data, write the mapping data into the primary mapping table, and update the mapping data in the primary mapping table into the secondary mapping table.
In an embodiment of the present invention, the processing unit is further configured to record a tertiary mapping table to which the host data corresponding to the mapping data in the secondary mapping table belongs, a number of mapping data of a certain tertiary mapping table to which the mapping data in the secondary mapping table belongs, and a time length associated with the corresponding tertiary mapping table by the certain secondary mapping table.
In an embodiment of the present invention, when the processing unit determines that the ratio is greater than the start threshold, the action performed is to perform a brushing process of the mapping data, and when the processing unit determines that the ratio is less than or equal to the start threshold, the action performed is to perform no brushing process of the mapping data.
In an embodiment of the present invention, when the processing unit determines that the ratio is greater than the stop threshold, the action performed is to continue the brushing process of the mapping data, and when the processing unit determines that the ratio is less than or equal to the stop threshold, the action performed is to stop the brushing process of the mapping data.
In an embodiment of the present invention, the processing unit is configured to poll all the secondary mapping tables, and determine that when a time length associated with a certain secondary mapping table and a corresponding tertiary mapping table is greater than a time threshold, an action to be performed is to write mapping data in the certain secondary mapping table into the corresponding tertiary mapping table.
In an embodiment of the present invention, when the processing unit determines that the time length associated with the certain secondary mapping table and the corresponding tertiary mapping table is less than or equal to a time threshold, the action is performed according to a comparison result of the number of the mapping data written in the certain secondary mapping table and an average threshold, so as to write the mapping data in the certain secondary mapping table into the corresponding tertiary mapping table.
In an embodiment of the present invention, when the processing unit determines that the number of the mapping data written in the certain secondary mapping table is greater than the average threshold, the processing unit performs an action of writing the mapping data in the certain secondary mapping table into the corresponding tertiary mapping table.
In an embodiment of the present invention, when the processing unit determines that the number of the mapping data written in the certain secondary mapping table is smaller than or equal to the average threshold, the processing unit performs an action of sorting the secondary mapping tables according to the number of the mapping data of the secondary mapping table belonging to the certain tertiary mapping table and a time length associated with the corresponding tertiary mapping table by the secondary mapping table, and sequentially writing the mapping data in the sorted secondary mapping tables into the corresponding tertiary mapping table.
The invention also provides a data processing method of the memory, which comprises the following steps:
responding to host data of a host, and sequentially writing corresponding mapping data into a first storage unit and a second storage unit by a processing unit;
acquiring the ratio of the number of the mapping data written in the second storage unit to the maximum writing amount, and performing the brushing processing of the mapping data according to the comparison result of the ratio and the starting threshold;
polling all the secondary mapping tables, and writing mapping data in the secondary mapping tables into corresponding tertiary mapping tables according to comparison results of the secondary mapping tables and preset conditions;
stopping the brushing process of the mapping data according to the comparison result of the ratio and the stop threshold
As described above, the present invention provides a memory and a data processing method thereof, which can release as much buffer space of a second storage unit as possible when updating the same three-level mapping table by optimizing a down-flushing manner of mapping data. Meanwhile, the proportion of mapping data actually required to be brushed can be improved by selecting more secondary mapping tables for brushing, which is equivalent to reducing the writing times of the tertiary mapping tables, and the service life of the flash memory block can be prolonged to a certain extent. In addition, when the same amount of mapping data is brushed down, the number of times of the read three-level mapping table can be reduced, and the writing efficiency is improved to a certain extent. Finally, according to the time length of the association between the second-level mapping table and the corresponding third-level mapping table, the part of mapping data can be guaranteed to be timely brushed down, and then the cache space of the second storage unit can be timely released. According to the method and the device, the lower brushing mode of the mapping data is optimized, so that the write amplification optimization mode aiming at the flash memory block is perfected, and the service life of the flash memory block is prolonged to a certain extent.
Of course, it is not necessary for any one product to practice the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a memory according to an embodiment of the invention;
FIG. 2 is a flow chart of a method for processing data in a memory according to an embodiment of the invention;
FIG. 3 is a flowchart of step S10 in FIG. 2;
FIG. 4 is a flowchart of step S20 in FIG. 2;
FIG. 5 is a flowchart of step S30 in FIG. 2;
FIG. 6 is a flowchart of step S33 in FIG. 5;
fig. 7 is a flowchart of step S40 in fig. 2.
In the figure: 100. a memory; 110. a master controller; 111. a processing unit; 112. a first storage unit; 113. a second storage unit; 120. a flash memory block; 200. and a host.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, the present invention provides a memory 100, which may be configured to be mounted on a circuit board, as a storage medium for electronic devices such as smart phones, tablet computers, mobile internet devices, and the like. Memory 100 may include a master 110, a flash block 120. Flash block 120 may be configured to electrically connect to master 110, and master 110 may be configured to electrically connect to host 200. Master 110 may be configured to write host data from host 200 into different flash blocks 120.
In one embodiment of the present invention, the master 110 may be configured to generate corresponding mapping data when writing host data into the corresponding flash memory block 120 in response to host data of the host 200. The mapping data may be a mapping relationship between a host logical address and a device physical address. The mapping data may be written into a corresponding mapping table. The mapping table may be represented as a table of host logical addresses corresponding to device physical addresses. In this embodiment, the mapping tables may be divided into a primary mapping table, a secondary mapping table, and a tertiary mapping table. The number of the primary mapping tables may be plural. The number of secondary mapping tables may be plural. The number of the three-level mapping tables may be plural.
Referring to fig. 1, in an embodiment of the present invention, a main controller 110 may include a processing unit 111, a first storage unit 112, and a second storage unit 113. The first storage unit 112 may be a Static Random-Access Memory (SRAM) space. The first storage unit 112 may have a plurality of primary mapping tables. The second storage unit 113 may also be a static random access memory space. The second storage unit 113 may have a plurality of secondary mapping tables.
In one embodiment of the present invention, after generating the plurality of mapping data, the processing unit 111 may sequentially write the mapping data to the primary mapping table of the first storage unit 112. When the number of mapping data stored in the first storage unit 112 reaches the set number, the mapping data in the first mapping table may be updated to the second mapping table in the second storage unit 113. When the number of the mapping data stored in the second storage unit 113 reaches a certain number, the mapping data in the second mapping table may be written into the third mapping table of the flash memory block 120.
In one embodiment of the present invention, when the processing unit 111 updates the mapping data in the primary mapping table to the secondary mapping table of the second storage unit 113, the processing unit 111 may be configured to record the tertiary mapping table to which the host data corresponding to the mapping data in the secondary mapping table belongs. Since multiple mapping data may be recorded in the secondary mapping table, it is necessary to write to a different tertiary mapping table for different mapping data. Therefore, it is necessary to record a tertiary mapping table associated with certain mapping data in the secondary mapping table. Namely, recording a third-level mapping table to which host data corresponding to the mapping data in the second-level mapping table belongs.
In one embodiment of the present invention, the processing unit 111 may be configured to record the number of mapping data in the secondary mapping table to which the mapping data belongs in a certain tertiary mapping table. Wherein, for the same three-level mapping table, the mapping data written therein is continuous, i.e. the mapping relationship between the host logical address and the device physical address is continuous. Therefore, it is necessary to record the number of mapping data that can be written into the same three-level mapping table for all mapping data in a certain two-level mapping table. I.e. the number of mapping data of a certain tertiary mapping table to which the mapping data of the secondary mapping table belongs is recorded.
In one embodiment of the present invention, the processing unit 111 may be configured to record the length of time that a certain secondary mapping table is associated with a corresponding tertiary mapping table. For the secondary mapping table, it often happens that the internal mapping data is written into the common tertiary mapping table. Therefore, the length of time for writing the mapping data in a certain secondary mapping table to the corresponding tertiary mapping table needs to be recorded. I.e. the length of time a certain secondary mapping table is associated with the corresponding tertiary mapping table is recorded.
In one embodiment of the present invention, the processing unit 111 may be configured to obtain a ratio of the amount of the written mapping data in the second storage unit 113 to the maximum writing amount, and perform the brushing process of the mapping data according to a comparison result of the ratio and the start threshold. In this embodiment, since the second storage unit 113 may be provided with a plurality of secondary mapping tables, a plurality of mapping data may be written into each secondary mapping table. Therefore, it is necessary to determine whether the mapping data already written in the second storage unit 113 reaches a preset threshold value, so as to write the mapping data in the second storage unit 113 into the three-level mapping table of the flash memory block 120. The processing unit 111 may first obtain the maximum value, that is, the maximum writing amount, of the mapping data that can be written in the second storage unit 113, and then obtain the number of mapping data that has been written in the second storage unit 113, so as to obtain the ratio of the number of mapping data that has been written to the maximum writing amount.
In one embodiment of the invention, the processing unit 111 may be configured to determine if the ratio is greater than a start-up threshold. When the ratio of the number of written mapping data to the maximum writing amount in the second storage unit 113 is greater than the start threshold, the flushing-down processing of the mapping data is performed. When the ratio of the number of written mapping data to the maximum writing amount in the second storage unit 113 is less than or equal to the start threshold, the down-flushing processing of the mapping data is not performed. That is, when the used buffer space in the second storage unit 113 reaches the start-up threshold, a flush-down process of the mapping data may be performed to release the buffer space of the second storage unit 113. The starting threshold may be a preset threshold value. The specific size of the activation threshold may not be limiting. In this embodiment, the start threshold may be in the range of 80% -95%. For example, the actuation threshold may be 80%, 85%, 90%, 95%, etc. That is, when the processing unit 111 determines that the ratio is greater than the start-up threshold, the action performed is to perform the down-brushing process of the map data. When the processing unit 111 determines that the ratio is less than or equal to the start threshold, the action performed is not to perform the down-brushing processing of the mapping data.
In one embodiment of the present invention, the processing unit 111 may be configured to poll all the secondary mapping tables, and write the mapping data in the secondary mapping tables into the corresponding tertiary mapping tables according to the comparison result of the secondary mapping tables and the preset condition. The preset condition may include a time threshold and an average threshold. The processing unit 111 may be configured to obtain a length of time that the secondary mapping table is associated with a certain tertiary mapping table, and obtain the amount of mapping data written in the certain secondary mapping table. The processing unit 111 may write the mapping data in the secondary mapping table into the corresponding tertiary mapping table according to the comparison result of the time length and the time threshold and the comparison result of the number of the mapping data written in a certain secondary mapping table and the average threshold. The time threshold may be a length of time that the secondary mapping table is accessed by a certain tertiary mapping table, the length of time being determined by a number K of memory blocks (blocks) allocated after mapping data is written from the secondary mapping table to the tertiary mapping table. K is a constant, and is a value obtained by simultaneously meeting the power-on time according to the size of the allocated cache space. The average threshold value may be an average value of the number of mapping data written in all the secondary mapping tables in the second storage unit 113. I.e. average threshold = number of mapping data/number of secondary mapping tables.
In one embodiment of the present invention, the processing unit 111 may compare the time length with the time threshold, and then compare the number of the mapping data written in a certain secondary mapping table with the average threshold. Specifically, the processing unit 111 may poll all the secondary mapping tables, obtain the time length associated with a certain tertiary mapping table, and determine whether the time length is greater than a time threshold. When the processing unit 111 determines that the time length associated with a certain secondary mapping table and a corresponding tertiary mapping table is greater than the time threshold, the action is performed by writing mapping data in a certain secondary mapping table into a corresponding tertiary mapping table. When determining that the time length associated with a certain secondary mapping table and a corresponding tertiary mapping table is less than or equal to the time threshold, the processing unit 111 performs an action of writing mapping data in a certain secondary mapping table into the corresponding tertiary mapping table according to a comparison result of the number of writing mapping data in the certain secondary mapping table and the average threshold.
In one embodiment of the present invention, the processing unit 111 may poll the remaining secondary mapping tables, obtain the number of the written mapping data in a certain secondary mapping table, and determine whether the number of the written mapping data in the certain secondary mapping table is greater than an average threshold. When determining that the number of mapping data written in a certain secondary mapping table is greater than the average threshold, the processing unit 111 performs an action of writing the mapping data in the certain secondary mapping table into the corresponding tertiary mapping table. When determining that the number of the mapping data written in a certain secondary mapping table is smaller than or equal to the average threshold, the processing unit 111 performs an action of sorting the secondary mapping tables according to the number of the mapping data in the secondary mapping table belonging to a certain tertiary mapping table and the time length associated with the secondary mapping table and the corresponding tertiary mapping table, and sequentially writing the mapping data in the sorted secondary mapping tables into the corresponding tertiary mapping tables.
In one embodiment of the present invention, the processing unit 111 continuously swipes the mapping data written in the secondary mapping table down to the tertiary mapping table, and thus, the cache space of the second storage unit 113 is gradually released. When the buffer space of the second storage unit 113 is released to the threshold value, the swiping operation may be stopped. In this embodiment, the processing unit 111 may be further configured to stop the brushing process of the mapping data according to the real-time comparison result of the ratio and the stop threshold. The stop threshold may be a preset threshold. The specific size of the stop threshold may not be limiting. In this embodiment, the stop threshold may be in the range of 40% -60%. For example, the stop threshold may be 40%, 45%, 50%, 55%, 60%, etc. That is, when the processing unit 111 determines that the ratio is greater than the stop threshold, the action performed is to continue the flushing processing of the map data. When the processing unit 111 determines that the ratio is less than or equal to the stop threshold, the action performed is to stop the down-brushing processing of the map data.
Referring to fig. 2, the present invention further provides a data processing method of a memory, which can be applied to the memory 100 in the above embodiment, and when the memory 100 enters a state of flushing processing of mapping data, the flushing mode of the mapping data can be optimized, and further, the write amplification of the flash memory block 120 can be optimized to a certain extent, so as to perfect the optimizing mode of the write amplification of the flash memory block 120, and to improve the service life of the flash memory block 120 to a certain extent. The data processing method may include the steps of:
step S10, responding to host data of a host, and sequentially writing corresponding mapping data into a primary mapping table and a secondary mapping table by a processing unit;
step S20, obtaining the ratio of the number of the written mapping data in the second storage unit to the maximum writing amount, and performing the brushing processing of the mapping data according to the comparison result of the ratio and the starting threshold;
step S30, polling all the secondary mapping tables, and writing mapping data in the secondary mapping tables into the corresponding tertiary mapping tables according to the comparison result of the secondary mapping tables and preset conditions;
and S40, stopping the brushing process of the mapping data according to the comparison result of the ratio and the stop threshold.
Referring to fig. 3, in one embodiment of the present invention, when step S10 is performed, specifically, step S10 may include the following steps:
step S11, responding to host data of a host, generating corresponding mapping data by a processing unit, and writing the mapping data into a first-level mapping table of a first storage unit, wherein the number of the first-level mapping tables is a plurality of;
step S12, updating the mapping data written in the first-stage mapping table of the first storage unit to the second-stage mapping table of the second storage unit, wherein the number of the second-stage mapping tables is a plurality of;
step S13, recording a third-level mapping table to which host data corresponding to mapping data in the second-level mapping table belongs, wherein the mapping data in the second-level mapping table belongs to the number of mapping data of a certain third-level mapping table, and the time length of association between a certain second-level mapping table and the corresponding third-level mapping table.
Referring to fig. 4, in one embodiment of the present invention, when step S20 is performed, specifically, step S20 may include the following steps:
s21, obtaining the ratio of the number of the written mapping data in the second storage unit to the maximum writing amount, and judging whether the ratio is larger than a starting threshold value;
step S22, if the ratio of the number of the mapping data written in the second storage unit to the maximum writing amount is greater than the starting threshold, performing the downward brushing processing of the mapping data;
step S23, if the ratio of the number of the written mapping data in the second storage unit to the maximum writing amount is smaller than or equal to the starting threshold value, the downward brushing processing of the mapping data is not performed.
Referring to fig. 5, in one embodiment of the present invention, when step S30 is performed, specifically, step S30 may include the following steps:
step S31, all the secondary mapping tables are polled, and whether the time length associated with one tertiary mapping table is greater than a time threshold value is judged;
step S32, if the time length of a certain secondary mapping table associated with a corresponding tertiary mapping table is greater than a time threshold, mapping data in the certain secondary mapping table is written into the corresponding tertiary mapping table;
step S33, if the time length associated with a certain secondary mapping table and a corresponding tertiary mapping table is smaller than or equal to the time threshold, according to the comparison result of the number of the mapping data written in the certain secondary mapping table and the average threshold, the mapping data in the certain secondary mapping table is written in the corresponding tertiary mapping table.
Referring to fig. 6, in one embodiment of the present invention, when step S33 is performed, specifically, step S33 may include the following steps:
step S331, judging whether the number of the written mapping data in a certain secondary mapping table is larger than an average threshold value;
step S332, if the number of the mapping data written in a certain secondary mapping table is greater than the average threshold value, writing the mapping data in the secondary mapping table into a corresponding tertiary mapping table;
step S333, if the number of the mapping data written in a certain secondary mapping table is smaller than or equal to the average threshold value, sorting the secondary mapping tables according to the number of the mapping data in the secondary mapping table, which belongs to a certain tertiary mapping table, and the time length associated with the secondary mapping table and the corresponding tertiary mapping table, and sequentially writing the mapping data in the sorted secondary mapping tables into the corresponding tertiary mapping tables.
Referring to fig. 7, in one embodiment of the present invention, when step S40 is performed, specifically, step S40 may include the following steps:
step S41, judging whether the ratio of the number of the written mapping data in the second storage unit to the maximum writing amount is larger than a stop threshold value;
step S42, if the ratio of the number of the mapping data written in the second storage unit to the maximum writing amount is greater than the stop threshold, continuing to perform the brushing processing of the mapping data;
and step S43, if the ratio of the number of the written mapping data in the second storage unit to the maximum writing amount is smaller than or equal to the stop threshold value, stopping the brushing processing of the mapping data.
Therefore, in the above scheme, by optimizing the brushing-down mode of the mapping data, when the same three-level mapping table is updated, the cache space of the second storage unit can be released as much as possible. Meanwhile, the proportion of mapping data actually required to be brushed can be improved by selecting more secondary mapping tables for brushing, which is equivalent to reducing the writing times of the tertiary mapping tables, and the service life of the flash memory block can be prolonged to a certain extent. In addition, when the same amount of mapping data is brushed down, the number of times of the read three-level mapping table can be reduced, and the writing efficiency is improved to a certain extent. Finally, according to the time length of the association between the second-level mapping table and the corresponding third-level mapping table, the part of mapping data can be guaranteed to be timely brushed down, and then the cache space of the second storage unit can be timely released. According to the method and the device, the lower brushing mode of the mapping data is optimized, so that the write amplification optimization mode aiming at the flash memory block is perfected, and the service life of the flash memory block is prolonged to a certain extent.
The embodiments of the invention disclosed above are intended only to help illustrate the invention. The examples are not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. The invention is limited only by the claims and the full scope and equivalents thereof.

Claims (10)

1. A memory, comprising:
a flash memory block provided with a three-level mapping table therein configured to store mapping data;
the host computer, the electrical connection is in host computer with the flash memory piece, is configured to according to the host computer data of host computer, the mapping data that generates corresponds, the host computer includes:
the first storage unit is internally provided with a first-level mapping table and is configured to write the mapping data;
the second storage unit is internally provided with a second-level mapping table and is configured to write the mapping data; and
the processing unit is configured to acquire the ratio of the number of the mapping data written in the second storage unit to the maximum writing amount, and execute the brushing processing of the mapping data or stop the brushing processing of the mapping data according to the comparison result of the ratio and the starting threshold and the comparison result of the ratio and the stopping threshold;
the processing unit is further configured to poll all the secondary mapping tables, and write mapping data in the secondary mapping tables into the corresponding tertiary mapping tables according to comparison results of the secondary mapping tables and preset conditions;
the preset condition includes a time threshold and an average threshold, where the time threshold is a time length for which the second-level mapping table is accessed by a certain third-level mapping table, and the average threshold is an average value of the numbers of mapping data written in all the second-level mapping tables in the second storage unit, and the average threshold=the number of mapping data/the number of second-level mapping tables.
2. The memory of claim 1, wherein the processing unit is configured to generate corresponding mapping data in response to the host data, write the mapping data into the primary mapping table, and update the mapping data in the primary mapping table into the secondary mapping table.
3. The memory according to claim 2, wherein the processing unit is further configured to record a tertiary mapping table to which the host data corresponding to the mapping data in the secondary mapping table belongs, the number of mapping data of a certain tertiary mapping table to which the mapping data in the secondary mapping table belongs, and a time length for which the certain secondary mapping table is associated with the corresponding tertiary mapping table.
4. The memory according to claim 1, wherein the processing unit determines that the ratio is greater than the activation threshold, the action performed is to perform a flush-down process of the mapping data, and the processing unit determines that the ratio is less than or equal to the activation threshold, the action performed is to perform no flush-down process of the mapping data.
5. The memory according to claim 1, wherein the processing unit determines that the ratio is greater than the stop threshold, the action performed is to continue the brushing-down processing of the map data, and the processing unit determines that the ratio is less than or equal to the stop threshold, the action performed is to stop the brushing-down processing of the map data.
6. The memory of claim 1, wherein the processing unit is configured to poll all of the secondary mapping tables and determine that an action performed by a particular secondary mapping table is to write mapping data in the particular secondary mapping table to the corresponding tertiary mapping table when a length of time associated with the particular secondary mapping table is greater than a time threshold.
7. The memory according to claim 6, wherein when the processing unit determines that the length of time that the certain secondary mapping table is associated with the corresponding tertiary mapping table is less than or equal to a time threshold, the processing unit performs an action of writing the mapping data in the certain secondary mapping table into the corresponding tertiary mapping table according to a comparison result of the number of the mapping data written in the certain secondary mapping table and an average threshold.
8. The memory of claim 7, wherein the processing unit determines that the number of mapping data written in the one secondary mapping table is greater than the average threshold, the action is to write the mapping data in the one secondary mapping table into the corresponding tertiary mapping table.
9. The memory according to claim 7, wherein when the processing unit determines that the number of the written mapping data in the certain secondary mapping table is smaller than or equal to the average threshold, the processing unit performs an action of sorting the secondary mapping tables according to the number of the mapping data in the secondary mapping table belonging to the certain tertiary mapping table and a time length of association of the secondary mapping table with the corresponding tertiary mapping table, and sequentially writing the mapping data in the sorted secondary mapping tables into the corresponding tertiary mapping table.
10. A data processing method of a memory, comprising:
responding to host data of a host, and sequentially writing corresponding mapping data into a first storage unit and a second storage unit by a processing unit;
acquiring the ratio of the number of the mapping data written in the second storage unit to the maximum writing amount, and performing the brushing processing of the mapping data according to the comparison result of the ratio and the starting threshold;
polling all the secondary mapping tables, and writing mapping data in the secondary mapping tables into corresponding tertiary mapping tables according to a comparison result of the secondary mapping tables and preset conditions, wherein the preset conditions comprise a time threshold and an average threshold, the time threshold is the time length of the secondary mapping tables accessed by a certain tertiary mapping table, the average threshold is the average value of the number of mapping data written in all the secondary mapping tables in a second storage unit, and the average threshold=the number of mapping data/the number of secondary mapping tables;
and stopping the brushing process of the mapping data according to the comparison result of the ratio and the stopping threshold value.
CN202311841649.1A 2023-12-29 2023-12-29 Memory and data processing method thereof Active CN117492663B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311841649.1A CN117492663B (en) 2023-12-29 2023-12-29 Memory and data processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311841649.1A CN117492663B (en) 2023-12-29 2023-12-29 Memory and data processing method thereof

Publications (2)

Publication Number Publication Date
CN117492663A CN117492663A (en) 2024-02-02
CN117492663B true CN117492663B (en) 2024-03-26

Family

ID=89676779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311841649.1A Active CN117492663B (en) 2023-12-29 2023-12-29 Memory and data processing method thereof

Country Status (1)

Country Link
CN (1) CN117492663B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107003942A (en) * 2014-10-27 2017-08-01 桑迪士克科技有限责任公司 To for strengthening the performance of storage device and the processing of persistent unmapped order
CN108491335A (en) * 2018-03-30 2018-09-04 北京联想核芯科技有限公司 Handle method, apparatus, equipment and the medium of mapping item
TWI688861B (en) * 2018-09-18 2020-03-21 新唐科技股份有限公司 Data processing apparatus and data protection method thereof
TWI766764B (en) * 2021-07-20 2022-06-01 群聯電子股份有限公司 Method for managing memory buffer, memory control circuit unit and memory storage apparatus
CN115407946A (en) * 2022-11-02 2022-11-29 合肥康芯威存储技术有限公司 Memory and control method and control system thereof
CN115599578A (en) * 2022-10-09 2023-01-13 合肥康芯威存储技术有限公司(Cn) Memory, control method thereof and memory system
CN116540950A (en) * 2023-07-05 2023-08-04 合肥康芯威存储技术有限公司 Memory device and control method for writing data thereof
CN116737613A (en) * 2022-03-04 2023-09-12 联芸科技(杭州)股份有限公司 Mapping table management method and memory

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7711923B2 (en) * 2006-06-23 2010-05-04 Microsoft Corporation Persistent flash memory mapping table
US20140025921A1 (en) * 2012-07-19 2014-01-23 Jmicron Technology Corp. Memory control method utilizing main memory for address mapping and related memory control circuit
TWI534618B (en) * 2015-07-13 2016-05-21 群聯電子股份有限公司 Mapping table updating method, memory control circuit unit and memory storage device
US9946473B2 (en) * 2015-12-03 2018-04-17 Sandisk Technologies Llc Efficiently managing unmapped blocks to extend life of solid state drive

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107003942A (en) * 2014-10-27 2017-08-01 桑迪士克科技有限责任公司 To for strengthening the performance of storage device and the processing of persistent unmapped order
CN108491335A (en) * 2018-03-30 2018-09-04 北京联想核芯科技有限公司 Handle method, apparatus, equipment and the medium of mapping item
TWI688861B (en) * 2018-09-18 2020-03-21 新唐科技股份有限公司 Data processing apparatus and data protection method thereof
TWI766764B (en) * 2021-07-20 2022-06-01 群聯電子股份有限公司 Method for managing memory buffer, memory control circuit unit and memory storage apparatus
CN116737613A (en) * 2022-03-04 2023-09-12 联芸科技(杭州)股份有限公司 Mapping table management method and memory
CN115599578A (en) * 2022-10-09 2023-01-13 合肥康芯威存储技术有限公司(Cn) Memory, control method thereof and memory system
CN115407946A (en) * 2022-11-02 2022-11-29 合肥康芯威存储技术有限公司 Memory and control method and control system thereof
CN116540950A (en) * 2023-07-05 2023-08-04 合肥康芯威存储技术有限公司 Memory device and control method for writing data thereof

Also Published As

Publication number Publication date
CN117492663A (en) 2024-02-02

Similar Documents

Publication Publication Date Title
US11068391B2 (en) Mapping table updating method for data storage device
CN107168647B (en) FLASH data read-write method and system
US8135904B2 (en) Method and apparatus for facilitating fast wake-up of a non-volatile memory system
US7613870B2 (en) Efficient memory usage in systems including volatile and high-density memories
US20120166710A1 (en) Flash Memory Device and Data Access Method Thereof
TWI403897B (en) Memory device and data management method thereof
KR102063738B1 (en) Data backup device and method
CN111475425A (en) Method for managing flash memory module and related flash memory controller and electronic device
JP2005209188A (en) Data recovery apparatus and method used for flash memory
CN109213450B (en) Associated metadata deleting method, device and equipment based on flash memory array
US10275187B2 (en) Memory device and data read method thereof
CN113608701A (en) Data management method in storage system and solid state disk
CN111562882A (en) Data writing method, intelligent terminal and storage medium
CN117492663B (en) Memory and data processing method thereof
CN110309081B (en) FTL data page reading and writing method based on compressed storage and address mapping table entry
CN111966531A (en) Data snapshot method and device, computer equipment and storage medium
CN112068772A (en) Data storage method, data storage device and storage device
WO2016141817A1 (en) Data backup device and method
US11789864B2 (en) Flush method for mapping table of SSD
CN109243517B (en) Searching method for NAND Flash bad block and solid state disk
CN111078128A (en) Data management method and device and solid state disk
CN114003169B (en) Data compression method for SSD
TW201709207A (en) Access method of flash memory and associated memory controller and electronic device
CN112559384B (en) Dynamic partitioning method for hybrid solid-state disk based on nonvolatile memory
LU101617B1 (en) Method for improving the efficiency of reconstructing no mapping tables

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant