Data recovery method and device, storage medium and electronic equipment

By deploying multiple servers and recovery services in a distributed storage system, and using multiple request queues and recovery threads to prioritize high-priority data recovery requests, the problem of low data recovery efficiency is solved, improving data recovery efficiency and reducing costs. I/O latency.

CN118567908APending Publication Date: 2024-08-30JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410650735.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In distributed storage systems, data recovery efficiency is low, especially when abnormalities occur in multiple storage devices, which may lead to data loss and business paralysis.

Method used

By deploying multiple servers and recovery services in a distributed storage system, multiple initial request queues are used to handle different types of storage device exceptions, data recovery requests are executed according to processing priorities, and recovery threads are used to filter and recover from multiple request queues. Execute data recovery requests, ensuring that high-priority recovery tasks are prioritized.

Benefits of technology

It improves data recovery efficiency, reduces I/O delays, avoids business impact due to data recovery sequence, and enables timely processing of storage device exceptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567908A
    Figure CN118567908A
Patent Text Reader

Abstract

The embodiment of the invention provides a data recovery method and device, a storage medium and electronic device.The method comprises the steps that when an abnormal target storage device exists in multiple storage devices in a target server where a recovery service is located, the target storage device is recovered; acquiring a data recovery request corresponding to the exception occurring in the target storage device; adding the data recovery request to a request queue corresponding to the target exception type in a plurality of initial request queues to obtain a plurality of target request queues; and executing the data recovery requests in the plurality of target request queues according to the plurality of processing priorities. By means of the data recovery method and device, the problem that the data recovery efficiency is low is solved, and then the effect of improving the data recovery efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data recovery, and specifically, to a data recovery method and device, a storage medium, and an electronic device. Background Art

[0002] There are multiple copies of data in a distributed storage system. Each I / O (Input / Output) generally maintains strong consistency. Storage devices (for example, disks) in a distributed storage system may have various anomalies, such as disk offline after firmware upgrade, loose disk slots, etc., which may lead to disk unplugging events. These anomalies may cause the loss of data stored in the storage device. For example, the disk unplugging event may cause the loss of some data copies.

[0003] In the related technology, the data on the storage device with the abnormality is restored through the copy of the data stored in the distributed storage system in the order of the time when the disk abnormality occurs. This method may cause a sharp increase in I / O latency, resulting in the impact on the upper-layer business; if multiple storage devices in the distributed storage system have disk unplugging events, it may cause data loss in the cluster and paralyze the entire business. Summary of the invention

[0004] The embodiments of the present application provide a data recovery method and device, a storage medium, and an electronic device to at least solve the problem of low data recovery efficiency in the related art.

[0005] According to an embodiment of the present application, a data recovery method is provided, wherein a plurality of servers are deployed in a distributed storage system, and a plurality of storage devices and a recovery service are deployed on each of the plurality of servers, wherein the storage device is used to store data on the server, and a plurality of initial request queues are deployed in the recovery service, wherein the plurality of initial request queues correspond to a plurality of abnormality types of abnormalities occurring in the storage device, and the plurality of initial request queues correspond to a plurality of processing priorities, and the method is applied to the recovery service, and the method comprises: in the case where there is a target storage device having an abnormality among the plurality of storage devices in the target server where the recovery service is located, obtaining a data recovery request corresponding to the abnormality occurring in the target storage device, wherein the data recovery request is used to request to restore the target data stored in the target storage device to a reference storage device other than the target storage device among the plurality of storage devices; adding the data recovery request to a request queue corresponding to a target abnormality type in the plurality of initial request queues to obtain a plurality of target request queues, wherein the abnormality occurring in the target storage device belongs to the target abnormality type, and the plurality of abnormality types include the target abnormality type; and executing the data recovery requests in the plurality of target request queues according to the plurality of processing priorities.

[0006] In an exemplary embodiment, the data recovery request is added to the request queue corresponding to the target exception type in the multiple initial request queues to obtain multiple target request queues, including: obtaining a candidate request queue corresponding to the target exception type from the multiple initial request queues; and adding the data recovery request to the candidate request queue to obtain the multiple target request queues.

[0007] In an exemplary embodiment, a recovery thread is deployed in the recovery service, and executing the data recovery requests in the multiple target request queues according to the multiple processing priorities includes: obtaining a target call request, wherein the target call request is used to request calling the recovery thread to execute the data recovery requests in the multiple target request queues; calling the recovery thread to execute the data recovery requests in the multiple target request queues according to the multiple processing priorities.

[0008] In an exemplary embodiment, the multiple target request queues include N request queues, and the N request queues correspond to N processing priorities, wherein N is a positive integer greater than or equal to 2. The calling of the recovery thread to execute the data recovery request in the multiple target request queues includes: calling the recovery thread to filter M request queues whose processing priorities meet the target matching condition with a first priority threshold from the N request queues, wherein M is a positive integer less than or equal to N; calling the recovery thread to extract P requests to be processed from the M request queues, and calling the recovery thread to execute the P requests, wherein P is a positive integer, and the P requests include the data recovery request.

[0009] In an exemplary embodiment, after calling the recovery thread to execute the P requests, the method further includes: detecting a first relationship between a first number of requests currently processed by the recovery thread and a quantity threshold, wherein the first number of requests includes the P requests; in a case where the first relationship indicates that the first number is less than the quantity threshold, and the P requests do not include the data recovery request, calling the recovery thread to filter R request queues whose processing priorities meet a target matching condition with a second priority threshold from NM request queues, wherein the second priority threshold is less than the first priority threshold, and R is a positive integer less than or equal to NM; calling the recovery thread to extract T requests to be processed from the R request queues, and calling the recovery thread to execute the T requests, wherein T is a positive integer, T is less than a value obtained by subtracting the first number from the quantity threshold, and the T requests include the data recovery request.

[0010] In an exemplary embodiment, after calling the recovery thread to execute the T requests, the method further includes: detecting a second relationship between a second number of requests currently processed by the recovery thread and a quantity threshold, wherein the second number of requests includes the P requests and the T requests; when the second relationship indicates that the second number is less than the quantity threshold, and neither the P requests nor the T requests include the data recovery request, calling the recovery thread to filter W request queues whose processing priorities meet a target matching condition with a third priority threshold from NMR request queues, wherein the third priority threshold is less than the second priority threshold, and W is a positive integer less than or equal to NMR; calling the recovery thread to extract Q requests to be processed from the W request queues, and calling the recovery thread to execute the Q requests, wherein Q is a positive integer, Q is less than or equal to a value obtained by subtracting the second number from the quantity threshold, and the Q requests include the data recovery request.

[0011] In an exemplary embodiment, the calling of the recovery thread to execute the P requests includes: calling the recovery thread to execute the data recovery request in the P requests by executing the following steps: calling the recovery thread to detect the availability of candidate data stored in the target storage device where the abnormality occurs, wherein the availability is used to indicate whether the candidate data is consistent with the target data stored on a reference server, and the reference server is a server among the multiple servers other than the target server; in the case where the availability is used to indicate that at least part of the reference data is consistent between the candidate data and the target data stored on a server among the multiple servers other than the target server, calling the recovery thread to retrieve the candidate data stored in the target storage device; The target data is extracted from the reference server, and the recovery thread is called to extract the recovery data other than the reference data from the target data stored in the reference server; the recovery thread is called to copy the reference data and the recovery data to the reference storage device; wherein the calling of the recovery thread to extract the recovery data other than the reference data from the target data stored in the reference server comprises: generating a target extraction request, wherein the target extraction request is used to request to extract the recovery data from the target data stored in the reference server; sending the target extraction request to the reference server, and receiving the recovery data returned by the reference server in response to the target extraction request, wherein the target extraction request carries an identifier of the recovery data.

[0012] According to another embodiment of the present application, a data recovery device is provided. A plurality of servers are deployed in a distributed storage system. A plurality of storage devices and a recovery service are deployed on each of the plurality of servers. The storage device is used to store data on the server. A plurality of initial request queues are deployed in the recovery service. The plurality of initial request queues correspond to a plurality of abnormality types of abnormalities occurring in the storage device. The plurality of initial request queues correspond to a plurality of processing priorities. The device is applied to the recovery service. The device comprises: an acquisition module, used to acquire a data recovery request corresponding to an abnormality occurring in the target storage device when there is an abnormal target storage device among the plurality of storage devices in the target server where the recovery service is located, wherein the data recovery request is used to request to restore the target data stored in the target storage device to a reference storage device other than the target storage device among the plurality of storage devices; an adding module, used to add the data recovery request to a request queue corresponding to a target abnormality type in the plurality of initial request queues to obtain a plurality of target request queues, wherein the abnormality occurring in the target storage device belongs to the target abnormality type, and the plurality of abnormality types include the target abnormality type; and an execution module, used to execute the data recovery requests in the plurality of target request queues according to the plurality of processing priorities.

[0013] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0014] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0016] Through the present application, a recovery service and multiple storage devices are deployed in each server in a distributed storage system, and multiple request queues are deployed in the recovery service. The requests in the request queues are processed according to the multiple processing priorities corresponding to the multiple request queues. In this way, it is avoided to process the requests in the chronological order of the acquired data recovery requests, and instead, the requests in the multiple request queues are differentiated and processed according to the priorities corresponding to the exception types of the exceptions occurring in the storage devices, thereby achieving priority processing of data recovery requests with higher priorities. Therefore, the problem of low data recovery efficiency can be solved, thereby achieving the effect of improving data recovery efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a hardware structure block diagram of a server device of a data recovery method according to an embodiment of the present application;

[0018] Figure 2 is a flow chart of a method for recovering data according to an embodiment of the present application;

[0019] Figure 3 is a schematic diagram of an optional distributed storage system according to an embodiment of the present application;

[0020] Figure 4 is a schematic diagram of an optional request queue according to an embodiment of the present application;

[0021] Figure 5 is a schematic diagram of an optional data recovery according to an embodiment of the present application;

[0022] Figure 6 It is a structural block diagram of a data recovery device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0025] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a data recovery method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data recovery method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0028] First, the features involved in the embodiments of the present application are explained as follows:

[0029] I / O: Input / Output, read and write operations on data objects in distributed storage systems.

[0030] SDS: Software Defined Storage, software defined storage, its core is storage virtualization technology, in the embodiment of the present application is a distributed storage system that provides storage capabilities for virtualization.

[0031] OSD: Object Storage Device, usually refers to the hardware device that stores objects, responsible for storing and retrieving the data part of the object.

[0032] OBJ: object, which is the basic storage unit for SDS to provide data storage services. The main information of each data OBJ is managed in SDS through OBJ memory. The main OBJ memory information involved in the embodiment of the present application includes OBJ disk information (for example, the disk OSD information where OBJ is located) and OBJ old disk information (disk OSD information where the old disk is mounted, if any, it is not empty). OBJ disk information (which disk the data is stored on) is implemented based on the consistent hash algorithm; the disk OSD status is divided into Online and Offline. I / O access can be performed when Online. If a disk is unplugged, the disk OSD status is Offline.

[0033] In this embodiment, a data recovery method is provided. A plurality of servers are deployed in a distributed storage system. A plurality of storage devices and a recovery service are deployed on each of the plurality of servers. The storage device is used to store data on the server. A plurality of initial request queues are deployed in the recovery service. The plurality of initial request queues correspond to a plurality of abnormal types of abnormalities occurring in the storage device. The plurality of initial request queues correspond to a plurality of processing priorities. The method is applied to the recovery service. Figure 2 is a flow chart of a method for recovering data according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0034] Step S202, when there is a target storage device with an abnormality among the multiple storage devices in the target server where the recovery service is located, obtaining a data recovery request corresponding to the abnormality of the target storage device, wherein the data recovery request is used to request to restore the target data stored in the target storage device to a reference storage device other than the target storage device among the multiple storage devices;

[0035] Step S204, adding the data recovery request to the request queue corresponding to the target exception type in the multiple initial request queues to obtain multiple target request queues, wherein the exception occurring in the target storage device belongs to the target exception type, and the multiple exception types include the target exception type;

[0036] Step S206: Execute the data recovery requests in the multiple target request queues according to the multiple processing priorities.

[0037] Through the above steps, a recovery service and multiple storage devices are deployed in each server in the distributed storage system, and multiple request queues are deployed in the recovery service. The requests in the request queues are processed according to the multiple processing priorities corresponding to the multiple request queues. In this way, it is avoided to process the requests in the order of the time in which the data recovery requests are obtained. Instead, the requests in the multiple request queues are differentiated and processed according to the priorities corresponding to the exception types of the exceptions occurring in the storage devices, thereby giving priority to data recovery requests with higher priorities. Therefore, the problem of low data recovery efficiency can be solved, thereby achieving the effect of improving data recovery efficiency.

[0038] In the technical solution provided in the above step S202, the distributed storage system may be but is not limited to deploying multiple servers, and multiple storage devices and recovery services are deployed on each server. As an optional example, the storage device deployed on the server may be but is not limited to including a disk, a hard disk or RAID, etc. The data stored in each server in the distributed storage system may be but is not limited to being the same.

[0039] Figure 3 is a schematic diagram of an optional distributed storage system according to an embodiment of the present application, such as Figure 3 As shown, servers 1 to 3 are deployed in the distributed storage system. Taking server 2 as an example, recovery services and storage devices 1 to 4 are deployed in server 2. Storage devices 1 to 4 can be used but are not limited to storing data of server 2.

[0040] Optionally, in this embodiment, multiple request queues may be deployed in the recovery service but are not limited to, and different request queues may correspond to multiple exception types but are not limited to. Figure 4 is a schematic diagram of an optional request queue according to an embodiment of the present application, such as Figure 4 As shown, the recovery service in server 2 may be but is not limited to being deployed with queues 1 to 3, and queues 1 to 3 correspond to exception types 1 to 3 respectively. When an exception occurs in storage device 2, the recovery service may be but is not limited to obtaining a data recovery request. In such a case, the recovery service may be but is not limited to adding exception type 2 to the corresponding queue 2 for the data recovery request.

[0041] Optionally, in this embodiment, the data recovery request can be obtained in the following ways, but is not limited to: detecting through the target server whether there is an abnormal target storage device among the multiple storage devices in the target server, and if the target server detects that there is an abnormal target storage device among the multiple storage devices in the target server, generating a data recovery request through the target server and sending the data recovery request to the recovery service in the target server; or detecting through the recovery service in the target server whether there is an abnormal target storage device among the multiple storage devices in the target server, and if the recovery service in the target server detects that there is an abnormal target storage device among the multiple storage devices in the target server, generating a data recovery request through the recovery service.

[0042] Optionally, in this embodiment, the abnormalities occurring in the storage device in the server may be but are not limited to having corresponding abnormality types, and the abnormality types corresponding to different abnormalities occurring in the storage device may be but are not limited to being the same or different. For example, the abnormalities occurring in the storage device in the server may be but are not limited to including storage device falling, storage device looseness, or storage device read and write abnormalities, etc. The storage device falling and storage device looseness may be but are not limited to corresponding to abnormality type 1, and the storage device read and write abnormalities may be but are not limited to corresponding to abnormality type 2.

[0043] Optionally, different request queues have corresponding processing priorities. The higher the processing priority of a request queue, the earlier the requests in the request queue are processed. The processing priority of a request queue can be, but is not limited to, determined according to the type of abnormality that occurs in the storage device. For example, the type of abnormality that may affect the reading and writing business or is more serious (for example, the storage device is physically damaged) has a higher processing priority, and the type of abnormality that occurs in the storage device but does not affect the data stored in the storage device has a lower processing priority. In this way, it is achieved that more urgent and important abnormalities that occur in the storage device are processed first, and the timeliness of the abnormalities that occur in the storage device is improved.

[0044] For example, the recovery queue (equivalent to the request queue) may include, but is not limited to: 1) QL: low priority recovery queue; 2) QM: medium priority recovery queue; 3) SH: high priority queue.

[0045] The recovery list may include, but is not limited to, three types: 1) SL: low priority recovery list; 2) SM: medium priority recovery list; 3) QH: high priority recovery list.

[0046] If OBJ (equivalent to data) needs to be recovered, an OBJ recovery request (equivalent to a data recovery request) needs to be generated and placed in an OBJ recovery queue (equivalent to a request queue). A dedicated recovery thread processes each recovery queue. The recovery request may be, but is not limited to, four types, for example, R1, R2, R3, and R4, where R1 represents a disk pull recovery request with a low priority; R2 represents an old disk mount recovery request with a medium priority; R3 represents an O recovery request with a high priority, and is marked as a disk pull recovery; R4 represents an IO recovery request with a high priority, and is marked as an online old disk mount.

[0047] For example, the data recovery based on the disk recovery task, the data recovery based on the online mounting of the old disk task, and the data recovery based on the IO request can be used as examples for explanation, but are not limited to. The data recovery requests corresponding to R1, R2, R3, and R4 can be generated in the following manner, but are not limited to.

[0048] a. Data recovery based on disk recovery task

[0049] The disk with I / O abnormality that meets the conditions can be identified through, but is not limited to, udev events (unplugging disks) or I / O monitoring algorithms, and a disk unplugging recovery task is generated. The main work of the disk unplugging recovery task is to update the disk information of this node (delete the faulty disk information), mark the disk status as Offline, obtain all OBJ information on the disk, generate an R1 request for each OBJ and put it into the QL queue to be restored thread for recovery processing.

[0050] b. Data recovery based on online mounting of old disk tasks

[0051] After the disk unplugging event occurs, the user can promptly perform the online mounting of the old disk operation in the interface in order to use the valid data of the old disk. The user interface triggers the online mounting of the old disk task and sends it to the SDS for processing. For example, the user interface mounts the old disk, generates an online mounting of the old disk task, sends it to the SDS, and the faulty node performs online mounting of the old disk. The main tasks of the online mounting of the old disk task are: updating the disk information of this node (for example, adding the OSD disk information to the SDS faulty node), marking the disk status as Online, loading all OBJ information of the disk, and updating the corresponding old disk information of each OBJ to the mounted disk, generating an R2 request for each 0BJ, putting it in the QM queue, and waiting for the recovery thread to perform recovery processing. If the recovery is successful, the disk OSD information corresponding to the OBJ is updated to the online mounted old disk.

[0052] c. Data recovery based on IO requests

[0053] The OBJ status must be clarified first. OBJ is divided into normal status and recovery status. If it is in the recovery status, IO needs to be blocked and wait for the normal status before subsequent I / O processing can be performed. When business data I / O arrives, if the OSD status in the disk OSD information of the OBJ is Offline, it means that the OBJ has not been successfully recovered. If the OBJ is not in the recovery status at this time and the corresponding old disk information is empty, an R3 request is generated, otherwise an R4 request is generated and put into the QH waiting for recovery thread for recovery processing.

[0054] The business data I / O is sent to the faulty node. If the OBJ disk OSD status is Online, it can be accessed normally. If it is Offline and the OBJ old disk OSD is empty, an R3 request needs to be generated and placed in QH. If the OBJ old disk OSD is not empty, an R4 request is generated and placed in QH, waiting for the recovery thread to perform data recovery. If the recovery is successful, the OBJ disk OSD information is updated, and the status is Online, then the I / O can be accessed immediately afterwards, and this I / O is successful.

[0055] Optionally, in this embodiment, it is possible but not limited to detecting whether there is an abnormal storage device among multiple storage devices in the following manner: a monitoring thread is deployed in the recovery service, and whether there is an abnormal storage device among the multiple storage devices is detected through the monitoring thread, or, whether there is an abnormal storage device among the multiple storage devices is detected through the target server where the recovery service is located; or, response description information of multiple storage devices is read through the recovery service, wherein the response description information is used to describe the target duration required for multiple storage devices to complete responding to received data read and write requests, and the data read and write requests are used to request read operations or write operations on data stored in multiple storage devices, and when the response description information is used to indicate that the target duration of the target storage device is greater than or equal to a duration threshold, it is determined that the target storage device has an abnormality.

[0056] For example, but not limited to, a monitoring thread (for example, a udev monitoring thread) can be started to monitor disk unplugging events in the system. If a disk unplugging event is received and the disk belongs to an SDS storage system, a disk unplugging recovery task is generated; or, I / O abnormal data is counted for processing: for a single disk OSD, if IO timeouts occur for a cumulative period of 100 seconds every 600 seconds, the disk is considered abnormal and needs to be kicked out of the SDS, and a disk unplugging recovery task is generated; if IO errors occur 100 times in a row, the disk is also considered abnormal and a disk unplugging recovery task is generated.

[0057] In the technical solution provided in the above step S204, the multiple initial request queues deployed in the recovery service may include but are not limited to requests to be executed. For example, before the target storage device has an exception, storage devices other than the target storage device deployed on the target server also have an exception. Alternatively, there are no requests to be executed. For example, the target storage device is the first storage device deployed on the target server to have an exception. When the target storage device has an exception, all requests to be executed in the multiple initial request queues have been executed.

[0058] As an optional example, the target exception type can be but is not limited to being carried in the data recovery request, or the recovery service can read exception description information from the target storage device where the exception occurs, wherein the exception description information is used to describe the exception that occurs in the target storage device, and the recovery service obtains the target exception type corresponding to the exception that occurs in the target storage device from the corresponding exceptions and exception types.

[0059] In an exemplary embodiment, the data recovery request can be added to the request queue corresponding to the target exception type in the multiple initial request queues to obtain multiple target request queues in the following manner but is not limited to: obtaining a candidate request queue corresponding to the target exception type from the multiple initial request queues; adding the data recovery request to the candidate request queue to obtain the multiple target request queues.

[0060] Optionally, in this embodiment, the multiple initial request queues may include but are not limited to queues of first-in-first-out requests, and data recovery requests may be added to the candidate request queues in a first-in-first-out manner but are not limited to. In this way, requests in request queues of the same priority level are processed in the order in which the data recovery requests are received, thereby improving the orderliness of request processing in request queues of the same priority level.

[0061] In the technical solution provided in the above step S206, data recovery requests in multiple target request queues can be executed according to multiple processing priorities but are not limited to. In this way, it is avoided to execute the data recovery request according to the time when the data recovery request is obtained, and the data recovery request is processed according to the processing priority corresponding to the request queue where the data recovery request is located.

[0062] Through the embodiments of the present application, the recovery priority of OBJ (e.g., data) recovery in various scenarios is identified, and lost data is quickly recovered, which can reduce the occupancy of network resources and reduce the impact of data recovery on I / O performance.

[0063] In an exemplary embodiment, a recovery thread is deployed in the recovery service, which can, but is not limited to, execute the data recovery requests in the multiple target request queues according to the multiple processing priorities: obtain a target call request, wherein the target call request is used to request to call the recovery thread to execute the data recovery requests in the multiple target request queues; in response to the target call request, call the recovery thread to execute the data recovery requests in the multiple target request queues according to the multiple processing priorities.

[0064] Optionally, in this embodiment, a common recovery thread may be deployed in the recovery service but is not limited to it, and the recovery thread may be called but is not limited to execute data recovery requests in multiple target request queues according to multiple processing priorities. In this way, it is possible to execute data recovery requests in multiple request queues through the same recovery thread, thereby reducing the number of threads that need to be deployed for data recovery, reducing the processing resources required for data recovery, and reducing the impact of data recovery on the normal I / O business of the storage device.

[0065] In an exemplary embodiment, the multiple target request queues include N request queues, and the N request queues correspond to N processing priorities, where N is a positive integer greater than or equal to 2. The recovery thread can be called to execute the data recovery request in the multiple target request queues in the following manner, but is not limited to: calling the recovery thread to filter M request queues whose processing priorities meet the target matching condition with a first priority threshold from the N request queues, where M is a positive integer less than or equal to N; calling the recovery thread to extract P requests to be processed from the M request queues, and calling the recovery thread to execute the P requests, where P is a positive integer, and the P requests include the data recovery request.

[0066] Optionally, in this embodiment, the recovery thread can be called in the following manner, but is not limited to, to filter M request queues whose processing priorities meet the target matching condition with the first priority threshold from N request queues: filtering M request queues whose processing priorities are greater than or equal to the first priority threshold from N request queues, or filtering M request queues with the highest processing priorities from N request queues.

[0067] In an exemplary embodiment, after calling the recovery thread to execute the P requests, the method further includes: detecting a first relationship between a first number of requests currently processed by the recovery thread and a quantity threshold, wherein the first number of requests includes the P requests; in a case where the first relationship is used to indicate that the first number is less than the quantity threshold, and the P requests do not include the data recovery request, calling the recovery thread to filter R request queues whose processing priorities meet a target matching condition with a second priority threshold from NM request queues, wherein the second priority threshold is less than the first priority threshold, and R is a positive integer less than or equal to NM; calling the recovery thread to extract T requests to be processed from the R request queues, and calling the recovery thread to execute the T requests, wherein T is a positive integer, T is less than a value obtained by subtracting the first number from the quantity threshold, and the T requests include the data recovery request.

[0068] Optionally, in this embodiment, after calling the recovery thread to execute P requests, it is possible but not limited to continuing to obtain T requests from the remaining request queues. It should be noted that the P requests may not include a data recovery request, and the processing priority of the request queue where the data recovery request is located does not meet the target matching condition with the first priority threshold. For example, the processing priority of the request queue where the data recovery request is located is less than the first priority threshold. The P requests may include a data recovery request. For example, the processing priority of the request queue where the data recovery request is located meets the target matching condition with the first priority threshold.

[0069] Optionally, in this embodiment, the recovery thread can be called in the following manner, but is not limited to, to filter R request queues whose processing priorities meet the target matching condition with the second priority threshold from NM request queues: filter R request queues whose processing priorities are greater than or equal to the second priority threshold from NM request queues, or filter R request queues with the highest processing priorities from NM request queues.

[0070] In an exemplary embodiment, after calling the recovery thread to execute the T requests, the method further includes: detecting a second relationship between a second number of requests currently processed by the recovery thread and a quantity threshold, wherein the second number of requests includes the P requests and the T requests; when the second relationship indicates that the second number is less than the quantity threshold, and neither the P requests nor the T requests include the data recovery request, calling the recovery thread to filter W request queues whose processing priorities meet a target matching condition with a third priority threshold from NMR request queues, wherein the third priority threshold is less than the second priority threshold, and W is a positive integer less than or equal to NMR; calling the recovery thread to extract Q requests to be processed from the W request queues, and calling the recovery thread to execute the Q requests, wherein Q is a positive integer, Q is less than or equal to a value obtained by subtracting the second number from the quantity threshold, and the Q requests include the data recovery request.

[0071] Optionally, in this embodiment, after calling the recovery thread to execute T requests, it is possible but not limited to continuing to obtain Q requests from the remaining request queues. It should be noted that the T requests may not include a data recovery request, and the processing priority of the request queue where the data recovery request is located does not meet the target matching condition with the second priority threshold. For example, the processing priority of the request queue where the data recovery request is located is less than the first priority threshold. The T requests may include a data recovery request. For example, the processing priority of the request queue where the data recovery request is located meets the target matching condition with the second priority threshold.

[0072] Optionally, in this embodiment, the recovery thread can be called in the following ways, but is not limited to, to filter W request queues whose processing priorities meet the target matching condition with the second priority threshold from NM request queues: to filter W request queues whose processing priorities are greater than or equal to the third priority threshold from NMR request queues; or to filter R request queues with the highest processing priorities from NMR request queues.

[0073] In order to better understand the process of restoring requests in the thread execution queue in the embodiment of the present application, the process of restoring requests in the thread execution queue in the embodiment of the present application is explained and illustrated in combination with optional embodiments below, which can be applicable to but not limited to the embodiment of the present application.

[0074] The recovery thread filters and recovers each recovery queue. The recovery thread will continuously poll each recovery queue for processing. The processing flow can be but is not limited to the following:

[0075] a. First, get a certain number of R3 or R4 requests up to NUM_MAX (configurable, equivalent to P requests) from the QH queue, process each one, and then add it to the SH list.

[0076] For R3 request: obtain the OBJ information in the R3 request, and then check whether there is a recovery request for the OBJ in the SM. If so, convert the request to an R4 request.

[0077] b. Set the maximum number of OBJs that can be processed each time the recovery thread polls the recovery request list to COUNT_MAX (equivalent to the number threshold). If SH has a recovery request, traverse all R3 or R4 requests in SH for processing, mark the number of recovery requests processed this time as COUNT_H, and the cumulative processing number this time is COUNT=COUNT_H, and perform recovery logic processing on each request.

[0078] c. If there is a recovery request in the SM, all R2 requests in the SM are traversed for processing, and the number of medium-priority recovery requests processed this time is marked as COUNT_M. The cumulative number of processed recovery requests this time is COUNT = COUNT_H + COUNT_M, and each request is processed through the recovery logic module;

[0079] If there is a recovery request in SL, all R1 requests in SM are traversed for processing, and the number of low-priority recovery requests processed this time is marked as COUNT_L. The cumulative number of recovery requests processed this time is COUNT = COUNT_H + COUNT_M + COUNT_L, and the recovery logic module is processed for each request.

[0080] d. Check and compare the COUNT and COUNT_MAX values. If COUNT is greater than or equal to COUNT_MAX, end the polling and continue processing from step a. If COUNT is less than COUNT_MAX, mark the remaining recoverable amount as COUNT_S2 (equivalent to T requests) = COUNT_MAX-COUNT. If QM is not empty, a maximum of COUNT__S2 R2 requests can be obtained from QM. For each R2 request, add the R2 request to the SM list and mark the number of R2 requests processed this time as COUNT_QM. Then COUNT = COUNT+COUNT_QM.

[0081] e. Check the current COUNT and COUNT_MAX values ​​for comparison. If COUNT is greater than or equal to COUNT_MAX, end the polling and continue from step a. If COUNT is less than COUNT_MAX, mark the remaining recoverable amount as COUNT_S1 (equivalent to Q requests) = COUNT_MAX-COUNT. If QL is not empty, get up to COUNT_S1 R1 requests from QL. For each R1 request, add it to the SL list.

[0082] Each recovery thread repeats the above process until the SH, SM and SL recovery lists are all empty, and the data recovery is completed.

[0083] In an exemplary embodiment, the recovery thread may be called to execute the P requests in the following manner, but is not limited to: calling the recovery thread to execute the data recovery request among the P requests by executing the following steps: calling the recovery thread to detect the availability of candidate data stored in the target storage device where the abnormality occurs, wherein the availability is used to indicate whether the candidate data is consistent with the target data stored on a reference server, and the reference server is a server among the multiple servers other than the target server; when the availability is used to indicate that at least part of the reference data is consistent between the candidate data and the target data stored on a server among the multiple servers other than the target server, calling the recovery thread to retrieve the candidate data from the target storage device stored in the target storage device. The reference data is extracted from the candidate data, and the recovery thread is called to extract the recovery data other than the reference data from the target data stored in the reference server; the recovery thread is called to copy the reference data and the recovery data to the reference storage device; wherein the calling of the recovery thread to extract the recovery data other than the reference data from the target data stored in the reference server comprises: generating a target extraction request, wherein the target extraction request is used to request to extract the recovery data from the target data stored in the reference server; sending the target extraction request to the reference server, and receiving the recovery data returned by the reference server in response to the target extraction request, wherein the target extraction request carries an identifier of the recovery data.

[0084] Optionally, in this embodiment, a recovery logic module is also deployed in the recovery service, which can call the recovery thread to execute the P requests in the following manner but is not limited to: calling the recovery logic module through the recovery thread to execute the P requests and obtaining P execution results corresponding to the P requests.

[0085] Optionally, in the present embodiment, there may still be some usable data in the target storage device where the exception occurs, for example, data that is not damaged. In such a case, the data that is still usable in the target storage device can be directly restored to the reference storage device, but is not limited to being restored. For example, when an exception occurs in the target storage device, but the data in the target storage device is all usable, the data in the target storage device can be directly restored to the reference storage device, which greatly reduces the processing resources required to recover the data in the target storage device where the exception occurs through the data stored in other servers in the distributed storage system, and improves the data recovery efficiency.

[0086] Figure 5 is a schematic diagram of an optional data recovery according to an embodiment of the present application, such as Figure 5 shown.

[0087] The OBJ memory management information status can include but is not limited to the following 4 states:

[0088] S1: The OSD status of the OBJ disk is Offfine, and the OSD information of the old disk does not exist and is empty;

[0089] S2: The OSD status of the OBJ disk is Offline, and the OSD information of the old disk is Online;

[0090] S3: The OSD status of the OBJ disk is Online, and the OSD information of the old disk does not exist and is empty;

[0091] S4: The OSD status of the OBJ disk is Online, and the OSD information of the old disk exists in the Online status.

[0092] The recovery logic handles R4 and R2 requests: If the state is S2, it means that the OBJ has not been recovered yet, and the OBJ data on the old disk OSD can be used. The OBJ disk OSD information is updated to the old disk OSD information, and the old disk OSD information in the OBJ memory management information is cleared. The state is converted to S3 and the recovery is completed; if the state is S4, it means that the OBJ has been recovered to the latest data on the disk OSD. The data on the OBJ disk OSD is read and written to the old disk OSD, and then the OBJ disk OSD information is updated to the old disk OSD information, and the old disk OSD information in the OBJ memory management information is cleared. The state is converted to S3 and the recovery is completed; other states are not processed by default and the recovery is completed.

[0093] Processing of R3 and R1 requests: If the status is S1, it means that the data has not been recovered and the old disk has not been mounted. The data needs to be recovered from other nodes to this node. The new OBJ disk OSD information is obtained according to the disk consistency hash algorithm and written to the disk. The OBJ disk OSD information is updated to the new disk, the status changes to S3, and the recovery is completed; if the status is S2, it means that the data has not been recovered, but the old disk has been mounted. The OBJ on the old disk OSD can be used. The OBJ disk OSD information is updated to the old disk OSD information, the old disk OSD information in the OBJ memory management information is cleared, the status changes to S3, and the recovery is completed; other statuses are not processed by default and the recovery is completed.

[0094] Through the embodiments of the present application, in response to anomalies that occur in storage devices (for example, the disk unplugging scenario), the three methods of disk unplugging task recovery, online old disk mounting task recovery, and I / O triggered data recovery are combined to quickly complete the recovery of lost data on the failed node, reduce the impact of a large amount of cross-node data recovery on I / O performance, improve the efficiency of restoring nodes to normal usage, save network bandwidth resources between nodes, and reduce I / O delays, thereby achieving improved I / O performance during failures.

[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0096] In this embodiment, a data recovery device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0097] Figure 6 is a structural block diagram of a data recovery device according to an embodiment of the present application, such as Figure 6As shown, a plurality of servers are deployed in a distributed storage system, and a plurality of storage devices and a recovery service are deployed on each of the plurality of servers. The storage device is used to store data on the server, and a plurality of initial request queues are deployed in the recovery service. The plurality of initial request queues correspond to a plurality of abnormal types of abnormalities occurring in the storage device, and the plurality of initial request queues correspond to a plurality of processing priorities. The apparatus is applied to the recovery service, and the apparatus comprises:

[0098] An acquisition module 602 is used to acquire a data recovery request corresponding to the abnormality of a target storage device when there is an abnormal target storage device among multiple storage devices in the target server where the recovery service is located, wherein the data recovery request is used to request to restore the target data stored in the target storage device to a reference storage device other than the target storage device among the multiple storage devices;

[0099] An adding module 604 is used to add the data recovery request to a request queue corresponding to a target exception type in the multiple initial request queues, to obtain multiple target request queues, wherein the exception occurring in the target storage device belongs to the target exception type, and the multiple exception types include the target exception type;

[0100] The execution module 606 is used to execute the data recovery requests in the multiple target request queues according to the multiple processing priorities.

[0101] Through the above-mentioned device, a recovery service and multiple storage devices are deployed in each server in the distributed storage system, and multiple request queues are deployed in the recovery service. The requests in the request queues are processed according to the multiple processing priorities corresponding to the multiple request queues. In this way, it is avoided to process the requests in the order of the time in which the data recovery requests are obtained, but the requests in the multiple request queues are differentiated and processed according to the priority corresponding to the exception type of the exception occurring in the storage device, thereby achieving priority processing of data recovery requests with higher priorities. Therefore, the problem of low data recovery efficiency can be solved, and the effect of improving data recovery efficiency can be achieved.

[0102] In an exemplary embodiment, the adding module includes:

[0103] A first acquisition unit, configured to acquire a candidate request queue corresponding to the target exception type from a plurality of initial request queues;

[0104] An adding unit is used to add the data recovery request to the candidate request queue to obtain the multiple target request queues.

[0105] In an exemplary embodiment, a recovery thread is deployed in the recovery service, and the execution module includes:

[0106] A second acquiring unit, configured to acquire a target call request, wherein the target call request is used to request to call the recovery thread to execute the data recovery request in the plurality of target request queues;

[0107] The calling unit is used to call the recovery thread and execute the data recovery requests in the multiple target request queues according to the multiple processing priorities.

[0108] In an exemplary embodiment, the multiple target request queues include N request queues, the N request queues correspond to N processing priorities, where N is a positive integer greater than or equal to 2, and the calling unit includes:

[0109] Calling the recovery thread to screen M request queues whose processing priorities and the first priority threshold meet the target matching condition from the N request queues, where M is a positive integer less than or equal to N;

[0110] The recovery thread is called to extract P requests to be processed from the M request queues, and the recovery thread is called to execute the P requests, wherein P is a positive integer and the P requests include the data recovery request.

[0111] In an exemplary embodiment, the apparatus further comprises:

[0112] A first detection module is used to detect a first relationship between a first number of requests currently processed by the recovery thread and a number threshold after calling the recovery thread to execute the P requests, wherein the first number of requests includes the P requests;

[0113] A first calling module is used for calling the recovery thread to screen R request queues whose processing priorities and a second priority threshold satisfy a target matching condition from NM request queues when the first relationship indicates that the first number is less than the number threshold and the P requests do not include the data recovery request, wherein the second priority threshold is less than the first priority threshold, and R is a positive integer less than or equal to NM;

[0114] The second calling module is used to call the recovery thread to extract T requests to be processed from the R request queues, and call the recovery thread to execute the T requests, wherein T is a positive integer, T is less than the value obtained by subtracting the first number from the quantity threshold, and the T requests include the data recovery request.

[0115] In an exemplary embodiment, the apparatus further comprises:

[0116] A second detection module is used to detect a second relationship between a second number of requests currently processed by the recovery thread and the number threshold after calling the recovery thread to execute the T requests, wherein the second number of requests includes the P requests and the T requests;

[0117] A third calling module is used for calling the recovery thread to screen W request queues whose processing priorities meet a target matching condition with a third priority threshold from NMR request queues, when the second relationship is used to indicate that the second number is less than the number threshold, and the P requests and the T requests do not include the data recovery request, wherein the third priority threshold is less than the second priority threshold, and W is a positive integer less than or equal to NMR;

[0118] A fourth calling module is used to call the recovery thread to extract Q requests to be processed from the W request queues, and call the recovery thread to execute the Q requests, wherein Q is a positive integer, Q is less than or equal to the value obtained by subtracting the second number from the quantity threshold, and the Q requests include the data recovery request.

[0119] In an exemplary embodiment, the calling unit is used to call the recovery thread to execute the data recovery request among the P requests by performing the following steps:

[0120] Calling the recovery thread to detect the availability of candidate data stored in the target storage device that has an exception, wherein the availability is used to indicate whether the candidate data is consistent with the target data stored on a reference server, and the reference server is a server among the multiple servers except the target server;

[0121] In a case where the availability indicates that at least part of the reference data is consistent between the candidate data and the target data stored on a server other than the target server among the multiple servers, calling the recovery thread to extract the reference data from the candidate data stored in the target storage device, and calling the recovery thread to extract recovery data other than the reference data from the target data stored in the reference server;

[0122] Invoking the recovery thread to copy the reference data and the recovery data to the reference storage device;

[0123] Wherein, calling the recovery thread to extract the recovery data other than the reference data from the target data stored in the reference server includes: generating a target extraction request, wherein the target extraction request is used to request to extract the recovery data from the target data stored in the reference server; sending the target extraction request to the reference server, and receiving the recovery data returned by the reference server in response to the target extraction request, wherein the target extraction request carries an identifier of the recovery data.

[0124] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0125] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0126] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0127] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0128] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0129] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0130] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0131] An embodiment of the present application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0132] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0133] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0134] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data recovery method, characterized in that: A plurality of servers are deployed in a distributed storage system, and a plurality of storage devices and a recovery service are deployed on each of the plurality of servers. The storage device is used to store data on the server. A plurality of initial request queues are deployed in the recovery service. The plurality of initial request queues correspond to a plurality of abnormality types of abnormalities occurring in the storage device. The plurality of initial request queues correspond to a plurality of processing priorities. The method is applied to the recovery service, and the method includes: In the case that there is a target storage device with an abnormality among the multiple storage devices in the target server where the recovery service is located, obtaining a data recovery request corresponding to the abnormality of the target storage device, wherein the data recovery request is used to request to restore the target data stored in the target storage device to a reference storage device other than the target storage device among the multiple storage devices; Adding the data recovery request to a request queue corresponding to a target exception type in the multiple initial request queues to obtain multiple target request queues, wherein the exception occurring in the target storage device belongs to the target exception type, and the multiple exception types include the target exception type; The data recovery requests in the plurality of target request queues are executed according to the plurality of processing priorities.

2. The method according to claim 1, characterized in that The step of adding the data recovery request to the request queue corresponding to the target exception type in the multiple initial request queues to obtain multiple target request queues includes: Obtaining a candidate request queue corresponding to the target exception type from multiple initial request queues; The data recovery request is added to the candidate request queue to obtain the multiple target request queues.

3. The method according to claim 1, characterized in that A recovery thread is deployed in the recovery service, and executing the data recovery requests in the multiple target request queues according to the multiple processing priorities includes: Obtaining a target call request, wherein the target call request is used to request to call the recovery thread to execute the data recovery requests in the multiple target request queues; The recovery thread is called to execute the data recovery requests in the multiple target request queues according to the multiple processing priorities.

4. The method according to claim 3, characterized in that The multiple target request queues include N request queues, the N request queues correspond to N processing priorities, where N is a positive integer greater than or equal to 2, and the calling of the recovery thread to execute the data recovery request in the multiple target request queues includes: Calling the recovery thread to screen M request queues whose processing priorities and the first priority threshold meet the target matching condition from the N request queues, where M is a positive integer less than or equal to N; The recovery thread is called to extract P requests to be processed from the M request queues, and the recovery thread is called to execute the P requests, wherein P is a positive integer and the P requests include the data recovery request.

5. The method according to claim 4, characterized in that After calling the recovery thread to execute the P requests, the method further includes: Detecting a first relationship between a first number of requests currently processed by the recovery thread and a number threshold, wherein the first number of requests includes the P requests; In a case where the first relationship is used to indicate that the first number is less than the number threshold, and the P requests do not include the data recovery request, calling the recovery thread to screen R request queues whose processing priorities meet a target matching condition with a second priority threshold from NM request queues, wherein the second priority threshold is less than the first priority threshold, and R is a positive integer less than or equal to NM; Call the recovery thread to extract T requests to be processed from the R request queues, and call the recovery thread to execute the T requests, where T is a positive integer, T is less than the value obtained by subtracting the first number from the quantity threshold, and the T requests include the data recovery request.

6. The method according to claim 5, characterized in that After calling the recovery thread to execute the T requests, the method further includes: Detecting a second relationship between a second number of requests currently processed by the recovery thread and the number threshold, wherein the second number of requests includes the P requests and the T requests; In a case where the second relationship is used to indicate that the second number is less than the number threshold, and the P requests and the T requests do not include the data recovery request, calling the recovery thread to screen W request queues whose processing priorities meet a target matching condition with a third priority threshold from NMR request queues, wherein the third priority threshold is less than the second priority threshold, and W is a positive integer less than or equal to NMR; Call the recovery thread to extract Q requests to be processed from the W request queues, and call the recovery thread to execute the Q requests, where Q is a positive integer, Q is less than or equal to the value obtained by subtracting the second number from the quantity threshold, and the Q requests include the data recovery request.

7. The method according to claim 4, characterized in that The calling the recovery thread to execute the P requests includes: calling the recovery thread to execute the data recovery request among the P requests by executing the following steps: Calling the recovery thread to detect the availability of candidate data stored in the target storage device that has an exception, wherein the availability is used to indicate whether the candidate data is consistent with the target data stored on a reference server, and the reference server is a server among the multiple servers except the target server; In a case where the availability indicates that at least part of the reference data is consistent between the candidate data and the target data stored on a server other than the target server among the multiple servers, calling the recovery thread to extract the reference data from the candidate data stored in the target storage device, and calling the recovery thread to extract recovery data other than the reference data from the target data stored in the reference server; Invoking the recovery thread to copy the reference data and the recovery data to the reference storage device; Wherein, calling the recovery thread to extract the recovery data other than the reference data from the target data stored in the reference server includes: generating a target extraction request, wherein the target extraction request is used to request to extract the recovery data from the target data stored in the reference server; sending the target extraction request to the reference server, and receiving the recovery data returned by the reference server in response to the target extraction request, wherein the target extraction request carries an identifier of the recovery data.

8. A data recovery device, characterized in that: A plurality of servers are deployed in a distributed storage system, and a plurality of storage devices and a recovery service are deployed on each of the plurality of servers. The storage device is used to store data on the server. A plurality of initial request queues are deployed in the recovery service. The plurality of initial request queues correspond to a plurality of abnormal types of abnormalities occurring in the storage device. The plurality of initial request queues correspond to a plurality of processing priorities. The apparatus is applied to the recovery service, and the apparatus comprises: an acquisition module, configured to, when there is a target storage device with an abnormality among multiple storage devices in the target server where the recovery service is located, acquire a data recovery request corresponding to the abnormality of the target storage device, wherein the data recovery request is used to request to restore the target data stored in the target storage device to a reference storage device other than the target storage device among the multiple storage devices; An adding module, configured to add the data recovery request to a request queue corresponding to a target exception type in the multiple initial request queues, to obtain multiple target request queues, wherein the exception occurring in the target storage device belongs to the target exception type, and the multiple exception types include the target exception type; An execution module is used to execute the data recovery requests in the multiple target request queues according to the multiple processing priorities.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.