Data recovery method and device, equipment, storage medium and program product

By obtaining the working status information of the storage hard disk and multi-position escape space design, and dynamically adjusting the priority, the problem of low efficiency of invalid data recycling is solved, and efficient data recycling and storage space optimization is achieved.

CN120353383APending Publication Date: 2025-07-22DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510339374.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

Invalid data recycling methods in the prior art are inefficient, resulting in serious waste of disk storage space.

Method used

By obtaining the working status information of the hard disk stored in the storage system, using the reserved multi-position escape space for data recovery, dynamically adjusting the priority of the escape space, ensuring data recovery is performed when the hard disk is in the best state, and switching to the power-keeping memory space to continue working when the hard disk fails.

Benefits of technology

Improve data recycling efficiency, avoid data recycling stagnation in hard disk failure, optimize storage space utilization, and reduce resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353383A_ABST
    Figure CN120353383A_ABST
Patent Text Reader

Abstract

The invention relates to a data recovery method and device, equipment, a storage medium and a program product, and the method comprises the steps: obtaining the working state information of a storage hard disk in a storage system under the condition that an escape space is triggered for data recovery; and then data in the storage space is recycled according to the working state information of the storage hard disk and the escape space reserved in the storage system. According to the method, the design of the multi-position escape space provides redundancy and fault-tolerant capability for the storage system, when the escape space at one position goes wrong, the escape spaces at other positions can quickly replace work, it can be ensured that the data recovery work is uninterrupted, and the data recovery efficiency is improved while the work continuity of the storage system is ensured. And relatively high data recovery efficiency is maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technologies, and in particular, to a data recovery method, apparatus, device, storage medium, and program product. Background Art

[0002] With the development of information technology, the amount of data has increased explosively, and the demand for efficient and stable data storage in the big data era is becoming more and more urgent. With the advantages of high-speed reading and writing, low latency, etc., all-flash arrays have become the key technology for coping with massive data storage in fields such as data centers.

[0003] Currently, in the process of storing data, the append-write method is usually used to store data. That is, when a certain piece of data to be written needs to be modified, the modified data is written at a new storage location on the disk. Therefore, the data stored at the original storage location will become invalid data. The append-write method will cause a large amount of invalid data to exist on the disk, and thus a large amount of storage space on the disk will be wasted. Therefore, it is necessary to timely recycle the space of invalid data on the disk.

[0004] However, the invalid data recovery methods in the related technologies have the problem of low data recovery efficiency. Summary of the Invention

[0005] Based on this, it is necessary to provide a data recovery method, apparatus, device, storage medium, and program product that can improve the data recovery efficiency for the above technical problems.

[0006] In a first aspect, the present application provides a data recovery method, and the method includes:

[0007] When triggering data recovery in the escape space, obtain the working state information of the storage hard disks in the storage system;

[0008] Recover the data in the storage space according to the working state information of the storage hard disks and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0009] The data recovery method provided by the embodiments of the present application obtains the working state information of the storage hard disks in the storage system when triggering data recovery in the escape space, and then recovers the data in the storage space according to the working state information of the storage hard disks and the escape space reserved in the storage system. By combining the working state information of the storage hard disks for data recovery, the above method can ensure that data recovery operations are carried out when the storage hard disks are in the best state, avoiding the problem of low efficiency caused by forcibly recovering data when the hard disk performance is poor. Moreover, the design of multiple-position escape spaces provides redundancy and fault tolerance for the storage system. When a problem occurs in the escape space at one position, the escape spaces at other positions can quickly take over the work, ensuring that the data recovery work is uninterrupted, maintaining the continuity of the storage system work while maintaining a high data recovery efficiency. In addition, setting escape spaces at different positions avoids the situation where the escape spaces are concentrated in one place and occupy too much space, enabling more reasonable allocation and utilization of the data space, reducing data space waste caused by unreasonable escape space layout, and improving the utilization rate of the storage space of the entire storage system.

[0010] In some of the embodiments, recovering the data according to the working state information of the storage hard disks and the escape space reserved in the storage system includes:

[0011] Determining the priority levels of the escape spaces set at each position according to the working state information of the storage hard disks;

[0012] Recovering the data in the storage space by using the escape spaces set at each position according to the priority levels of the escape spaces set at each position.

[0013] The method described in the embodiments of the present application can determine the priority levels of the escape spaces according to the working state information of the storage hard disks, and can allocate resources more precisely to the escape spaces with better performance. Moreover, since the escape spaces at different positions have different performances and characteristics, data recovery according to the priority levels can give full play to the advantages of each escape space and achieve reasonable allocation and utilization of resources. For some tasks with high requirements for data processing speed, the escape space with fast read and write speed can be preferentially used, and for some tasks with high requirements for storage capacity, the escape space with a larger capacity can be selected, thereby improving the resource utilization rate of the entire storage system.

[0014] In some of the embodiments, the escape space includes a first escape space and a second escape space. Determining the priority levels of the escape spaces set at each position according to the working state information of the storage hard disks includes:

[0015] Determining whether the storage hard disks meet a preset condition according to the working state information; the preset condition includes hard disk anomalies or slow disk failures;

[0016] If the storage hard disk does not meet the preset conditions, it is determined that the priority of the first escape space is higher than that of the second escape space; the first escape space is the escape space set on the disk; the second escape space is the escape space set in the power - retained memory.

[0017] If the storage hard disk meets the preset conditions, it is determined that the priority of the second escape space is higher than that of the first escape space.

[0018] The method described in the embodiments of the present application dynamically adjusts the priority of the escape space according to the working state of the hard disk, achieving reasonable allocation and efficient utilization of storage resources. When the hard disk is working properly, the first escape space on the disk usually has a large storage capacity and high read - write performance. Prioritizing the use of the first escape space can give full play to the large - capacity storage and high - speed read - write capabilities of the hard disk, accelerate the data recovery speed, and improve the overall data processing efficiency. Once the hard disk has an abnormality or a slow - disk fault, it is timely switched to the second escape space in the power - retained memory. Although the capacity of the power - retained memory is relatively small, its read - write speed is fast, and it can respond quickly when the hard disk fails and continue the data recovery work, avoiding data recovery stagnation caused by hard disk failures and ensuring the efficient progress of data recovery work.

[0019] In some embodiments, according to the priority of the escape space set at each location, the data in the storage space is recovered by using the escape space set at each location, including:

[0020] Monitoring whether there is free space on the escape space with a higher priority;

[0021] If there is, the data is recovered by using the escape space with a higher priority;

[0022] If not, the data is recovered by using the escape space with other priorities.

[0023] The method described in the embodiments of the present application, on the one hand, the escape space with a higher priority usually has advantages in performance, stability or other aspects. Therefore, giving priority to using the escape space with a higher priority for data recovery can give full play to its advantages and improve the data recovery efficiency. On the other hand, by first checking the free situation of the escape space with a higher priority, it avoids the situation of using the escape space with a lower priority when there is still free space in the higher - priority space, preventing the idle waste of high - priority resources, and only using the space with other priorities when there is no free space in the higher - priority space, ensuring that each level of escape space can be reasonably utilized.

[0024] In some embodiments, using the escape space with a higher priority to recover data includes:

[0025] Determining whether the capacity of the free space is greater than the capacity of the data to be recovered;

[0026] If it is greater than, use the escape space with a higher priority to recycle data.

[0027] If it is not greater than, use the escape space with a higher priority to recycle some data, and use other escape spaces to recycle another part of the data.

[0028] The method described in the embodiments of the present application allocates data recycling tasks based on the free status and data capacity requirements of each escape space, which helps to balance the usage frequency and storage pressure of different escape spaces, avoids the situation where a certain escape space is overused while other escape spaces are idle, and improves the resource utilization rate of the entire storage system. When the escape space with a higher priority is free and its capacity is sufficient to accommodate the data to be recycled, this space is preferentially selected to carry out data recycling work, which can ensure that the data is processed in a better storage environment. When the high-priority escape space is not free or has insufficient capacity, it is timely switched to other priority escape spaces for data recycling, which can avoid wasting time due to waiting for the high-priority space and enable the data recycling work to proceed continuously and efficiently.

[0029] In some embodiments, the method further includes:

[0030] After data recycling in the storage space, determine whether the remaining space capacity of the storage space and the power-preserving memory meet the preset migration conditions, and when it is determined that the preset migration conditions are met, migrate the data in the second escape space to the storage space and release the second escape space.

[0031] The method described in the embodiments of the present application, because the power-preserving memory has the characteristics of fast read and write speed but relatively small capacity and high cost, so when the preset migration conditions are met, migrating the data in the second escape space located in the power-preserving memory to the storage space can timely release the power-preserving memory space, can reduce the demand for the capacity of the power-preserving memory to a certain extent, helps to reduce the cost of the storage system, and at the same time enables the power-preserving memory to focus on processing tasks with extremely high speed requirements, which can improve the performance-price ratio of the entire storage system. Because the storage space has the characteristics of large capacity and is suitable for long-term data storage, migrating the data in the power-preserving memory to the storage space can enable different characteristic storage resources to perform their respective functions, realize the reasonable allocation of storage resources, and avoid waste and misallocation of resources.

[0032] In a second aspect, the present application also provides a data recycling device, which includes:

[0033] An acquisition module, configured to acquire the working state information of the storage hard disks in the storage system when triggering an escape space to perform data recycling;

[0034] A recycling module, configured to recycle data in the storage space according to the working state information of the storage hard disk and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0035] In a third aspect, the present application further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0036] When triggering data recycling in the escape space, obtain the working state information of the storage hard disk in the storage system;

[0037] Recycle data in the storage space according to the working state information of the storage hard disk and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0038] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0039] When triggering data recycling in the escape space, obtain the working state information of the storage hard disk in the storage system;

[0040] Recycle data in the storage space according to the working state information of the storage hard disk and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0041] In a fifth aspect, the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0042] When triggering data recycling in the escape space, obtain the working state information of the storage hard disk in the storage system;

[0043] Recycle data in the storage space according to the working state information of the storage hard disk and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0044] The above data recovery method, device, equipment, storage medium, and program product. In this method, when triggering data recovery in the escape space, the working state information of the storage hard disks in the storage system is obtained, and then the data in the storage space is recovered according to the working state information of the storage hard disks and the reserved escape space in the storage system. By combining the working state information of the storage hard disks for data recovery, the above method can ensure that data recovery operations are carried out when the storage hard disks are in the best state, avoiding the problem of low efficiency caused by forcibly recovering data when the hard disk performance is poor. Moreover, the design of multiple-position escape spaces provides redundancy and fault tolerance for the storage system. When a problem occurs in the escape space at one position, the escape spaces at other positions can quickly take over the work, ensuring that the data recovery work continues without interruption, while maintaining the continuity of the storage system's operation and a relatively high data recovery efficiency. In addition, setting escape spaces at different positions avoids the situation where the escape spaces are concentrated in one place and occupy too much space, enabling a more reasonable allocation and utilization of the data space, reducing the waste of data space caused by unreasonable escape space layout, and improving the utilization rate of the storage space of the entire storage system. Description of the Drawings

[0045] Figure 1 It is an application environment diagram of the data recovery method in some embodiments;

[0046] Figure 2 It is one of the flow diagrams of the data recovery method in some embodiments;

[0047] Figure 3 It is another flow diagram of the data recovery method in some embodiments;

[0048] Figure 4 It is yet another flow diagram of the data recovery method in some embodiments;

[0049] Figure 5 It is a structural diagram of the first escape space and the second escape space;

[0050] Figure 6 It is a flow diagram of the data recovery method in some embodiments;

[0051] Figure 7 It is a flow diagram of the data recovery method in some embodiments;

[0052] Figure 8 It is a flow diagram of the data recovery method in some embodiments;

[0053] Figure 9 It is a flow diagram of the data recovery method in some embodiments;

[0054] Figure 10It is the eighth flowchart diagram of the data recovery method in some embodiments;

[0055] Figure 11 It is the structural block diagram of the data recovery device in some embodiments. Detailed implementation manners

[0056] In the embodiments of the present application, the term "and / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0057] In the embodiments of the present application, the term "a plurality of" means two or more, and other quantifiers are similar.

[0058] In the embodiments of the present application, the term "at least one" means one or more. For example, at least one of A, B, and C can represent: A exists alone, B exists alone, C exists alone, A and B exist simultaneously, A and C exist simultaneously, B and C exist simultaneously, and A, B, and C exist simultaneously.

[0059] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0060] With the development of information technology, the amount of data has increased explosively, and the demand for efficient and stable data storage in the big data era is becoming more and more urgent. All-flash arrays, with advantages such as high-speed reading and writing and low latency, have become a key technology for dealing with massive data storage in fields such as data centers. At present, in the process of storing data, the append-write method is usually used to store data, that is, when a certain piece of data to be written needs to be modified, the modified data is written at a new storage location on the disk. Therefore, the data stored at the original storage location will become invalid data. The append-write method will cause a large amount of invalid data to exist on the disk, and thus a large amount of storage space on the disk will be wasted. Therefore, it is necessary to timely recycle the space of invalid data on the disk. However, the invalid data recovery methods in the related technologies have the problem of low data recovery efficiency.

[0061] In view of this, the embodiments of the present application propose a data recovery method, device, equipment, storage medium, and program product, which can perform data recovery by storing the working state information of the storage hard disk, and set escape spaces at different positions, which can improve the data recovery efficiency.

[0062] It should be noted that the beneficial effects brought by the embodiments of the present application or the technical problems solved are not limited to this one, and there may also be other implicit or related problems. For specific details, please refer to the descriptions of the following embodiments.

[0063] The following uses specific embodiments to elaborate in detail on the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems. These several specific embodiments can be combined with each other, and concepts or processes that are the same or similar may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0064] In some embodiments, the data recovery method provided by the embodiments of the present application can be applied to a computer device as shown in Figure 1 The computer device can be a terminal or a server, and its internal structure diagram can be as shown in Figure 1 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it realizes a data recovery method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the shell of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0065] Those skilled in the art can understand that Figure 1 The structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0066] In some embodiments, as shown in Figure 2The following provides a data recovery method, taking the computer device applied with this method in Figure 1 as an example for illustration, including the following steps:

[0067] S201, when triggering the escape space for data recovery, obtain the working state information of the storage hard disks in the storage system.

[0068] Among them, the escape space refers to the space for recovering data in the storage system when both the garbage collection space (i.e., GC space) and the reserved space (i.e., OP space) in the storage space are full, that is, the space for garbage escape. The storage hard disk can be a solid state drive (SSD for short), or other types of hard disks or disks. The role of the working state information of the storage hard disk is to detect whether there are abnormal hard disks or slow disks in the system; the working state information can include at least one of the capacity usage information, health status information, and performance index information of the storage hard disk. Among them, the capacity usage information can include at least one of the total capacity, used capacity, and remaining capacity; the health status information can include the working temperature information and / or the lifespan information; the performance index information can include the read and write speed and / or the number of input / output operations per second (i.e., IOPS).

[0069] In the embodiments of the present application, the proportions of the garbage collection space (i.e., GC space), the reserved space (i.e., OP space), and the escape space in the entire storage space can be determined in advance according to the characteristics of the storage system, the data usage pattern, and the hardware conditions. For example, the escape space can be set to 5% - 10% of the total storage space. And capacity thresholds can be set for the GC space, the OP space, and the escape space respectively. When the usage amounts of the GC space, the OP space, and the escape space reach their respective thresholds, the corresponding warning mechanisms are triggered. It should be noted that if the storage system consists of multiple storage hard disks, a partial area of one or more of the storage hard disks can be designated as the escape space. During the process of data recovery in the system, the computer device can use the system monitoring tool or write a script program to check the remaining space conditions of the GC space and the OP space in the storage system at regular time intervals (such as every minute, every hour, or every day). When it is detected that the remaining space of the GC space and the OP space reaches or is lower than the set trigger threshold, the escape space can be automatically triggered to start data recovery. Optionally, when it is detected that the remaining space of a certain storage hard disk or partition reaches or is lower than the set trigger threshold, an alarm prompt can be given. For example, an email or a text message is sent to notify the administrator, or in the local system, the built-in pop-up prompt function of the system or a third-party pop-up tool is used to send an alarm to the local user to instruct the user to actively trigger the start of the escape space. It should be noted that the escape space trigger threshold in this embodiment can be determined according to the actual business requirements or storage requirements. The escape space trigger threshold can be a percentage of the remaining available space. For example, it is triggered when the remaining space is lower than 10%. Optionally, the escape space trigger threshold can also be a specific number of bytes. For example, it is triggered when the remaining space is less than 10GB. During the process of triggering the escape space to perform data recovery, the system monitoring tool or a script program can be used to check the working state information of the storage hard disks in the storage system at regular time intervals (such as every minute, every hour, or every day). For example, the capacity usage information, the health status information, and the performance index information of the storage hard disks are detected for subsequent determination of whether there are hard disks with abnormal working conditions based on the working state information of the storage hard disks.

[0070] S202, Recover the data in the storage space according to the working state information of the storage hard disks and the escape space reserved in the storage system.

[0071] Among them, the reserved escape space refers to the escape space pre-divided in the storage space, and the reserved escape space includes escape spaces set at different positions. The escape spaces set at different positions may include the escape space set on the storage hard disk and the escape space set on the power-preserving memory. Optionally, the escape spaces set at different positions may further include at least two of the escape space set on the first type of storage hard disk, the escape space set on the second type of storage hard disk, the escape space set on the power-preserving memory, and the escape space set on the memory; for example, the escape spaces set at different positions are the escape space set on the first type of storage hard disk and the escape space set on the second type of storage hard disk; for another example, the escape spaces set at different positions are the escape space set on the first type of storage hard disk, the escape space set on the second type of storage hard disk, and the escape space set on the memory.

[0072] In the embodiment of the present application, when setting the escape space in advance, the escape space can be set at different positions. Specifically, the escape space can be set on the storage hard disk and the escape space can be set on the power-preserving memory. Optionally, multiple escape spaces can be set on different types of storage hard disks. For example, the escape space is set on the first type of storage hard disk, the escape space is set on the second type of storage hard disk, and the escape space is set on the third type of storage hard disk. Optionally, the escape space can also be set on different types of storage hard disks and the escape space can be set on the power-preserving memory. After the computer device obtains the working state information of the storage hard disk based on the above steps, it can select an optimal escape space from the escape spaces reserved at different positions for data recovery according to the working state information of the storage hard disk. Specifically, it can be determined whether the current hard disk is abnormal according to the working state information of the storage hard disk. If all the hard disks where the escape spaces at different positions are located are in a normal state, an escape space can be randomly selected for data recovery; optionally, it can also be evaluated according to at least one of the remaining capacity, health status, and working performance of the escape space, and the optimal escape space is evaluated for data recovery. When evaluating according to the remaining capacity, health status, and working performance of the escape space, the remaining capacity, health status, and working performance of each escape space can be scored respectively, and then the escape space with the highest total score is used as the optimal escape space; optionally, the scores of the remaining capacity, health status, and working performance of each escape space are weighted, and then the escape space with the highest weighted score is used as the optimal escape space.

[0073] The data recovery method provided by the embodiments of the present application obtains the working state information of the storage hard disks in the storage system when triggering the escape space for data recovery, and then recovers the data in the storage space according to the working state information of the storage hard disks and the escape space reserved in the storage system. By combining the working state information of the storage hard disks for data recovery, the above method can ensure that the data recovery operation is carried out when the storage hard disks are in the best state, avoiding the problem of low efficiency caused by forcibly recovering data when the hard disk performance is poor. Moreover, the design of multiple-position escape spaces provides redundancy and fault tolerance for the storage system. When a problem occurs in the escape space at one position, the escape spaces at other positions can quickly take over the work, ensuring that the data recovery work is uninterrupted. While ensuring the continuity of the storage system operation, a high data recovery efficiency is maintained. In addition, setting escape spaces at different positions avoids the situation where the escape spaces are concentrated in one place and occupy too much space, enabling a more reasonable allocation and utilization of the data space, reducing the waste of data space caused by unreasonable escape space layout, and improving the utilization rate of the storage space of the entire storage system.

[0074] In some embodiments, a specific implementation manner for recovering data is further provided, such as Figure 3 shown, the "recovering data according to the working state information of the storage hard disks and the escape space reserved in the storage system" in S202 above includes:

[0075] S301, determining the priorities of the escape spaces set at each position according to the working state information of the storage hard disks.

[0076] Among them, the priority indicates the usage order of the escape spaces set at each position. The escape space with a higher priority is preferentially used. When the escape space with a higher priority does not meet the usage conditions, the escape space with a lower priority is used. The usage conditions can be determined according to actual requirements.

[0077] In the embodiment of the present application, after the computer device obtains the working state information of the storage hard disk, it can evaluate the escape spaces set at each location according to the working state information of the storage hard disk, obtain the evaluation score of each escape space, and then sort the evaluation scores of each escape space in descending order, and use this sorting as the sorting of priorities. Specifically, the higher the evaluation score of an escape space, the higher its priority, and the lower the evaluation score of an escape space, the lower its priority. For example, if the evaluation score of escape space A is greater than the evaluation score of escape space B, then the priority of escape space A is higher than that of escape space B. Conversely, if the evaluation score of escape space A is less than the evaluation score of escape space B, then the priority of escape space A is lower than that of escape space B. Optionally, after the computer device obtains the evaluation score of each escape space, it can screen out the escape spaces with evaluation scores greater than the preset score threshold from all the escape spaces as candidate escape spaces, that is, multiple candidate escape spaces can be obtained, and then a usage order is randomly generated for the multiple candidate escape spaces, and this usage order is used as the sorting of priorities. The preset score threshold in this embodiment can be determined according to actual business usage requirements or storage system requirements. It should be noted that the method for evaluating the escape spaces set at each location according to the working state information of the storage hard disk can be to evaluate according to at least one of the remaining capacity, health status, and working performance of the escape space. Specifically, the remaining capacity, health status, and working performance of each escape space can be scored respectively, and then the total score of these three items of remaining capacity, health status, and working performance is obtained, and the total score is used as the evaluation score. Optionally, different weights can be assigned to these three items of remaining capacity, health status, and working performance, and then the scores of the remaining capacity, health status, and working performance and their respective corresponding weights are weighted to obtain a weighted score, and finally the weighted score is used as the evaluation score. It should be noted that for a hard disk that is not working, its evaluation score is 0.

[0078] S302, Recover the data in the storage space by using the escape spaces set at each location according to the priorities of the escape spaces set at each location.

[0079] In the embodiments of the present application, after the computer device obtains the priorities of the escape spaces set at each position based on the above steps, it can first use the escape space with the highest priority to perform data recovery. During the data recovery process, it can monitor the current state of the escape space with the highest priority at regular time intervals (such as every second or every millisecond), and determine whether the escape space with the highest priority meets the usage conditions according to the current state. If it meets the conditions, continue to use the escape space with the highest priority to perform data recovery. If it does not meet the conditions, stop using the escape space with the highest priority and instead use the escape spaces with other priorities to perform data recovery. For example, it can use the escape space with the second highest priority to perform data recovery, and during the process of using the escape space with the second highest priority to perform data recovery, determine whether the escape space with the second highest priority can continue to be used according to the current state of the escape space with the second highest priority. The usage conditions in this embodiment can be determined by at least one of the remaining capacity, health status, and working performance. For example, the usage condition can be that the remaining capacity is greater than a preset capacity value or a preset capacity percentage. Optionally, the usage condition can be that the working temperature is greater than a preset temperature value, and / or the remaining life is greater than a preset life threshold. Optionally, the usage condition can be that the read / write speed is greater than a preset speed threshold, and / or the working performance IOPS is greater than a preset IOPS threshold. Optionally, the usage condition can be determined by a combination of two or more of the remaining capacity, working temperature, remaining life, read / write speed, and IOPS. The preset capacity value, preset capacity percentage, preset temperature value, preset life threshold, preset speed threshold, and preset IOPS threshold in this embodiment can be determined according to actual business requirements or storage requirements.

[0080] The method described in the embodiments of the present application can determine the priority of the escape space according to the working state information of the storage hard disk, and can allocate resources more accurately to the escape space with better performance. Moreover, since the escape spaces at different positions have different performances and characteristics, data recovery based on the priority can give full play to the advantages of each escape space and achieve reasonable allocation and utilization of resources. For some tasks with high requirements for data processing speed, the escape space with fast read / write speed can be preferentially used. For some tasks with high requirements for storage capacity, the escape space with a larger capacity can be selected, thereby improving the resource utilization rate of the entire storage system.

[0081] In some embodiments, the above escape space includes a first escape space and a second escape space. On this basis, a specific implementation method for setting the priority of the escape space is also provided, such as Figure 4 shown, the "determining the priorities of the escape spaces set at each position according to the working state information of the storage hard disk" in S301 above includes:

[0082] S401. Determine whether the storage hard disk meets the preset conditions according to the working status information.

[0083] Among them, the preset conditions include hard disk anomalies or slow disk failures. For example, a hard disk anomaly is an abnormal strip allocation of an SSD disk caused by a multi-disk failure. Multi-disk means more than a preset number of hard disks, and the preset number can be one or more; a slow disk failure is an abnormal read / write delay of the entire strip due to the existence of a slow disk. The escape space includes a first escape space and a second escape space. The first escape space is the escape space set on the disk, and the second escape space is the escape space set in the power-preserving memory.

[0084] In the embodiments of the present application, an escape space can be set on the storage hard disk as the first escape space, and an escape space can be set in the power-preserving memory as the second escape space. For example, as Figure 5 shown, a GC escape space is divided from the SSD hard disk and the power-preserving memory in the storage space as the total escape space of the storage system, forming a total space including the escape space on the SSD disk (i.e., the first escape space in the figure) + the escape space in the power-preserving memory (i.e., the second escape space in the figure). Among them, the first escape space CKG1 and the second escape space CKG2 both belong to the strip. This total space can meet the maximum rotation space requirement of the service, and all service data can be rotated in this rotation space to realize the recovery of valid data and the release of garbage data. Figure 5 The storage space in [] consists of SSD1, SSD2, SSD3, and SSD4. The number of storage hard disks in the storage space in the figure is only an exemplary illustration. In actual applications, the number of hard disks in the storage space can be more than Figure 5 the number of storage hard disks in [], or less than Figure 5 the number of storage hard disks in [], and the specific number of storage hard disks can be determined according to the storage requirements. Similarly, Figure 5 SSD1 in [] includes two data blocks (i.e., CK1 and CK2), SSD2 includes two data blocks (i.e., CK3 and CK4), SSD3 includes two data blocks (i.e., CK5 and CK6), and SSD4 includes two data blocks (i.e., CK7 and CK8). In actual applications, the number of data blocks included in the hard disk can be more than Figure 5 the number of data blocks in [], or less than Figure 5The number of data blocks in it is small, and the specific number of data blocks can be determined according to storage requirements. There are two situations when using the first escape space and the second escape space for data recovery: The first situation is the normal situation. In this case, by default, the priority of the first escape space is higher than that of the second escape space. That is, the escape space on the SSD disk is used as the first-level GC escape space, and the power-preserving memory escape space is used as the second-level GC escape space. That is, the first escape space is first used for data recovery. When the first escape space is full or about to be full, the second escape space will be used for data recovery. For example, the escape space is first divided into multiple data blocks according to the capacity of a single data block (i.e., CK block). When applying for a new escape space (i.e., CKG group, in the form of a stripe), CK blocks are selected from each SSD disk in the first escape space to form a CKG group for data rotation. When the first escape space is exhausted, the second escape space is enabled, and CK logical blocks are selected from the power-preserving memory according to the number of controllers to form a CKG group. It should be noted that Figure 5 in it, a stripe CKG1 in the first escape space includes CK1, CK3, CK5, and CK7, Figure 5 This is only an exemplary description. In actual applications, CKG1 may include CK1, CK4, CK6, and the specific quantity and location can be determined according to actual storage requirements, as long as the CKG groups in the first escape space (i.e., the escape space on the disk) come from different hard disks. Similarly, Figure 5 a stripe CKG2 in the second escape space in it may include CK17, CK19, CK22, and the specific quantity and location can be determined according to actual storage requirements.

[0085] The second situation is an unexpected situation, such as a hard disk exception or a slow disk failure in the storage hard disk. In this case, the priority of the second escape space is higher than that of the first escape space. That is, the power-preserving memory escape space is used as the first-level GC escape space, and the escape space on the SSD disk is used as the second-level GC escape space. That is, the second escape space is used for data recovery. When the second escape space is full or about to be full, an alarm prompt can be given. For example, an email or text message is sent to notify the administrator, or in the local system, the built-in pop-up prompt function of the system or a third-party pop-up tool is used to send an alarm to the local user to indicate that the user actively triggers the start of the escape space. After the computer device obtains the working status information of the storage hard disk, it can determine whether there is a hard disk exception or a slow disk failure in the storage hard disk according to the working status information of the storage hard disk. If there is no hard disk exception and slow disk failure, it is considered that the storage hard disk does not meet the preset conditions. If there is a hard disk exception or a slow disk failure, it is considered that the storage hard disk meets the preset conditions.

[0086] S402, if the storage hard disk does not meet the preset conditions, then determine that the priority of the first escape space is higher than that of the second escape space.

[0087] In the embodiments of the present application, when the computer device determines based on the above steps that the storage hard disk does not meet the preset conditions, this situation belongs to the first situation above. Then, it can be determined that the priority of the first escape space is higher than the priority of the second escape space, that is, the priority of the escape space on the disk is greater than the priority of the escape space in the power - retained memory.

[0088] S403. If the storage hard disk meets the preset conditions, determine that the priority of the second escape space is higher than the priority of the first escape space.

[0089] In the embodiments of the present application, when the computer device determines based on the above steps that the storage hard disk meets the preset conditions, this situation belongs to the second situation above. Then, it can be determined that the priority of the second escape space is higher than the priority of the first escape space, that is, the priority of the escape space in the power - retained memory is greater than the priority of the escape space on the disk.

[0090] The method described in the embodiments of the present application dynamically adjusts the priority of the escape space according to the working state of the hard disk, realizing the reasonable allocation and efficient utilization of storage resources. When the hard disk is working normally, the first escape space on the disk usually has a large storage capacity and high read - write performance. By preferentially using the first escape space, the large - capacity storage and high - speed read - write capabilities of the hard disk can be fully utilized, accelerating the speed of data recovery and improving the overall data processing efficiency. Once the hard disk has an abnormality or a slow - disk failure, it is timely switched to the second escape space in the power - retained memory. Although the capacity of the power - retained memory is relatively small, its read - write speed is fast, and it can quickly respond when the hard disk fails and continue the data recovery work, avoiding the stagnation of data recovery caused by hard disk failures and ensuring the efficient progress of data recovery work.

[0091] In some embodiments, a specific implementation manner for recovering data in the storage space is also provided, such as Figure 6 shown, "using the escape space set at each position to recover the data in the storage space according to the priority of the escape space set at each position" in S302 above includes:

[0092] S501. Monitor whether there is free space on the escape space with a higher priority.

[0093] Among them, the free space refers to the remaining capacity being greater than the preset capacity value or the preset capacity percentage.

[0094] In the embodiments of the present application, after the computer device determines the priority of the escape spaces set at each location according to the working status information of the storage hard disk, it can use the escape space with a higher priority to perform data recovery. During the data recovery process, it can monitor the remaining capacity of the escape space with a higher priority at regular time intervals (such as every second or every millisecond), and determine whether there is free space in the escape space with a higher priority according to the remaining capacity. For example, if the remaining capacity of the escape space with a higher priority is greater than the preset capacity value or the preset capacity percentage, it is considered that there is free space in the escape space with a higher priority; if the remaining capacity of the escape space with a higher priority is not greater than the preset capacity value or the preset capacity percentage, it is considered that there is no free space in the escape space with a higher priority.

[0095] S502. If there is, use the escape space with a higher priority to perform data recovery.

[0096] In the embodiments of the present application, if the computer device determines that there is free space in the escape space with a higher priority, it can continue to use the escape space with a higher priority to perform data recovery.

[0097] S503. If not, use the escape space with other priorities to perform data recovery.

[0098] In the embodiments of the present application, if the computer device determines that there is no free space in the escape space with a higher priority, it stops using the escape space with a higher priority and instead uses the escape space with other priorities to perform data recovery. For example, it can use the escape space ranked second in priority to perform data recovery, and during the process of using the escape space ranked second in priority to perform data recovery, take the escape space ranked second in priority as the new escape space with a higher priority, and return to execute step S501.

[0099] For the method described in the embodiments of the present application, on the one hand, the escape space with a higher priority usually has advantages in terms of performance, stability, or other aspects. Therefore, preferentially using the escape space with a higher priority to perform data recovery can give full play to its advantages and improve the efficiency of data recovery. On the other hand, by first checking the free situation of the escape space with a higher priority, it avoids the situation of using the escape space with a lower priority when there is still free space in the escape space with a higher priority, preventing the idle waste of high-priority resources, and only using the escape space with other priorities when there is no free space in the escape space with a higher priority, ensuring that each level of escape space can be reasonably utilized.

[0100] In some embodiments, a specific implementation manner of using the escape space with a higher priority to perform data recovery is also provided, such as Figure 7 As shown, "using the escape space with a higher priority to perform data recovery" in the above S502 includes:

[0101] S601, Determine whether the capacity of the free space is greater than the capacity of the data to be recycled.

[0102] Wherein, the capacity of the data to be recycled is the data capacity that the system needs to rotate during data recycling.

[0103] In the embodiments of the present application, the computer device can obtain the capacity of the data to be recycled through a data statistics tool or by writing a script program. Then, before the computer device uses the high-priority escape space to recycle data and after determining that there is free space in the high-priority escape space, the computer device can further determine the capacity of the free space. After the computer device obtains the capacity of the free space and the capacity of the data to be recycled, it can determine whether the capacity of the free space is greater than the capacity of the data to be recycled.

[0104] S602, If it is greater, use the high-priority escape space to recycle data.

[0105] In the embodiments of the present application, if the computer device determines that the capacity of the free space is greater than the capacity of the data to be recycled, this scenario indicates that there is less data to be recycled, and all data can be recycled only by using the high-priority escape space.

[0106] S603, If it is not greater, use the high-priority escape space to recycle part of the data, and use other escape spaces to recycle another part of the data.

[0107] In the embodiments of the present application, if the computer device determines that the capacity of the free space is not greater than the capacity of the data to be recycled, this scenario indicates that there is more data to be recycled, and it cannot be recycled completely only by using the high-priority escape space. Therefore, part of the data can be recycled by using the high-priority escape space, and another part of the data can be recycled by using other escape spaces.

[0108] The method described in the embodiments of the present application allocates data recycling tasks based on the free status of each escape space and the data capacity requirements, which helps to balance the usage frequency and storage pressure of different escape spaces, avoid the situation where a certain escape space is overused while other escape spaces are idle, and improve the resource utilization rate of the entire storage system. When the high-priority escape space is free and its capacity is sufficient to accommodate the data to be recycled, this space is preferentially selected to carry out data recycling work, which can ensure that the data is processed in a better storage environment. When the high-priority escape space is not free or has insufficient capacity, switch to other priority escape spaces in time to recycle data, which can avoid wasting time waiting for the high-priority space and enable the data recycling work to proceed continuously and efficiently.

[0109] In some embodiments, as Figure 8 shown, the above data recycling method further includes:

[0110] S203. After data recycling in the storage space, determine whether the remaining space capacity of the storage space and the power retention memory meet the preset migration conditions. If it is determined that the preset migration conditions are met, migrate the data in the second escape space to the storage space and release the second escape space.

[0111] Among them, the preset migration conditions refer to the conditions that need to be met for migrating the data in the second escape space to the storage space. The preset migration conditions include the power retention memory migration condition and the storage space migration condition. The power retention memory migration condition is that the second escape space has participated in the data recycling process. The storage space migration condition is that the remaining capacity of the storage space after migration is greater than the preset capacity threshold. The preset capacity threshold can be determined according to business requirements or storage requirements, and the preset capacity threshold can be a preset capacity value or a preset capacity percentage. For example, the preset capacity threshold is 10%, which means that the remaining capacity of the storage space after migration is greater than or equal to 10% of the total space. This is to avoid invalid data migration caused by repeated data recycling under high water levels.

[0112] In the embodiments of the present application, the computer device can monitor the remaining capacity of the current storage space in real time through a data statistics tool or by writing a script program. When the remaining capacity of the current storage space is greater than a preset threshold, for example, the preset threshold is 40%, it indicates that the process of data recovery using the escape space ends. After the process of data recovery using the escape space ends, it can be determined whether the power-preserving memory meets the power-preserving memory migration condition according to whether the amount of data in the power-preserving memory increases before and after data recovery, and it can be determined whether the storage space meets the storage space migration condition according to the remaining capacity of the storage space after migration. If both the power-preserving memory migration condition and the storage space migration condition are met, it indicates that the remaining space capacity of the storage space and the power-preserving memory meet the preset migration conditions. If the power-preserving memory migration condition or the storage space migration condition is not met, it indicates that the remaining space capacity of the storage space and the power-preserving memory do not meet the preset migration conditions. During the process of the computer device determining whether the power-preserving memory meets the power-preserving memory migration condition, if the amount of data in the power-preserving memory does not increase before and after data recovery, it indicates that the second escape space does not participate in the data recovery process, that is, the power-preserving memory does not meet the power-preserving memory migration condition. In this case, there is no need to perform the migration operation. If the amount of data in the power-preserving memory increases before and after data recovery, it indicates that the second escape space participates in the data recovery process, that is, the power-preserving memory meets the power-preserving memory migration condition. When the power-preserving memory meets the power-preserving memory migration condition, the computer device can determine the remaining capacity of the storage space after migration according to the remaining capacity of the current storage space and the increased capacity / used capacity of the power-preserving memory. Specifically, the remaining capacity of the storage space after migration = the remaining capacity of the current storage space - the increased capacity / used capacity of the power-preserving memory. If the remaining capacity of the storage space after migration is not greater than the preset capacity threshold, it indicates that the storage space does not meet the storage space migration condition. In this case, there is no need to perform the migration operation. If the remaining capacity of the storage space after migration is greater than the preset capacity threshold, it indicates that the storage space meets the storage space migration condition. In this case, the data in the second escape space can be migrated to the storage space, and the second escape space can be released. This migration process can be seen in Figure 9 as shown. The data of the second escape space that needs to be migrated is the data block in stripe CKG2. During the migration process, it is necessary to first apply for a new stripe CKG3 corresponding to stripe CKG2 from the storage space, then migrate the data block in CKG2 to CKG3, and modify the mapping relationship between the original CKG2 and the data block in the power-preserving memory to the mapping relationship between CKG3 and the corresponding data block in the storage space. For example, CK18 originally represents the mapping relationship between the power-preserving memory and CKG2. After migration, CK18 corresponds to CK9 in CKG3, which represents the mapping relationship between the storage space and CKG3.

[0113] In the method described in the embodiments of the present application, since the non-volatile memory has the characteristics of fast read and write speed, relatively small capacity, and high cost, when the preset migration condition is met, migrating the data in the second escape space located in the non-volatile memory to the storage space can timely release the non-volatile memory space, can reduce the demand for the capacity of the non-volatile memory to a certain extent, helps to reduce the cost of the storage system, and at the same time allows the non-volatile memory to focus on processing tasks with extremely high speed requirements, which can improve the cost performance of the entire storage system. Since the storage space has a large capacity and is suitable for long-term data storage, migrating the data in the non-volatile memory to the storage space can enable storage resources with different characteristics to perform their respective functions, realize the reasonable allocation of storage resources, and avoid waste and misallocation of resources.

[0114] In combination with all the above embodiments, a data recovery method is further provided. As Figure 10 shown, the method includes:

[0115] S701, when triggering data recovery in the escape space, obtain the working state information of the storage hard disk in the storage system.

[0116] S702, determine whether the storage hard disk meets the preset conditions according to the working state information. The preset conditions include hard disk abnormality or slow disk failure.

[0117] S703, if the storage hard disk does not meet the preset conditions, determine that the priority of the first escape space is higher than that of the second escape space. The first escape space is the escape space set on the disk. The second escape space is the escape space set in the non-volatile memory.

[0118] S704, if the storage hard disk meets the preset conditions, determine that the priority of the second escape space is higher than that of the first escape space.

[0119] S705, monitor whether there is free space on the escape space with a higher priority.

[0120] S706, if there is, determine whether the capacity of the free space is greater than the capacity of the data to be recovered. If it is greater, use the escape space with a higher priority to recover the data. If it is not greater, use the escape space with a higher priority to recover part of the data, and use other escape spaces to recover the other part of the data.

[0121] S707, if not, use other priority escape spaces to recover the data.

[0122] S708, after data recovery in the storage space, determine whether the remaining space capacity of the storage space and the non-volatile memory meet the preset migration conditions, and when it is determined that the preset migration conditions are met, migrate the data in the second escape space to the storage space and release the second escape space.

[0123] The method described in the embodiments of the present application reduces the waste of data space on the SSD disk through the design of a two-level GC escape space, improves the space utilization rate of the disk, replaces the SSD escape space with a power-preserving memory escape space, improves the reliability of the storage system in abnormal scenarios, and ensures that the GC process is not affected by faulty disks. Compared with SSD hard disks, power-preserving memory has stronger reliability and more stable read and write performance.

[0124] The methods described in the above steps have been described in the foregoing embodiments. For detailed content, please refer to the foregoing description and will not be repeated here.

[0125] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.

[0126] Based on the same inventive concept, the embodiments of the present application also provide a data recovery device for implementing the data recovery method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the data recovery device provided below can refer to the limitations on the data recovery method in the above text and will not be repeated here.

[0127] In some embodiments, as Figure 11 shown, a data recovery device is provided, including:

[0128] An acquisition module 11, configured to acquire the working state information of the storage hard disk in the storage system when triggering the escape space for data recovery.

[0129] A recovery module 12, configured to recover the data in the storage space according to the working state information of the storage hard disk and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0130] In some embodiments, the above recovery module includes:

[0131] A determination unit, configured to determine the priority of the escape spaces set at each location according to the working state information of the storage hard disk.

[0132] A recycling unit, configured to recycle the data in the storage space by using the escape spaces set at each location according to the priority of the escape spaces set at each location.

[0133] In some embodiments, the above-mentioned determination unit includes:

[0134] A first determination subunit, configured to determine whether the storage hard disk meets a preset condition according to the working state information; the preset condition includes hard disk abnormality or slow disk failure.

[0135] A second determination subunit, configured to determine that the priority of the first escape space is higher than that of the second escape space if the storage hard disk does not meet the preset condition; the first escape space is the escape space set on the disk; the second escape space is the escape space set in the power-preserving memory.

[0136] A third determination subunit, configured to determine that the priority of the second escape space is higher than that of the first escape space if the storage hard disk meets the preset condition.

[0137] In some embodiments, the above-mentioned recycling unit includes:

[0138] A monitoring subunit, configured to monitor whether there is free space on the escape space with a higher priority.

[0139] A first recycling subunit, configured to recycle the data by using the escape space with a higher priority if there is any.

[0140] A second recycling subunit, configured to recycle the data by using the escape spaces with other priorities if there is no free space.

[0141] In some embodiments, the above-mentioned first recycling subunit is specifically configured to determine whether the capacity of the free space is greater than the capacity of the data to be recycled; if it is greater, recycle the data by using the escape space with a higher priority; if it is not greater, recycle part of the data by using the escape space with a higher priority and recycle the other part of the data by using other escape spaces.

[0142] In some embodiments, the above-mentioned data recycling device further includes:

[0143] A migration module, configured to determine whether the remaining space capacity of the storage space and the power-preserving memory meet a preset migration condition after the data in the storage space is recycled, and migrate the data in the second escape space to the storage space and release the second escape space when it is determined that the preset migration condition is met.

[0144] Each module in the above data recovery device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0145] In some embodiments, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:

[0146] When triggering data recovery in the escape space, obtain the working state information of the storage hard disks in the storage system;

[0147] Recover the data in the storage space according to the working state information of the storage hard disks and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0148] In some embodiments, when the processor executes the computer program, the following steps are also implemented:

[0149] Determine the priority of the escape space set at each position according to the working state information of the storage hard disks;

[0150] Recover the data in the storage space by using the escape space set at each position according to the priority of the escape space set at each position.

[0151] In some embodiments, when the processor executes the computer program, the following steps are also implemented:

[0152] Determine whether the storage hard disks meet the preset conditions according to the working state information; the preset conditions include hard disk anomalies or slow disk failures;

[0153] If the storage hard disks do not meet the preset conditions, determine that the priority of the first escape space is higher than that of the second escape space; the first escape space is the escape space set on the disk; the second escape space is the escape space set in the power-preserving memory;

[0154] If the storage hard disks meet the preset conditions, determine that the priority of the second escape space is higher than that of the first escape space.

[0155] In some embodiments, when the processor executes the computer program, the following steps are also implemented:

[0156] Monitor whether there is free space on the escape space with a higher priority;

[0157] If there is, use the escape space with a higher priority to recover the data;

[0158] If not, use the escape space with other priorities to recycle the data.

[0159] In some embodiments, when the processor executes the computer program, the following steps are further implemented:

[0160] Determine whether the capacity of the free space is greater than the capacity of the data to be recycled;

[0161] If it is greater, use the escape space with a higher priority to recycle the data;

[0162] If it is not greater, use the escape space with a higher priority to recycle part of the data, and use other escape spaces to recycle the other part of the data.

[0163] In some embodiments, when the processor executes the computer program, the following steps are further implemented:

[0164] After the data is recycled in the storage space, determine whether the remaining space capacity of the storage space and the power-preserving memory meet the preset migration conditions, and in the case of determining that the preset migration conditions are met, migrate the data in the second escape space to the storage space and release the second escape space.

[0165] For a computer device provided in the above embodiments, its implementation principle and technical effects are similar to those of the above method embodiments, and will not be elaborated here.

[0166] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0167] In the case of triggering the escape space to recycle data, obtain the working state information of the storage hard disk in the storage system;

[0168] Recycle the data in the storage space according to the working state information of the storage hard disk and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

[0169] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:

[0170] Determine the priority of the escape space set at each position according to the working state information of the storage hard disk;

[0171] According to the priority of the escape space set at each position, use the escape space set at each position to recycle the data in the storage space.

[0172] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:

[0173] Determine whether the storage hard disk meets a preset condition according to the working status information; the preset condition includes hard disk abnormality or slow disk failure;

[0174] If the storage hard disk does not meet the preset condition, determine that the priority of the first escape space is higher than that of the second escape space; the first escape space is the escape space set on the disk; the second escape space is the escape space set on the power - retained memory;

[0175] If the storage hard disk meets the preset condition, determine that the priority of the second escape space is higher than that of the first escape space.

[0176] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:

[0177] Monitor whether there is free space on the escape space with a higher priority;

[0178] If there is, use the escape space with a higher priority to recycle data;

[0179] If not, use the escape space with other priorities to recycle data.

[0180] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:

[0181] Determine whether the capacity of the free space is greater than the capacity of the data to be recycled;

[0182] If it is greater, use the escape space with a higher priority to recycle data;

[0183] If it is not greater, use the escape space with a higher priority to recycle part of the data, and use other escape spaces to recycle the other part of the data.

[0184] In some embodiments, when the computer program is executed by a processor, the following steps are further implemented:

[0185] After data recycling in the storage space, determine whether the remaining space capacity of the storage space and the power - retained memory meet the preset migration condition, and when it is determined that the preset migration condition is met, migrate the data in the second escape space to the storage space and release the second escape space.

[0186] The computer - readable storage medium provided in the above - mentioned embodiments has the same implementation principle and technical effects as the above - mentioned method embodiments, and will not be elaborated here.

[0187] In some embodiments, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0188] When triggering the data recovery of the escape space, obtain the working status information of the storage hard disks in the storage system;

[0189] Recover the data in the storage space according to the working status information of the storage hard disks and the escape space reserved in the storage system; the reserved escape space includes the escape spaces set at different positions.

[0190] In some embodiments, when the computer program is executed by the processor, the following steps are further implemented:

[0191] Determine the priority of the escape spaces set at each position according to the working status information of the storage hard disks;

[0192] Recover the data in the storage space by using the escape spaces set at each position according to the priority of the escape spaces set at each position.

[0193] In some embodiments, when the computer program is executed by the processor, the following steps are further implemented:

[0194] Determine whether the storage hard disks meet the preset conditions according to the working status information; the preset conditions include hard disk anomalies or slow disk failures;

[0195] If the storage hard disks do not meet the preset conditions, determine that the priority of the first escape space is higher than that of the second escape space; the first escape space is the escape space set on the disk; the second escape space is the escape space set in the power-preserving memory;

[0196] If the storage hard disks meet the preset conditions, determine that the priority of the second escape space is higher than that of the first escape space.

[0197] In some embodiments, when the computer program is executed by the processor, the following steps are further implemented:

[0198] Monitor whether there is free space on the escape space with a higher priority;

[0199] If there is, use the escape space with a higher priority to recover the data;

[0200] If not, use the escape spaces with other priorities to recover the data.

[0201] In some embodiments, when the computer program is executed by the processor, the following steps are further implemented:

[0202] Determine whether the capacity of the free space is greater than the capacity of the data to be recovered;

[0203] If it is greater, use the escape space with a higher priority to recover the data;

[0204] If it is not greater than, use the escape space with higher priority to recycle some data, and use other escape spaces to recycle another part of the data.

[0205] In some embodiments, when the computer program is executed by the processor, the following steps are further implemented:

[0206] After data recycling in the storage space, determine whether the remaining space capacity of the storage space and the power retention memory meet the preset migration conditions, and when it is determined that the preset migration conditions are met, migrate the data in the second escape space to the storage space and release the second escape space.

[0207] The implementation principle and technical effects of a computer program product provided by the above embodiments are similar to those of the above method embodiments, and will not be elaborated here.

[0208] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0209] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0210] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A data recovery method, characterized in that, The method includes: When triggering data recovery in the escape space, obtaining the working state information of the storage hard disks in the storage system; Recovering the data in the storage space according to the working state information of the storage hard disks and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

2. The method according to claim 1, wherein The recovering the data according to the working state information of the storage hard disks and the escape space reserved in the storage system includes: Determining the priority of the escape space set at each position according to the working state information of the storage hard disks; Recovering the data in the storage space by using the escape space set at each position according to the priority of the escape space set at each position.

3. The method according to claim 2, wherein The escape space includes a first escape space and a second escape space. The determining the priority of the escape space set at each position according to the working state information of the storage hard disks includes: Determining whether the storage hard disks meet a preset condition according to the working state information; the preset condition includes hard disk anomalies or slow disk failures; If the storage hard disks do not meet the preset condition, determining that the priority of the first escape space is higher than the priority of the second escape space; the first escape space is the escape space set on the disk; the second escape space is the escape space set in the power-preserving memory; If the storage hard disks meet the preset condition, determining that the priority of the second escape space is higher than the priority of the first escape space.

4. The method according to claim 2, wherein The recovering the data in the storage space by using the escape space set at each position according to the priority of the escape space set at each position includes: Monitoring whether there is free space on the escape space with a higher priority; If there is, using the escape space with a higher priority to recover the data; If not, using the escape space with other priorities to recover the data.

5. The method according to claim 4, wherein The using the escape space with a higher priority to recover the data includes: Determining whether the capacity of the free space is greater than the capacity of the data to be recovered; If it is greater, using the escape space with a higher priority to recover the data; If it is not greater, using the escape space with a higher priority to recover part of the data and using other escape spaces to recover the other part of the data.

6. The method according to claim 3, characterized in that, The method further includes: After the data in the storage space is recovered, determining whether the remaining space capacity of the storage space and the power-preserving memory meet a preset migration condition, and if it is determined that the preset migration condition is met, migrating the data in the second escape space to the storage space and releasing the second escape space.

7. A data recovery device, characterized in that, The device includes: An obtaining module, configured to obtain the working state information of the storage hard disks in the storage system when triggering data recovery in the escape space; A recovery module, configured to recover the data in the storage space according to the working state information of the storage hard disks and the escape space reserved in the storage system; the reserved escape space includes escape spaces set at different positions.

8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When this computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.