Data recovery method and electronic equipment

By identifying and utilizing status flag areas and periodic identifiers in the storage system, the latest and complete sub-storage space can be quickly filtered out. By using reference metadata and bitmap status recovery management data, the problem of excessive time consumption in traditional data recovery methods is solved, and data recovery efficiency and system reliability are improved.

CN120909849AActive Publication Date: 2025-11-07LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511449124.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-11
Publication Date
2025-11-07
Estimated Expiration
2045-10-11

AI Technical Summary

Technical Problem

Traditional data recovery methods are too time-consuming after system failures, resulting in low data recovery efficiency and impacting business continuity and user experience.

Method used

By obtaining recovery instructions, the status flag area in the storage system is identified, candidate sub-storage spaces containing flag data are filtered out, and the target sub-storage space is determined using periodic identifiers. The management data is then quickly recovered using the reference metadata and bitmap status in the target sub-storage space.

Benefits of technology

It enables rapid location of the latest complete data, avoids full scans, improves the accuracy and efficiency of data recovery, shortens recovery time after a failure, and enhances system reliability and business continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909849A_ABST
    Figure CN120909849A_ABST
Patent Text Reader

Abstract

The invention discloses a data recovery method and electronic equipment, and relates to the technical field of computers, and the data recovery method comprises the following steps: obtaining a recovery instruction used for indicating to recover management data of a storage system; state flag areas corresponding to all sub-storage spaces in the target storage space are recognized, the sub-storage spaces containing flag data in the state flag areas are determined as candidate sub-storage spaces, metadata and bitmap states written in different write-in periods are stored in all the sub-storage spaces respectively, and the metadata and the bitmap states are written in the candidate sub-storage spaces. The flag data is used for indicating that the data stored in the sub-storage space is in a complete state; identifying a period identifier corresponding to each candidate sub-storage space, and determining the sub-storage space of which the period identifier meets a predetermined condition as a target sub-storage space; and recovering the management data by using the reference metadata and the reference bitmap state stored in the target sub-storage space. The technical problem of low data recovery efficiency is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a data recovery method and an electronic device. BACKGROUND

[0002] All-Flash Array (AFA) plays a key role in modern data centers and cloud environments. However, one of the challenges faced by storage systems is to ensure the safety and rapid recovery of data under various failure conditions, which directly affects business continuity and user experience.

[0003] The traditional data recovery method performs full-scan of metadata after system failure to reconstruct a bitmap and recover the mapping relationship of data, which is extremely time-consuming and often takes several hours to several days.

[0004] In other words, the data recovery method provided in the related art still has the technical problem of low recovery efficiency. SUMMARY

[0005] The present application provides a data recovery method and an electronic device to at least solve the technical problem of low data recovery efficiency in the related art.

[0006] The present application provides a data recovery method, comprising: obtaining a recovery instruction used to indicate recovery of management data of a storage system, wherein the management data comprises metadata and bitmap state, the metadata is used to represent a mapping relationship between a virtual address and a physical address of data in the storage system, and the bitmap state is used to represent an occupancy state of a physical block in a target storage space, and the target storage space is used to store data in the storage system; identifying a state flag area corresponding to each sub-storage space in the target storage space, determining a sub-storage space containing flag data in the state flag area as a candidate sub-storage space, wherein each sub-storage space respectively stores metadata and bitmap state written at different write periods, and the flag data is used to indicate that the data stored in the sub-storage space is in a complete state; identifying a period identifier corresponding to each candidate sub-storage space, and determining a sub-storage space whose period identifier satisfies a predetermined condition as a target sub-storage space, wherein the period identifier is used to represent a write period of the data stored in the sub-storage space; and recovering the management data by using reference metadata and reference bitmap state stored in the target sub-storage space.

[0007] The application further provides a data recovery device, comprising: an acquisition unit, configured to acquire a recovery instruction used to indicate recovery of management data of a storage system, wherein the management data comprises metadata and bitmap status, the metadata is used to represent a mapping relationship between a virtual address and a physical address of data in the storage system, and the bitmap status is used to represent an occupancy status of a physical block in a target storage space, and the target storage space is used to store the data in the storage system; a first determination unit, configured to identify a state flag area corresponding to each sub-storage space in the target storage space, and determine a sub-storage space containing flag data in the state flag area as a candidate sub-storage space, wherein each sub-storage space respectively stores metadata and bitmap status written at different writing periods, and the flag data is used to indicate that the data stored in the sub-storage space is in a complete state; a second determination unit, configured to identify a period identifier corresponding to each candidate sub-storage space, and determine a sub-storage space with a period identifier satisfying a predetermined condition as a target sub-storage space, wherein the period identifier is used to represent a writing period of the data stored in the sub-storage space; and a recovery unit, configured to recover the management data by using reference metadata and reference bitmap status stored in the target sub-storage space.

[0008] The application further provides an electronic device, comprising: a memory, configured to store a computer program; and a processor, configured to execute the computer program to implement the steps of any one of the data recovery methods.

[0009] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any one of the data recovery methods.

[0010] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of any one of the data recovery methods.

[0011] In the embodiment of the present application, a recovery instruction for indicating recovery of management data of a storage system is acquired, wherein the management data comprises metadata and bitmap status, the metadata is used to represent a mapping relationship between a virtual address and a physical address of data in the storage system, and the bitmap status is used to represent an occupancy status of a physical block in a target storage space, and the target storage space is used to store data in the storage system; a state flag area corresponding to each sub-storage space in the target storage space is identified, a sub-storage space containing flag data in the state flag area is determined as a candidate sub-storage space, wherein each sub-storage space respectively stores metadata and bitmap status written at different writing periods, and the flag data is used to indicate that the data stored in the sub-storage space is in a complete state; a period identifier corresponding to each candidate sub-storage space is identified, a sub-storage space with a period identifier satisfying a predetermined condition is determined as a target sub-storage space, wherein the period identifier is used to represent a writing period of the data stored in the sub-storage space; and the management data is recovered by using reference metadata and reference bitmap status stored in the target sub-storage space. By using the embodiment of the present application, the technical effect of improving the recovery efficiency of data is achieved, and the technical problem of low data recovery efficiency is solved. BRIEF DESCRIPTION OF DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0013] Figure 1 A flowchart of a data recovery method provided by the embodiment of the present application;

[0014] Figure 2 A schematic diagram of a data recovery method provided by the embodiment of the present application;

[0015] Figure 3 A schematic diagram of another data recovery method provided by the embodiment of the present application;

[0016] Figure 4 A flowchart of a physical block delay release provided by the embodiment of the present application;

[0017] Figure 5 A structural schematic diagram of a data recovery device provided by the embodiment of the present application; DETAILED DESCRIPTION

[0018] With reference to the drawings and specific embodiments described below, the technical solutions in the embodiments of the present application will be clearly and completely described, obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0019] It should be noted that in the description of the present application, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices comprising a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. The terms "first", "second" and the like in the present application are used to distinguish similar objects, not to describe a specific order or sequence.

[0020] In order to enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0021] As an optional solution, the above data recovery method, as shown in Figure 1 includes:

[0022] S102, obtaining a recovery instruction for indicating recovery of management data of a storage system, wherein the management data includes metadata and bitmap state, the metadata is used to represent the mapping relationship between the virtual address and the physical address of the data in the storage system, and the bitmap state is used to represent the occupancy state of the physical block in the target storage space, and the target storage space is used to store the data in the storage system.

[0023] S104, identifying the state flag area corresponding to each sub-storage space in the target storage space, determining the sub-storage space containing flag data in the state flag area as a candidate sub-storage space, wherein each sub-storage space respectively stores metadata and bitmap state written at different write cycles, and the flag data is used to indicate that the data stored in the sub-storage space is in a complete state.

[0024] S106, identifying the cycle identifier corresponding to each candidate sub-storage space, and determining the sub-storage space whose cycle identifier meets a predetermined condition as a target sub-storage space, wherein the cycle identifier is used to represent the write cycle of the data stored in the sub-storage space.

[0025] S108, using the reference metadata and the reference bitmap state stored in the target sub-storage space to recover the management data.

[0026] Optionally, the above-mentioned recovery instruction is used to represent a special command received by the storage system, instructing the storage system to perform a data recovery operation, usually triggered by system failure or data inconsistency.

[0027] It should be noted that the above-mentioned management data includes metadata and bitmap state used for managing data in the storage system, which are core parts of the storage system, used to record the mapping of virtual addresses to physical addresses of data and the occupancy of physical blocks.

[0028] Further, the above-mentioned metadata specifically refers to data used to describe and manage actual data in the storage system, which contains mapping information between virtual addresses and physical addresses of data, and is the key to data recovery.

[0029] Optionally, the above-mentioned bitmap state is used to represent the occupancy state of the physical blocks of the target storage space in the storage system, which marks which physical blocks are occupied and which are free through a bitmap (usually a series of binary bits).

[0030] It should be noted that the above-mentioned target storage space includes a physical area in the storage system used for persistent storage of data, which includes a series of sub-storage spaces, each of which records the data of a write cycle.

[0031] Further, the above-mentioned sub-storage space is a logical area in the target storage space, used to store metadata and bitmap state written in a specific write cycle.

[0032] Optionally, the above-mentioned state flag area is used to represent a reserved area in each sub-storage space, used to store marker data indicating whether the data of the sub-storage space is complete.

[0033] It should be noted that the above-mentioned flag data includes a special data format or flag, used to indicate whether the data stored in the sub-storage space has been completely written.

[0034] Further, the above-mentioned candidate sub-storage space refers to a sub-storage space containing flag data in the state flag area, indicating the completeness of the data, which is a potential candidate for data recovery.

[0035] Optionally, the above-mentioned cycle identifier is used to represent a unique identifier of a write cycle, used to track and manage data in the write cycle.

[0036] It should be noted that the aforementioned predetermined conditions include a periodic identifier comparison strategy, used to filter target sub-storage spaces for data recovery. The process of identifying the periodic identifiers corresponding to each candidate sub-storage space and determining the sub-storage spaces whose periodic identifiers meet the predetermined conditions as target sub-storage spaces may include, but is not limited to: sorting each candidate sub-storage space according to the periodic identifier; and determining the candidate sub-storage space whose sorting order matches the target order as the target sub-storage space.

[0037] Furthermore, the aforementioned target sub-storage space refers to the candidate sub-storage space that periodically identifies and meets predetermined conditions, which will serve as the direct data source for data recovery operations.

[0038] For example, to avoid irreparable situations caused by write failures (i.e., writing to the target storage space), the write operation is not performed by overwriting in place during each cycle. Instead, multiple write areas (representing multiple sub-storage spaces) are pre-defined and used cyclically. A cursor is used to record the current position, for example, such as... Figure 2 As shown, 2-3 disk write areas are typically sufficient. After disk write is complete, the cursor points to the next disk write area. During the next write cycle, data is written to the new disk write area. In this way, if a write failure or incomplete write occurs in the most recent write cycle, the disk write information for this cycle is discarded, and the metadata and bitmap from the previous cycle are used as a reference for repair. To facilitate identification of whether disk write is complete within a cycle, a special flag area (used to indicate the aforementioned status flag area) is usually reserved in each disk write area. The size can be one sector or 4K. Before writing to disk in a write cycle, the data in the flag area is cleared, and then the metadata and bitmap are written to disk. After the write is complete, data in a specific format is written to the flag area again. If the flag area in a disk write area is empty, it means that the write process is not complete, and the metadata and bitmap of this disk write area are unavailable during recovery; if the flag area contains data in a specific format, it means that this disk write area is available.

[0039] Optionally, the aforementioned reference metadata and reference bitmap state are used to represent the metadata and bitmap state read from the target sub-storage space, which will be used to recover the management data of the storage system.

[0040] Optionally, as an alternative example, the above content can be illustrated by, but is not limited to, the following examples:

[0041] When a controller serious failure occurs, cache data loss (used to represent the above management data), such as performing repair tasks, first need to scan each landing area (used to represent the above sub-storage space), and according to the marking area in the landing area to determine whether the landing area is written to the disk is complete, that is, the metadata and bitmap are complete, find the landing area that is written to the disk as an effective landing area (used to represent the candidate sub-storage space).

[0042] Read the write count ID recorded in the effective landing area, find the landing area with the largest ID (used to represent the target sub-storage space).

[0043] Read the metadata and bitmap from the landing area with the largest ID, and use it as the metadata and bitmap after data repair is completed, and then restore the mapping relationship between virtual space and physical block according to the metadata to support user data read and write, and restore the space management module according to the bitmap to support subsequent physical space allocation and recycling tasks. Since the read-out metadata and bitmap can be used directly without additional scanning detection or reconstruction actions, the repair task can be completed quickly, greatly improving the repair efficiency.

[0044] Alternatively, as another optional example, the above can be exemplified and explained by the following examples, but not limited to:

[0045] Suppose a full flash storage system encounters a serious failure, resulting in the loss of management data in the current cache. In order to quickly recover data, the system needs to perform the following operations:

[0046] Receive recovery instruction: the system detects data inconsistency or system failure, triggering a recovery instruction.

[0047] Scan state flag area: the system starts scanning the state flag area of all sub-storage spaces in the target storage space to find those sub-storage spaces that contain flag data indicating data integrity.

[0048] Determine candidate sub-storage space: suppose three sub-storage spaces in the state flag area contain flag data, which are marked as candidate sub-storage spaces.

[0049] Screen target sub-storage space: the system compares the cycle identifiers of the three candidate sub-storage spaces to determine the sub-storage space with the latest write cycle as the target of data recovery. This target sub-storage space contains the latest reference metadata and reference bitmap state.

[0050] Data recovery: the system reads the reference metadata and reference bitmap state in the target sub-storage space, and uses these data to update or rebuild the management data of the storage system, quickly recovering the system to normal operation.

[0051] In the embodiment of the present application, a recovery instruction for indicating recovery of management data of a storage system is acquired, wherein the management data includes metadata and bitmap status, the metadata is used to represent a mapping relationship between a virtual address and a physical address of data in the storage system, and the bitmap status is used to represent an occupancy status of a physical block in a target storage space used to store data in the storage system. A state flag area corresponding to each sub-storage space in the target storage space is identified, and a sub-storage space containing flag data in the state flag area is determined as a candidate sub-storage space, wherein the metadata and the bitmap status written at different writing periods are respectively stored in each sub-storage space, and the flag data is used to indicate that the data stored in the sub-storage space is in a complete state. A period identifier corresponding to each candidate sub-storage space is identified, and a sub-storage space with a period identifier satisfying a predetermined condition is determined as a target sub-storage space, wherein the period identifier is used to represent a writing period of the data stored in the sub-storage space. The management data is recovered by using reference metadata and reference bitmap status stored in the target sub-storage space. By combining the acquisition of the recovery instruction with the identification of the state flag area, the system can quickly locate the sub-storage space containing complete data, creating a favorable starting point for data recovery. By combining the use of the period identifier with the state flag area, the system can quickly filter out the sub-storage space closest to the state before the failure and having complete data in the data recovery process, avoiding the inefficiency of full scanning and greatly saving the time of data recovery. By using the reference metadata and the bitmap status in the target sub-storage space for data recovery, it is ensured that the recovery process is based on the latest and complete data, improving the accuracy and efficiency of data recovery and reducing the risk of inconsistent or incorrect recovery. In summary, by combining the three core technical features of fast response, efficient filtering and accurate recovery, the embodiment of the present application improves the efficiency of data recovery in the all-flash storage system, shortens the recovery time after failure, thereby enhancing the reliability and business continuity of the system, and solving the technical problem of low data recovery efficiency in related technologies.

[0052] As an optional solution, the sub-storage space with the period identifier satisfying the predetermined condition is determined as the target sub-storage space, including:

[0053] S1, each candidate sub-storage space is sorted according to the period identifier.

[0054] S2, the candidate sub-storage space with a target sequence position is determined as the target sub-storage space.

[0055] Optionally, the period identifier is used to represent a timestamp or a period number of a data writing operation in the storage system, which is an important basis for identifying a data version during data recovery.

[0056] It should be noted that the above sorting processing is a data management strategy, which can but is not limited to arranging the sub-storage spaces in ascending order or descending order according to the cycle identifiers of the sub-storage spaces to locate the sub-storage space containing the latest data.

[0057] Optionally, the above sequence position is used to represent the position of each sub-storage space in the sorted sub-storage space list, and the higher the sequence position is, the newer the data is generally.

[0058] It should be noted that the target sequence position is usually the highest sequence position (the largest cycle identifier) to ensure that the sub-storage space containing the latest complete data is used for recovery.

[0059] In the embodiment of the present application, the candidate sub-storage spaces are sorted according to the cycle identifiers; and the candidate sub-storage space with the target sequence position is determined as the target sub-storage space. By sorting the candidate sub-storage spaces and selecting the latest and complete state sub-storage space based on the cycle identifier, the system can quickly locate the sub-storage space containing the latest cycle data, thereby significantly reducing the time required for data recovery. This method avoids full scanning of all sub-storage spaces and focuses only on the latest cycle identifier, ensuring efficient data recovery.

[0060] As an optional solution, the reference metadata and the reference bitmap state stored in the target sub-storage space are used to recover the management data, including:

[0061] The metadata in the management data is adjusted by using the reference metadata, and the bitmap state in the management data is adjusted by using the reference bitmap state.

[0062] In the case that the metadata in the management data matches the reference metadata, and the bitmap state in the management data matches the reference bitmap state, it is determined that the recovery of the management data is completed.

[0063] It should be noted that the above adjustment refers to the process of updating or correcting the metadata and bitmap state in the management data according to the reference metadata and the reference bitmap state to ensure that they match the reference information.

[0064] Optionally, the above matching of the metadata in the management data and the reference metadata can but is not limited to indicate that the metadata in the management data is consistent with the corresponding metadata in the reference metadata, and the above matching of the bitmap state in the management data and the reference bitmap state can but is not limited to indicate that the bitmap state in the management data is consistent with the corresponding part in the reference bitmap state.

[0065] In the embodiments of the present application, the metadata in the management data is adjusted by using the reference metadata, and the bitmap state in the management data is adjusted by using the reference bitmap state; in the case that the metadata in the management data matches the reference metadata, and the bitmap state in the management data matches the reference bitmap state, it is determined that the recovery of the management data is completed. In the embodiments of the present application, the metadata and the bitmap state in the management data are adjusted by using the reference metadata and the reference bitmap state in the target sub-storage space during the data recovery process, so that the recovered management data is consistent with the data in the target sub-storage space. The completion of the data recovery is detected and confirmed by comparing the management data with the reference data, which avoids errors and inconsistency problems in the data recovery process, and improves the reliability of the system.

[0066] As an optional solution, identifying the state flag area corresponding to each sub-storage space in the target storage space comprises:

[0067] S1, each sub-storage space is determined as a current sub-storage space.

[0068] S2, a current state flag area in the current sub-storage space is identified.

[0069] S3, in the case that the current state flag area is empty, it is determined that the data stored in the current sub-storage space is in an incomplete state.

[0070] S4, in the case that the current state flag area stores current flag data conforming to a target format, it is determined that the current sub-storage space is in a complete state.

[0071] Optionally, the current sub-storage space represents a sub-storage space being checked to determine the data state.

[0072] It should be noted that the current state flag area refers to the state flag area in the current sub-storage space, which is used to check the data integrity of the sub-storage space.

[0073] Further, the target format is a standard format used to identify and verify whether the flag data in the state flag area is valid, which ensures the correctness of the data and the accuracy of the recovery process.

[0074] In the embodiment of the present application, each sub-storage space is determined as a current sub-storage space; a current state flag area in the current sub-storage space is identified; in the case that the current state flag area is empty, it is determined that the data stored in the current sub-storage space is in an incomplete state; in the case that the current state flag area stores current flag data in a target format, it is determined that the current sub-storage space is in a complete state. By using the embodiment of the present application, the existence of the state flag area makes the system not need to read the actual data in the sub-storage space when detecting the data integrity. If the state flag area is empty, it indicates that the data in the sub-storage space is incomplete or not completed writing; if the state flag area contains the flag data in the target format, it indicates that the data has been completely written. This mechanism provides a method for quickly judging the data integrity, avoids unnecessary data scanning, and effectively improves the efficiency of data recovery.

[0075] As an optional solution, before obtaining the recovery instruction for indicating to recover the management data in the memory of the storage system, the method further includes:

[0076] S1, in the case that the first write cycle is reached, a first cycle identifier matching the first write cycle is generated.

[0077] S2, a first metadata and a first bitmap state stored in a cache space of the storage system before the first write cycle are determined.

[0078] S3, the first bitmap state carrying the first cycle identifier is written into a first sub-storage space in a target storage space.

[0079] S4, the first metadata carrying the first cycle identifier is written into the first sub-storage space.

[0080] It should be noted that the first write cycle refers to a cycle of the management data (i.e., the metadata and the bitmap state) writing process in the storage system, which is a periodic time point of the system recording the data state.

[0081] Optionally, the first cycle identifier is used to represent a unique identifier generated in the first write cycle, which is used to mark the time point of writing data, facilitating subsequent data recovery and management.

[0082] It should be noted that the first metadata is the data stored in the cache space in the first write cycle, which contains the meta-information about the user data, such as the mapping relationship between the virtual address and the physical address.

[0083] Optionally, the first bitmap state is used to represent the bitmap state information stored in the cache space in the first write cycle, which reflects the occupation of the physical blocks in the target storage space.

[0084] Further, the above-mentioned cache space is a high-speed storage area in a storage system for temporarily storing data, and the purpose is to improve the data processing speed, but the data in the cache is volatile and may be lost due to failure.

[0085] It should be noted that the above-mentioned first sub-storage space is a part of the target storage space, and is used to store the metadata and bitmap state of the first write cycle.

[0086] Optionally, as an optional example, the above-mentioned content can be exemplarily explained by the following example, but is not limited to the following example:

[0087] An metadata write disk count module is added, as shown in Figure 3 Before a batch of changed metadata in the cache is written to disk, the metadata management module 302 needs to perform step S302 to obtain an unique identifier (Identifier, referred to as ID) (used to represent the cycle identifier) from the count module 304. This ID always maintains a monotonic increase and will not be repeated.

[0088] The metadata of this batch will be written to disk with this ID, and before the metadata is written to disk, the count module 304 needs to perform S304 to send the same ID to the bitmap management module 306, so that the bitmap management module performs step S306 to perform the write disk (i.e., write to the first sub-storage space) operation for the bitmap carrying the ID.

[0089] Then, the metadata management module 302 can perform step S308 to perform the write disk operation for the metadata of this batch carrying the ID.

[0090] Finally, the metadata and bitmap with the same ID are written to the same write disk cycle or write disk batch, so that it can be ensured that as long as the complete metadata in the same cycle can be obtained during subsequent read disk, the complete bitmap can be obtained. It should be noted that the write disk of the bitmap can be full or incremental, and can be determined according to the size of the bitmap. If the total amount of the bitmap is small, the full amount method can be selected, and if the total amount of the bitmap is large, the incremental method can be selected. In engineering practice, the size of the bitmap is usually not too large, so the full amount method is generally preferred.

[0091] In the embodiment of the present application, in the case that the first write cycle is reached, a first cycle identifier matching the first write cycle is generated; a first metadata and a first bitmap state stored in a cache space of the storage system before the first write cycle are determined; the first bitmap state carrying the first cycle identifier is written into a first sub-storage space in the target storage space; and the first metadata carrying the first cycle identifier is written into the first sub-storage space. By generating a cycle identifier in each write cycle and writing the metadata and bitmap state of the current cycle into a sub-storage space of the target storage space, the system can periodically update and save the key management data, which ensures that the system can quickly recover to the latest complete state even in the case of system failure, and reduces the complexity and time of data recovery.

[0092] As an optional solution, generating the first cycle identifier matching the first write cycle comprises:

[0093] S1, obtaining a historical cycle identifier corresponding to a historical write cycle before and adjacent to the first write cycle.

[0094] S2, accumulating a target value to the historical cycle identifier to obtain the first cycle identifier.

[0095] It should be noted that the target value is used to represent an incremental value for generating a new cycle identifier, which is usually 1, but can also be other values to maintain the monotonicity of the cycle identifier, which is not limited in the embodiment.

[0096] In the embodiment of the present application, the historical cycle identifier corresponding to the historical write cycle before and adjacent to the first write cycle is obtained; and a target value is accumulated to the historical cycle identifier to obtain the first cycle identifier. By accumulating the target value to the historical cycle identifier, the system can generate a new and continuous cycle identifier, which ensures that each write cycle has a unique identifier for the metadata and bitmap state. This is helpful for version control and data integrity check during data recovery, and prevents data errors caused by repeated or chaotic identifiers.

[0097] As an optional solution, before the first bitmap state carrying the first cycle identifier is written into the first sub-storage space in the target storage space, the method further comprises:

[0098] S1, in the case that a first data stored in a first physical block is requested to be recycled, the first data is cleared from the first physical block, wherein the target storage space comprises the first physical block.

[0099] S2, adding identification information of the first physical block to the first linked list.

[0100] It should be noted that the first physical block is a basic unit for storing data in the storage system, which can contain user data or management data.

[0101] Further, the first data refers to user data s stored in the first physical block, which will be cleared in the garbage collection process to release storage space.

[0102] Optionally, the above-mentioned recycling request is used to represent the garbage collection action initiated in the system, the purpose of which is to release the physical blocks that are no longer needed for new data writing.

[0103] It should be noted that the first linked list is a data structure used to temporarily store the identification information of the physical blocks waiting to be released until they can be safely marked as unoccupied.

[0104] In the embodiment of the present application, in the case of obtaining a recycling request for requesting recycling of the first data stored in the first physical block, the first data is cleared from the first physical block, wherein the target storage space includes the first physical block; the identification information of the first physical block is added to the first linked list. In the garbage collection process, the system adds the identification information of the physical block to the linked list, delays its actual release, and updates the bitmap state to mark the physical block as unoccupied after a certain period of time. This way avoids data overwrite and redundant data writing, improves data security and storage space utilization efficiency.

[0105] As an optional solution, after adding the identification information of the first physical block to the first linked list, it further includes:

[0106] S1, in the case of reaching a target write period, the identification information of the first physical block is removed from the first linked list, wherein the period interval between the target write period and the first write period is a target interval.

[0107] S2, update the corresponding bit in the bitmap state currently stored in the cache space of the first physical block to a first value, wherein the first value represents that the first physical block is currently unoccupied.

[0108] Optionally, the target write period refers to the time period for garbage collection and bitmap state update in the operation process of the storage system. It has a fixed period interval with the first write period to ensure that the release and state update of the physical block do not occur immediately to avoid data overwrite problem.

[0109] Optionally, the target interval is used to represent the time difference between the first write period and the target write period, which is a preset time period to ensure data security.

[0110] Further, the first value is used to represent a state that the physical block is not occupied, for example, in the bitmap state, the first value can be 0.

[0111] Optionally, the cache space is used to represent a high-speed storage area in the storage system for temporarily storing data, and the data in the cache is volatile, but is used for fast read and write operations.

[0112] Optionally, as an optional example, the process of delayed release of the physical block can be illustrated by the following example, but is not limited to the following example:

[0113] Figure 4 is a flowchart of a process of delayed release of a physical block, as Figure 4 shown in FIG. 4, after completing the recycling of the physical block (for example, the first physical block), the current write disk count ID is queried and recorded. Then, in step S404, the recycled physical block is temporarily mounted in the staging linked list (for example, the first linked list). When the next period of down flushing is completed and the count is increased by 1, step S406 is executed to query the physical blocks existing in the staging linked list, and the physical blocks waiting for two periods or more are taken out. Then, in step S408, the bitmap is updated and the release process is continued. Usually, the delay waiting time is up to two periods, and the longer the delay waiting time is, the better the data security is, but the efficiency of the release of the physical block is affected, and the waiting for two write disk periods is enough to ensure the data security in the repair process.

[0114] In the embodiment of the present application, when the target write period is reached, the identification information of the first physical block is removed from the first linked list, wherein the period interval between the target write period and the first write period is a target interval; and the bit corresponding to the first physical block in the current bitmap state stored in the cache space is updated to the first value, wherein the first value is used to represent that the first physical block is currently not occupied. By setting the target write period, the system can timely remove the physical block identification from the linked list, update the bitmap state, and accurately reflect the occupation of the physical block. This helps to avoid the problem of data inconsistency caused by the delayed release of the physical block.

[0115] As an optional solution, before writing the first bitmap state carrying the first period identification into the first sub-storage space in the target storage space, the method further comprises:

[0116] clearing all data stored in the first state flag area corresponding to the first sub-storage space.

[0117] Optionally, the above clearing all data stored in the first state flag area corresponding to the first sub-storage space is used to indicate that the data in the first state flag area is cleared before the new first bitmap state is written to the first sub-storage space, so as to ensure that the flag data written later is the latest and is not disturbed.

[0118] In the embodiment of the present application, all data stored in the first state flag area corresponding to the first sub-storage space is cleared. By using the embodiment of the present application, the old data possibly existing in the state flag area is cleared before new data is written, so as to ensure that the state flag area can accurately reflect the current data state in the sub-storage space. In this way, confusion of the state flag area is avoided, and the efficiency and accuracy of data recovery are improved.

[0119] As an optional solution, after the first metadata carrying the first period identifier is written to the first sub-storage space, the method further includes:

[0120] writing the first flag data conforming to the target format to the first state flag area, wherein the first flag data is used to indicate that the data stored in the first sub-storage space is in a complete state.

[0121] Optionally, the above writing the first flag data conforming to the target format to the first state flag area is used to indicate that after the data (such as the first bitmap state and the first metadata) is written to the first sub-storage space, the system generates a first flag data conforming to a preset format, which is used to confirm whether the data is complete. The flag data is then written to a specific area (the first state flag area) of the first sub-storage space to mark the state of the data.

[0122] In the embodiment of the present application, the first flag data conforming to the target format is written to the first state flag area, wherein the first flag data is used to indicate that the data stored in the first sub-storage space is in a complete state. By using the embodiment of the present application, after the metadata and the bitmap state are written to the sub-storage space, the flag data of a specific format is written to the state flag area, which explicitly indicates that the data in the sub-storage space is in a complete state. This is helpful to quickly screen out the available sub-storage space in the early stage of data recovery, and reduces the complexity and time of data recovery.

[0123] As an optional solution, after the first metadata carrying the first period identifier is written to the first sub-storage space, the method further includes:

[0124] S1, in a case where a second write period adjacent to the first write period is reached, a second period identifier matched with the second write period is generated.

[0125] S2, second metadata and a second bitmap state stored in a cache space of the storage system before the second write period are determined.

[0126] S3, writing the second bitmap state carrying the second cycle identifier into a second sub-storage space in the target storage space.

[0127] S4, writing the second metadata carrying the second cycle identifier into the second sub-storage space.

[0128] Optionally, the second write cycle is used to represent the next data write cycle following the first write cycle, which is the next time point in the data management process.

[0129] It should be noted that the second cycle identifier is a unique identifier related to the second write cycle, used to mark all data written in the cycle, including metadata and bitmap state.

[0130] Further, the second metadata is the data stored in the cache during the second write cycle, which contains the mapping information of the virtual address to the physical address of the newly written data, and is the core part of data management.

[0131] Optionally, the second bitmap state is used to represent the bitmap information stored in the cache during the second write cycle, which reflects the usage of the physical blocks, such as which blocks are occupied and which blocks are free.

[0132] It should be noted that the generation of the second cycle identifier matching the second write cycle can be but is not limited to being achieved through a system internal counter or timestamp generation mechanism, ensuring that each write cycle has a unique identifier.

[0133] Further, the determination of the second metadata and the second bitmap state stored in the cache space of the storage system before the second write cycle can be but is not limited to indicating that the system will check all metadata and bitmap states to be written in the cache before starting the second write cycle, to determine which ones belong to the second cycle.

[0134] Optionally, the writing of the second bitmap state carrying the second cycle identifier into the second sub-storage space in the target storage space is used to represent that the second bitmap state and the second cycle identifier are written together into a new sub-storage space of the target storage space, to maintain the persistence and consistency of the data.

[0135] It should be noted that the writing of the second metadata carrying the second cycle identifier into the second sub-storage space can be but is not limited to indicating that the system stores the second metadata and the second bitmap state of the second cycle together with the second cycle identifier, which provides key information for subsequent data recovery.

[0136] In the embodiment of the present application, when the second write cycle adjacent to the first write cycle is reached, a second cycle identifier matching the second write cycle is generated; the second metadata and the second bitmap state stored in the cache space of the storage system before the second write cycle are determined; the second bitmap state carrying the second cycle identifier is written into the second sub-storage space in the target storage space; and the second metadata carrying the second cycle identifier is written into the second sub-storage space. By generating a new cycle identifier between adjacent write cycles, the system can continuously record and update the state of the management data, avoiding data loss and version control problems, and improving the continuity and persistence of the data.

[0137] As an optional solution, generating the second cycle identifier matching the second write cycle comprises:

[0138] The first cycle identifier of the first write cycle is obtained.

[0139] The target value is added to the first cycle identifier to obtain the second cycle identifier.

[0140] In the embodiment of the present application, the first cycle identifier of the first write cycle is obtained; and the target value is added to the first cycle identifier to obtain the second cycle identifier. By directly adding the previous cycle identifier, the system can quickly generate the identifier of the current cycle, which is easy to implement and also ensures the continuity and uniqueness of the cycle identifier.

[0141] As an optional solution, after the first metadata carrying the first cycle identifier is written into the first sub-storage space, the sub-storage space cursor position associated with the target storage space is marked as the position of the next sub-storage space corresponding to the first sub-storage space.

[0142] Before the second bitmap state carrying the second cycle identifier is written into the second sub-storage space in the target storage space, the position of the second sub-storage space is determined based on the cursor position.

[0143] Optionally, the sub-storage space cursor position is used to represent a pointer or a marker for tracking the next write position in the target storage space, which helps the system to determine where to write the data.

[0144] Optionally, as an optional example, the above content can be illustrated and explained by the following examples, but is not limited to the following examples:

[0145] Suppose that three sub-storage spaces A, B and C are set in the all-flash storage system, which are used in a cycle to store bitmap states and metadata. After the first cycle data (identified as CID1) is written, the system needs to:

[0146] Update cursor: the system updates the position of the sub-storage space cursor, assuming it starts from A, after writing CID1 data, the cursor is marked to point to B, meaning that B is the target sub-storage space of the next writing cycle.

[0147] Write CID1 data: the first bitmap state and the first metadata have been written to sub-storage space A, and the cursor is then pointed to B, indicating that B is the target area of CID2 data.

[0148] CID2 data preparation stage: when the system enters the second writing cycle to prepare to write CID2 data, it first determines the position of the second sub-storage space based on the cursor position, i.e., sub-storage space B.

[0149] Write CID2 data: then, the system writes the second bitmap state and the second metadata, along with the CID2 identifier, into sub-storage space B, completing the data writing operation of the second cycle.

[0150] Cursor updated to C: after completing the writing of CID2 data, the cursor position is updated to point to sub-storage space C, preparing for the writing of CID3 data.

[0151] In the embodiment of the present application, before writing the second bitmap state carrying the second cycle identifier into the second sub-storage space in the target storage space, the position of the second sub-storage space is determined based on the cursor position. By using the cursor recording method, the system can determine the position of the next target sub-storage space for writing, achieving the cyclic use of the writing area, avoiding the overuse of a specific sub-storage space, and simplifying the selection process of the target sub-storage space, thereby improving the efficiency of data recovery.

[0152] As an optional solution, the recovery instruction for indicating the recovery of the management data in the memory of the storage system is obtained, including:

[0153] In the case where the storage system is in a fault state, the recovery instruction for indicating the recovery of the management data in the cache space of the storage system is obtained.

[0154] It should be noted that the above fault state includes any state in the storage system that causes abnormal data processing or system failure, such as power failure, controller failure, data inconsistency, etc., which is not limited in this embodiment.

[0155] In the embodiments of the present application, in the case that the storage system is in a fault state, a recovery instruction indicating recovery of management data in the cache space of the storage system is acquired. With the embodiments of the present application, when the storage system is in a fault state, the system can accurately detect and generate a recovery instruction pointing to the management data in the cache space that needs to be recovered. This ensures that the data recovery operation can be started in time, reduces the time of business interruption after a fault, and improves the overall availability of the system.

[0156] As an optional solution, the data recovery method further includes:

[0157] Before the first bitmap state and the first metadata are written into the target storage space, the first bitmap state is compressed and encoded;

[0158] When the first bitmap state is read for repair, the state is decoded to recover its original form.

[0159] Optionally, the compression and encoding is used to represent a technique for reducing the storage space requirement before the first bitmap state is written into the target storage space. It can be any standard compression algorithm, depending on the nature of the bitmap state and the data compression requirement.

[0160] It should be noted that the decoding process includes the process of reading the compressed first bitmap state and recovering it to its original form when data repair is performed. The decoding algorithm must match the compression and encoding algorithm used previously to ensure data integrity and readability.

[0161] Optionally, as a specific implementation, it can be explained and described by the following examples, but is not limited to:

[0162] It is assumed that the bitmap state in the all-flash storage system is very large in normal state, especially when the scale of the storage system is expanded. In order to reduce the use of storage space, the system can:

[0163] Bitmap state compression: before the first bitmap state is written into the sub-storage space of the target storage space, the first bitmap state is compressed by using an efficient compression algorithm to generate a compressed bitmap state. This not only reduces the requirement of storage space, but also speeds up the writing process and improves the writing performance of the storage system.

[0164] Compressed storage: the compressed first bitmap state is written into the sub-storage space of the target storage space together with the first metadata and the first period identifier, and the state flag area is updated to indicate that the data in the sub-storage space has been compressed.

[0165] Decompression recovery: when the system needs to perform data repair and read the first bitmap state, it is identified that the state has been compressed. The system uses the corresponding decoding algorithm to decode the read first bitmap state, restores its original form, and then performs data repair operation. This ensures the accuracy of the repair process and the consistency of the data.

[0166] By adopting the embodiments of the present application, the full-flash storage system can effectively reduce the occupation of storage space, especially in the case of a large bitmap state. This not only reduces the demand for storage resources, but also speeds up the writing and reading of data, improving the overall performance of the storage system. In the data repair process, by decoding the compressed bitmap state, the repair efficiency and storage efficiency can be improved without sacrificing data integrity and accuracy, which exhibits significant technical effects and improvements.

[0167] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.

[0168] The embodiments of the present application also provide a data recovery device, as shown in Figure 5 The data recovery device includes:

[0169] The acquisition unit 502 is configured to acquire a recovery instruction used to instruct to recover management data of a storage system, wherein the management data includes metadata and a bitmap state, the metadata is used to represent a mapping relationship between a virtual address and a physical address of data in the storage system, and the bitmap state is used to represent an occupation state of a physical block in a target storage space, and the target storage space is used to store data in the storage system.

[0170] The first determination unit 504 is configured to identify a state flag area corresponding to each sub-storage space in the target storage space, and determine a sub-storage space containing flag data in the state flag area as a candidate sub-storage space, wherein each sub-storage space respectively stores metadata and a bitmap state written at different writing periods, and the flag data is used to indicate that the data stored in the sub-storage space is in a complete state.

[0171] The second determination unit 506 is configured to identify a period identifier corresponding to each candidate sub-storage space, and determine a sub-storage space with a period identifier satisfying a predetermined condition as a target sub-storage space, wherein the period identifier is used to represent a writing period of the data stored in the sub-storage space.

[0172] The recovery unit 508 is configured to recover the management data by using reference metadata and a reference bitmap state stored in the target sub-storage space.

[0173] Optionally, in the embodiment, the second determining unit comprises: an ordering module, configured to order each candidate sub-storage space according to the period identifier; and a determining module, configured to determine the candidate sub-storage space with the target sequence position as the target sub-storage space.

[0174] Optionally, in the embodiment, the restoring unit comprises: a data adjusting module, configured to adjust the metadata in the management data by using the reference metadata, and adjust the bitmap state in the management data by using the reference bitmap state; and a first determining module, configured to determine that the restoring of the management data is completed, in a case where the metadata in the management data matches the reference metadata, and the bitmap state in the management data matches the reference bitmap state.

[0175] Optionally, in the embodiment, the first determining unit comprises: a second determining module, configured to determine each sub-storage space as a current sub-storage space; an identifying module, configured to identify a current state flag area in the current sub-storage space; a third determining module, configured to determine that the data stored in the current sub-storage space is in an incomplete state, in a case where the current state flag area is empty; and a fourth determining module, configured to determine that the current sub-storage space is in a complete state, in a case where the current state flag area stores current flag data conforming to the target format.

[0176] Optionally, in the embodiment, the apparatus further comprises: a generating unit, configured to generate a first period identifier matching the first write period, in a case where the first write period is reached; a third determining unit, configured to determine first metadata and a first bitmap state stored in a cache space of the storage system before the first write period; a write unit, configured to write the first bitmap state carrying the first period identifier into a first sub-storage space in the target storage space; and a first write unit, configured to write the first metadata carrying the first period identifier into the first sub-storage space.

[0177] Optionally, in the embodiment, the generating unit comprises: an obtaining module, configured to obtain a historical period identifier corresponding to a historical write period before the first write period and adjacent to the first write period; and a calculating module, configured to add a target value to the historical period identifier to obtain the first period identifier.

[0178] Optionally, in the embodiment, the apparatus further comprises: a data clearing unit, configured to clear first data from a first physical block in a case where a recycling request for requesting to recycle the first data stored in the first physical block is obtained, wherein the target storage space comprises the first physical block; and an adding unit, configured to add identification information of the first physical block into the first linked list.

[0179] Optionally, in the embodiment, the device further comprises a removing unit configured to remove the identification information of the first physical block from the first linked list if a target write period is reached, wherein a period interval between the target write period and the first write period is a target interval; and an updating unit configured to update a corresponding bit in the bitmap state currently stored by the first physical block in the cache space to a first value, wherein the first value is used to represent that the first physical block is currently unoccupied.

[0180] Optionally, in the embodiment, the device further comprises a first data clearing unit configured to clear all data stored in the first status flag area corresponding to the first sub-storage space.

[0181] Optionally, in the embodiment, the device further comprises a second writing unit configured to write first flag data conforming to a target format to the first status flag area, wherein the first flag data is used to indicate that the data stored in the first sub-storage space is in a complete state.

[0182] Optionally, in the embodiment, the device further comprises a first generating unit configured to generate a second period identifier matching a second write period if a second write period adjacent to the first write period is reached; a fourth determining unit configured to determine second metadata and a second bitmap state stored in the cache space of the storage system before the second write period; a third writing unit configured to write the second bitmap state carrying the second period identifier to the second sub-storage space in the target storage space; and a fourth writing unit configured to write the second metadata carrying the second period identifier to the second sub-storage space.

[0183] Optionally, in the embodiment, the first generating unit comprises a first obtaining module configured to obtain a first period identifier of the first write period; and a first calculating module configured to accumulate a target value to the first period identifier to obtain the second period identifier.

[0184] Optionally, in the embodiment, the device further comprises a marking unit configured to mark a sub-storage space cursor position associated with the target storage space as a position of a next sub-storage space corresponding to the first sub-storage space; and a fifth determining unit configured to determine the position of the second sub-storage space based on the cursor position.

[0185] Optionally, in the embodiment, the obtaining unit is further configured to obtain a recovery instruction used to instruct to recover the management data in the cache space of the storage system if the storage system is in a fault state.

[0186] The features of the embodiments of the data recovery device are described in the related description of the embodiments of the data recovery method, which will not be repeated here.

[0187] Embodiments of the present application also provide an electronic device comprising a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the above data recovery method embodiments.

[0188] Embodiments of the present application also provide a computer readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above data recovery method embodiments when executed.

[0189] In an example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic or optical disk, and other media capable of storing computer programs.

[0190] Embodiments of the present application also provide a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the steps in any of the above data recovery method embodiments.

[0191] Embodiments of the present application also provide another computer program product comprising a non-volatile computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the steps in any of the above data recovery method embodiments.

[0192] Those skilled in the art will further appreciate that the functions of the examples described herein, including any related steps of a method, can be implemented using electronic hardware, computer software, or any combination of the two. To clearly illustrate this interchangeability of hardware and software, various examples have been described herein generally in terms of their functionality, which is the manner in which the various examples are described herein. Whether such functionality is implemented as hardware or software depends on the particular application and design constraints imposed on the overall system. Those skilled in the art can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

[0193] The above provides a data recovery method. The principles and implementation manners of the present application are described by using specific examples. The above description of the examples is only used to help understand the method and core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A method of recovering data, characterized by, The method comprises: obtaining a recovery instruction for indicating recovery of management data of a storage system, wherein the management data comprises metadata and bitmap state, the metadata is used to represent a mapping relationship between a virtual address and a physical address of data in the storage system, and the bitmap state is used to represent an occupancy state of a physical block in a target storage space used to store data in the storage system; identifying a state flag area corresponding to each sub-storage space in the target storage space, determining a sub-storage space containing flag data in the state flag area as a candidate sub-storage space, wherein each of the sub-storage spaces stores metadata and bitmap state written at different write cycles, and the flag data is used to indicate that the data stored in the sub-storage space is in a complete state; identifying a cycle identifier corresponding to each of the candidate sub-storage spaces, and determining a sub-storage space whose cycle identifier meets a predetermined condition as a target sub-storage space, wherein the cycle identifier is used to represent a write cycle of the data stored in the sub-storage space; recovering the management data by using reference metadata and reference bitmap state stored in the target sub-storage space.

2. The data recovery method of claim 1, wherein determining a sub-storage space whose cycle identifier meets a predetermined condition as a target sub-storage space comprises: sorting each of the candidate sub-storage spaces according to the cycle identifier; and determining the candidate sub-storage space with a target sequence position as the target sub-storage space; the recovering the management data by using the reference metadata and the reference bitmap state stored in the target sub-storage space comprises: adjusting the metadata in the management data by using the reference metadata, and adjusting the bitmap state in the management data by using the reference bitmap state; and determining that the recovery of the management data is completed in a case where the metadata in the management data matches the reference metadata, and the bitmap state in the management data matches the reference bitmap state.

3. The data recovery method of claim 1, wherein The identifying a state flag area corresponding to each sub-storage space in the target storage space comprises: determining each of the sub-storage spaces as a current sub-storage space; identifying a current state flag area in the current sub-storage space; determining that the data stored in the current sub-storage space is in an incomplete state in a case where the current state flag area is empty; determining that the current sub-storage space is in the complete state in a case where the current sub-storage space stores current flag data conforming to a target format in the current state flag area.

4. The data recovery method of claim 1, wherein Before the obtaining the recovery instruction for indicating recovery of the management data in the memory of the storage system, the method further comprises: obtaining a historical cycle identifier corresponding to a historical write cycle before and adjacent to a first write cycle in a case where the first write cycle is reached; accumulating a target value to the historical cycle identifier to obtain a first cycle identifier; determining first metadata and first bitmap state stored in a cache space of the storage system before the first write cycle; and write the first bitmap state carrying the first period identifier into a first sub-storage space in the target storage space; write the first metadata carrying the first period identifier into the first sub-storage space.

5. The data recovery method according to claim 4, wherein Before the step of writing the first bitmap state carrying the first period identifier into a first sub-storage space in the target storage space, the method further comprises: in a case that a recovery request for requesting recovery of first data stored in a first physical block is acquired, clear the first data from the first physical block, wherein the target storage space comprises the first physical block; add identification information of the first physical block into a first linked list.

6. The data recovery method according to claim 5, wherein After the step of adding the identification information of the first physical block into the first linked list, the method further comprises: in a case that a target write period is reached, remove the identification information of the first physical block from the first linked list, wherein a period interval between the target write period and the first write period is a target interval; update a corresponding bit in a bitmap state currently stored by the first physical block in the cache space to a first numerical value, wherein the first numerical value represents that the first physical block is currently not occupied.

7. The data recovery method of claim 4, wherein, Before the step of writing the first bitmap state carrying the first period identifier into a first sub-storage space in the target storage space, the method further comprises: clearing all data stored in a first state flag area corresponding to the first sub-storage space; After the step of writing the first metadata carrying the first period identifier into the first sub-storage space, the method further comprises: in a case that a second write period adjacent to the first write period is reached, generating a second period identifier matched with the second write period; determining second metadata and a second bitmap state stored in a cache space of the storage system before the second write period; writing the second bitmap state carrying the second period identifier into a second sub-storage space in the target storage space; and writing the second metadata carrying the second period identifier into the second sub-storage space.

8. The data recovery method according to claim 7, wherein After the step of writing the first metadata carrying the first period identifier into the first sub-storage space, the method further comprises: write first flag data conforming to a target format into the first state flag area, wherein the first flag data is used to indicate that data stored in the first sub-storage space is in a complete state.

9. The method of recovering data according to any one of claims 1 to 8, wherein, The recovery instruction used to indicate recovery of management data in a memory of a storage system comprises: in a case that the storage system is in a fault state, acquire the recovery instruction used to indicate recovery of the management data in a cache space of the storage system.

10. An electronic device, comprising: comprise: a memory configured to store a computer program; a processor configured to implement steps of the data recovery method of any one of claims 1 to 9 when executing the computer program.

Citation Information

Patent Citations

  • Space recovery method and device, equipment and readable storage medium

    CN113608687A

  • Data processing method and device, equipment, storage medium and program product

    CN117407211A

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

    CN117687845A

  • Metadata management method, storage system and related computer equipment

    CN118885339A

  • Metadata storage method and device

    CN119718216A