CN117687845A - Power-on recovery method and device, readable storage medium and electronic equipment - Google Patents

Power-on recovery method and device, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN117687845A
CN117687845A CN202410156646.2A CN202410156646A CN117687845A CN 117687845 A CN117687845 A CN 117687845A CN 202410156646 A CN202410156646 A CN 202410156646A CN 117687845 A CN117687845 A CN 117687845A
Authority
CN
China
Prior art keywords
check point
writing
sequence number
point file
address information
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.)
Pending
Application number
CN202410156646.2A
Other languages
Chinese (zh)
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.)
Chengdu Baiwei Storage Technology Co ltd
Original Assignee
Chengdu Baiwei 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 Chengdu Baiwei Storage Technology Co ltd filed Critical Chengdu Baiwei Storage Technology Co ltd
Priority to CN202410156646.2A priority Critical patent/CN117687845A/en
Publication of CN117687845A publication Critical patent/CN117687845A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a power-on recovery method, a device, a readable storage medium and electronic equipment, wherein a storage medium check point file is stored according to a preset period, the check point file comprises write address information and write sequence numbers of all open blocks when the check point file is stored, current write address information and write sequence numbers of the open blocks are obtained, the latest check point file is obtained from all stored check point files, a target open block is determined from the open blocks based on the write address information and the write sequence numbers in the latest check point file and the current write address information and the write sequence numbers, and data recovery is carried out on the target open block, so that the check point file stored in the period is utilized to ensure that the target open block to be recovered is in the same SN period, the condition that the data is new and old cannot be confirmed due to repeated turning is avoided, the target open block can be rapidly determined by utilizing the check point file, the requirement of a multi-open block scene is met, and the power-on recovery efficiency is improved.

Description

Power-on recovery method and device, readable storage medium and electronic equipment
Technical Field
The present invention relates to the field of memory technologies, and in particular, to a power-on recovery method and apparatus, a readable storage medium, and an electronic device.
Background
As is well known, SD cards have limited SRAM (Static Random Access Memory ) available internally due to their small capacity, and also have very high requirements for time to resume power up; the current mainstream power-on recovery scheme is to perform reverse recovery according to the largest SN (serial number), which is only applicable to a single open block scheme, i.e. all host data are written into the same super block.
If a scheme of a plurality of open blocks exists in the system at the same time, namely, data is written into a plurality of super blocks according to a certain rule, and the situation that overflow turnover exists in consideration of the fact that SN is an unsigned integer which is continuously increased is considered, under the scene of the plurality of open blocks, the size of the SN is independently compared, so that whether the data is old or new can not be confirmed; for example, the host data is written into three open blocks as shown in fig. 4 according to a certain rule, wherein the last written address of the open block_0 is page0, the last written address of the open block_1 is page1, the last written address of the open block_1 is num_1, the last written address of the open block_2 is page2, and the last written address of the open block_2 is num_2; assuming that num_0< num_1 exists, it is impossible to confirm that the data on open block_0 is old data and that on open block_1 is new data, there is a possibility that the SN value of num_1 undergoes a plurality of times of flipping.
Thus, conventional power-on restoration schemes have not been applicable to multiple open block systems.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the power-on recovery method, the device, the readable storage medium and the electronic equipment can meet the requirement of a multi-open block scene and improve the power-on recovery efficiency.
In order to solve the technical problems, the invention adopts the following technical scheme:
a power-on restoration method comprising the steps of:
storing a storage medium check point file according to a preset period, wherein the check point file comprises writing address information and writing serial numbers of all open blocks when the check point file is stored;
acquiring current writing address information and writing sequence numbers of the open blocks, and acquiring the latest check point files from all stored check point files;
determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number;
and carrying out data recovery on the target open block.
In order to solve the technical problems, the invention adopts another technical scheme that:
a power-on restoration device, comprising:
the storage module is used for storing a storage medium check point file according to a preset period, wherein the check point file comprises writing address information and writing sequence numbers of all open blocks when the check point file is stored;
the data acquisition module is used for acquiring the current writing address information and the writing sequence number of the open block and acquiring the latest check point file from all stored check point files;
the target open block determining module is used for determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number;
and the data recovery module is used for carrying out data recovery on the target open block.
In order to solve the technical problems, the invention adopts another technical scheme that:
a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the power-on restoration method described above.
In order to solve the technical problems, the invention adopts another technical scheme that:
an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the power-on restoration method described above when the computer program is executed.
The invention has the beneficial effects that: storing a storage medium check point file according to a preset period, wherein the check point file comprises write address information and write sequence numbers of all open blocks when the check point file is stored, acquiring current write address information and write sequence numbers of the open blocks, acquiring the latest check point file from all stored check point files, determining a target open block from the open blocks based on the write address information and the write sequence numbers in the latest check point file and the current write address information and the write sequence numbers, and recovering data of the target open block.
Drawings
FIG. 1 is a flowchart illustrating a power-on recovery method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a power-on recovery device 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 diagram of a prior art host data write;
FIG. 5 is a schematic diagram of a checkpoint file in a power-on recovery method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a target data block for power-on recovery method according to an embodiment of the present invention;
fig. 7 is a diagram showing the intention of generating serial number data in the power-on recovery method according to the embodiment of the present invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, a power-on recovery method includes the steps of:
storing a storage medium check point file according to a preset period, wherein the check point file comprises writing address information and writing serial numbers of all open blocks when the check point file is stored;
acquiring current writing address information and writing sequence numbers of the open blocks, and acquiring the latest check point files from all stored check point files;
determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number;
and carrying out data recovery on the target open block.
From the above description, the beneficial effects of the invention are as follows: storing a storage medium check point file according to a preset period, wherein the check point file comprises write address information and write sequence numbers of all open blocks when the check point file is stored, acquiring current write address information and write sequence numbers of the open blocks, acquiring the latest check point file from all stored check point files, determining a target open block from the open blocks based on the write address information and the write sequence numbers in the latest check point file and the current write address information and the write sequence numbers, and recovering data of the target open block.
Further, before the storage medium checkpoint file is saved according to the preset period, the method further includes:
receiving host data writing completion information;
and generating a check point file according to the host data writing completion information.
As can be seen from the above description, a checkpoint file is generated every time data writing is completed, but the checkpoint file generated every time is not saved, so that excessive memory occupation is avoided.
Further, the checkpoint file also includes a global sequence number;
the generating a checkpoint file according to the host data write completion information includes:
acquiring the writing address information and the writing serial number of all open blocks according to the host data writing completion information;
and adding one to the global sequence number, and generating a check point file according to the added global sequence number, the writing address information of all open blocks and the writing sequence number.
As can be seen from the above description, the write address information and the write sequence number of all open blocks are obtained, the global sequence number is added by one, and a check point file is generated according to the added global sequence number and the write address information and the write sequence number of all open blocks, so that the global sequence number performs self-increasing operation after each data writing, thereby facilitating the subsequent determination of the data range to be recovered.
Further, the storing the storage medium checkpoint file according to the preset period includes:
acquiring a stored storage medium last check point file, and determining the global sequence number of the last check point file;
judging whether the interval between the global serial number of the current check point file and the global serial number of the last check point file meets a preset interval, if so, storing the current check point file, and if not, not storing the current check point file.
From the above description, if the interval between the global sequence number of the current checkpoint file and the global sequence number of the previous checkpoint file meets the preset interval, the current checkpoint file is saved, so that the periodic saving of the checkpoint file is realized, the preset interval can be flexibly set according to the actual situation, the saving frequency of the checkpoint file directly determines the data size to be recovered in the current process, and the power-on recovery time can also be shortened.
Further, the determining a target open block from the open blocks based on the write address information and the write sequence number in the latest checkpoint file and the current write address information and the write sequence number includes:
and judging whether the current writing address information and the writing sequence number exist in the latest check point file, and if not, determining the current writing address information and the opening block of the writing sequence number which do not exist as a target opening block.
As can be seen from the above description, when the current write address information and the write sequence number do not exist in the latest CheckPoint file, this means that new data is written into the open blocks in which the current write address information and the write sequence number are written after the last CheckPoint file is saved, which indicates that data recovery needs to be performed on such open blocks, so that the open blocks in which data recovery needs to be performed can be accurately and quickly determined.
Further, the data recovery of the target open block includes:
determining a writing sequence number of the target open block;
sequencing the writing sequence numbers according to the sequence from small to large to obtain sequenced writing sequence numbers;
determining a data range to be recovered based on the ordered writing sequence numbers;
and carrying out data recovery according to the data range needing to be recovered.
As can be seen from the above description, since the periodic storage checkpoint file ensures that the open block data to be restored is within the same SN period, there is no case that SN turns over multiple times to confirm whether the data is old or new, and the data range to be restored can be determined directly based on the ordered write sequence number.
Further, the determining the data range to be recovered based on the ordered writing sequence number includes:
determining the last written sequence number in the ordered written sequence numbers;
generating a serial number data table according to the global serial number in the latest check point file and the last written serial number;
and determining the data range needing to be recovered according to the serial number data table.
As can be seen from the above description, even if the data information between the global sequence number and the last written sequence number in the latest checkpoint file is not saved, the sequence number data table can be generated according to the global sequence number and the last written sequence number in the latest checkpoint file, so as to quickly determine the data range to be restored.
Referring to fig. 2, another embodiment of the present invention provides a power-on recovery device, including:
the storage module is used for storing a storage medium check point file according to a preset period, wherein the check point file comprises writing address information and writing sequence numbers of all open blocks when the check point file is stored;
the data acquisition module is used for acquiring the current writing address information and the writing sequence number of the open block and acquiring the latest check point file from all stored check point files;
the target open block determining module is used for determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number;
and the data recovery module is used for carrying out data recovery on the target open block.
From the above description, the beneficial effects of the invention are as follows: storing a storage medium check point file according to a preset period, wherein the check point file comprises write address information and write sequence numbers of all open blocks when the check point file is stored, acquiring current write address information and write sequence numbers of the open blocks, acquiring the latest check point file from all stored check point files, determining a target open block from the open blocks based on the write address information and the write sequence numbers in the latest check point file and the current write address information and the write sequence numbers, and recovering data of the target open block.
Further, the method further comprises the following steps:
the data generation module is used for receiving the writing completion information of the host data; and
and generating a check point file according to the host data writing completion information.
As can be seen from the above description, a checkpoint file is generated every time data writing is completed, but the checkpoint file generated every time is not saved, so that excessive memory occupation is avoided.
Further, the checkpoint file also includes a global sequence number;
generating a checkpoint file in the data generation module according to the host data write completion information includes:
acquiring the writing address information and the writing serial number of all open blocks according to the host data writing completion information;
and adding one to the global sequence number, and generating a check point file according to the added global sequence number, the writing address information of all open blocks and the writing sequence number.
As can be seen from the above description, the write address information and the write sequence number of all open blocks are obtained, the global sequence number is added by one, and a check point file is generated according to the added global sequence number and the write address information and the write sequence number of all open blocks, so that the global sequence number performs self-increasing operation after each data writing, thereby facilitating the subsequent determination of the data range to be recovered.
Further, the storage module is specifically configured to:
acquiring a stored storage medium last check point file, and determining the global sequence number of the last check point file;
judging whether the interval between the global serial number of the current check point file and the global serial number of the last check point file meets a preset interval, if so, storing the current check point file, and if not, not storing the current check point file.
From the above description, if the interval between the global sequence number of the current checkpoint file and the global sequence number of the previous checkpoint file meets the preset interval, the current checkpoint file is saved, so that the periodic saving of the checkpoint file is realized, the preset interval can be flexibly set according to the actual situation, the saving frequency of the checkpoint file directly determines the data size to be recovered in the current process, and the power-on recovery time can also be shortened.
Further, the target open block determining module is specifically configured to:
and judging whether the current writing address information and the writing sequence number exist in the latest check point file, and if not, determining the current writing address information and the opening block of the writing sequence number which do not exist as a target opening block.
As can be seen from the above description, when the current write address information and the write sequence number do not exist in the latest CheckPoint file, this means that new data is written into the open blocks in which the current write address information and the write sequence number are written after the last CheckPoint file is saved, which indicates that data recovery needs to be performed on such open blocks, so that the open blocks in which data recovery needs to be performed can be accurately and quickly determined.
Further, the data recovery module is specifically configured to:
determining a writing sequence number of the target open block;
sequencing the writing sequence numbers according to the sequence from small to large to obtain sequenced writing sequence numbers;
determining a data range to be recovered based on the ordered writing sequence numbers;
and carrying out data recovery according to the data range needing to be recovered.
As can be seen from the above description, since the periodic storage checkpoint file ensures that the open block data to be restored is within the same SN period, there is no case that SN turns over multiple times to confirm whether the data is old or new, and the data range to be restored can be determined directly based on the ordered write sequence number.
Further, determining, in the data recovery module, a data range to be recovered based on the ordered write sequence number includes:
determining the last written sequence number in the ordered written sequence numbers;
generating a serial number data table according to the global serial number in the latest check point file and the last written serial number;
and determining the data range needing to be recovered according to the serial number data table.
As can be seen from the above description, even if the data information between the global sequence number and the last written sequence number in the latest checkpoint file is not saved, the sequence number data table can be generated according to the global sequence number and the last written sequence number in the latest checkpoint file, so as to quickly determine the data range to be restored.
Another embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the power-on restoration method described above.
Referring to fig. 3, another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the steps of the above power-on recovery method when executing the computer program.
The power-on recovery method, the device, the readable storage medium and the electronic equipment provided by the invention can be applied to power-on recovery of an SD card, and are explained by the following specific embodiments:
referring to fig. 1 and fig. 5-7, a first embodiment of the present invention is as follows:
a power-on restoration method comprising the steps of:
s1, receiving writing completion information of Host Data (Host Data).
S2, generating a check point (CheckPoint) file according to the host data writing completion information, wherein the CheckPoint file comprises writing address information, writing serial numbers and global serial numbers of all open blocks when the CheckPoint file is stored, and specifically comprises the following steps:
s21, acquiring write address information and write Sequence Numbers (SN) of all open blocks (open blocks) according to the host data write completion information.
The written address information and the written sequence number are the last written address information and the written sequence number when writing.
S22, adding one global sequence number, and generating a check point file according to the added global sequence number, the writing address information of all open blocks and the writing sequence number, as shown in fig. 5.
Wherein the global sequence number is actually consistent with the written sequence number, and the self-increment operation is performed after each writing.
S3, storing a storage medium check point file according to a preset period, wherein the method specifically comprises the following steps:
s31, acquiring a stored last check point file of the storage medium, and determining the global sequence number of the last check point file.
S32, judging whether the interval between the global serial number of the current check point file and the global serial number of the last check point file meets a preset interval, if so, storing the current check point file, and if not, not storing the current check point file.
The preset interval can be flexibly set according to practical situations, and in an alternative implementation, the preset interval is 1000.
Assuming that the global serial number of the last CheckPoint file is 1000, if the global serial number of the current CheckPoint file is 2001, the interval between the global serial number of the last CheckPoint file and the global serial number of the current CheckPoint file satisfies 1000, and the current CheckPoint file is saved.
S4, acquiring current writing address information and writing sequence numbers of the open blocks, and acquiring the latest check point files from all stored check point files.
S5, determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number.
Specifically, whether the current writing address information and the writing sequence number exist in the latest check point file is judged, if not, the current writing address information and the opening block of the writing sequence number which do not exist are determined as target opening blocks.
As shown in fig. 5 and fig. 6, the write address information of the CheckPoint block in the latest CheckPoint file found is page3, the write SN is num_3, the write address information and the write SN of the open block_0 in the latest CheckPoint file are found to be consistent with the current write address information and the write SN by comparison, and the write address information and the write SN of the open block_1 and the write SN of the open block_2 are inconsistent, which means that after the latest CheckPoint file is saved, new data is written into the two open blocks, so that the two open blocks are determined as target open blocks, and then data recovery is only needed for the open blocks_1 and the open block_2.
S6, carrying out data recovery on the target open block, wherein the method specifically comprises the following steps:
s61, determining the writing sequence number of the target open block.
S62, sequencing the writing sequence numbers in the sequence from small to large to obtain sequenced writing sequence numbers.
S63, determining a data range to be recovered based on the ordered writing sequence numbers, wherein the method specifically comprises the following steps:
s631, determining the last written serial number in the ordered written serial numbers.
S632, generating a serial number data table according to the global serial number in the latest check point file and the last written serial number.
For example, the write sequence numbers of the open blocks open block_1 and open block_2 are num_1 'and num_2', the last write SN in the ordered write SNs is num_2', the global sequence number of the CheckPoint block of the latest CheckPoint file is num_3, num_3 is started, num_2' is ended, and a sequence number data table as shown in fig. 7 is generated, wherein num_x refers to a different write sequence number.
Because the operation of periodically storing the CheckPoint file ensures that open block data to be restored is in the same SN period, the situation that the data is new and old cannot be confirmed by repeated SN overturn does not exist, if the situation that the data is new and old cannot be confirmed by repeated SN overturn occurs, namely the target open block cannot arrange the writing SNs in an increasing order, in an alternative implementation manner, the writing SN corresponding to the writing address recorded in the CheckPoint file is used as the initial SN, and then the writing SN is read until the last page (page) writing SN, and a serial number data table is generated.
S633, determining a data range to be restored according to the serial number data table.
S64, carrying out data recovery according to the data range needing to be recovered.
Referring to fig. 2, a second embodiment of the present invention is as follows:
a power-on restoration device, comprising:
the storage module is used for storing a storage medium check point file according to a preset period, wherein the check point file comprises writing address information and writing sequence numbers of all open blocks when the check point file is stored;
the data acquisition module is used for acquiring the current writing address information and the writing sequence number of the open block and acquiring the latest check point file from all stored check point files;
the target open block determining module is used for determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number;
and the data recovery module is used for carrying out data recovery on the target open block.
In an alternative embodiment, the method further comprises:
the data generation module is used for receiving the writing completion information of the host data; and
and generating a check point file according to the host data writing completion information.
In an alternative embodiment, the checkpoint file further includes a global sequence number;
generating a checkpoint file in the data generation module according to the host data write completion information includes:
acquiring the writing address information and the writing serial number of all open blocks according to the host data writing completion information;
and adding one to the global sequence number, and generating a check point file according to the added global sequence number, the writing address information of all open blocks and the writing sequence number.
In an alternative embodiment, the storage module is specifically configured to:
acquiring a stored storage medium last check point file, and determining the global sequence number of the last check point file;
judging whether the interval between the global serial number of the current check point file and the global serial number of the last check point file meets a preset interval, if so, storing the current check point file, and if not, not storing the current check point file.
In an alternative embodiment, the target open block determining module is specifically configured to:
and judging whether the current writing address information and the writing sequence number exist in the latest check point file, and if not, determining the current writing address information and the opening block of the writing sequence number which do not exist as a target opening block.
In an alternative embodiment, the data recovery module is specifically configured to:
determining a writing sequence number of the target open block;
sequencing the writing sequence numbers according to the sequence from small to large to obtain a sequenced writing sequence;
determining a data range to be recovered based on the ordered writing sequence numbers;
and carrying out data recovery according to the data range needing to be recovered.
In an alternative embodiment, the determining, in the data recovery module, the range of data that needs to be recovered based on the ordered write sequence number includes:
determining the last written sequence number in the ordered written sequence numbers;
generating a serial number data table according to the global serial number in the latest check point file and the last written serial number;
and determining the data range needing to be recovered according to the serial number data table.
The third embodiment of the invention is as follows:
a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the power-on restoration method of the first embodiment.
Referring to fig. 3, a fourth embodiment of the present invention is as follows:
an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the power-on restoration method of embodiment one when the computer program is executed.
In summary, the method, the device, the readable storage medium and the electronic equipment for power-on recovery provided by the invention store a storage medium check point file according to a preset period, wherein the check point file comprises write address information and write sequence numbers of all open blocks when the check point file is stored, current write address information and write sequence numbers of the open blocks are obtained, the latest check point file is obtained from all stored check point files, a target open block is determined from the open blocks based on the write address information and the write sequence numbers in the latest check point file and the current write address information and the write sequence numbers, and data recovery is carried out on the target open block, so that the check point file stored in the period is utilized to ensure that the target open block to be recovered is in the same SN period, therefore, the situation that the data can not be confirmed by multiple times of turning over of the SN is avoided, the target open block can be quickly determined by utilizing the check point file, thereby meeting the requirement of multiple open block scenes, and improving the power-on recovery efficiency; specifically, if the interval between the global sequence number of the current checkpoint file and the global sequence number of the previous checkpoint file meets the preset interval, the current checkpoint file is saved, so that the periodic saving of the checkpoint file is realized, the preset interval can be flexibly set according to the actual situation, the saving frequency of the checkpoint file directly determines the data size to be recovered in the current process, and the power-on recovery time can be shortened.
In the foregoing embodiments provided by the present application, it should be understood that the disclosed method, apparatus, computer readable storage medium and electronic device may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple components or modules may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with respect to each other may be an indirect coupling or communication connection via some interfaces, devices or components or modules, which may be in electrical, mechanical, or other forms.
The components illustrated as separate components may or may not be physically separate, and components shown as components may or may not be physical modules, i.e., may be located in one place, or may be distributed over multiple network modules. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The integrated modules, if implemented in the form of software functional modules 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 essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform 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, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present invention is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present invention.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (16)

1. A power-on restoration method, comprising the steps of:
storing a storage medium check point file according to a preset period, wherein the check point file comprises writing address information and writing serial numbers of all open blocks when the check point file is stored;
acquiring current writing address information and writing sequence numbers of the open blocks, and acquiring the latest check point files from all stored check point files;
determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number;
and carrying out data recovery on the target open block.
2. The method for power-on recovery according to claim 1, wherein before storing the storage medium checkpoint file according to the preset period, further comprising:
receiving host data writing completion information;
and generating a check point file according to the host data writing completion information.
3. The power-on restoration method according to claim 2, wherein the checkpoint file further comprises a global sequence number;
the generating a checkpoint file according to the host data write completion information includes:
acquiring the writing address information and the writing serial number of all open blocks according to the host data writing completion information;
and adding one to the global sequence number, and generating a check point file according to the added global sequence number, the writing address information of all open blocks and the writing sequence number.
4. A power-on restoration method as claimed in claim 3, wherein said saving the storage medium checkpoint file at a predetermined period comprises:
acquiring a stored storage medium last check point file, and determining the global sequence number of the last check point file;
judging whether the interval between the global serial number of the current check point file and the global serial number of the last check point file meets a preset interval, if so, storing the current check point file, and if not, not storing the current check point file.
5. The method of claim 1, wherein the determining a target open block from the open blocks based on the write address information and the write sequence number in the latest checkpoint file and the current write address information and write sequence number comprises:
and judging whether the current writing address information and the writing sequence number exist in the latest check point file, and if not, determining the current writing address information and the opening block of the writing sequence number which do not exist as a target opening block.
6. A power-on restoration method as set forth in claim 3, wherein said restoring data to said target open block comprises:
determining a writing sequence number of the target open block;
sequencing the writing sequence numbers according to the sequence from small to large to obtain sequenced writing sequence numbers;
determining a data range to be recovered based on the ordered writing sequence numbers;
and carrying out data recovery according to the data range needing to be recovered.
7. The method of power-on restoration according to claim 6, wherein said determining a data range to be restored based on said ordered write sequence number comprises:
determining the last written sequence number in the ordered written sequence numbers;
generating a serial number data table according to the global serial number in the latest check point file and the last written serial number;
and determining the data range needing to be recovered according to the serial number data table.
8. A power-on restoration device, comprising:
the storage module is used for storing a storage medium check point file according to a preset period, wherein the check point file comprises writing address information and writing sequence numbers of all open blocks when the check point file is stored;
the data acquisition module is used for acquiring the current writing address information and the writing sequence number of the open block and acquiring the latest check point file from all stored check point files;
the target open block determining module is used for determining a target open block from the open blocks based on the writing address information and the writing sequence number in the latest check point file and the current writing address information and the current writing sequence number;
and the data recovery module is used for carrying out data recovery on the target open block.
9. The power-on restoration device as recited in claim 8, further comprising:
the data generation module is used for receiving the writing completion information of the host data; and
and generating a check point file according to the host data writing completion information.
10. The power-on restoration device as recited in claim 9, wherein said checkpoint file further comprises a global sequence number;
generating a checkpoint file in the data generation module according to the host data write completion information includes:
acquiring the writing address information and the writing serial number of all open blocks according to the host data writing completion information;
and adding one to the global sequence number, and generating a check point file according to the added global sequence number, the writing address information of all open blocks and the writing sequence number.
11. The power-on restoration device as recited in claim 10, wherein the memory module is specifically configured to:
acquiring a stored storage medium last check point file, and determining the global sequence number of the last check point file;
judging whether the interval between the global serial number of the current check point file and the global serial number of the last check point file meets a preset interval, if so, storing the current check point file, and if not, not storing the current check point file.
12. The power-on restoration device as set forth in claim 8, wherein the target open block determination module is specifically configured to:
and judging whether the current writing address information and the writing sequence number exist in the latest check point file, and if not, determining the current writing address information and the opening block of the writing sequence number which do not exist as a target opening block.
13. The power-on recovery device of claim 10, wherein the data recovery module is specifically configured to:
determining a writing sequence number of the target open block;
sequencing the writing sequence numbers according to the sequence from small to large to obtain sequenced writing sequence numbers;
determining a data range to be recovered based on the ordered writing sequence numbers;
and carrying out data recovery according to the data range needing to be recovered.
14. The power-on restoration device as recited in claim 13, wherein determining a range of data in said data restoration module to restore based on said ordered write sequence number comprises:
determining the last written sequence number in the ordered written sequence numbers;
generating a serial number data table according to the global serial number in the latest check point file and the last written serial number;
and determining the data range needing to be recovered according to the serial number data table.
15. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of a power-on restoration method according to any one of claims 1 to 7.
16. 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-on restoration method as claimed in any one of claims 1 to 7 when the computer program is executed by the processor.
CN202410156646.2A 2024-02-04 2024-02-04 Power-on recovery method and device, readable storage medium and electronic equipment Pending CN117687845A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410156646.2A CN117687845A (en) 2024-02-04 2024-02-04 Power-on recovery method and device, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410156646.2A CN117687845A (en) 2024-02-04 2024-02-04 Power-on recovery method and device, readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117687845A true CN117687845A (en) 2024-03-12

Family

ID=90130515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410156646.2A Pending CN117687845A (en) 2024-02-04 2024-02-04 Power-on recovery method and device, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117687845A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009067476A2 (en) * 2007-11-21 2009-05-28 Violin Memory, Inc. Method and system for storage of data in non-volatile media
US20110173488A1 (en) * 2010-01-08 2011-07-14 International Business Machines Corporation Non-volatile memory for checkpoint storage
CN102999564A (en) * 2012-11-06 2013-03-27 华为技术有限公司 Method, device and equipment for writing in data
CN110688256A (en) * 2019-09-12 2020-01-14 苏州浪潮智能科技有限公司 Metadata power-on recovery method and device, electronic equipment and storage medium
US20200226038A1 (en) * 2019-01-16 2020-07-16 Western Digital Technologies, Inc. Non-volatile storage system with rapid recovery from ungraceful shutdown
US20200226035A1 (en) * 2019-01-16 2020-07-16 Vmware, Inc. Method to perform crash and failure recovery for a virtualized checkpoint protected storage system
CN111581022A (en) * 2020-04-30 2020-08-25 江苏芯盛智能科技有限公司 Data recovery method and system
CN111857604A (en) * 2020-07-31 2020-10-30 记忆科技(深圳)有限公司 Method, apparatus, device and medium for quickly reconstructing packet management mapping reverse lookup table
CN112084070A (en) * 2020-09-21 2020-12-15 深圳佰维存储科技股份有限公司 L2P mapping data recovery method and device, storage medium and electronic equipment
CN113535086A (en) * 2021-07-12 2021-10-22 成都信息工程大学 Method for accelerating reconstruction in solid state disk
CN117056123A (en) * 2023-08-11 2023-11-14 北京火山引擎科技有限公司 Data recovery method, device, medium and electronic equipment

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009067476A2 (en) * 2007-11-21 2009-05-28 Violin Memory, Inc. Method and system for storage of data in non-volatile media
US20110173488A1 (en) * 2010-01-08 2011-07-14 International Business Machines Corporation Non-volatile memory for checkpoint storage
CN102999564A (en) * 2012-11-06 2013-03-27 华为技术有限公司 Method, device and equipment for writing in data
US20200226038A1 (en) * 2019-01-16 2020-07-16 Western Digital Technologies, Inc. Non-volatile storage system with rapid recovery from ungraceful shutdown
US20200226035A1 (en) * 2019-01-16 2020-07-16 Vmware, Inc. Method to perform crash and failure recovery for a virtualized checkpoint protected storage system
CN110688256A (en) * 2019-09-12 2020-01-14 苏州浪潮智能科技有限公司 Metadata power-on recovery method and device, electronic equipment and storage medium
CN111581022A (en) * 2020-04-30 2020-08-25 江苏芯盛智能科技有限公司 Data recovery method and system
CN111857604A (en) * 2020-07-31 2020-10-30 记忆科技(深圳)有限公司 Method, apparatus, device and medium for quickly reconstructing packet management mapping reverse lookup table
CN112084070A (en) * 2020-09-21 2020-12-15 深圳佰维存储科技股份有限公司 L2P mapping data recovery method and device, storage medium and electronic equipment
CN113535086A (en) * 2021-07-12 2021-10-22 成都信息工程大学 Method for accelerating reconstruction in solid state disk
CN117056123A (en) * 2023-08-11 2023-11-14 北京火山引擎科技有限公司 Data recovery method, device, medium and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RENHAI CHEN等: "DCR: Deterministic Crash Recovery for NAND Flash Storage Systems", 《IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS》, 25 October 2018 (2018-10-25), pages 2201 - 2214 *
杨靖: "基于数据块的数据保护技术研究", 《中国博士学位论文全文数据库 信息科技辑》, 11 February 2015 (2015-02-11), pages 137 - 2 *

Similar Documents

Publication Publication Date Title
CN101582076A (en) Data de-duplication method based on data base
CN102750317A (en) Method and device for data persistence processing and data base system
CN113626256A (en) Virtual machine disk data backup method, device, terminal and storage medium
CN109976669B (en) Edge storage method, device and storage medium
CN104216796A (en) Data backup and recovery method and electronic device
CN111338844A (en) Database backup management method and electronic equipment
CN105045850A (en) Method for recovering junk data in cloud storage log file system
CN105022680A (en) Data backup method and device
CN113641446A (en) Memory snapshot creating method, device and equipment and readable storage medium
US8825600B2 (en) File backup apparatus and method for backing up one or more directories
CN117687845A (en) Power-on recovery method and device, readable storage medium and electronic equipment
CN104408126A (en) Persistent writing method, device and system of database
CN103092955A (en) Checking point operation method, operation device and operation system
CN111722800A (en) Method for realizing ROW snapshot of distributed storage system and related components
CN111858159A (en) Backup method and system based on chain clone characteristic
CN109960611B (en) Data recovery method and device, electronic equipment and machine-readable storage medium
CN113886352B (en) Metadata recovery method, device, equipment and medium of distributed file system
CN115421856A (en) Data recovery method and device
CN103559106A (en) Data backup method, device and system
CN115328704A (en) File backup method, file recovery method, device, equipment and storage medium
CN103177085A (en) Check point operation method and device
CN112698984A (en) Database recovery method of embedded device, electronic device and medium
CN105260132A (en) Method and device for hot loading disk filter drive
CN110688258A (en) Snapshot creating method and device
CN113031851A (en) Data snapshot method, device and equipment

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