Metadata backup method and apparatus, electronic device, and storage medium
By obtaining and backing up the metadata of stored files in the mechanical hard disk in advance, the problem of metadata backup consuming disk IO capacity is solved, and the performance of the backup service and data recovery efficiency are improved.
Patent Information
- Application Number
- PCT/CN2024/085590
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-10
- Filing Date
- 2024-04-02
- Publication Date
- 2024-10-17
AI Technical Summary
In mechanical hard disks, metadata backup consumes a lot of disk IO capabilities, which affects the performance of the backup service. Especially when the storage space is large and the IO capabilities do not change much, the timeliness of data recovery is affected.
When receiving a preset operation for a storage file, obtain and back up the metadata of the storage file in advance, including closing, deletion and data verification operations after the write operation, ensuring that the metadata is processed in the kernel memory to avoid additional Disk IO consumption.
It reduces the cost of metadata backup, improves the availability and performance of backup services, reduces dependence on disk IO, and improves the efficiency of data recovery.
Smart Images

Figure CN2024085590_17102024_PF_FP_ABST
Abstract
Description
Metadata backup method, device, electronic device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 10, 2023, with application number CN202310377190.8 and invention name “Metadata backup method, device, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the technical field of data storage, and in particular to a metadata backup method, device, electronic device, and storage medium. Background Art
[0003] Storage services must ensure that stored data is not lost or lost. In real-world data storage, data recovery is often required due to various reasons, such as accidental file deletion caused by storage system software failures, accidental file deletion due to maintenance operations, file system corruption, or user error. To ensure data is not lost, storage systems must recover these accidentally deleted files.
[0004] For solid-state drives (SSDs), full disk scans are used to ensure the integrity of stored data. However, for hard disk drives (HDDs), whose storage space is increasing but whose input / output (IO) capabilities remain relatively constant, full disk scans take weeks to complete, severely impacting the timeliness of storage service recovery. To speed up data recovery, it is necessary to back up the metadata of files stored on the HDD. However, commonly used metadata backup solutions require reading files stored on the HDD, consuming a significant amount of disk IO capacity and impacting the performance of backup services.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a metadata backup method, device, electronic device, and storage medium to avoid consuming too much disk IO capacity and improve the performance of backup services.
[0007] In a first aspect, an embodiment of the present application provides a metadata backup method, the method comprising: upon receiving a preset operation for a storage file, before responding to the preset operation, obtaining the metadata of the storage file and backing up the metadata; wherein the preset operation includes any one of the following: after performing a data writing operation on the storage file, closing the storage file after the writing operation; deleting the storage file; and performing data verification on the storage file.
[0008] In a second aspect, an embodiment of the present application provides a metadata backup device, which includes: an acquisition module for acquiring the metadata of a storage file before responding to a preset operation for the storage file when a preset operation for the storage file is received; a backup module for backing up the metadata; wherein the preset operation includes any one of the following: after performing a data writing operation on the storage file, closing the storage file after the writing operation; deleting the storage file; and performing data verification on the storage file.
[0009] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the above methods when executing the computer program.
[0010] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above methods is implemented.
[0011] Compared with the prior art, this application has the following advantages:
[0012] The present application provides a metadata backup method, device, electronic device, and storage medium. When a preset operation for a storage file is received, metadata of the storage file is obtained and backed up before responding to the preset operation. The preset operation includes any of the following: after performing a data write operation on the storage file, closing the storage file after the write operation; deleting the storage file; and performing data verification on the storage file. In this embodiment, when a preset operation for a storage file is received, the operation is intercepted, metadata is obtained, and backed up. The storage file after the write operation is closed, and data verification is performed on the storage file. Before these operations, the metadata is still in the kernel memory. At this time, obtaining the metadata does not consume the disk's IO capacity. For the operation of deleting the storage file, the deletion operation itself also requires loading metadata. Therefore, obtaining metadata before deleting the storage file is a warm-up operation and does not increase the number of disk IO operations, thereby reducing the overhead of metadata backup and improving the availability of the backup service.
[0013] The above description is only an overview of the technical solution of this application. In order to more clearly understand the technical means of this application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of this application more obvious and easy to understand, the specific implementation methods of this application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to the present application and should not be regarded as limiting the scope of the present application.
[0015] FIG1 is a schematic diagram of an application scenario provided by this application;
[0016] FIG2 is a flowchart of a metadata backup method according to an embodiment of the present application;
[0017] FIG3 is a structural block diagram of a metadata backup device according to an embodiment of the present application;
[0018] FIG4 is a block diagram of an electronic device used to implement an embodiment of the present application. DETAILED DESCRIPTION
[0019] Hereinafter, only certain exemplary embodiments are briefly described. As will be appreciated by those skilled in the art, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and description are to be regarded as illustrative in nature and not restrictive.
[0020] To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and all of them fall within the scope of protection of the embodiments of the present application.
[0021] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0022] Figure 1 is a schematic diagram of an application scenario for the technical solution of this application. As shown in Figure 1, in this embodiment, metadata backup is accomplished through two channels: the data service and the metadata service. In storage services, the data service is responsible for writing data and is the foundation of the storage system. User data is written to the HDD through this service. In this embodiment, at key points where data is modified, the metadata backup engine is called to complete metadata backup.
[0023] In the data service channel, after writing data to a storage file, before closing the storage file after the write operation (as shown in "Before closing the write-open file" in Figure 1), before deleting the storage file (as shown in "Before deleting the file" in Figure 1), and before verifying the data on the storage file (as shown in "Before verifying the data" in Figure 1), the above operations are intercepted, and the metadata backup engine is used to obtain metadata through the standard application programming interface provided by the operating system, and the obtained metadata is persisted to the metadata backup warehouse. In other words, when performing the corresponding operation task, metadata backup of a single task does not require a full disk scan to read data, nor does it require reading files on the disk. Before closing the storage file after the write operation and verifying the data on the storage file, the metadata is still in the memory, and obtaining the metadata at this time will not consume the disk's IO capacity; for the operation of deleting the storage file, the deletion operation also requires loading metadata. Therefore, obtaining metadata before deleting the storage file is a warm-up operation and will not increase the number of disk IO operations.
[0024] In actual operation, the data service may suddenly fail or exit abnormally at a certain moment, resulting in the metadata of some files not being backed up normally. In this case, the metadata service channel is needed to check for missing files. Regularly obtain the valid file list and metadata of valid files on the disk, and load the backed-up metadata obtained from the metadata backup warehouse. Compare the metadata of valid files with the backed-up metadata, including file name, creation time, and index node identification file length. Compare them separately to obtain the incremental file list. If the metadata of the files in the incremental file list is metadata that has not been backed up, obtain the metadata of the files in the incremental file list and back up the metadata of the files in the incremental file list to the metadata backup warehouse.
[0025] In related technologies, data loss or errors are avoided by scanning files or backing up the file system metadata area and journal area. These two processing methods inevitably require reading data on the HDD, thereby consuming disk IO capacity and affecting service performance.
[0026] Another related technology, to reduce disk IO operations, achieves metadata backup by enhancing the kernel. For example, kernel modules and other solutions can be used to enhance kernel functionality. When a file's metadata is modified within the kernel, the modified file's metadata is persisted, thereby completing the backup. However, this solution requires kernel-mode modifications, which places high demands on development and can introduce faults, potentially causing system crashes. Furthermore, with kernel version changes and iterations, uncontrollable adaptation risks are introduced. Therefore, kernels with different architectures, versions, and compilation options must be adapted, which is a significant workload and carries high stability risks. If a failure in a related function causes kernel problems, this can lead to downtime and even data loss.
[0027] This embodiment backs up metadata at key nodes in the service process, followed by a metadata backup service to detect and address any gaps. This approach ensures that the corresponding metadata is still in kernel memory, thus avoiding additional disk I / O operations. Furthermore, the application programming interface (API) supported by the operating system does not require kernel adaptation, thus avoiding the risk of kernel incompatibility.
[0028] The present application provides a metadata backup method. The method in this embodiment can be applied to a computing device, which may include a server, a user terminal, etc. FIG2 is a flowchart of the metadata backup method in one embodiment of the present application. The method includes:
[0029] Step S201: upon receiving a preset operation for a storage file, obtaining metadata of the storage file before responding to the preset operation.
[0030] Step S202: back up the metadata.
[0031] The preset operation includes any one of the following: after performing a data writing operation on the storage file, closing the storage file after the writing operation; deleting the storage file; and performing data verification on the storage file.
[0032] The method in this embodiment is applicable to any storage system, not limited to HDD, SSD, etc.
[0033] In this embodiment, when a preset operation for a storage file is received, before processing the preset operation, the preset operation is intercepted, the metadata of the storage file corresponding to the preset operation is obtained and backed up, and then the preset operation is processed again, and the closing operation, deletion operation or data verification operation is continued.
[0034] Among them, metadata, also known as intermediary data or relay data, is data that describes data, mainly information that describes data attributes, and is used to support functions such as indicating storage location, historical data, resource search, and file records.
[0035] Exemplarily, the metadata includes at least one of the following: file name, file length, creation time, inode identifier, and storage location information. The inode identifier may be an inode number, etc. The storage location information may be extent information, where an extent is defined by the starting block plus the length.
[0036] Files are stored on a hard drive, whose smallest storage unit is a sector. Each sector holds 512 bytes. When the operating system reads data from the hard drive, it doesn't read sectors one by one, but rather reads multiple sectors at once, often in blocks. This block of sectors is the smallest unit of file access. For example, a block can be 4KB in size, meaning eight consecutive sectors make up a block. File data is stored in blocks. The area storing metadata is called an inode.
[0037] On HDD disks, to better utilize the performance of HDD disks, the storage service tries to write files in large blocks. After the file is written, the Ops (Operations, the maximum number of switches (or actions) per minute) called for the close operation will be relatively low. At this time, the Ops (Operations) of the metadata backup operation will also be reduced accordingly.
[0038] When a file is deleted from the file system, its metadata is released. Crucial information for data recovery is the file's location on the disk. If these locations haven't been overwritten, the storage service can reassemble the disk data into the original user file. To enhance system data reliability and increase the likelihood of data recovery, metadata is backed up before file deletion.
[0039] The purpose of data verification is to detect silent errors on the HDD disk. When data verification is running, the data will be read from the disk and checked for integrity and consistency. Before the data verification is completed, the metadata of the verified file will be backed up.
[0040] The metadata backup method provided in an embodiment of the present application, upon receiving a preset operation for a storage file, obtains the metadata of the storage file and backs up the metadata before responding to the preset operation; wherein the preset operation includes any one of the following: after performing a data writing operation on the storage file, closing the storage file after the writing operation; deleting the storage file; performing data verification on the storage file. In this embodiment, upon receiving a preset operation for a storage file, the operation is intercepted, metadata is obtained and backed up, wherein the storage file after the writing operation is closed and the storage file is verified. Before these operations, the metadata is still in the kernel memory, and obtaining the metadata at this time does not consume the disk's IO capacity; for the operation of deleting the storage file, the deletion operation itself also requires loading the metadata. Therefore, obtaining the metadata before deleting the storage file is a warm-up operation, which does not increase the number of disk IO times, thereby reducing the overhead of metadata backup and improving the availability of the backup service.
[0041] The specific method of obtaining metadata is shown in the following embodiment:
[0042] In one implementation, in step S201 , obtaining metadata of the storage file includes: obtaining metadata of the storage file through an application programming interface provided by an operating system.
[0043] In the file system, the operating system obtains key information in the file metadata through the stat interface: file name, file length, creation / modification time, inode identifier, etc. The storage location information in the metadata is obtained through the fiemap interface.
[0044] In this embodiment, metadata information of the file is obtained through the application programming interface provided by the operating system to complete data backup. No kernel adaptation is required, which can avoid the risk of system crash due to kernel incompatibility.
[0045] In one implementation, the method further includes: obtaining metadata of valid storage files in the storage service according to a preset time period, and comparing the metadata of the valid storage files with the backed-up metadata; if the metadata of the valid storage files does not match the backed-up metadata, backing up the metadata of the unmatched storage files.
[0046] In actual operation, the data service may suddenly fail or exit abnormally at some point, resulting in the metadata of some files not being backed up normally. In this case, the metadata service channel is needed to check for missing files. The metadata of valid storage files in the storage service is regularly obtained and compared with the backed-up metadata. If the metadata matches, the file has not been modified and does not need to be backed up again. If it does not match, it means that the file has been modified since the last backup, and an incremental backup needs to be triggered for correction. Among them, the valid storage file can be a file that meets the preset requirements, including format requirements, time requirements, etc.
[0047] In one implementation, the metadata of the valid storage file does not match the backed-up metadata, including that the metadata of the valid storage file does not match at least one of the file name, file length, creation time, and index node identifier in the backed-up metadata.
[0048] In one example, if the key information (file name, file length, creation time, inode identifier) in the metadata of a valid stored file completely matches the key information in the backed-up metadata, the metadata of this file is considered to match the backed-up metadata, and no metadata modification has occurred, so no backup is required. If they do not match, it indicates that metadata modification has occurred, and the storage location information needs to be re-read for backup.
[0049] In one implementation, metadata of valid storage files in a storage service is obtained according to a preset time period, including: communicating with the storage service through a remote procedure call or reading a checkpoint file of the storage service according to the preset time period to obtain metadata of valid storage files in the storage service.
[0050] In actual applications, the file list of valid storage files in the storage service and the file name, file length, creation time, index node identifier, etc. in the metadata are obtained through Remote Procedure Call (RPC) or checkpoint files. Obtaining this information through RPC does not require disk IO. The data that needs to be read through checkpoint files is relatively small and concentrated, so there is no loss in the IO performance of the HDD disk.
[0051] In one implementation, backing up the metadata includes: utilizing a metadata backup engine to persist the metadata in a backup database.
[0052] Data backup is the foundation of disaster recovery. It refers to the process of copying all or part of a data set from the application host's hard drive or array to other storage media to prevent data loss due to operational errors or system failures. During data backup, the data backup engine is started and the metadata to be backed up is persisted in the backup database.
[0053] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a metadata backup device, which is applied to a client of an access platform. Figure 3 is a structural block diagram of the metadata backup device of an embodiment of the present application. The device includes: an acquisition module 301, which is used to obtain the metadata of the storage file before responding to the preset operation when a preset operation for the storage file is received; a backup module 302, which is used to back up the metadata; wherein the preset operation includes any one of the following: after performing a data writing operation on the storage file, closing the storage file after the writing operation; deleting the storage file; and performing data verification on the storage file.
[0054] The metadata backup device provided in an embodiment of the present application, upon receiving a preset operation for a storage file, obtains the metadata of the storage file and backs up the metadata before responding to the preset operation; wherein the preset operation includes any one of the following: after performing a data writing operation on the storage file, closing the storage file after the writing operation; deleting the storage file; performing data verification on the storage file. In this embodiment, upon receiving a preset operation for a storage file, the operation is intercepted, metadata is obtained and backed up, wherein the storage file after the writing operation is closed, and data verification is performed on the storage file. Before these operations, the metadata is still in the kernel memory, and obtaining the metadata at this time does not consume the disk's IO capacity; for the operation of deleting the storage file, the deletion operation itself also needs to load the metadata. Therefore, obtaining the metadata before deleting the storage file is a warm-up operation, which does not increase the number of disk IO times, thereby reducing the overhead of metadata backup and improving the availability of the backup service.
[0055] In one implementation, when acquiring the metadata of a storage file, the acquisition module 301 is configured to: acquire the metadata of the storage file through an application programming interface provided by the operating system.
[0056] In one implementation, the apparatus further includes a comparison module configured to: obtain metadata of valid storage files in the storage service according to a preset time period, and compare the metadata of the valid storage files with the backed-up metadata;
[0057] If the metadata of the valid storage file does not match the backed-up metadata, the metadata of the mismatched storage file is backed up.
[0058] In one implementation, the metadata of the valid storage file does not match the backed-up metadata, including that the metadata of the valid storage file does not match at least one of the file name, file length, creation time, and index node identifier in the backed-up metadata.
[0059] In one implementation, when the comparison module obtains the metadata of the valid storage files stored according to a preset time period, it is used to: communicate with the storage service through a remote procedure call or read the checkpoint file of the storage service according to the preset time period to obtain the metadata of the valid storage files in the storage service.
[0060] In one implementation, the backup module 302 is configured to: utilize a metadata backup engine to persist metadata into a backup database.
[0061] In one implementation, the metadata includes at least one of the following: file name, file length, creation time, index node identifier, and storage location information.
[0062] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.
[0063] Figure 4 is a block diagram of an electronic device used to implement embodiments of the present application. As shown in Figure 4 , the electronic device includes a memory 410 and a processor 420. Memory 410 stores a computer program that can be executed on processor 420. Processor 420 executes the computer program to implement the methods described in the above embodiments. There can be one or more memory 410 and processor 420.
[0064] The electronic device further includes a communication interface 430 for communicating with external devices and performing data exchange transmission.
[0065] If the memory 410, processor 420, and communication interface 430 are implemented independently, the memory 410, processor 420, and communication interface 430 can be interconnected via a bus and communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG4 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0066] Optionally, in a specific implementation, if the memory 410, the processor 420 and the communication interface 430 are integrated on a chip, the memory 410, the processor 420 and the communication interface 430 can communicate with each other through an internal interface.
[0067] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.
[0068] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided in the embodiment of the present application.
[0069] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory. The input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0070] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced RISC Machines (ARM) architecture.
[0071] Furthermore, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct RAM bus random access memory (DR RAM).
[0072] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0073] In the description of this specification, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.
[0074] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.
[0075] Any process or method described in the flowchart or otherwise described herein can be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process. The scope of the preferred embodiments of the present application includes other implementations in which the functions may be performed in a different order than shown or discussed, including performing the functions substantially simultaneously or in reverse order depending on the functions involved.
[0076] The logic and / or steps described in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with such instruction execution systems, apparatuses or devices.
[0077] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0078] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the aforementioned integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, or an optical disk, etc.
[0079] The above is merely an exemplary embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various modifications or substitutions within the technical scope described in this application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A metadata backup method, characterized in that: The method comprises: In case of receiving a preset operation for a storage file, before responding to the preset operation, obtaining metadata of the storage file and backing up the metadata; The preset operation includes any of the following: After performing a data writing operation on the storage file, performing a closing operation on the storage file after the writing operation; Deleting the stored file; Perform data verification on the storage file.
2. The method according to claim 1, characterized in that The obtaining of metadata of the storage file includes: The metadata of the storage file is obtained through an application programming interface provided by the operating system.
3. The method according to claim 1, characterized in that The method further comprises: Obtaining metadata of valid storage files in the storage service according to a preset time period, and comparing the metadata of the valid storage files with the backed-up metadata; If the metadata of the valid storage file does not match the backed-up metadata, the metadata of the unmatched storage file is backed up.
4. The method according to claim 3, characterized in that The metadata of the valid storage file does not match the backed-up metadata, which includes that the metadata of the valid storage file does not match at least one of the file name, file length, creation time, and index node identifier in the backed-up metadata.
5. The method according to claim 3, characterized in that: The step of acquiring metadata of valid stored files stored according to a preset time period includes: The system communicates with the storage service through remote procedure calls or reads the checkpoint files of the storage service according to a preset time period to obtain metadata of valid storage files in the storage service.
6. The method according to claim 1, characterized in that The step of backing up the metadata includes: The metadata is persisted in a backup database using a metadata backup engine.
7. The method according to any one of claims 1 to 6, characterized in that: The metadata includes at least one of the following: File name, file length, creation time, index node identifier, and storage location information.
8. A metadata backup device, characterized in that: The device comprises: An acquisition module, configured to, upon receiving a preset operation for a storage file, acquire metadata of the storage file before responding to the preset operation; A backup module, used for backing up the metadata; The preset operation includes any of the following: After performing a data writing operation on the storage file, performing a closing operation on the storage file after the writing operation; Deleting the stored file; Perform data verification on the storage file.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
SSD storage method, device and system based on data characteristics
CN108664218A
Data writing method and device based on True CDP and medium
CN112130760A
Method, system and equipment for backing up hot data of massive small files and medium
CN112988474A
Effective data backup method, device and equipment for Windows operating system and storage medium
CN114924911A
Metadata backup method and device, electronic equipment and storage medium
CN116401096A
Cited By
Unmanned aerial vehicle remote sensing data processing method and system, electronic equipment and storage medium
CN122653550A
