Full data recovery method, device, electronic device and medium

By using bitmap and memory cache data recovery mechanism in the Ceph cluster, cached data is directly pulled and pushed from memory to the object storage device to be recovered, the problem of time-consuming data recovery in the Ceph cluster video surveillance service is solved, and an efficient data recovery process is achieved.

CN115756961BActive Publication Date: 2025-09-02CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211458342.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-17
Publication Date
2025-09-02
Estimated Expiration
2042-11-17

AI Technical Summary

Technical Problem

The full data recovery mechanism of the existing Ceph cluster takes a long time in the video surveillance service and cannot efficiently recover the full data.

Method used

By obtaining the bit value in the bit diagram, directly pulling and pushing cached data from memory to the object storage device to be restored, avoiding traversing the available OSD, and using the cached data in memory of video writing services for data recovery.

Benefits of technology

The data recovery speed of Ceph cluster is accelerated, the conflict between the full data recovery process and the upper-level business read and write process is avoided, and the recovery efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115756961B_ABST
    Figure CN115756961B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and medium for full data recovery. The method includes: when a data recovery request is obtained, a bitmap is obtained from the data structure of the current recovery process, and the value of the bit corresponding to the first target object of the object storage device to be recovered in the bitmap is determined, and the data recovery request is used to indicate that the object storage device to be recovered needs to perform data recovery on the first target object corresponding to the second target object hit by the current write cache service; if the value of the bit is the first value, the cached data of the second target object is obtained from the memory through a pull operation in response to the data recovery request, and the first value is used to indicate that data recovery of the first target object is required; and the cached data is pushed to the first target object of the object storage device to be recovered through a push operation. The method of the present application improves the efficiency of full data recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to storage cluster technology, and in particular to a full data recovery method, device, electronic device, and medium. Background Art

[0002] As a large-scale distributed storage system, Ceph is implemented as an object storage system. A Ceph cluster consists of many independent object-based storage devices (OSDs) that provide object storage services. Ceph uses a multi-replication mechanism to ensure high data reliability. For a given piece of data, Ceph automatically stores multiple copies in the background, preventing data loss in the event of a hard drive failure, server failure, or cabinet power outage. After a failure occurs, Ceph must promptly recover from the failure and replace the lost data copies to maintain continuous high data reliability.

[0003] Ceph data recovery is divided into two types: differential data recovery and full data recovery. For cases where differential data recovery cannot meet high data reliability requirements, full data recovery requires a full copy of the data. Ceph's full data recovery mechanism involves traversing all available OSDs in ascending hash value order for each object in the OSD to be recovered, and writing each object to the OSD to be recovered in turn through a full object copy.

[0004] Ceph cluster-based video surveillance services plan the video write rate, number of channels, and number of days in advance based on the total size of the block storage linear address space to fill the Ceph cluster's available space. When the planned number of days is reached, the write will restart from the beginning. For upper-layer services like video surveillance, when full data recovery is required, searching for the corresponding objects in the available underlying OSDs in the order they were written is time-consuming and hinders the efficient full data recovery process. Summary of the Invention

[0005] The present application provides a full data recovery method, device, electronic device and medium for optimizing the full data recovery mechanism of the existing Ceph cluster to save the time of full data recovery of upper-layer services such as video surveillance services, thereby improving their full data recovery efficiency.

[0006] In one aspect, the present application provides a method for full data recovery, the method comprising:

[0007] When a data recovery request is obtained, a bitmap is obtained from the data structure of the current recovery process, and a value of a bit corresponding to a first target object of the object storage device to be recovered in the bitmap is determined, wherein the data recovery request is used to indicate that the object storage device to be recovered needs to recover data of the first target object corresponding to the second target object hit by the current write cache service, the first target object and the second target object are used to store the same data, and the second target object is located in an available object storage device;

[0008] If the value of the bit is a first value, responding to the data recovery request, obtaining cached data of the second target object from the memory through a pull operation, the first value being used to indicate that data recovery of the first target object is required;

[0009] The cached data is pushed to the first target object of the object storage device to be restored through a push operation.

[0010] In another possible implementation, before obtaining the bitmap from the data structure of the current recovery process, the method further includes:

[0011] If the current recovery process is not the first recovery process, obtaining a recovery identifier based on the data structure of the previous recovery process, the recovery identifier being used to indicate whether the previous recovery process completed data recovery of each of the first target objects;

[0012] If the restoration identifier indicates that the previous restoration process did not complete the data restoration for each first target object, a bitmap of the data structure of the previous restoration process is obtained and saved in the data structure of the current restoration process.

[0013] In another possible implementation, when a data recovery request is obtained, the method further includes:

[0014] Setting a global parameter to a first parameter, wherein the first parameter is used to indicate that cache data written to each second target object is stored in the memory;

[0015] For each cached data of the second target object, it is determined whether to release the cached data of the second target object in the memory based on the value of the bit corresponding to the first target object.

[0016] In another possible implementation, determining whether to release cached data of the second target object in the memory based on a value of a bit corresponding to the first target object includes:

[0017] If the value of the bit is the first value, the cached data of the second target object corresponding to the bit in the memory is not released;

[0018] If the value of the bit is a second value, the cached data of the second target object corresponding to the bit in the memory is released, and the second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

[0019] In another possible implementation, the method further includes:

[0020] If the value of each bit in the bitmap is the second value, setting the global parameter to the second parameter, where the second parameter is used to indicate the release of the cached data in the memory;

[0021] The recovery identifier is set to an identifier for indicating that the current recovery process has completed data recovery for each first target object.

[0022] In another possible implementation, before obtaining the bitmap of the data structure of the previous recovery process, the method further includes:

[0023] Adding a bitmap of the first target objects requiring data recovery to the data structure of the previous recovery process, wherein each first target object corresponds to one bit;

[0024] Initializing the value of the bit corresponding to each first target object in the bitmap to the first value;

[0025] For the first target object that has completed data recovery, the value of the bit corresponding to the first target object that has completed data recovery is set to a second value, where the second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

[0026] In another possible implementation, the method further includes:

[0027] When a stop recovery request is obtained, the global parameter is set as the second parameter.

[0028] On the other hand, the present application provides a full data recovery device, including a first acquisition module, a response module and a push module, wherein:

[0029] a first acquisition module configured to, upon receiving a data recovery request, obtain a bitmap from a data structure of a current recovery process and determine a value of a bit corresponding to a first target object of an object storage device to be recovered in the bitmap, wherein the data recovery request is used to indicate to the object storage device to be recovered that data recovery is required for the first target object corresponding to a second target object hit by a current write cache service, the first target object and the second target object being used to store the same data, and the second target object being located in an available object storage device;

[0030] a response module, configured to respond to the data recovery request and obtain cached data of the second target object from the memory through a pull operation when the value of the bit is a first value, wherein the first value is used to indicate that data recovery of the first target object is required;

[0031] The push module is configured to push the cache data to the first target object of the object storage device to be restored through a push operation.

[0032] In another possible implementation, the device further includes a second acquisition module and a storage module, wherein:

[0033] A second acquisition module is configured to acquire a recovery identifier based on a data structure of a previous recovery process when the current recovery process is not the first recovery process, the recovery identifier being used to indicate whether the previous recovery process completed data recovery of each of the first target objects;

[0034] The saving module is used to obtain the bitmap of the data structure of the previous recovery process and save it to the data structure of the current recovery process when the recovery identifier indicates that the previous recovery process did not complete the data recovery for each first target object.

[0035] In another possible implementation, the device further includes a first setting module and a determining module, wherein:

[0036] A first setting module, configured to set a global parameter to a first parameter, wherein the first parameter is used to indicate that cache data written to each second target object is stored in the memory;

[0037] The determination module is configured to determine, for each cached data of the second target object, based on the value of a bit corresponding to the first target object, whether to release the cached data of the second target object in the memory.

[0038] In another possible implementation, determining whether to release cached data of the second target object in the memory based on a value of a bit corresponding to the first target object includes:

[0039] If the value of the bit is the first value, the cached data of the second target object corresponding to the bit in the memory is not released;

[0040] If the value of the bit is a second value, the cached data of the second target object corresponding to the bit in the memory is released, and the second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

[0041] In another possible implementation, the device further includes a second setting module and a third setting module, wherein:

[0042] a second setting module, configured to set the global parameter to a second parameter when the value of each bit in the bitmap is the second value, wherein the second parameter is used to indicate the release of the cached data in the memory;

[0043] The third setting module is configured to set the recovery flag to a flag indicating that the current recovery process has completed data recovery for each first target object.

[0044] In another possible implementation, the device further includes an adding module, an initialization module, and a fourth setting module, wherein:

[0045] An adding module, configured to add a bitmap of a first target object requiring data recovery to the data structure of the previous recovery process, wherein each first target object corresponds to one bit;

[0046] An initialization module, configured to initialize the value of a bit corresponding to each first target object in the bitmap to the first value;

[0047] The fourth setting module is used to set the value of the bit corresponding to the first target object that has completed data recovery to a second value, where the second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

[0048] In another possible implementation, the device further includes a fifth setting module, wherein:

[0049] A fifth setting module is configured to set the global parameter to the second parameter when a stop recovery request is obtained.

[0050] In a third aspect, the present invention provides an electronic device, comprising:

[0051] at least one processor and memory;

[0052] The memory stores computer-executable instructions;

[0053] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the full data recovery method as described in any one of the first aspects above.

[0054] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the full data recovery method as described in any one of the first aspects above is implemented.

[0055] The present application provides a full data recovery method, device, electronic device and medium. When performing full data recovery in an application scenario with a fixed business model such as a video surveillance business, the data recovery is not performed in the order of object hash value sorting, but directly uses the valid data cached in the memory of the object hit by the current video write business to avoid pulling data from the available OSD, thereby accelerating the speed of data recovery of the entire Ceph cluster. At the same time, since the data recovery of each object is performed after the data to be written to the object is written to the memory, and there is a certain time interval between the object written by the video business and the next write, there is no conflict between the full data recovery process and the upper-level business read and write process. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0057] Figure 1 A schematic diagram of a full data recovery method provided in this application embodiment Figure 1 ;

[0058] Figure 2 A schematic diagram of a full data recovery method provided in this application embodiment Figure 2 ;

[0059] Figure 3 A schematic diagram of a full data recovery method provided in this application embodiment Figure 3 ;

[0060] Figure 4 A schematic diagram of the structure of a full data recovery device provided in an embodiment of the present application;

[0061] Figure 5 An electronic device is provided in an embodiment of the present application.

[0062] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0063] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0064] A Ceph cluster is composed of many independent object-based storage devices (OSDs) that can provide object storage services. Ceph ensures data reliability and loss prevention through multiple replicas and self-repair capabilities. Specifically, when given a piece of data, Ceph automatically stores multiple replicas in the background. When an OSD fails, the OSD exits service, and the data belonging to the OSD is reconstructed and redistributed to other available OSDs. After the OSD is repaired, the data on other available OSDs is migrated to the OSD to achieve data recovery.

[0065] Ceph has two data recovery methods: differential data recovery and full data recovery. Differential data recovery is only used to recover changed data. For data that cannot meet Ceph's high reliability requirements through differential data recovery, a full data recovery operation is required to perform a full copy of the data. Specifically, Ceph's full data recovery mechanism relies heavily on sorting all objects in a replica based on their full-precision hash values. The full data recovery process traverses all current objects in the available OSDs in ascending order of object hash values, and writes them sequentially to the OSD to be recovered through full object copies to complete data synchronization.

[0066] For video surveillance services that utilize a Ceph cluster, the logical volumes created by the upper layer are continuous block address spaces. After planning the video write bitrate, number of channels, and number of days, the surveillance device continuously writes data to the storage space from the logical starting address until the available space in the Ceph cluster is filled. Once the available space is filled within the planned number of days, the data is overwritten again from the logical starting address. For upper-layer services like video surveillance, when full data recovery is required, searching for the object data corresponding to each object to be recovered in the underlying available OSDs in the order in which each object was written is time-consuming and detrimental to improving the efficiency of the full data recovery process.

[0067] The present application provides a full data recovery method, device, electronic device and medium, which are used to optimize and enhance the full data recovery mechanism in the known technology for application scenarios with fixed business models such as video surveillance business, so as to improve the efficiency of the above application scenarios when performing full data recovery. Specifically, when performing full data recovery, the method of the present application does not perform data recovery in the order of object hash value sorting, but directly uses the valid data cached in the memory of the object hit by the current video write business to avoid pulling data from the available OSD, so as to speed up the data recovery speed of the entire Ceph cluster. At the same time, since the data recovery of each object is performed after the data that needs to be written to the object is written to the memory, and there is a certain time interval between the object written by the video business and the next write, there is no conflict between the full data recovery process and the upper-level business read and write process.

[0068] Figure 1 A schematic diagram of a full data recovery method provided in this application embodiment Figure 1 .like Figure 1 As shown, the method in this embodiment may include:

[0069] S101 : When a data recovery request is obtained, a bitmap is obtained from a data structure of a current recovery process, and a value of a bit corresponding to a first target object of an OSD to be recovered in the bitmap is determined.

[0070] The data recovery request is used to indicate that the OSD to be recovered needs to recover data on the first target object corresponding to the second target object hit by the current write cache service. The first target object and the second target object are used to store the same data, and the second target object is located in an available OSD.

[0071] Specifically, in this embodiment, when performing data recovery, the data corresponding to the second target object in the available OSD is restored to the first target object in the OSD to be recovered. The timing for performing data recovery on the first target object is: the write cache service hits the second target object corresponding to the first target object.

[0072] In this embodiment, the bitmap in the data structure of the current recovery process can be obtained based on the data structure of the previous recovery process, or it can be newly added during the current recovery process. As long as each first target object corresponds one-to-one to a bit in the bitmap, the value of the bit is used to indicate whether data recovery of the first target object is required.

[0073] S102: If the value of the bit is the first value, respond to the data recovery request and obtain the cached data of the second target object from the memory through a pull operation.

[0074] The first value is used to indicate that data recovery is required for the first target object.

[0075] Specifically, cached data of the second target object hit by the write cache service is cached in the memory. When the bit corresponding to the first target object indicates that data recovery of the first target object is required, the electronic device pulls the cached data of the second target object corresponding to the first target object from the memory through a pull operation (PullOp).

[0076] S103: Push the cached data to the first target object of the OSD to be restored through a push operation.

[0077] Specifically, after obtaining the cached data of the second target object, the electronic device pushes the cached data to the first target object of the OSD to be restored through a push operation (PushOperation, PushOp) to complete the data recovery of the first target object. At this time, the value of the bit corresponding to the first target object is used to indicate that the first target object does not need to be restored.

[0078] The method provided in this embodiment, upon receiving a data recovery request for restoring data for a first target object, first retrieves a bitmap from the data structure of the current recovery process to determine the value of the bit corresponding to the first target object. Next, when the value of the bit indicates that data recovery is required for the first target object, the cached data of the second target object corresponding to the first target object is pulled from memory via a PullOp operation. Finally, the cached data is pushed to the first target object of the OSD to be recovered via a PushOp operation, completing the data recovery of the first target object.

[0079] In the above process, when data recovery is needed for the first target object of the electronic device, the cached data of the second target object corresponding to the first target object is directly retrieved from memory and pushed to the first target object, thus completing the data recovery for the first target object. This saves the time required to traverse all objects in the available OSDs, which is required in the known technology, and improves data recovery efficiency. Furthermore, the above recovery process is performed after the cached data to be written to the second target object has been cached, which is less likely to cause conflicts between the recovery process and the upper-layer service read and write processes.

[0080] Figure 2 This is a schematic diagram of the process of a full data recovery method provided in an embodiment of the present application. Figure 2 The following is combined Figure 2 , the specific implementation process of the embodiment of the present application is described in detail. Specifically, based on the above embodiment, this embodiment describes in detail the method for determining the current recovery process bitmap.

[0081] like Figure 2 As shown, the method includes:

[0082] S201, when a data recovery request is obtained, it is determined whether the current recovery process is the first recovery process, if so, execute S202, otherwise execute S204.

[0083] S202 : Add a bitmap of a first target object requiring data recovery to the data structure of the current recovery process, and initialize the value of each bit corresponding to the first target object in the bitmap to a first value.

[0084] Specifically, each first target object corresponds to a bit, and the value of the bit determines whether the corresponding first target object needs to perform data recovery.

[0085] S203: For the first target object whose data has been recovered, set the value of the bit corresponding to the first target object whose data has been recovered to a second value.

[0086] The second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

[0087] In this embodiment, the 0 / 1 value of a bit determines whether the corresponding first target object needs to recover data. The first value can be 0 and the corresponding second value can be 1, or the first value can be 1 and the second value can be 0. This embodiment does not limit this, as long as the first value and the second value are inconsistent.

[0088] S204: Obtain the recovery identifier of the previous recovery process according to the data structure of the previous recovery process.

[0089] The recovery flag is used to indicate whether the previous recovery process has completed the data recovery of each first target object.

[0090] Specifically, in this embodiment, if the value of each bit in the bitmap included in the data structure of the previous recovery process is the second value, then the recovery flag is set to a flag indicating that the previous recovery process has completed data recovery for each first target object. Otherwise, the recovery flag is set to a flag indicating that the previous recovery process has not completed data recovery for each first target object.

[0091] S205: If the recovery identifier indicates that the previous recovery process did not complete the data recovery for each first target object, obtain a bitmap of the data structure of the previous recovery process and save it to the data structure of the current recovery process.

[0092] Specifically, the electronic device confirms, based on the recovery identifier, that the previous recovery process completed data recovery for all first target objects to be recovered. If the recovery identifier indicates that the previous recovery process did not complete data recovery for each first target object, the bitmap of the data structure of the previous recovery process is used to avoid repeated data recovery. If the recovery identifier indicates that the previous recovery process has completed data recovery for each first target object, a bitmap corresponding to each first target object requiring data recovery is added to the data structure of the current recovery process, and the value of each bit in the bitmap is initialized.

[0093] In the method provided by this embodiment, upon receiving a data recovery request, the electronic device first determines whether the current recovery process is the first recovery process. If so, a bitmap is directly added to the data structure of the current recovery process. If not, the recovery identifier of the previous recovery process is obtained. Based on the recovery identifier of the previous recovery process, it is determined whether data recovery was completed for each first target object requiring data recovery in the previous recovery process. If so, a bitmap is directly added to the data structure of the current recovery process. If not, the bitmap in the data structure of the previous recovery process is directly used.

[0094] In the above process, when the current recovery process is not the first recovery process, the bitmap in the previous recovery process can be used to avoid repeated recovery of the first target object requiring data recovery, thereby improving the overall data recovery efficiency.

[0095] Figure 3 A flow chart of a full data recovery method provided in an embodiment of the present application. Figure 3 , the specific implementation process of the embodiment of the present application is further described in detail. Specifically, this embodiment defines in detail the management method of cached data in the memory. Figure 3 As shown, the method may include:

[0096] S301: When a data recovery request is obtained, a global parameter is set as a first parameter.

[0097] The first parameter is used to instruct that the cache data written to each second target object be stored in the memory.

[0098] S302 : For each cached data of the second target object, if the value of the bit is the first value, the cached data of the second target object corresponding to the bit in the memory is not released.

[0099] S303: If the value of the bit is the second value, the cached data of the second target object corresponding to the bit in the memory is released.

[0100] The second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

[0101] Specifically, for each cached data of the second target object in the memory, when the value of the bit corresponding to the corresponding first target object is the first value, the electronic device does not release the cached data. When the value of the bit corresponding to the corresponding first target object is the second value, the electronic device releases the cached data in the memory.

[0102] S304: If the value of each bit in the bitmap is the second value, set the global parameter to the second parameter.

[0103] The second parameter is used to instruct to release the cached data in the memory.

[0104] Specifically, the value of each bit in the bitmap is the second value, indicating that there is no first target object that needs data recovery. At this time, the global parameter is set to the second parameter to indicate the release of cached data in the memory, thereby improving performance.

[0105] Optionally, when a stop recovery request is obtained, the global parameter is set as the second parameter.

[0106] Specifically, the stop recovery request is used to instruct to exit the current recovery process. At this time, the global parameter is set to the second parameter to instruct to release the cached data in the memory to improve performance.

[0107] S305: Set the recovery flag to a flag indicating that the current recovery process has completed data recovery for each first target object.

[0108] Specifically, if the value of each bit in the bitmap is the second value, it means that the current recovery process has completed data recovery for all first target objects. At this time, the recovery identifier needs to be modified to indicate that the current recovery process has completed data recovery for each first target object.

[0109] In the method provided by this embodiment, when the electronic device obtains a data recovery request, it sets the global parameter to the first parameter to indicate that the cached data written to each second target object will not be released for the current recovery process to pull. After the data recovery of a certain first target object is completed, that is, when the value of the bit corresponding to the first target object becomes the second value, the cached data of the second target object corresponding to the first target object in the memory is released separately to improve performance. When all first target objects in the current recovery process have completed data recovery, the global parameter is set to the second parameter to indicate that the cached data written to the second target object is released.

[0110] The above embodiment introduces a full data recovery method from the perspective of method flow, and the following embodiment introduces a full data recovery device from the perspective of a virtual module or virtual unit. Please refer to the following embodiment for details.

[0111] The embodiment of the present application provides a full data recovery device, such as Figure 4 As shown, the device includes a first acquisition module 41, a response module 42 and a push module 43, wherein:

[0112] A first acquisition module 41 is configured to, upon receiving a data recovery request, obtain a bitmap from a data structure of the current recovery process and determine a value of a bit corresponding to a first target object of the OSD to be recovered in the bitmap, wherein the data recovery request is used to indicate that the OSD to be recovered needs to recover data of a first target object corresponding to a second target object hit by the current write cache service, wherein the first target object and the second target object are used to store the same data, and the second target object is located in an available OSD;

[0113] a response module 42 configured to respond to the data recovery request by obtaining cached data of the second target object from the memory through a pull operation when the value of the bit is a first value, the first value being used to indicate that data recovery of the first target object is required;

[0114] The push module 43 is configured to push the cached data to the first target object of the OSD to be restored through a push operation.

[0115] In another possible implementation of the embodiment of the present application, the device further includes a second acquisition module and a storage module, wherein:

[0116] A second acquisition module is used to acquire a recovery identifier based on the data structure of the previous recovery process when the current recovery process is not the first recovery process, where the recovery identifier is used to indicate whether the previous recovery process completed the data recovery of each first target object;

[0117] The saving module is used to obtain a bitmap of the data structure of the previous recovery process and save it into the data structure of the current recovery process when the recovery identifier indicates that the previous recovery process did not complete the data recovery for each first target object.

[0118] In another possible implementation of the embodiment of the present application, the device further includes a first setting module and a determining module, wherein:

[0119] A first setting module is used to set the global parameter to a first parameter, where the first parameter is used to indicate that the cache data written to each second target object is stored in the memory;

[0120] The determination module is configured to determine, for each cached data of the second target object, based on the value of a bit corresponding to the first target object, whether to release the cached data of the second target object in the memory.

[0121] Another possible implementation of the embodiment of the present application is to determine whether to release cached data of the second target object in the memory based on the value of the bit corresponding to the first target object, including:

[0122] If the value of the bit is the first value, the cached data of the second target object corresponding to the bit in the memory is not released;

[0123] If the value of the bit is the second value, the cached data of the second target object corresponding to the bit in the memory is released, and the second value is used to indicate that the first target object corresponding to the bit does not need to recover data.

[0124] In another possible implementation of the embodiment of the present application, the device further includes a second setting module and a third setting module, wherein:

[0125] A second setting module is configured to set the global parameter to a second parameter when the value of each bit in the bitmap is the second value, the second parameter being used to indicate the release of cached data in the memory;

[0126] The third setting module is configured to set the recovery flag to an flag indicating that the current recovery process has completed data recovery for each first target object.

[0127] In another possible implementation of the embodiment of the present application, the device further includes an adding module, an initialization module, and a fourth setting module, wherein:

[0128] An adding module, configured to add a bitmap of a first target object requiring data recovery to the data structure of the previous recovery process, wherein each first target object corresponds to one bit;

[0129] An initialization module, configured to initialize the value of a bit corresponding to each first target object in the bitmap to a first value;

[0130] The fourth setting module is used to set the value of the bit corresponding to the first target object for which data recovery has been completed to a second value, where the second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

[0131] In another possible implementation of the embodiment of the present application, the device further includes a fifth setting module, wherein:

[0132] The fifth setting module is configured to set the global parameter to the second parameter when a stop recovery request is obtained.

[0133] In the embodiment of the present application, the first acquisition module 41 and the second acquisition module can be the same acquisition module or different acquisition modules; the first setting module 42, the second setting module, the third setting module, the fourth setting module and the fifth setting module can be the same setting module, partially the same setting modules, or completely different setting modules, which are not limited in the embodiment of the present application.

[0134] The embodiment of the present application provides a full data recovery device, which is applicable to the above method embodiment and will not be described in detail here.

[0135] An electronic device is provided in an embodiment of the present application, such as Figure 5 As shown, Figure 5 The electronic device shown includes a processor 51 and a memory 52. ​​The processor 51 and the memory 52 are connected, for example, via a bus 53. Optionally, the electronic device may further include a transceiver 54. It should be noted that in actual applications, the number of transceivers 54 is not limited to one, and the structure of the electronic device does not constitute a limitation on the embodiments of the present application.

[0136] The processor 51 can be a CPU (Central Processing Unit, central processing unit 51), a general-purpose processor 51, a DSP (Digital Signal Processor, data signal processor 51), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute the various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor 51 can also be a combination that implements computing functions, such as a combination of one or more microprocessors 51, a combination of a DSP and a microprocessor 51, etc.

[0137] The bus 53 may include a path for transmitting information between the above components. The bus 531002 may be a PCI (Peripheral Component Interconnect) bus 53 or an EISA (Extended Industry Standard Architecture) bus 53. The bus 53 may be divided into an address bus 53, a data bus 53, a control bus 53, etc. For ease of representation, Figure 5 Only one thick line is used in the figure, but it does not mean that there is only one bus 53 or one type of bus 53.

[0138] The memory 52 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0139] The memory 52 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 51. The processor 51 is used to execute the application code stored in the memory 52 to implement the content shown in the above method embodiment.

[0140] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers and the like are also possible. Figure 5 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0141] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.

[0142] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the claims.

[0143] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A full data recovery method, characterized in that: include: When a data recovery request is obtained, a bitmap is obtained from the data structure of the current recovery process, and a value of a bit corresponding to a first target object of the object storage device to be recovered in the bitmap is determined, wherein the data recovery request is used to indicate that the object storage device to be recovered needs to recover data of the first target object corresponding to the second target object hit by the current write cache service, the first target object and the second target object are used to store the same data, and the second target object is located in an available object storage device; If the value of the bit is a first value, responding to the data recovery request, obtaining cached data of the second target object from the memory through a pull operation, the first value being used to indicate that data recovery of the first target object is required; Pushing the cached data to the first target object of the object storage device to be restored through a push operation; Before obtaining the bitmap from the data structure of the current recovery process, the method further includes: If the current recovery process is not the first recovery process, obtaining a recovery identifier based on the data structure of the previous recovery process, the recovery identifier being used to indicate whether the previous recovery process completed data recovery of each of the first target objects; If the recovery identifier indicates that the previous recovery process did not complete the data recovery for each of the first target objects, obtaining a bitmap of the data structure of the previous recovery process and saving it to the data structure of the current recovery process; When a data recovery request is received, the method further includes: Setting a global parameter to a first parameter, wherein the first parameter is used to indicate that cache data written to each second target object is stored in the memory; For each cached data of the second target object, it is determined whether to release the cached data of the second target object in the memory based on the value of the bit corresponding to the first target object.

2. The method according to claim 1, characterized in that The determining, based on the value of the bit corresponding to the first target object, whether to release the cached data of the second target object in the memory includes: If the value of the bit is the first value, the cached data of the second target object corresponding to the bit in the memory is not released; If the value of the bit is a second value, the cached data of the second target object corresponding to the bit in the memory is released, and the second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

3. The method according to claim 2, characterized in that The method further comprises: If the value of each bit in the bitmap is the second value, setting the global parameter to the second parameter, where the second parameter is used to indicate the release of the cached data in the memory; The recovery identifier is set to an identifier for indicating that the current recovery process has completed data recovery for each first target object.

4. The method according to claim 1 or 2, characterized in that Before obtaining the bitmap of the data structure of the previous recovery process, the method further includes: Adding a bitmap of the first target objects requiring data recovery to the data structure of the previous recovery process, wherein each first target object corresponds to one bit; Initializing the value of the bit corresponding to each first target object in the bitmap to the first value; For the first target object that has completed data recovery, the value of the bit corresponding to the first target object that has completed data recovery is set to a second value, where the second value is used to indicate that the first target object corresponding to the bit does not need data recovery.

5. The method according to claim 3, characterized in that The method further comprises: When a stop recovery request is obtained, the global parameter is set as the second parameter.

6. A full data recovery device, characterized in that: include: a first acquisition module configured to, upon receiving a data recovery request, obtain a bitmap from a data structure of a current recovery process and determine a value of a bit corresponding to a first target object of an object storage device to be recovered in the bitmap, wherein the data recovery request is used to indicate to the object storage device to be recovered that data recovery is required for the first target object corresponding to a second target object hit by a current write cache service, the first target object and the second target object being used to store the same data, and the second target object being located in an available object storage device; a response module, configured to respond to the data recovery request and obtain cached data of the second target object from the memory through a pull operation when the value of the bit is a first value, wherein the first value is used to indicate that data recovery of the first target object is required; A push module, configured to push the cached data to the first target object of the OSD to be restored through a push operation; The apparatus further includes a second acquisition module and a storage module, wherein the second acquisition module is configured to acquire a recovery identifier based on a data structure of a previous recovery process when the current recovery process is not the first recovery process, the recovery identifier being configured to indicate whether the previous recovery process completed data recovery of each of the first target objects; The saving module is configured to obtain a bitmap of the data structure of the previous recovery process and save it to the data structure of the current recovery process when the recovery identifier indicates that the previous recovery process did not complete the data recovery for each first target object; The device further includes a first setting module and a determining module, wherein the first setting module is used to set the global parameter to a first parameter, and the first parameter is used to indicate that the cache data written to each second target object is stored in the memory; The determination module is configured to determine, for each cached data of the second target object, based on a value of a bit corresponding to the first target object, whether to release the cached data of the second target object in the memory.

7. An electronic device, characterized in that: It includes: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are used to: execute the full data recovery method according to any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the full data recovery method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Data recovery method and device and computer readable storage medium

    CN111078465A

  • Data recovery method and device, equipment and storage medium

    CN112925672A