Data recovery method, electronic device, and storage medium
Patent Information
- Application Number
- CN202510168716.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本申请主要解决的技术问题是提供一种数据恢复方法、电子设备以及存储介质,以解决异常掉电恢复耗时长的问题
[0016] The beneficial effects of this invention are as follows: Unlike the prior art, this application uses the storage logic of the target cache to save the target data after an abnormal power failure, thereby using the storage logic to determine the storage range of the target data in the storage unit, reducing the search range from the entire storage unit to the storage range, greatly reducing the search range of the target data, thereby improving the search efficiency of the target data, reducing the time spent on abnormal power failure recovery, and helping to solve the impact of abnormal power failure and improve the efficiency of restoring the state before the abnormal power failure.
Smart Images

Figure CN122594064A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to data recovery methods, electronic devices, and storage media. Background Technology
[0002] In traditional storage devices, DRAM (Dynamic Random Access Memory) is used as a cache for host data. Then, at certain points, this data is flushed into the storage unit, and a mapping table of host data is established.
[0003] However, in the event of an abnormal power outage, the mapping table of host data stored in DRAM will be lost.
[0004] After power-on, the storage device needs to perform operations such as retrieving data from the entire storage unit and rebuilding the mapping table to restore the state before the abnormal power failure before it can resume receiving read and write commands from the host. This process takes a lot of time. Summary of the Invention
[0005] The main technical problem addressed by this application is to provide a data recovery method, electronic device, and storage medium to solve the problem of long recovery time due to abnormal power loss.
[0006] To address the aforementioned issues, this application provides a data recovery method, comprising storing target data from a target cache in a storage device into a storage unit of the storage device; responding to an abnormal power failure before updating the mapping relationship of the target data, upon power-up, determining the storage range of the target data in the storage unit based on the storage logic of the target data; searching for the target data in the storage unit based on the storage range to recover the mapping relationship of the target data; wherein, after the abnormal power failure, the storage state of the target cache remains unchanged to preserve the storage logic of the target data.
[0007] The process of searching for target data in a storage unit based on a storage range to restore the mapping relationship of the target data includes: searching for target data in a storage unit based on a storage range to obtain the storage address of the target data in the storage unit; and reconstructing the mapping relationship of the target data based on the storage address.
[0008] The target cache includes a cache storage unit, a mapping unit, and a system unit. The data recovery method includes: storing the target data in the cache storage unit into the storage unit of the storage device; in response to an abnormal power failure before updating the mapping relationship of the target data to the mapping unit, after power-on, determining the storage range of the target data in the storage unit based on the storage logic in the system unit; searching for the target data in the storage unit based on the storage range, and restoring the mapping relationship of the target data in the mapping unit based on the storage address of the target data.
[0009] The step of storing target data in the cache storage unit to the storage unit of the storage device includes: receiving new storage data; in response to the number of data stored in the cache storage unit of the storage device exceeding a preset number, transferring the target data to the storage unit of the storage device; wherein the target data is the data with the longest storage time in the cache storage unit; storing new storage data in the cache storage unit; and in response to the completion of the target data transfer, updating the mapping relationship of the target data in the mapping unit and updating the storage logic in the system unit.
[0010] After restoring the mapping relationship of the target data, the process includes: in response to receiving a read instruction for preset data, determining whether the preset data exists in the cache storage unit of the target cache; if the preset data exists in the cache storage unit of the target cache, reading the preset data from the cache storage unit; if the preset data does not exist in the cache storage unit of the target cache, searching for the mapping relationship of the target data in the mapping unit, determining the storage address of the target data based on the mapping relationship, and reading the target data from the storage unit.
[0011] The mapping relationship includes hierarchical multi-level mapping relationships. The first-level mapping relationship is stored in the mapping unit, and at least the last-level mapping relationship is stored in the storage unit. The process involves finding the mapping relationship of the target data from the mapping unit, determining the storage address of the target data based on the mapping relationship, and then reading the target data from the storage unit. This includes: determining the second-level mapping relationship of the target data from the first-level mapping relationship in the mapping unit; determining the next-level mapping relationship of the target data based on the second-level mapping relationship, and so on, until the last-level mapping relationship is determined. The storage address of the target data is then determined based on the last-level mapping relationship, and the target data is read from the storage unit.
[0012] The mapping relationship includes a referencing mapping table, which contains the correspondence between referencing parameters and their corresponding storage addresses; the referencing parameters include referencing characters or referencing positions; searching for the mapping relationship of the target data in the mapping unit and determining the storage address of the target data based on the mapping relationship to read the target data from the storage unit includes: searching for the referencing parameters of the target data in the referencing mapping table in the mapping unit, determining the storage address of the target data based on the referencing parameters, and reading the target data from the storage unit.
[0013] The target cache includes one or more of phase-change memory, resistive random access memory, magnetoresistive random access memory, ferroelectric memory, or storage-level memory.
[0014] To address the aforementioned technical problems, the present invention also provides an electronic device, including a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the data recovery method as described above.
[0015] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the data recovery method described above.
[0016] The beneficial effects of this invention are as follows: Unlike the prior art, this application uses the storage logic of the target cache to save the target data after an abnormal power failure, thereby using the storage logic to determine the storage range of the target data in the storage unit, reducing the search range from the entire storage unit to the storage range, greatly reducing the search range of the target data, thereby improving the search efficiency of the target data, reducing the time spent on abnormal power failure recovery, and helping to solve the impact of abnormal power failure and improve the efficiency of restoring the state before the abnormal power failure. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating an embodiment of the data recovery method of this application;
[0018] Figure 2 This is a flowchart illustrating another embodiment of the data recovery method of this application;
[0019] Figure 3 This is a schematic diagram of one embodiment of the storage device;
[0020] Figure 4 This is a schematic diagram of the framework of an embodiment of the electronic device of this application;
[0021] Figure 5 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0022] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0023] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0024] In this paper, the terms "system" and "network" are often used interchangeably. The term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this paper means two or more.
[0025] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the data recovery method of this application. The data recovery method in this embodiment specifically includes the following steps:
[0026] Step S11: Store the target data in the target cache of the storage device into the storage unit of the storage device.
[0027] Storage devices include, but are not limited to, solid-state drives (SSDs), storage devices with Universal Flash Storage (UFS) standard, storage devices with Embedded Multi Media Card (eMMC) standard, SD memory cards, ESSD enterprise-grade solid-state drives, CSSD computing solid-state drives, USB flash drives, etc.
[0028] The target cache (RAM) is used to temporarily store storage data and related management data, and then at certain times, the temporarily stored data is stored in the storage unit. The storage unit has high storage density and a longer lifespan, and is typically used for long-term storage of large amounts of data. The storage unit is non-volatile to ensure long-term data preservation. The storage unit in this embodiment includes, but is not limited to, NAND FLASH (a non-volatile storage medium), PROM (Programmable read-only memory), EEPROM (Electrically erasable programmable read-only memory), etc.
[0029] This step stores the target data from the target cache of the storage device into the storage unit of the storage device. The target data is the data that needs to be transferred from the target cache to the storage unit, and the specific data is determined based on actual needs, which is not limited here.
[0030] Step S12: In response to an abnormal power failure before updating the mapping relationship of the target data, after power-on, the storage range of the target data in the storage unit is determined based on the storage logic of the target data.
[0031] After storing the target data in the storage unit, the mapping relationship of the target data's storage status in the storage unit needs to be updated so that when reading the target data, the target data can be found in the storage unit based on the mapping relationship and read.
[0032] However, if an abnormal power outage occurs after the target data in the target cache of the storage device is stored in the storage unit of the storage device, but before the mapping relationship of the target data is updated, the mapping relationship of the target data will be lost.
[0033] In this embodiment, after power-on, the storage range of the target data in the storage unit is determined based on the storage logic of the target data. The storage logic of the target data refers to the storage logic when the target data is transferred from the target cache to the storage unit. This storage logic guides the current storage range of the target data, i.e., the start and end points of the storage location.
[0034] Therefore, after power-on, the storage range of the target data in the storage unit is determined based on the storage logic of the target data.
[0035] The target cache retains its storage state after an abnormal power outage to preserve the storage logic of the target data, so that this step can determine the storage range of the target data in the storage unit based on the storage logic of the target data.
[0036] Step S13: Locate the target data in the storage unit based on the storage range to restore the mapping relationship of the target data.
[0037] The stored data can be found simply by searching within the storage range, thereby determining the storage status of the stored data and restoring the mapping relationship of the target data.
[0038] Since the storage range indicates the start and end points of the storage location, the search range is reduced from the entire storage unit to the storage range, which greatly reduces the search range of the target data, thereby improving the search efficiency of the target data, reducing the time spent on abnormal power outage recovery, and improving the efficiency of resolving the impact of abnormal power outages.
[0039] Through the above steps, the data recovery method of this embodiment stores the target data in the target cache of the storage device into the storage unit of the storage device; in response to an abnormal power failure before updating the mapping relationship of the target data, after power-on, the storage range of the target data in the storage unit is determined based on the storage logic of the target data; the target data is searched in the storage unit based on the storage range to restore the mapping relationship of the target data; wherein, after the abnormal power failure, the storage state of the target cache remains unchanged to save the storage logic of the target data, so as to use the storage logic to determine the storage range of the target data in the storage unit by saving the storage logic of the target data after the abnormal power failure, thereby reducing the search range from the entire storage unit to the storage range, greatly reducing the search range of the target data, thereby improving the search efficiency of the target data, reducing the time spent on abnormal power failure recovery, and helping to solve the impact of abnormal power failure and improve the efficiency of restoring the state before the abnormal power failure.
[0040] Please see Figure 2-3 , Figure 2 This is a flowchart illustrating another embodiment of the data recovery method of this application. Figure 3 This is a schematic diagram of one embodiment of the storage device. The data recovery method in this embodiment specifically includes the following steps:
[0041] Step S21: Store the target data in the cache storage unit to the storage unit of the storage device.
[0042] Please see Figure 3 The storage device 100 in this embodiment includes a tightly-coupled memory 130 (TCM), a target cache 110, and a storage unit 120 that are coupled in sequence.
[0043] Tightly coupled memory 130 is used to store global variables and the stack. Target cache 110 is used to temporarily store host data, and storage unit 120 is used to store host data permanently. Storage unit 120 includes long-term non-volatile memory such as NAND FLASH.
[0044] The target cache 110 includes interconnected cache storage units 111, mapping units 114 (L2P), and system units 115 (SYS INFO). The cache storage unit 111 includes interconnected data blocks 112 (DATA BUF FIFO) and storage management 113 (BUF MANAGEMENT). The cache storage unit 111 and the storage units 120 within the storage device 100 use different storage media. Data blocks 112 are used to store host data, and storage management 113 is used to manage the storage of data blocks 112; that is, the specific storage location, transfer, and other operations of host data within data blocks 112 are determined or executed by storage management 113. Mapping units 114 are used to store the mapping relationships of data written to storage units 120; system units 115 are used to store the storage logic for transferring data from cache storage units 111 to storage units 120. Storage management 113 transfers data from cache storage unit 111 to storage unit 120 based on certain storage logic. This process requires determining system logic information such as transfer time and location, which is stored in system unit 115. Other units in the target cache 110 may also store other internal variables, which will not be elaborated upon here.
[0045] This step first stores the target data in cache storage unit 111 into storage unit 120 of storage device 100. In a specific application scenario, cache storage unit 111 receives new stored data from the host. In response to the number of data stored in cache storage unit 111 exceeding a preset limit, the target data is transferred to storage unit 120 of storage device 100. The preset limit is determined by the size of data block 112, and the target data is the data with the longest storage time in cache storage unit 111. That is, when storing new stored data, if cache storage unit 111 is full, storage management 113, based on the first-in, first-out principle, transfers the data with the longest storage time in the managed data block 112 of cache storage unit 111 to storage unit 120, and then stores the new stored data into cache storage unit 111.
[0046] In response to the completion of target data transfer, the mapping relationship of the target data is updated in mapping unit 114 for subsequent target data lookup, and the storage logic in system unit 115 is updated in system unit 115 for transferring the next target data. This assumes no abnormal power failure has occurred.
[0047] Step S22: In response to an abnormal power failure before updating the mapping relationship of the target data to the mapping unit, after power-on, the storage range of the target data in the storage unit is determined based on the storage logic in the system unit.
[0048] If an abnormal power failure occurs after the target data has been stored in storage unit 120 but before the mapping relationship of the target data has been updated in mapping unit 114, the mapping relationship of the target data will be lost.
[0049] However, in this embodiment, after power-on, the storage range of the target data in the storage unit 120 is determined based on the storage logic in the system unit 115. The target cache maintains its storage state after an abnormal power outage to preserve the storage logic of the target data.
[0050] The target cache 110 includes, but is not limited to, one or more of phase-change memory (PCM), resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FeFET), or storage-class memory (SCM). The target cache 110 is non-volatile and can retain the stored data, mapping table, and system information in the target cache 110 during abnormal power loss. Therefore, in the event of an abnormal power loss, only the mapping relationship of the target data needs to be restored, significantly reducing the impact of abnormal power loss on the storage device 100, reducing the steps required to recover from an abnormal power loss, and improving the efficiency of abnormal power loss recovery.
[0051] In phase-change memory (PCM), the crystalline and amorphous states of the phase-change material are two stable physical states. Even when power is off, the material retains its current state, so data is not lost, exhibiting non-volatility. Resistive random access memory (ReRAM) achieves its resistance state by changing the atomic arrangement or defect positions; these changes remain stable after power is off, also exhibiting non-volatility. Magnetoresistive random access memory (MRAM) uses magnetic materials whose spin direction is stable in the absence of an external magnetic field, allowing for long-term data storage, also exhibiting non-volatility. Ferroelectric field-electro-electric memory (FeFET) uses ferroelectric materials whose polarization state remains unchanged after power is off, ensuring data persistence, also exhibiting non-volatility.
[0052] Step S23: Locate the target data in the storage unit based on the storage range, and restore the mapping relationship of the target data in the mapping unit based on the storage address of the target data.
[0053] After determining the storage range of the target data, the target data is located in storage unit 120 based on the storage range, and the storage address of the target data in storage unit 120 is determined. Then, the mapping relationship of the target data is reconstructed in mapping unit 114 based on the storage address of the target data. The mapping relationship is a mapping between the logical address of the target data and the storage address of the physical block, for addressing purposes.
[0054] The restored mapping relationship is stored in mapping unit 114.
[0055] If the target cache 110 has a limited size, the space of the mapping unit 114 can be reduced, and mapping can be performed through multi-level mapping relationships or referential mapping. Specifically, in a specific application scenario, the mapping relationship can include hierarchical multi-level mapping relationships. The first-level mapping relationship is stored in the mapping unit 114, and at least the last-level mapping relationship is stored in the storage unit 120. That is, the first-level mapping relationship is stored in the mapping unit 114, and the last-level mapping relationship is stored in the storage unit 120. The intermediate-level mapping relationships are selected between the mapping unit 114 and the storage unit 120 based on the size of the mapping unit 114. The specific selection is not limited here.
[0056] The target data is then retrieved from the mapping unit 114 to find the mapping relationship of the target data. Based on the mapping relationship, the storage address of the target data is determined so as to read the target data from the storage unit 120. This includes: determining the second-level mapping relationship of the target data from the first-level mapping relationship in the mapping unit 114; determining the next-level mapping relationship of the target data based on the second-level mapping relationship of the target data, and so on, until the last-level mapping relationship in the mapping relationship is determined. Based on the last-level mapping relationship, the storage address of the target data is determined so as to read the target data from the storage unit 120.
[0057] In a specific application scenario, the mapping relationship includes a referencing mapping table, which contains the correspondence between referencing parameters and their corresponding storage addresses. Referencing parameters include referencing characters or referencing positions. Referencing positions refer to the correspondence between each position in the referencing mapping table and its corresponding storage address. That is, mapping is performed by using referencing parameters instead of complete storage addresses, thereby reducing the size requirement of the mapping unit 114.
[0058] The process involves searching for the mapping relationship of the target data in the mapping unit 114, determining the storage address of the target data based on the mapping relationship, and reading the target data from the storage unit 120. This includes searching for the reference parameter of the target data in the reference mapping table in the mapping unit 114, determining the storage address of the target data based on the reference parameter, and reading the target data from the storage unit 120.
[0059] After the mapping relationship of the target data is restored, the impact of the abnormal power failure is eliminated, and the storage device 100 continues to operate.
[0060] In a specific application scenario, in response to receiving a read instruction for preset data, it is determined whether the preset data exists in the cache storage unit 111 of the target cache 110; if the preset data exists in the cache storage unit 111 of the target cache 110, the preset data in the cache storage unit 111 is read; specifically, the storage management 113 searches for the existence of the preset data in the data block 112; if the preset data does not exist in the cache storage unit 111 of the target cache 110, the mapping relationship of the target data is searched from the mapping unit 114, and the storage address of the target data is determined based on the mapping relationship, so as to read the target data from the storage unit 120 and complete the reading of the preset data.
[0061] Through the above steps, this embodiment utilizes the target cache to maintain its storage state after an abnormal power outage, preserving the storage logic of the target data. This storage logic determines the storage range of the target data within the storage unit, reducing the search range from the entire storage unit to the specified storage area. This significantly reduces the search range for the target data, improving search efficiency, shortening the recovery time after an abnormal power outage, and increasing the efficiency of mitigating the impact of abnormal power outages and restoring the state before the outage. If the host writes data with small burst characteristics, it can greatly improve write performance for backend devices with low bandwidth. Furthermore, in abnormal power outage scenarios, received data is not lost. When caching the mapping table, it is updated immediately after host data is written to the storage unit. The mapping table does not need to be periodically flushed to the storage unit. After an abnormal power outage, only the most recent NAND pages in the storage unit need to be scanned to rebuild the mapping table, greatly reducing the power-on recovery time in abnormal power outage scenarios and improving the latency of the host's first read / write operation.
[0062] Please see Figure 4 , Figure 4 This is a schematic diagram of a framework of an embodiment of the electronic device of this application. The electronic device 400 includes a memory 401 and a processor 402 coupled to each other. The processor 402 is used to execute program instructions stored in the memory 401 to implement the steps of the above-described method embodiment. In a specific implementation scenario, the electronic device 400 may include, but is not limited to, a microcomputer, a server, etc. In addition, the electronic device 400 may also include a laptop computer, a tablet computer, a Nand Flash memory, etc., without limitation.
[0063] Specifically, processor 402 controls itself and memory 401 to implement the steps of any of the above method embodiments. Processor 402 may also be referred to as a CPU (Central Processing Unit). Processor 402 may be an integrated circuit chip with signal processing capabilities. Processor 402 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 402 may be implemented using integrated circuit chips.
[0064] The above solution can reduce the time required to recover from abnormal power outages, which is beneficial for mitigating the impact of abnormal power outages and improving the efficiency of restoring the state before the abnormal power outage.
[0065] Please see Figure 5 , Figure 5 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. The computer-readable storage medium 500 stores program instructions 501 that can be executed by a processor. The program instructions 501 are used to implement the steps of any of the above method embodiments.
[0066] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0067] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0068] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0069] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0070] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A data recovery method, characterized in that, The data recovery method includes: The target data in the target cache of the storage device is stored in the storage unit of the storage device; In response to an abnormal power failure before updating the mapping relationship of the target data, after power-on, the storage range of the target data in the storage unit is determined based on the storage logic of the target data; Based on the storage range, the target data is located in the storage unit to restore the mapping relationship of the target data; The target cache retains its storage state after an abnormal power outage, thus preserving the storage logic of the target data.
2. The data recovery method according to claim 1, characterized in that, The step of searching for the target data in the storage unit based on the storage range to restore the mapping relationship of the target data includes: Based on the storage range, the target data is located in the storage unit to obtain the storage address of the target data in the storage unit; The mapping relationship of the target data is reconstructed based on the storage address.
3. The data recovery method according to claim 1 or 2, characterized in that, The target cache includes a cache storage unit, a mapping unit, and a system unit; The data recovery method includes: The target data in the cache storage unit is stored in the storage unit of the storage device; In response to an abnormal power failure before updating the mapping relationship of the target data to the mapping unit, after power-on, the storage range of the target data in the storage unit is determined based on the storage logic in the system unit; Based on the storage range, the target data is located in the storage unit, and the mapping relationship of the target data is restored in the mapping unit based on the storage address of the target data.
4. The data recovery method according to claim 3, characterized in that, The step of storing the target data in the cache storage unit to the storage unit of the storage device includes: Upon receiving new stored data, in response to the number of data stored in the cache storage unit of the storage device exceeding a preset number, the target data is transferred to the storage unit of the storage device; wherein, the target data is the data that has been stored for the longest time in the cache storage unit; The new storage data is stored in the cache storage unit; In response to the completion of the target data transfer, the mapping relationship of the target data is updated in the mapping unit and the storage logic in the system unit is updated in the system unit.
5. The data recovery method according to claim 3, characterized in that, After restoring the mapping relationship of the target data, the process includes: In response to receiving a read instruction for preset data, determine whether the preset data exists in the cache storage unit of the target cache; When the preset data exists in the cache storage unit of the target cache, read the preset data from the cache storage unit; If the preset data is not present in the cache storage unit of the target cache, the mapping relationship of the target data is searched in the mapping unit, and the storage address of the target data is determined based on the mapping relationship, so as to read the target data from the storage unit.
6. The data recovery method according to claim 5, characterized in that, The mapping relationship includes a hierarchical multi-level mapping relationship, wherein the first-level mapping relationship is stored in the mapping unit, and at least the last-level mapping relationship is stored in the storage unit; The step of finding the mapping relationship of the target data from the mapping unit, determining the storage address of the target data based on the mapping relationship, and reading the target data from the storage unit includes: The second-level mapping relationship of the target data is determined from the first-level mapping relationship in the mapping unit; Based on the second-level mapping relationship of the target data, the next-level mapping relationship of the target data is determined, and so on, until the last-level mapping relationship is determined, so as to determine the storage address of the target data based on the last-level mapping relationship, and to read the target data from the storage unit.
7. The data recovery method according to claim 5, characterized in that, The mapping relationship includes a referencing mapping table, which contains the correspondence between referencing parameters and their corresponding storage addresses; the referencing parameters include referencing characters or referencing positions. The step of finding the mapping relationship of the target data from the mapping unit, determining the storage address of the target data based on the mapping relationship, and reading the target data from the storage unit includes: The reference parameter of the target data is retrieved from the reference mapping table in the mapping unit, and the storage address of the target data is determined based on the reference parameter, so as to read the target data from the storage unit.
8. The data recovery method according to claim 1, characterized in that, The target cache includes one or more of phase-change memory, resistive random access memory, magnetoresistive random access memory, ferroelectric memory, or memory-level memory.
9. An electronic device, characterized in that, The device includes a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the data recovery method as described in any one of claims 1 to 8.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the data recovery method as described in any one of claims 1 to 8.