CN115543865B - Power failure protection method and device, readable storage medium and electronic equipment - Google Patents
Power failure protection method and device, readable storage medium and electronic equipment Download PDFInfo
- Publication number
- CN115543865B CN115543865B CN202211487922.0A CN202211487922A CN115543865B CN 115543865 B CN115543865 B CN 115543865B CN 202211487922 A CN202211487922 A CN 202211487922A CN 115543865 B CN115543865 B CN 115543865B
- Authority
- CN
- China
- Prior art keywords
- power
- segment
- data
- read
- host
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1027—Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/16—Protection against loss of memory contents
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention discloses a power failure protection method, a power failure protection device, a readable storage medium and electronic equipment, which are used for receiving power failure occurrence information; flushing the segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information, and generating a power failure segment table based on the flushed segmented L2P mapping data; the method comprises the steps of receiving a host reading request, wherein the host reading request comprises data to be read, reading the data to be read based on a power-down segment table according to the host reading request, realizing segment power-down protection, knowing which segmented data are not flushed into a flash memory from the power-down segment table, namely which segmented data are not converted into an L2P mapping table, and performing mutual exclusion and recovery based on the power-down segment table after power is on and when the host reading request is received, wherein the host reading request can be responded without waiting for the data in all L2P cache pools to be recovered into the L2P mapping table, so that the time for re-power-on is shortened, the speed for responding to the host reading and writing request is improved, and the compatibility problem caused by long re-power-on is reduced.
Description
Technical Field
The invention relates to the technical field of solid state disks, in particular to a power failure protection method, a power failure protection device, a readable storage medium and electronic equipment.
Background
At present, in mainstream enterprise-level SSD (Solid State drive) firmware development, a capacitor is generally provided on an SSD of a DRAM (Dynamic Random Access Memory) series for power down protection, because a host read-write data and a modified L2P (Logical To Physical ) mapping data are stored in the DRAM; the problem that SSD manufacturers need to consider is that the cost and the size of the SSD are limited, the matched capacitor is limited, and how to ensure that all data are not lost in the limited capacitor discharge time and the data can be quickly recovered after being electrified is solved.
After a power loss event occurs, firstly, flushing data written by a host into a NAND (flash memory), and flushing mapping data cached in an L2P cache pool into the NAND; the mapping relation between the LAA (logical address) and the PAA (physical address) which are updated according to the request sequence is stored in the L2P cache pool, for example, LAA0, LAA50, LAA2000 and the like are stored in sequence according to the request sequence; the L2P cache table stores the mapping relationship between the LAA and the PAA stored according to the address relationship, for example, LAA0, LAA1, LAA2, etc. are stored in sequence according to the address order; since the amount of the L2P cache table is large, if the addresses of 4Bytes are stored according to the mapping granularity of 4k, the 1T data space needs 1G of the L2P cache table, so that it cannot be guaranteed that all data in the L2P cache table is updated to the NAND when power lost occurs.
The current mainstream scheme is as follows: as shown in fig. 4 and 5, the L2P cache table performs periodic NAND flushing in the background, for example, triggering with a fixed duration or a fixed write amount; after power lost occurs, the incremental data in the L2P cache pool is flushed into the NAND, after the L2P is completely updated once, a consistent checkpoint (an internal event) similar to a database is formed, and subsequent incremental updating can be recovered through the L2P cache pool.
The scheme has a serious problem, that is, if the data stored in the L2P cache pool is more, all the data in the load L2P cache pool needs to be updated to the L2P cache table in the power-on process, so that the read-write request issued by the host can be executed, which may cause the problem of too long power-on time or slow response of the host request.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the power failure protection method, the power failure protection device, the readable storage medium and the electronic equipment are provided, the time length for re-electrifying can be shortened, and the speed for responding to a host read-write request is improved.
In order to solve the technical problems, the invention adopts a technical scheme that:
a power-down protection method comprises the following steps:
receiving power failure occurrence information;
flushing the segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information, and generating a power failure segment table based on the flushed segmented L2P mapping data;
receiving a host reading request, wherein the host reading request comprises data to be read, and reading the data to be read based on the power-down segment table according to the host reading request.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a power down protection device comprising:
the information acquisition module is used for receiving power failure occurrence information;
the data processing module is used for flushing the segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information and generating a power failure segment table based on the flushed segmented L2P mapping data;
and the data reading module is used for receiving a host reading request, wherein the host reading request comprises data to be read, and the data to be read is read based on the power-down segment table according to the host reading request.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a power down protection method as described above.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of a power down protection method as described above when executing the computer program.
The invention has the beneficial effects that: the method comprises the steps of flushing segmented L2P mapping data in each L2P cache pool into a flash memory according to power failure occurrence information, generating a power failure segment table based on the flushed segmented L2P mapping data, reading data to be read based on the power failure segment table according to a host reading request, achieving segmented power failure protection, knowing which segmented data are not flushed into the flash memory from the power failure segment table, namely, which segmented data are not converted into an L2P mapping table, performing mutual exclusion and recovery based on the power failure segment table after power-on and when the host reading request is received, and responding to the host reading request without waiting for the data in all the L2P cache pools to be recovered into the L2P mapping table, so that the time for power-on is shortened, the speed for responding to the host reading request is increased, and the compatibility problem caused by overlong power-on is reduced.
Drawings
Fig. 1 is a flowchart illustrating steps of a power down protection method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a power down protection apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of data protection in case of power failure in the prior art;
FIG. 5 is a diagram illustrating a data recovery during power-up in the prior art;
fig. 6 is a schematic diagram of data protection in power failure in the power failure protection method according to the embodiment of the present invention;
fig. 7 is a schematic diagram of data recovery at power up in the power failure protection method according to the embodiment of the present invention.
Detailed Description
In order to explain the technical contents, the objects and the effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1, an embodiment of the present invention provides a power failure protection method, including:
receiving power failure occurrence information;
flushing the segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information, and generating a power failure segment table based on the flushed segmented L2P mapping data;
receiving a host reading request, wherein the host reading request comprises data to be read, and reading the data to be read based on the power-down segment table according to the host reading request.
From the above description, the beneficial effects of the present invention are: the method comprises the steps of flushing segmented L2P mapping data in each L2P cache pool into a flash memory according to power failure occurrence information, generating a power failure segment table based on the flushed segmented L2P mapping data, reading data to be read based on the power failure segment table according to a host reading request, achieving segmented power failure protection, knowing which segmented data are not flushed into the flash memory from the power failure segment table, namely, which segmented data are not converted into an L2P mapping table, performing mutual exclusion and recovery based on the power failure segment table after power-on and when the host reading request is received, and responding to the host reading request without waiting for the data in all the L2P cache pools to be recovered into the L2P mapping table, so that the time for power-on is shortened, the speed for responding to the host reading request is increased, and the compatibility problem caused by overlong power-on is reduced.
Further, the step of flushing the segmented L2P mapping data in each L2P cache pool to the flash memory according to the received power failure occurrence information includes:
acquiring L2P mapping data;
segmenting the L2P mapping data according to a preset length to obtain a plurality of segmented L2P mapping data;
and storing each segmented L2P mapping data to a corresponding L2P cache pool.
As can be seen from the above description, the L2P mapping data is segmented according to the preset length, and each segmented L2P mapping data is stored in the corresponding L2P cache pool, so as to facilitate the subsequent implementation of the segmented power-down protection.
Further, the receiving a host read request, where the host read request includes data to be read, and the reading the data to be read based on the power-down segment table according to the host read request includes:
judging whether power-on occurrence information is received or not;
if so, determining power failure protection information corresponding to each segment based on the power failure segment table according to the power-on occurrence information;
and judging whether a host reading request is received, wherein the host reading request comprises data to be read, and if so, reading the data to be read based on the power-fail protection information corresponding to each segment according to the host reading request.
As can be seen from the above description, the power-down protection information indicates whether data in the corresponding segment has not been converted into the L2P mapping table, and when a host read request is subsequently received, whether data is directly read from the L2P mapping table can be determined according to the power-down protection information, so that the response speed of the host read request is increased.
Further, the generating a power-down segment table based on the flushed-in segment L2P mapping data includes:
determining a physical address, a segment identifier and a brushing timestamp corresponding to each flushed segment of L2P mapping data;
and generating a power-down segment table according to the physical address, the segment identifier and the brushing timestamp.
As can be seen from the above description, the power-down segment table is generated according to the physical address, the segment identifier, and the flush timestamp, and it can be known through the power-down segment table which data of which segments has been flushed to the flash memory, that is, converted into the L2P mapping table, so that the method for determining the subsequent response read request based on the power-down segment table is convenient.
Further, the determining power down protection information corresponding to each segment based on the power down segment table according to the power up occurrence information includes:
and traversing each segment according to the power-on occurrence information, judging whether the traversed segment exists in the power-down segment table or not according to the physical address, the segment identifier and the brushing timestamp for the traversed segment, if so, determining the power-down protection information corresponding to the traversed segment to be a first preset value, and otherwise, determining the power-down protection information corresponding to the traversed segment to be a second preset value.
According to the description, which data are not recovered can be accurately and effectively known according to the physical address, the segment identifier and the brushing timestamp, so that the time length for powering on again after power failure is reduced.
Further, the reading the data to be read based on the power down protection information corresponding to each segment according to the host read request includes:
determining a target segment corresponding to the data to be read according to the host read request;
determining target power failure protection information corresponding to the target segment from the power failure protection information corresponding to each segment;
and judging whether the target power-down protection information is a first preset value, if so, directly reading the data to be read from an L2P cache table corresponding to the L2P cache pool, otherwise, loading the segmented L2P mapping data in the target segment to the L2P cache table corresponding to the L2P cache pool, and reading the data to be read from the L2P cache table.
As can be seen from the above description, when the target power-down protection information is the first preset value, it indicates that all data in the segment are restored to the L2P cache table corresponding to the L2P cache pool, and the data to be read can be directly read from the L2P cache table, otherwise, it is considered that part of the data in the segment is not restored to the L2P cache table corresponding to the L2P cache pool, the L2P mapping data in the segment needs to be loaded to the L2P cache table, and then the data is read from the L2P cache table, so as to respond to the read request of the host in time, and improve the response efficiency.
Further, the first preset value is 0.
Referring to fig. 2, another embodiment of the present invention provides a power down protection device, including:
the information acquisition module is used for receiving power failure occurrence information;
the data processing module is used for flushing the segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information and generating a power failure segment table based on the flushed segmented L2P mapping data;
and the data reading module is used for receiving a host reading request, wherein the host reading request comprises data to be read, and the data to be read is read based on the power-down segment table according to the host reading request.
Another embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of a power fail safeguard method as described above.
Referring to fig. 3, another embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the power failure protection method.
The power failure protection method, the power failure protection device, the readable storage medium and the electronic device of the present invention can be applied to an SSD, and the following description is given by specific embodiments:
example one
Referring to fig. 1, fig. 6 and fig. 7, a power down protection method of the present embodiment includes the steps of:
s1, acquiring L2P mapping data;
s2, segmenting the L2P mapping data according to a preset length to obtain a plurality of segmented L2P mapping data;
the preset length can be set according to actual conditions;
in an optional implementation manner, the preset length is 16G, the L2P mapping data is segmented according to 16G to obtain a plurality of segmented L2P mapping data, and the range of 1T may be divided into 64 segments (segments).
And S3, storing each piece of L2P mapping data into a corresponding L2P cache pool, namely, each piece corresponds to the respective L2P cache pool.
S4, receiving power failure (power lost) occurrence information;
s5, according to the power failure occurrence information, flushing the segmented L2P mapping data in each L2P cache pool into a flash memory, and generating a power failure segment table based on the flushed segmented L2P mapping data, as shown in FIG. 6, specifically comprising:
and S51, flushing the segmented L2P mapping data in each L2P cache pool into a flash memory (NAND) according to the power failure occurrence information.
S52, determining a physical address (PAA), a segment identifier (segment id) and a brushing timestamp corresponding to each flushed segment L2P mapping data;
and S53, generating a segment table (segment table) according to the physical address, the segment identifier and the brushing timestamp.
Specifically, the physical address, the segment identifier, and the brushing timestamp are saved in a segment table.
S6, receiving a host read request, where the host read request includes data to be read, and reading the data to be read based on the power-down segment table according to the host read request, as shown in fig. 7, specifically including:
s61, judging whether power on occurrence information is received or not;
s611, if yes, determining power failure protection information corresponding to each segment based on the power failure segment table according to the power-on occurrence information;
specifically, each segment is traversed according to the power-on occurrence information, and whether the traversed segment exists in the power-down segment table or not is judged according to the physical address, the segment identifier and the brushing timestamp for the traversed segment, if so, power-down protection information (segment dirty bit map) corresponding to the traversed segment is determined to be a first preset value, and otherwise, the power-down protection information corresponding to the traversed segment is determined to be a second preset value.
Wherein the first preset value is 0, and the second preset value is 1.
For example, if the segment id of a segment is in the segment table, and PAAs of all segment L2P mapping data of the segment are in the segment table, the segment dirty bitmap corresponding to the segment is determined to be 1, otherwise, the segment dirty bitmap is determined to be 0.
S612, if not, returning to S61;
s62, judging whether a host reading request is received or not, wherein the host reading request comprises data to be read;
s621, if yes, reading the data to be read based on the power fail-over information corresponding to each segment according to the host read request, specifically including:
s6211, determining a target segment corresponding to the data to be read according to the host read request;
the data to be read is a logic address (LAA) corresponding to the data to be read;
specifically, the target segment corresponding to the data to be read is determined according to the logical address corresponding to the data to be read.
S6212, determining target power failure protection information corresponding to the target segment from the power failure protection information corresponding to each segment;
for example, all segment dirty bitmap is 00011100011001, if the target segment is segment 2, the corresponding target power-down protection information is 0, which indicates that the latest L2P mapping data is already in the L2P cache table, and the L2P cache table can be directly read, and if the target segment is segment 4, the corresponding target power-down protection information is 1, which indicates that the L2P mapping data is still in the L2P cache pool, and the data in the segment corresponding to the load can be directly loaded into the L2P cache table.
S6213, judging whether the target power-down protection information is a first preset value, if so, directly reading the data to be read from an L2P cache table corresponding to the L2P cache pool, and if not, loading the segmented L2P mapping data in the target segment to the L2P cache table corresponding to the L2P cache pool, and reading the data to be read from the L2P cache table.
And S622, if not, returning to S62.
Example two
Referring to fig. 2, a power down protection device of the present embodiment includes:
the information acquisition module is used for receiving power failure occurrence information;
the data processing module is used for flushing the segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information and generating a power failure segment table based on the flushed segmented L2P mapping data;
and the data reading module is used for receiving a host reading request, wherein the host reading request comprises data to be read, and the data to be read is read based on the power-down segment table according to the host reading request.
EXAMPLE III
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, is capable of implementing the steps of the power down protection method in the first embodiment.
Example four
Referring to fig. 3, an electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the power down protection method in the first embodiment.
In summary, the power failure protection method, device, readable storage medium and electronic device provided by the present invention receive power failure occurrence information; flushing segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information, and generating a power failure segment table based on the flushed segmented L2P mapping data; receiving a host reading request, wherein the host reading request comprises data to be read, and reading the data to be read based on the power-down segment table according to the host reading request; before the flash memory is flushed, acquiring L2P mapping data; segmenting the L2P mapping data according to a preset length to obtain a plurality of segmented L2P mapping data; storing each segment of L2P mapping data into a corresponding L2P cache pool, realizing segment power-down protection, knowing which segments of data have not been flushed into a flash memory from a power-down segment table, i.e. which segments of data have not been converted into an L2P mapping table, when the power is on and a host read request is received, performing mutual exclusion and recovery based on the power-down segment table, and responding to the host read request without waiting for the data in all the L2P cache pools to be recovered into the L2P mapping tables, thereby reducing the time length for power-up, improving the speed for responding to the host read-write request, and reducing the compatibility problem caused by long power-up.
In the above embodiments provided in the present application, it should be understood that the disclosed method, apparatus, computer-readable storage medium, and electronic device may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of components or modules may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or components or modules, and may be in an electrical, mechanical or other form.
The components described as separate parts may or may not be physically separate, and parts displayed as components may or may not be physical modules, may be located in one position, or may be distributed on a plurality of network modules. Some or all of the components can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each component may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that for simplicity and convenience of description, the above-described method embodiments are shown as a series of combinations of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required of the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.
Claims (6)
1. A power failure protection method is characterized by comprising the following steps:
receiving power failure occurrence information;
flushing segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information, and generating a power failure segment table based on the flushed segmented L2P mapping data;
receiving a host reading request, wherein the host reading request comprises data to be read, and reading the data to be read based on the power-down segment table according to the host reading request;
the receiving of the host read request includes data to be read, and the reading of the data to be read based on the power-down segment table according to the host read request includes:
judging whether power-on occurrence information is received or not;
if so, determining power failure protection information corresponding to each segment based on the power failure segment table according to the power-on occurrence information;
judging whether a host reading request is received, wherein the host reading request comprises data to be read, and if so, reading the data to be read based on the power-down protection information corresponding to each segment according to the host reading request;
the generating of the power-down segment table based on the flushed-in segmented L2P mapping data comprises:
determining a physical address, a segment identifier and a brushing timestamp corresponding to each flushed segment of L2P mapping data;
generating a power-down segment table according to the physical address, the segment identifier and the brushing timestamp;
the determining power failure protection information corresponding to each segment based on the power failure segment table according to the power-on occurrence information comprises:
traversing each segment according to the power-on occurrence information, judging whether the traversed segment exists in the power-off segment table or not according to the physical address, the segment identifier and the brushing timestamp for the traversed segment, if so, determining the power-off protection information corresponding to the traversed segment as a first preset value, otherwise, determining the power-off protection information corresponding to the traversed segment as a second preset value;
the reading the data to be read based on the power fail safe information corresponding to each segment according to the host read request comprises:
determining a target segment corresponding to the data to be read according to the host read request;
determining target power-fail protection information corresponding to the target segments from the power-fail protection information corresponding to each segment;
and judging whether the target power-down protection information is a first preset value, if so, directly reading the data to be read from an L2P cache table corresponding to the L2P cache pool, otherwise, loading the segmented L2P mapping data in the target segment to the L2P cache table corresponding to the L2P cache pool, and reading the data to be read from the L2P cache table.
2. The method of claim 1, wherein the step of flushing the segmented L2P mapping data in each L2P cache pool to the flash memory according to the received power failure occurrence information comprises the steps of:
acquiring L2P mapping data;
segmenting the L2P mapping data according to a preset length to obtain a plurality of segmented L2P mapping data;
and storing each segmented L2P mapping data to a corresponding L2P cache pool.
3. The power-fail protection method according to claim 1, wherein the first preset value is 0.
4. A power down protection device, comprising:
the information acquisition module is used for receiving power failure occurrence information;
the data processing module is used for flushing the segmented L2P mapping data in each L2P cache pool into a flash memory according to the power failure occurrence information and generating a power failure segment table based on the flushed segmented L2P mapping data;
the data reading module is used for receiving a host reading request, wherein the host reading request comprises data to be read, and the data to be read is read based on the power-down segment table according to the host reading request;
the receiving a host read request, where the host read request includes data to be read, and the reading the data to be read based on the power-down segment table according to the host read request includes:
judging whether power-on occurrence information is received or not;
if so, determining power failure protection information corresponding to each segment based on the power failure segment table according to the power-on occurrence information;
judging whether a host reading request is received, wherein the host reading request comprises data to be read, and if so, reading the data to be read based on the power-down protection information corresponding to each segment according to the host reading request;
the generating of the power-down segment table based on the flushed-in segmented L2P mapping data comprises:
determining a physical address, a segment identifier and a brushing timestamp corresponding to each flushed segment of L2P mapping data;
generating a power-down segment table according to the physical address, the segment identifier and the brushing timestamp;
the determining power failure protection information corresponding to each segment based on the power failure segment table according to the power-on occurrence information comprises:
traversing each segment according to the power-on occurrence information, judging whether the traversed segment exists in the power-off segment table or not according to the physical address, the segment identifier and the brushing timestamp for the traversed segment, if so, determining the power-off protection information corresponding to the traversed segment as a first preset value, otherwise, determining the power-off protection information corresponding to the traversed segment as a second preset value;
the reading the data to be read based on the power fail safe information corresponding to each segment according to the host read request comprises:
determining a target segment corresponding to the data to be read according to the host read request;
determining target power failure protection information corresponding to the target segment from the power failure protection information corresponding to each segment;
and judging whether the target power-down protection information is a first preset value, if so, directly reading the data to be read from an L2P cache table corresponding to the L2P cache pool, otherwise, loading the segmented L2P mapping data in the target segment to the L2P cache table corresponding to the L2P cache pool, and reading the data to be read from the L2P cache table.
5. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a method for power down protection according to any one of claims 1 to 3.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of a power down protection method as claimed in any one of claims 1 to 3 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211487922.0A CN115543865B (en) | 2022-11-25 | 2022-11-25 | Power failure protection method and device, readable storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211487922.0A CN115543865B (en) | 2022-11-25 | 2022-11-25 | Power failure protection method and device, readable storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115543865A CN115543865A (en) | 2022-12-30 |
CN115543865B true CN115543865B (en) | 2023-04-11 |
Family
ID=84722096
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211487922.0A Active CN115543865B (en) | 2022-11-25 | 2022-11-25 | Power failure protection method and device, readable storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115543865B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117149091A (en) * | 2023-10-23 | 2023-12-01 | 四川云海芯科微电子科技有限公司 | Solid state disk data storage method and related device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1447243A (en) * | 2002-03-25 | 2003-10-08 | 太和科技股份有限公司 | Calculation method executed in quick flash memory fast and not caused abnormal power breakdown as well as its control system |
CN112631950A (en) * | 2020-12-11 | 2021-04-09 | 苏州浪潮智能科技有限公司 | L2P table saving method, system, device and medium |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW531698B (en) * | 2001-08-31 | 2003-05-11 | Key Technology Corp | Rapid and abnormal power shutdown prevention algorithm for flash memory |
CN102043721B (en) * | 2010-05-12 | 2016-10-26 | 中颖电子股份有限公司 | Flash memory storage management method |
CN103996412A (en) * | 2013-02-19 | 2014-08-20 | 北京同方微电子有限公司 | Power-fail protection method applied to intelligent-card nonvolatile memories |
CN103425605A (en) * | 2013-07-26 | 2013-12-04 | 记忆科技(深圳)有限公司 | Solid-state disk power failure protection and quick start method and system |
US9558125B2 (en) * | 2014-10-27 | 2017-01-31 | Sandisk Technologies Llc | Processing of un-map commands to enhance performance and endurance of a storage device |
CN104967807B (en) * | 2014-12-30 | 2017-03-22 | 浙江大华技术股份有限公司 | Caching method and apparatus |
CN110908927A (en) * | 2018-09-14 | 2020-03-24 | 慧荣科技股份有限公司 | Data storage device and method for deleting name space thereof |
CN110908926B (en) * | 2018-09-14 | 2022-03-22 | 慧荣科技股份有限公司 | Data storage device and writing method of logical-to-physical address mapping table |
CN111984441B (en) * | 2019-05-21 | 2023-09-22 | 慧荣科技股份有限公司 | Instant power-off recovery processing method and device and computer readable storage medium |
CN110825325A (en) * | 2019-10-30 | 2020-02-21 | 深圳忆联信息***有限公司 | Mapping table dynamic loading-based SSD performance improving method and device, computer equipment and storage medium |
CN113590505B (en) * | 2021-06-30 | 2024-07-19 | 深圳大普微电子股份有限公司 | Address mapping method, solid state disk controller and solid state disk |
CN114036079B (en) * | 2021-09-07 | 2023-02-17 | 联芸科技(杭州)股份有限公司 | Mapping table compression method and system, memory controller, solid state disk and data reading method |
-
2022
- 2022-11-25 CN CN202211487922.0A patent/CN115543865B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1447243A (en) * | 2002-03-25 | 2003-10-08 | 太和科技股份有限公司 | Calculation method executed in quick flash memory fast and not caused abnormal power breakdown as well as its control system |
CN112631950A (en) * | 2020-12-11 | 2021-04-09 | 苏州浪潮智能科技有限公司 | L2P table saving method, system, device and medium |
Also Published As
Publication number | Publication date |
---|---|
CN115543865A (en) | 2022-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10255192B2 (en) | Data storage device and data maintenance method thereof | |
US11243709B2 (en) | Data storage apparatus and operating method thereof | |
TWI542991B (en) | Drive assisted system checkpointing | |
US7130962B2 (en) | Writing cache lines on a disk drive | |
US8694984B2 (en) | Memory apparatus and method of updating firmware of the memory apparatus | |
WO2021253983A1 (en) | Data recovery method and apparatus, and solid state drive | |
CN112988467B (en) | Solid state disk, data recovery method thereof and terminal equipment | |
CN108431783B (en) | Access request processing method and device and computer system | |
KR101862112B1 (en) | Accelerating boot time zeroing of memory based on non-volatile memory (nvm) technology | |
TWI596541B (en) | Data accessing system, data accessing appraratus and method for accessing data | |
CN112379830B (en) | Method and device for creating effective data bitmap, storage medium and electronic equipment | |
CN107632943B (en) | Solid state disk data protection method and solid state disk | |
CN111782656B (en) | Data reading and writing method and device | |
CN115543865B (en) | Power failure protection method and device, readable storage medium and electronic equipment | |
CN104516959A (en) | Method and device for managing database logs | |
US20180300236A1 (en) | Access request processing method and apparatus, and computer system | |
US20220188037A1 (en) | Information Writing Method and Apparatus | |
CN117370222A (en) | Storage mapping method, storage mapping device, computer readable storage medium and electronic equipment | |
CN115878033B (en) | Solid state disk and mapping table management method thereof | |
CN113778911B (en) | L2P data caching method and device, readable storage medium and electronic equipment | |
CN111124294B (en) | Sector mapping information management method and device, storage medium and equipment | |
CN111142792B (en) | Power-down protection method of storage device | |
CN109002265B (en) | Data processing method and related device | |
CN109960611B (en) | Data recovery method and device, electronic equipment and machine-readable storage medium | |
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 |