CN114218018A - System data protection method and device, readable storage medium and electronic equipment - Google Patents

System data protection method and device, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN114218018A
CN114218018A CN202210148909.6A CN202210148909A CN114218018A CN 114218018 A CN114218018 A CN 114218018A CN 202210148909 A CN202210148909 A CN 202210148909A CN 114218018 A CN114218018 A CN 114218018A
Authority
CN
China
Prior art keywords
block
state
shadow
target
blocks
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.)
Granted
Application number
CN202210148909.6A
Other languages
Chinese (zh)
Other versions
CN114218018B (en
Inventor
孙成思
孙日欣
廖亨权
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Baiwei Storage Technology Co ltd
Biwin Storage Technology Co Ltd
Original Assignee
Chengdu Baiwei Storage Technology Co ltd
Biwin 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, Biwin Storage Technology Co Ltd filed Critical Chengdu Baiwei Storage Technology Co ltd
Priority to CN202210148909.6A priority Critical patent/CN114218018B/en
Publication of CN114218018A publication Critical patent/CN114218018A/en
Application granted granted Critical
Publication of CN114218018B publication Critical patent/CN114218018B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Abstract

The invention discloses a system data protection method, a device, a readable storage medium and electronic equipment, wherein a shadow block is additionally arranged in a system, and system data are stored in the system block and the shadow block, so that backup of the system data is realized; meanwhile, all system blocks and shadow blocks which store system data in the system are scanned, the system blocks and the shadow blocks which have failure risks are marked and integrated into a risk data block set in advance, and the failed system blocks and the shadow blocks are recovered, so that the risks of the system blocks can be marked and marked in advance, the risk data blocks can be recovered, and the reliability of the system data is ensured more effectively.

Description

System data protection method and device, readable storage medium and electronic equipment
Technical Field
The present invention relates to the field of memories, and in particular, to a method and an apparatus for protecting system data, a readable storage medium, and an electronic device.
Background
Currently, most flash memory storage products have a special physical block (block) for storing system data. These physical blocks for storing system data, also referred to as system blocks, are used to store system data including firmware code and system configuration information. During the operation of the product, the firmware code is read from the system block at Random and is placed in a Static Random-Access Memory (SRAM) for operation.
However, when the flash memory storage product is operated for a long time or at high and low temperatures, the system block may have a risk of failure. At this time, the system data cannot be read out from the system block normally, and finally, the flash memory product cannot work normally.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: a system data protection method, a device, a readable storage medium and an electronic device are provided, and reliability of system data is improved.
In order to solve the technical problems, the invention adopts the technical scheme that:
a system data protection method comprises the following steps:
judging whether a scanning instruction is received or not, if so, traversing all system blocks and shadow blocks which store system data in the system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range or not, and if not, adding the target system block or the target shadow block to a risk data block set;
and judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a system data protection device, comprising:
the system comprises a first judgment module, a risk data block set and a second judgment module, wherein the first judgment module is used for judging whether a scanning instruction is received or not, if so, traversing all system blocks and shadow blocks which store system data in a system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range or not, and if not, adding the target system block or the target shadow block to the risk data block set;
and the second judgment module is used for judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set.
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 method for system data protection 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, the processor implementing the steps of a system data protection method as described above when executing the computer program.
The invention has the beneficial effects that: the shadow blocks are additionally arranged in the system, and system data are stored in the system blocks and the shadow blocks, so that the backup of the system data is realized; meanwhile, all system blocks and shadow blocks which store system data in the system are scanned, the system blocks and the shadow blocks which have failure risks are marked and integrated into a risk data block set in advance, and the failed system blocks and the shadow blocks are recovered, so that the risks of the system blocks can be marked and marked in advance, the risk data blocks can be recovered, and the reliability of the system data is ensured more effectively.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for protecting system data according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a scanning mechanism in a system data protection method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating the steps of a state machine mechanism in a system data protection method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a data writing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to explain technical contents, achieved objects, and 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, a method for protecting system data includes the steps of:
judging whether a scanning instruction is received or not, if so, traversing all system blocks and shadow blocks which store system data in the system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range or not, and if not, adding the target system block or the target shadow block to a risk data block set;
and judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set.
As can be seen from the above description, the beneficial effects of the present invention are: the shadow blocks are additionally arranged in the system, and system data are stored in the system blocks and the shadow blocks, so that the backup of the system data is realized; meanwhile, all system blocks and shadow blocks which store system data in the system are scanned, the system blocks and the shadow blocks which have failure risks are marked and integrated into a risk data block set in advance, and the failed system blocks and the shadow blocks are recovered, so that the risks of the system blocks can be marked and marked in advance, the risk data blocks can be recovered, and the reliability of the system data is ensured more effectively.
Further, the performing a recovery step on the set of risk data blocks comprises:
obtaining: acquiring the risk data block to be recovered and a corresponding target data block according to the risk data block set;
copying: acquiring a null system block or a null shadow block corresponding to the type of the risk data block according to the type of the risk data block, and copying system data in the target data block to the corresponding null system block or the null shadow block;
releasing: and releasing the risk data block.
As can be seen from the above description, by acquiring the risk data block to be restored and the corresponding target data block from the risk data block set, acquiring the corresponding empty system block or empty shadow block according to the type of the risk data block, and copying the system data in the target data block into the corresponding empty system block or empty shadow block in a copying manner, the situation that the system data is lost or damaged due to the restoration by the risk data block is avoided, and the reliability of the system data is improved.
Further, acquiring an empty system block or an empty shadow block corresponding to the type of the risk data block according to the type of the risk data block includes:
acquiring the empty system block from a system block resource pool;
or acquiring the empty shadow block from a shadow block resource pool;
the releasing the risk data block comprises:
and releasing the risk data block to the corresponding system block resource pool or shadow block resource pool.
According to the description, the system block resource pool and the shadow block resource pool are additionally arranged in the system, so that when the system block or the shadow block storing the system data has hidden danger, the empty system block can be obtained from the system block resource pool or the empty shadow block can be obtained from the shadow block resource pool to replace the risk data block with the hidden danger, and meanwhile, the replaced risk data block is released into the corresponding system block resource pool or the shadow block resource pool, so that a certain number of empty system blocks or empty shadow blocks always exist in the system block resource pool or the shadow block resource pool, the situation that the empty system blocks or the shadow blocks with insufficient number are not used for replacing the risk data block is avoided, and the stability of the system is improved.
Further, the performing a recovery step on the set of risk data blocks further comprises:
setting a state machine, wherein the state machine comprises an idle state, an initialization state, a copying state and a releasing state;
when the acquiring step is executed, setting the state of the state machine from the idle state to the initialization state;
when the copying step is executed, setting the state of the state machine from the initialization state to the copying state;
and when the releasing step is executed, setting the state of the state machine from the copying state to the releasing state.
As can be seen from the above description, by adding the state machine and corresponding the state of the state machine to the acquiring step, the copying step, and the releasing step in the recovering step, when the risk data block is power-down exited during the recovering process, the recovering process can be restarted and the corresponding steps can be continuously executed according to the state marked by the state machine, so that the stability of the system is improved.
Further, the state machine also includes an exception state;
the copying step further comprises:
judging whether the copying is successful, if so, executing the releasing step and setting the state machine to be in the releasing state; if the failure occurs, judging whether the state machine is abnormally exited, if so, setting the state machine to be in the abnormal state and reporting an error; if not, carrying out abnormity judgment.
According to the description, when the copying process is judged to be abnormally exited, the state of the corresponding state machine is set to be an abnormal state, so that the releasing step is executed only when the risk data block is successfully replaced by the empty system block or the empty shadow block, and the system stability is improved; and when the copy fails but the copy is abnormal exit, the abnormality is analyzed, and the processing capacity of the abnormality is improved.
Further, if not, the abnormal judgment includes:
judging whether the empty system block or the empty shadow block is abnormal, if so, re-executing the copying step; if the target data block is normal, judging whether the target data block is abnormal, if so, re-executing the obtaining step;
judging whether the abnormal exit is included:
and if all the target data blocks have the exception, executing exception exit.
It can be known from the above description that, after the copy process fails, the reason of the copy failure is determined, and different execution steps are performed according to different failure reasons, if the failure reason is that an empty system block or an empty shadow block is abnormal, the copy process is continuously performed after the empty system block or the empty shadow block is obtained again, and if the current target data block is abnormal, another target data block is obtained again from the risk data block set for copy operation, so that the adaptability of the recovery process is improved, and the copy step can be continuously performed under different abnormal conditions.
Further, the state machine further comprises a check state;
if the step of releasing is successful, the step of releasing and setting the state machine to the released state comprises:
comparing and checking the target data block and the copied empty system block and empty shadow block, and setting the state machine to be in the checking state;
performing the releasing step on the risk data block which completes the verification.
According to the above description, the copied target data block and the copied empty system block and empty shadow block are verified, so that the copied data in the system block and the copied shadow block are normal system data and consistent, that is, the replacement of the risk data block is successfully completed, and the stability of the system is further ensured.
Referring to fig. 3, another embodiment of the present invention provides a system data protection device, including:
the system comprises a first judgment module, a risk data block set and a second judgment module, wherein the first judgment module is used for judging whether a scanning instruction is received or not, if so, traversing all system blocks and shadow blocks which store system data in a system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range or not, and if not, adding the target system block or the target shadow block to the risk data block set;
and the second judgment module is used for judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set.
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 system data protection method as described above.
Referring to fig. 4, 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, wherein the processor executes the computer program to implement the steps of the system data protection method.
The system data protection method, the apparatus, the computer-readable storage medium and the electronic device of the present invention can be applied to various flash memory storage products, such as eMMC, UFS, SSD, etc., and are described in the following with specific embodiments:
referring to fig. 1, a method for protecting system data includes the steps of:
referring to table 1, S0, a system block resource pool, a shadow block, a scanning mechanism and a recovery mechanism are added in advance in the system, and after the setting is completed, the following steps are executed:
s1, judging whether a scanning instruction is received, if so, traversing all system blocks and shadow blocks in which system data are stored in the system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range, and if not, adding the target system block or the target shadow block to a risk data block set;
s2, judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set;
referring to fig. 2, specifically: the system sends out a scanning instruction at regular time, scans after receiving the scanning instruction, and reads a certain page (page) of all the system blocks or shadow blocks storing system data in the system at regular time; page100, as currently reading all of the system or shadow blocks; if a read failure or HECC/UNC (check error) occurs when the page100 of a certain system block or shadow block is read currently, marking the current system block or shadow block as a risk data block; if all the pages 100 of all the system blocks or the shadow blocks are successfully read, the scanning is normally exited; the whole scanning process continues the life cycle of the product, the scanned page number is increased progressively, for example, when the page100 is scanned at the current time, the page101 is scanned at the next time;
in step S2, the step of recovering the risk data block set includes:
obtaining: acquiring the risk data block to be recovered and a corresponding target data block according to the risk data block set; the target data block is a system block or a shadow block with the same system data as the risk data block, namely a source data block; one copy of system data is stored by two system blocks and one shadow block;
copying: acquiring a null system block or a null shadow block corresponding to the type of the risk data block according to the type of the risk data block, acquiring the null system block from the system block resource pool if the type of the risk data block is the system block, and acquiring the null shadow block from the shadow block resource pool if the type of the risk data block is the shadow block; copying system data in the target data block to the corresponding empty system block or empty shadow block;
releasing: and releasing the risk data block to the corresponding system block resource pool or shadow block resource pool.
TABLE 1
Figure 482083DEST_PATH_IMAGE001
Example two
The difference between this embodiment and the first embodiment is that the recovery step corresponds to the state of the state machine;
referring to table 2 and fig. 3, a state machine is set, where the state machine includes different state identifiers, such as an idle state, an initialization state, a copy state, a release state, a check state, and an abnormal state; the transformation between the different states is shown in fig. 2, and the specific transformation steps are described below:
setting the state of the state machine from the idle state to the initialization state when the acquiring step is executed; setting the state of the state machine from the initialization state to the copy state when the copying step is performed; setting the state of the state machine from the copy state to the release state while the releasing step is performed;
meanwhile, the copying step further comprises: judging whether the copying is successful, if so, S21, executing the releasing step and setting the state machine to be in the releasing state; if the data block fails, S22, determining whether all the target data blocks are abnormal, if so, S221, setting the state machine to the abnormal state and reporting an error;
if not, S222 performs an abnormality determination: judging whether the empty system block or the empty shadow block is abnormal, if so, re-executing the copying step; if the target data block is normal, judging whether the target data block is abnormal, if so, re-executing the obtaining step;
before executing step S21, the method further includes: step S02, comparing and checking the target data block and the copied empty system block and empty shadow block, and setting the state machine to the checking state; if the verification is successful, go to step S21; if the verification fails, go to step S221;
EXAMPLE III
The system data protection method is applied to an actual scene;
referring to table 3, different structure members are created according to different recovery step flows and types of the target data block;
after a recovery process is started, judging whether a current identifier sISPReclaiIMEntry.u16DamageISPBlk is effective, and meanwhile, identifying that the STATE of the current identifier sISPReclaiIMEntry.u08ReclaimState is not RECLAIM _ STATE _ DONE, if both the STATE of the current identifier sISPReclaimState and the STATE of the current identifier sISPRelaimEntry.u08ReclaimState are satisfied, indicating that the previous recovery process is not finished, and continuing to execute a corresponding recovery step from the last interrupted process according to the STATE of a current STATE machine;
if the current identifier sISPReclaimEntry.u16DamageISPBlk is invalid and the STATE of sISPReclaimState is RECLAIM _ STATE _ IDLE at the same time, which indicates that the current recovery flow does not exit from the last incomplete recovery flow halfway, the recovery flow is performed from the beginning;
when the recovery flow is performed from the beginning:
an acquisition step: traversing a ga32DamageISPBlk [ n ], taking out a first risk data block (shadow block or system block) to be recovered and a first valid target data block corresponding to the risk data block, assigning a value to an identifier sISPReclaiim entry.u32CrrntDamgeISPBLBlk, judging and marking the type of a current risk data block (damageblk), and updating a STATE machine to be RECLAIM _ STATE _ START;
a copying step: applying for a new data block (new blk) as a replacement block according to the type of the current damage blk, and setting the STATE machine to RECLAIM _ STATE _ COPY;
when the damage blk is a system block, acquiring an empty system block from the system block resource pool as a replacement block; when the damage blk is a shadow block, applying for an empty shadow block from the shadow block resource pool as a replacement block; copying data of pages 0-page last in the dam blk to the empty system block or the empty shadow block;
judging whether the copying is successful or not, if the copying is unsuccessful, executing step S22, judging whether UNC appears in all the pages corresponding to the source data block, if yes, executing step S221, and if abnormal exit, marking the STATE machine as RECLAIM _ STATE _ ERR;
if not, executing step S222, and performing an abnormality determination:
among these, exception 1: before copying, if an erasure replacement block is wrongly reported, the method exits abnormally, and marks the STATE machine as RECLAIM _ STATE _ COPY, namely reapplication for a new data block as a replacement block;
anomaly 2: in the copying process, a source data block for copying data also reports the UNC, a next effective source data block is searched in the ga32GoodISPBlk [ n ] again for data copying, if the UNC appears in corresponding pages of all the source data blocks, the correct data cannot be read, and the STATE machine is marked as RECLAIM _ STATE _ ERR;
anomaly 3: if the replacement block reports the programmer in the copying process, the COPY is abnormally exited, and the STATE machine is marked as RECLAIM _ STATE _ COPY, namely a new data block is reapplied as the replacement block;
if the copying is successful, executing step S02, comparing the CRC check of the source data block and the whole data block of the new blk, and updating the STATE machine to record _ STATE _ COPY _ DONE;
if the step S02 is successfully executed, execute step S21, erase and release the damage blk, and update the STATE machine to retrieve _ STATE _ CHK _ DONE; after the erasing and releasing steps are successfully completed, the STATE machine is updated to RECLAIM _ STATE _ FREE _ DONE; finally, the effective system block or shadow block which finishes the copying step is updated, and the STATE machine is marked as RECLAIM _ STATE _ DONE;
if the verification fails, step S21 is executed to update the STATE machine to retrieve _ STATE _ ERR;
meanwhile, in the read and write flows of the whole copying process, VDT and overtime exception handling are required to be added; in the recovery process, the release step can be uniformly executed after the copying process of all the risk data blocks in the risk data block set is completed; or each risk data block is released after the copying process is completed.
TABLE 2
Figure 461540DEST_PATH_IMAGE002
Table 3: new structural member
Figure 303594DEST_PATH_IMAGE003
Example four
Referring to fig. 4, a system data protection device includes:
the system comprises a first judgment module, a risk data block set and a second judgment module, wherein the first judgment module is used for judging whether a scanning instruction is received or not, if so, traversing all system blocks and shadow blocks which store system data in a system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range or not, and if not, adding the target system block or the target shadow block to the risk data block set;
and the second judgment module is used for judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set.
EXAMPLE five
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 system data protection as described above.
EXAMPLE six
Referring to fig. 5, an electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the system data protection method.
In summary, according to the method, the apparatus, the readable storage medium, and the electronic device for protecting system data provided by the present invention, the system data is stored in the system block and the shadow block by adding the system block resource pool, the shadow block, the scanning mechanism, and the recovery mechanism in the system, so as to implement backup of the system data; meanwhile, the scanning mechanism scans all system blocks and shadow blocks which store system data in the system, marks and integrates the system blocks and the shadow blocks with failure risks into a risk data block set in advance, then restores the failed system blocks and the shadow blocks through the restoring mechanism, and combines the state of the state machine with all the steps in the restoring step, so that the risks of the system blocks can be marked and marked in advance, the risk data blocks are restored, the reliability of the system data is effectively ensured, and when the risk data blocks are subjected to power failure exit and other conditions in the restoring process, the restoring process can be restarted and corresponding steps can be continuously executed according to the marked state of the state machine, and the stability of the system is improved.
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 place, 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 the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present 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 (10)

1. A method for protecting system data, comprising the steps of:
judging whether a scanning instruction is received or not, if so, traversing all system blocks and shadow blocks which store system data in the system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range or not, and if not, adding the target system block or the target shadow block to a risk data block set;
and judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set.
2. The method of claim 1, wherein the step of recovering the set of risk data blocks comprises:
obtaining: acquiring the risk data block to be recovered and a corresponding target data block according to the risk data block set;
copying: acquiring a null system block or a null shadow block corresponding to the type of the risk data block according to the type of the risk data block, and copying system data in the target data block to the corresponding null system block or the null shadow block;
releasing: and releasing the risk data block.
3. The method of claim 2, wherein obtaining empty system blocks or empty shadow blocks corresponding to the type of the risk data block according to the type of the risk data block comprises:
acquiring the empty system block from a system block resource pool;
or acquiring the empty shadow block from a shadow block resource pool;
the releasing the risk data block comprises:
and releasing the risk data block to the corresponding system block resource pool or shadow block resource pool.
4. The method of claim 2, wherein the step of recovering the set of risk data blocks further comprises:
setting a state machine, wherein the state machine comprises an idle state, an initialization state, a copying state and a releasing state;
when the acquiring step is executed, setting the state of the state machine from the idle state to the initialization state;
when the copying step is executed, setting the state of the state machine from the initialization state to the copying state;
and when the releasing step is executed, setting the state of the state machine from the copying state to the releasing state.
5. The method of claim 4, wherein the state machine further comprises an exception state;
the copying step further comprises:
judging whether the copying is successful, if so, executing the releasing step and setting the state machine to be in the releasing state; if the failure occurs, judging whether the state machine is abnormally exited, if so, setting the state machine to be in the abnormal state and reporting an error; if not, carrying out abnormity judgment.
6. The method of claim 5, wherein if not, the determining an exception comprises:
judging whether the empty system block or the empty shadow block is abnormal, if so, re-executing the copying step; if the target data block is normal, judging whether the target data block is abnormal, if so, re-executing the obtaining step;
judging whether the abnormal exit is included:
and if all the target data blocks have the exception, executing exception exit.
7. The method of claim 5, wherein the state machine further comprises a check state;
if the step of releasing is successful, the step of releasing and setting the state machine to the released state comprises:
comparing and checking the target data block and the copied empty system block and empty shadow block, and setting the state machine to be in the checking state;
performing the releasing step on the risk data block which completes the verification.
8. A system data protection apparatus, comprising:
the system comprises a first judgment module, a risk data block set and a second judgment module, wherein the first judgment module is used for judging whether a scanning instruction is received or not, if so, traversing all system blocks and shadow blocks which store system data in a system, reading the data in a target system block or a target shadow block when the target system block or the target shadow block is traversed, judging whether reading parameters are in a preset range or not, and if not, adding the target system block or the target shadow block to the risk data block set;
and the second judgment module is used for judging whether the scanning step is finished or not, and if so, executing a recovery step on the risk data block set.
9. 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 system data protection according to any one of claims 1 to 7.
10. 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 method for system data protection according to any one of claims 1 to 7 when executing the computer program.
CN202210148909.6A 2022-02-18 2022-02-18 System data protection method and device, readable storage medium and electronic equipment Active CN114218018B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210148909.6A CN114218018B (en) 2022-02-18 2022-02-18 System data protection method and device, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210148909.6A CN114218018B (en) 2022-02-18 2022-02-18 System data protection method and device, readable storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114218018A true CN114218018A (en) 2022-03-22
CN114218018B CN114218018B (en) 2022-05-27

Family

ID=80708909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210148909.6A Active CN114218018B (en) 2022-02-18 2022-02-18 System data protection method and device, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114218018B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231617A (en) * 2008-01-21 2008-07-30 中兴通讯股份有限公司 Method for processing data of flash memory equipment
CN107678686A (en) * 2017-09-19 2018-02-09 山东存储之翼电子科技有限公司 The method and its data storage device of the FTL functions of flash memory are realized based on hardware
US20190146879A1 (en) * 2017-11-13 2019-05-16 Weka.IO LTD Methods and systems for power failure resistance for a distributed storage system
CN111290773A (en) * 2020-03-12 2020-06-16 深圳Tcl新技术有限公司 System upgrading method, device and readable storage medium
CN112181713A (en) * 2020-10-10 2021-01-05 上海威固信息技术股份有限公司 Data recovery method and system of computer storage system
CN112527557A (en) * 2020-12-04 2021-03-19 北京浪潮数据技术有限公司 Data recovery method, device and equipment and computer readable storage medium
CN112802530A (en) * 2021-01-12 2021-05-14 成都佰维存储科技有限公司 NAND testing method and device, readable storage medium and electronic equipment
CN112889034A (en) * 2018-10-15 2021-06-01 Netapp股份有限公司 Erase coding of content driven distribution of data blocks
CN113051104A (en) * 2021-03-11 2021-06-29 重庆紫光华山智安科技有限公司 Method and related device for recovering data between disks based on erasure codes
CN114035745A (en) * 2021-10-19 2022-02-11 许昌许继软件技术有限公司 FLASH data storage control method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231617A (en) * 2008-01-21 2008-07-30 中兴通讯股份有限公司 Method for processing data of flash memory equipment
CN107678686A (en) * 2017-09-19 2018-02-09 山东存储之翼电子科技有限公司 The method and its data storage device of the FTL functions of flash memory are realized based on hardware
US20190146879A1 (en) * 2017-11-13 2019-05-16 Weka.IO LTD Methods and systems for power failure resistance for a distributed storage system
CN112889034A (en) * 2018-10-15 2021-06-01 Netapp股份有限公司 Erase coding of content driven distribution of data blocks
CN111290773A (en) * 2020-03-12 2020-06-16 深圳Tcl新技术有限公司 System upgrading method, device and readable storage medium
CN112181713A (en) * 2020-10-10 2021-01-05 上海威固信息技术股份有限公司 Data recovery method and system of computer storage system
CN112527557A (en) * 2020-12-04 2021-03-19 北京浪潮数据技术有限公司 Data recovery method, device and equipment and computer readable storage medium
CN112802530A (en) * 2021-01-12 2021-05-14 成都佰维存储科技有限公司 NAND testing method and device, readable storage medium and electronic equipment
CN113051104A (en) * 2021-03-11 2021-06-29 重庆紫光华山智安科技有限公司 Method and related device for recovering data between disks based on erasure codes
CN114035745A (en) * 2021-10-19 2022-02-11 许昌许继软件技术有限公司 FLASH data storage control method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
QI ZHANG等: "Optimizing deterministic garbage collection in NAND flash storage systems", 《 21ST IEEE REAL-TIME AND EMBEDDED TECHNOLOGY AND APPLICATIONS SYMPOSIUM》 *
于潇: "基于混合存储的数据保护系统研究", 《中国优秀博硕士学位论文全文数据库(博士) 信息科技辑》 *

Also Published As

Publication number Publication date
CN114218018B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
CN108646982B (en) Automatic data restoration method and device based on UBIFS
US8812910B2 (en) Pilot process method for system boot and associated apparatus
CN109582216B (en) Data storage device and data processing method of memory device
CN110286853B (en) Data writing method and device and computer readable storage medium
US5421003A (en) Disk storage system with fault tolerant media maintenance
CN111400267A (en) Method and device for recording log
CN114385418A (en) Protection method, device, equipment and storage medium for communication equipment
CN114218018B (en) System data protection method and device, readable storage medium and electronic equipment
US20100169572A1 (en) Data storage method, apparatus and system for interrupted write recovery
CN113050888B (en) Method, system, device and storage medium for quickly removing unstable Flash blocks
KR20080060658A (en) Multimedia storage device and data recovering method of the device
CN114691433A (en) Control method and device for solid state disk
CN117746960A (en) Self-error correction single disk master boot record protection device and protection method
CN112052112A (en) Bit flipping error detection method and device based on NOR Flash storage and storage medium
CN114201320B (en) System block upgrading method and device, readable storage medium and electronic equipment
US9971659B1 (en) Memory programming providing corruption protection
CN111209132A (en) Embedded system, power failure protection method, electronic device and storage medium
CN115657956B (en) Metadata consistency writing method and system for coping with cache data loss
CN112835517B (en) Method, device and medium for improving MLC NAND performance
CN117271225B (en) FRU information backup method, FRU information backup device and FRU information backup server
CN111367717B (en) Electronic equipment recovery method, device and system
CN114003249B (en) PSoC-based high-reliability mirror image loading method
CN109144409B (en) Data processing method and device, storage medium and data system
CN113050887A (en) Flash partition data processing method and device, computer equipment and storage medium
CN114637702A (en) Metadata loss prevention method and device, readable storage medium and electronic 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
GR01 Patent grant
GR01 Patent grant