WO2022042514A1 - Metadata synchronization method and apparatus - Google Patents

Metadata synchronization method and apparatus Download PDF

Info

Publication number
WO2022042514A1
WO2022042514A1 PCT/CN2021/114190 CN2021114190W WO2022042514A1 WO 2022042514 A1 WO2022042514 A1 WO 2022042514A1 CN 2021114190 W CN2021114190 W CN 2021114190W WO 2022042514 A1 WO2022042514 A1 WO 2022042514A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
operation log
metadata
stored
identifier
Prior art date
Application number
PCT/CN2021/114190
Other languages
French (fr)
Chinese (zh)
Inventor
德语心
彭勇
王英
李浩然
冯阳
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022042514A1 publication Critical patent/WO2022042514A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support

Definitions

  • the present application relates to the technical field of data storage, and in particular, to a method and device for synchronization of metadata.
  • file system There are generally two types of data storage systems: file system and object system.
  • File systems and object systems can be oriented to different users.
  • the file system and the object system need to provide the same file service to the user, that is, a certain file can be read through the file system or through the object system.
  • the contents of the files stored in the file system and the object system are the same, but both the storage space of the file system and the storage space of the object system are occupied, which is a waste of storage resources.
  • the embodiments of the present application provide a method and apparatus for synchronizing metadata.
  • the technical solution is as follows:
  • a metadata synchronization method is provided, the method is applied to a file system, and the method includes:
  • a trigger event for metadata synchronization occurs, and at least one pending operation log is obtained from the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the
  • the metadata of the file generated after the file system performs an operation on the file the metadata includes the storage address information of the file in the file system, and the file identifier and parent directory corresponding to each file corresponding to at least one operation log to be processed are sent to the target system. ID and metadata, so that the object system stores the file ID, parent directory ID, and metadata of each file received correspondingly.
  • the file system may store an operation log, and the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and after the file system performs an operation on the file Metadata for the generated file.
  • the file system can send the file identifier, parent directory identifier, and metadata recorded in the pending operation log to the object system, and the object system can compare the file identifier, parent directory identifier, metadata, and metadata of the file to the object system. Data is stored accordingly.
  • the metadata includes the storage address information of the file in the file system. In this way, the object system does not need to store the file itself. When the user has a file acquisition requirement, he only needs to acquire the file according to the storage address information of the stored file. , which effectively saves the storage resources of the object system.
  • the method further includes:
  • the operation log to be processed after the operation log to be processed is obtained, it can be deleted from the disk, so as to save storage space and avoid repeated acquisition of an operation log.
  • the determining that a trigger event for metadata synchronization occurs includes:
  • the obtaining at least one pending operation log that satisfies the processing condition in the stored operation log includes:
  • the operation log further records the operation time of the file system on the file
  • the determining that a trigger event for metadata synchronization occurs includes:
  • the obtaining at least one pending operation log in the stored operation log includes:
  • the metadata in the object system can be synchronized to a specified time according to user requirements.
  • the determining that a trigger event for metadata synchronization occurs includes:
  • the obtaining at least one pending operation log in the stored operation log includes:
  • the operation logs to be processed can be obtained periodically, so that the operation logs will not accumulate too much, and the metadata in the file system and the object system will not differ too much.
  • the method further includes:
  • a corresponding first operation log is generated, the parent directory identifier of the first file recorded in the first operation log is obtained, and the first bloom filter corresponding to the current storage period is obtained, recording the parent directory identifier of the first file in the first bloom filter, and storing the first file in the first operation log storage area corresponding to the first bloom filter;
  • the determining that a trigger event for metadata synchronization occurs includes:
  • the obtaining at least one pending operation log in the stored operation log includes:
  • the file system may use a Bloom filter to record the parent directory identifier in the stored operation log.
  • the metadata in all the stored operation logs may not be synchronized, but only the metadata in part of the operation logs can be synchronized, which can effectively save bandwidth.
  • the method further includes:
  • all the values of the array in the bloom filter corresponding to the corresponding operation log storage area can be set to 0, so that the bloom filter can be used cyclically in the future .
  • the method further includes:
  • the object system may query the metadata of the target file to determine the storage address of the target file, and then obtain the target file from the file system.
  • a metadata synchronization method is provided, the method is applied to an object system, and the method includes:
  • the received file identifier, parent directory identifier, and metadata of the file are stored correspondingly.
  • the method further includes:
  • an apparatus for metadata storage and synchronization is provided, the apparatus is applied to a file system, and the apparatus includes:
  • a determination module used to determine the occurrence of a trigger event for metadata synchronization
  • the acquisition module is used to acquire at least one pending operation log in the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and metadata of the file generated after the file system performs an operation on the file, the metadata includes storage address information of the file in the file system;
  • a sending module configured to send the file identifier, parent directory identifier and metadata corresponding to each file corresponding to the at least one operation log to be processed to the object system, so that the object system can identify the received file identifier of each file , parent directory ID, and metadata are stored accordingly.
  • the device also includes a deletion module for:
  • the determining module is used for:
  • the acquisition module is used for:
  • the operation log further records the operation time of the file system on the file
  • the determining module is used for:
  • the acquisition module is used for:
  • the determining module is used for:
  • the acquisition module is used for:
  • the apparatus further includes a generating module for:
  • the determining module is used for:
  • the acquisition module is used for:
  • the apparatus further includes:
  • the setting module is configured to set all the values in the Bloom filter corresponding to the storage area corresponding to the operation log to be processed to 0.
  • the apparatus further includes a receiving module for:
  • the third file is sent to the subject system.
  • an apparatus for metadata synchronization is provided, the apparatus is applied to an object system, and the apparatus includes a receiving module for:
  • the storage module is used for correspondingly storing the received file identifier, parent directory identifier and metadata of the file.
  • the apparatus further includes a reading module for:
  • a file system in a fifth aspect, includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to achieve the above-mentioned first The method of metadata synchronization described in the aspect.
  • an object system in a sixth aspect, includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the second aspect above. method for metadata synchronization described above.
  • a computer-readable storage medium comprising instructions, when the computer-readable storage medium runs on a file system, the file system is caused to perform the method for synchronizing metadata in the first aspect.
  • An eighth aspect a computer-readable storage medium, characterized by comprising instructions, when the computer-readable storage medium runs on an object system, causing the file system to perform the metadata synchronization described in the second aspect above Methods.
  • the file system may store an operation log, and the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the metadata of the file generated after the file system performs an operation on the file. data.
  • the file system can send the file identifier, parent directory identifier, and metadata of the file recorded in the operation log to be processed to the object system, and the object system can verify the file identifier and parent directory identifier of the file. , metadata corresponding to storage.
  • the metadata includes the storage address information of the file in the file system. In this way, the object system does not need to store the file itself. When the user has a file acquisition requirement, he only needs to acquire the file according to the storage address information of the stored file. , which effectively saves the storage resources of the object system.
  • FIG. 1 is an implementation scenario diagram provided by an embodiment of the present application
  • FIG. 2 is a flowchart of a method for synchronizing metadata provided by an embodiment of the present application
  • FIG. 3 is a flowchart of a method for reading a file provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an apparatus for metadata synchronization provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an apparatus for metadata synchronization provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a file system provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an object system provided by an embodiment of the present application.
  • the embodiment of the present application provides a method for synchronizing metadata, and the method can be jointly implemented by a file system and an object system.
  • the file system will generate a corresponding operation log when performing an operation on a file, and store the operation log. That is, in the embodiment of the present application, the file system may store operation logs in addition to files and metadata.
  • the metadata of the file after the operation is completed can be recorded in the operation log.
  • the file system is triggered to write the metadata in the operation log into the object system, so that the metadata in the object system and the file system are consistent.
  • Step 201 The file system determines a trigger event for metadata synchronization to occur.
  • the user can operate the specified file in the file system through the terminal.
  • the corresponding operation logs can be generated and stored.
  • the generated operation log can be stored on disk.
  • the operation log may record the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the metadata of the file generated after the file system performs an operation on the file.
  • Metadata can record file attribute information, such as creation time, modification time, owner, read and write permissions, and storage address information.
  • the storage address information indicates the storage location of the file in the file system.
  • the operation type and the like may also be recorded in the operation log.
  • the operation type may include create, delete, modify, and so on.
  • a trigger event for metadata synchronization In order to keep the metadata of the files stored in the object system consistent with the metadata of the files stored in the file system, you can set a trigger event for metadata synchronization. Data is synchronized to the target system. Specifically, there may be various trigger events for metadata synchronization. Several possible trigger events are listed below.
  • the preset metadata synchronization period is reached.
  • the user can directly send a metadata synchronization request to the file system through the terminal, so as to trigger the file system to perform metadata synchronization processing.
  • the object system may first send a metadata synchronization request to the file system, so as to trigger the file system to perform metadata synchronization processing.
  • Step 202 Acquire at least one pending operation log from the stored operation log.
  • all stored operation logs may be used as pending operation logs.
  • the operation log when the operation log is stored, the operation log may be recorded in combination with a Bloom Filter. Therefore, when acquiring the log to be processed, it is not necessary to acquire all the stored operation logs.
  • the specific processing can be as follows:
  • BloomFilter is essentially a data structure consisting of a very long array and multiple hash functions.
  • each hash function in the BloomFilter can be used to calculate a hash value of the element.
  • the corresponding position in the BloomFilter array can be disposed of by 1.
  • you need to query whether an element is recorded in the BloomFilter you must first use each hash function in the BloomFilter to calculate a hash value of the element, and then query the BloomFilter array with the hash value. Whether the corresponding position is 1, if it is all 1, it means that the BloomFilter may have recorded the element, if it is not all 1, it means that the BloomFilter must not have recorded the element.
  • the file system can store multiple BloomFilters in memory, and BloomFilters are used to record the parent directory identifier recorded in the operation log.
  • the parent directory identifier of the file can be considered as the element in the above-mentioned brief description of the usage method of BloomFilter.
  • Each BloomFilter corresponds to an operation log store on disk.
  • Each BloomFilter corresponds to an operation log write cycle.
  • Each operation log writing period can be tens of seconds or several minutes, and the operation log writing period can be set according to actual requirements.
  • these BloomFilters can be used cyclically, that is, after the operation log writing cycle corresponding to the last BloomFilter ends, it is possible to switch to the first BloomFilter to continue to use, so as to cycle.
  • the operation log writing cycle starts to time, and the operation log generated in the first operation log writing cycle obtains the parent directory identifier recorded in it, and records it in the first BloomFilter, the specific record
  • the method is as described in the above-mentioned brief description of the usage method of BloomFilter, and will not be repeated here.
  • the operation log is written into the operation log storage area corresponding to the first BloomFilter. It should also be noted here that, in each operation log storage area, it needs to be stored in the order in which it is written.
  • the operation log generated in the Nth operation log writing cycle For the operation log generated in the Nth operation log writing cycle, obtain the parent directory ID recorded in it, and record it in the Nth BloomFilter. At the same time, the operation log is written into the operation log storage area corresponding to the Nth BloomFilter.
  • Implementation 2 Obtain the first preset number of operation logs written in the operation log writing cycle as the pending operation logs.
  • a first storage threshold and a second storage threshold may also be set.
  • the first storage threshold is greater than the second storage threshold.
  • the preset metadata synchronization period if it is detected that the operation log stored in the disk is greater than
  • the above-mentioned preset number may be increased, for example, 1 is added to the above-mentioned preset number.
  • the preset metadata synchronization period if it is detected that the operation log stored in the disk is smaller than the second storage threshold, the number of metadata synchronization periods may be adjusted to the above-mentioned preset number.
  • the metadata synchronization request sent by the terminal may carry the synchronization time, and the synchronization time indicates that the user needs to synchronize the metadata in the target system to this time.
  • the operation time of the file may be recorded in the operation log, and the operation time of the file is the time when the file system performs an operation on the file.
  • the file system may use all the operation logs whose recorded operation time is before the above synchronization time as the pending operation logs.
  • the operation time of the file is not recorded in the operation log, but the file system can record the writing time of the operation log when storing the operation log.
  • the writing time is the time when the file system writes the operation log to the disk. All operation logs whose writing time is before the above synchronization time are regarded as pending operation logs.
  • the object system can send a metadata synchronization request for the file to the file system, and the metadata synchronization request carries the parent directory identifier of the file.
  • the file system obtains the parent directory identifier carried in the metadata synchronization request, generates a hash value of the parent directory identifier, and determines which BloomFilter records the parent directory identifier according to the hash value.
  • the specific determination method is as described in the above-mentioned brief description of the usage method of BloomFilter, which is not repeated here.
  • the operation log in the operation log storage area corresponding to the BloomFilter and the operation logs of other operation log storage areas whose writing time is before the operation log in the operation log storage area are regarded as pending processing. Operation log.
  • the corresponding operation logs are written to the target operation log in the operation log storage area corresponding to the BloomFilter with the last cycle, and other operation log storage areas whose writing time is before these target operation logs The operation log in , as the pending operation log.
  • Step 203 The file system sends the file identifier, parent directory identifier, and metadata corresponding to each file corresponding to at least one operation log to be processed to the target system.
  • the file identifier, parent directory identifier and metadata recorded therein can be extracted, and sent to the target system for synchronous storage.
  • the file system can also delete the pending operation log from the disk, and set each value in the corresponding BloomFilter array to 0.
  • Step 204 The object system stores correspondingly the file identifier, parent directory identifier and metadata of each file received.
  • the object system may store correspondingly the file identifier, parent directory identifier and metadata of each file received. That is, the "parent directory identifier + file identifier" is used as an index, and the corresponding metadata is used as storage data.
  • the object system can perform overwrite storage, that is, for the metadata with the same parent directory ID and file ID, use the metadata received later.
  • the metadata overwrites the previously received metadata.
  • the user can read the target file through the object system, and the corresponding processing can be as follows:
  • the terminal sends a first read request for the target file to the target system, where the first read request carries the parent directory identifier of the target file and the file identifier of the target file.
  • the object system may send a metadata synchronization request to the target file to the file system, where the metadata synchronization request carries the parent directory identifier of the target file.
  • the file system acquires the pending operation log according to the parent directory identifier of the target file.
  • the file system may obtain the pending operation log according to the method for obtaining the pending operation log corresponding to the fourth trigger event in the foregoing step 102 .
  • the file system sends the parent directory identifier, file identifier and metadata recorded in the operation log to be processed to the target system.
  • the object system stores the received parent directory identifier, file identifier and metadata correspondingly, and obtains the metadata of the target file according to the parent directory identifier and file identifier of the target file.
  • the object system sends a second read request for the target file to the file system, where the second read request carries the storage address information of the target file.
  • the file system acquires the target file according to the storage address information of the target file.
  • the file system sends the target file to the target system.
  • the target system returns the target file to the terminal.
  • the user can query the object system for which files satisfy a certain prefix.
  • the processing can be as follows:
  • the terminal sends a prefix query request to the target system, wherein the prefix query request carries the target prefix.
  • the object system sends a metadata synchronization request to the file system.
  • the file system acquires all stored operation logs as pending operation logs.
  • the file system sends the parent directory identifier, file identifier and metadata recorded in the operation log to be processed to the object system.
  • the object system stores the received parent directory identifier, file identifier and metadata correspondingly.
  • the target system finds an index satisfying the target prefix in the recorded indexes.
  • the index is composed of the parent directory ID of the file and the file ID.
  • the target system returns the index satisfying the target prefix to the terminal in lexicographical order.
  • the file system may store an operation log, and the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the metadata of the file generated after the file system performs an operation on the file. data.
  • the file system can send the file identifier, parent directory identifier, and metadata of the file recorded in the operation log to be processed to the object system, and the object system can verify the file identifier and parent directory identifier of the file. , metadata corresponding to storage.
  • the metadata includes the storage address information of the file in the file system. In this way, the object system does not need to store the file itself. When the user has a file acquisition requirement, he only needs to acquire the file according to the storage address information of the stored file. , which effectively saves the storage resources of the object system.
  • an embodiment of the present application also provides an apparatus for storing and synchronizing metadata.
  • the apparatus is applied to a file system, and the apparatus includes:
  • the determination module 510 is used to determine the occurrence of a trigger event for metadata synchronization, which can specifically implement the determination function of the file system in the above step 201, as well as other implicit steps;
  • the obtaining module 520 is configured to obtain at least one pending operation log in the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system and the parent directory identifier corresponding to the file And the metadata of the file generated after the file system performs an operation on the file, the metadata includes the storage address information of the file in the file system, and specifically the file system in the above step 202 can be implemented , and other implicit steps;
  • the sending module 530 is configured to send the file identifier, parent directory identifier and metadata corresponding to each file corresponding to the at least one operation log to be processed to the target system, so that the target system can respond to the received files of each file
  • the identifier, the parent directory identifier, and the metadata are stored correspondingly, and specifically, the sending function of the file system in the above step 203 and other implicit steps can be implemented.
  • the device also includes a deletion module for:
  • the determining module 510 is configured to:
  • the obtaining module 520 is used for:
  • the operation log further records the operation time of the file system on the file
  • the determining module 510 is used for:
  • the obtaining module 520 is used for:
  • the determining module 510 is configured to:
  • the obtaining module 520 is used for:
  • the apparatus further includes a generating module for:
  • the determining module 510 is used for:
  • the obtaining module 520 is used for:
  • the apparatus further includes:
  • the setting module is used to set all the values in the Bloom filter corresponding to the operation log storage area corresponding to the operation log to be processed to 0.
  • the apparatus further includes a receiving module for:
  • the third file is sent to the subject system.
  • the metadata synchronization device when the metadata synchronization device provided in the above embodiments synchronizes metadata, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. Complete, that is, dividing the internal structure of the file system into different functional modules to complete all or part of the functions described above.
  • the device for synchronizing metadata provided in the above embodiments and the method embodiments for synchronizing metadata belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
  • an embodiment of the present application also provides a metadata synchronization device, the device is applied to an object system, and the device includes a receiving module 610 for:
  • the storage module 620 is configured to store the received file identifier, parent directory identifier, and metadata correspondingly. Specifically, the storage function of the object system in the above step 204 and other implicit steps can be implemented.
  • the apparatus further includes a reading module for:
  • the metadata synchronization device when the metadata synchronization device provided in the above embodiments synchronizes metadata, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. To complete, that is, to divide the internal structure of the object system into different functional modules to complete all or part of the functions described above.
  • the device for synchronizing metadata provided in the above embodiments and the method embodiments for synchronizing metadata belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
  • the file system 700 may vary greatly due to different configurations or performance, and may include one or more central processing units (CPU) 701 and one or more memories 702, wherein, at least one instruction is stored in the memory 702, and the at least one instruction is loaded and executed by the processor 701 to implement the above metadata synchronization method.
  • CPU central processing units
  • memories 702 wherein, at least one instruction is stored in the memory 702, and the at least one instruction is loaded and executed by the processor 701 to implement the above metadata synchronization method.
  • FIG. 8 is a schematic structural diagram of an object system provided by an embodiment of the present application.
  • the object system 800 may vary greatly due to different configurations or performance, and may include one or more central processing units (CPU) 801 and one or more memories 802, wherein the memory 802 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 801 to implement the above metadata synchronization method.
  • CPU central processing units
  • memories 802 wherein the memory 802 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 801 to implement the above metadata synchronization method.
  • the computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on a device, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that the device can access, or a data storage device such as a server, data center, or the like that includes an integration of one or more available media.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid-state disk, etc.).

Abstract

A metadata synchronization method and apparatus, which belong to the technical field of data storage. Said method comprises: determining that a triggering event for synchronizing metadata occurs (201); acquiring at least one operation log to be processed from stored operation logs, each operation log recording file identifiers corresponding to files operated by a file system, parent directory identifiers corresponding to the files and metadata of the files generated after the file system executes operations on the files, and the metadata comprising storage address information of the files in the file system (202); and sending, to an object system, file identifiers, parent directory identifiers and metadata which are corresponding to files corresponding to the at least one operation log to be processed (203), so that the object system stores the received file identifiers, parent directory identifiers and metadata of the files correspondingly (204). Said method can save storage resources of an object system.

Description

元数据同步的方法和装置Method and apparatus for metadata synchronization 技术领域technical field
本申请涉及数据存储技术领域,特别涉及一种元数据同步的方法和装置。The present application relates to the technical field of data storage, and in particular, to a method and device for synchronization of metadata.
背景技术Background technique
数据存储系统一般有文件系统和对象系统两种。文件系统和对象系统可以面向不同的用户。且文件系统和对象系统需要向用户提供相同的文件服务,即对于某一文件即可以通过文件系统读取到,也可以通过对象系统读取到。There are generally two types of data storage systems: file system and object system. File systems and object systems can be oriented to different users. In addition, the file system and the object system need to provide the same file service to the user, that is, a certain file can be read through the file system or through the object system.
目前,为了使某一文件即可以通过文件系统读取到,也可以通过对象系统读取到,通常需要技术人员每过一段时间将文件系统中的文件向对象系统中迁移一次。每次迁移完成后,文件系统和对象系统中便可以维护相同的文件。Currently, in order for a certain file to be read through the file system or through the object system, it is usually necessary for the technician to migrate the file in the file system to the object system every time period. After each migration, the same files can be maintained in the file system and object system.
在实现本申请的过程中,发明人发现相关技术至少存在以下问题:In the process of realizing this application, the inventor found that the related art has at least the following problems:
文件系统和对象系统中存储的文件的内容是相同的,但是即要占用文件系统的存储空间,又要占用对象系统的存储空间,非常浪费存储资源。The contents of the files stored in the file system and the object system are the same, but both the storage space of the file system and the storage space of the object system are occupied, which is a waste of storage resources.
发明内容SUMMARY OF THE INVENTION
为了解决相关技术中对象系统需要存储全部文件,导致的存储资源浪费的问题,本申请实施例提供了一种元数据同步的方法和装置。所述技术方案如下:In order to solve the problem that the object system needs to store all files in the related art, which leads to the waste of storage resources, the embodiments of the present application provide a method and apparatus for synchronizing metadata. The technical solution is as follows:
第一方面,提供了一种元数据同步的方法,该方法应用于文件系统,该方法包括:In a first aspect, a metadata synchronization method is provided, the method is applied to a file system, and the method includes:
确定发生对元数据同步的触发事件,在存储的操作日志中获取至少一个待处理操作日志,其中,操作日志中记录有被文件系统操作的文件对应的文件标识、文件对应的父目录标识以及在所述文件系统对文件执行操作后生成的文件的元数据,元数据包括文件在文件系统中的存储地址信息,向对象系统发送至少一个待处理操作日志对应的各文件对应的文件标识、父目录标识以及元数据,以使对象系统对接收到的各文件的文件标识、父目录标识、元数据对应存储。It is determined that a trigger event for metadata synchronization occurs, and at least one pending operation log is obtained from the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the The metadata of the file generated after the file system performs an operation on the file, the metadata includes the storage address information of the file in the file system, and the file identifier and parent directory corresponding to each file corresponding to at least one operation log to be processed are sent to the target system. ID and metadata, so that the object system stores the file ID, parent directory ID, and metadata of each file received correspondingly.
在本申请实施例所示的方案中,文件系统可以存储操作日志,操作日志记录了被文件系统操作的文件对应的文件标识、文件对应的父目录标识以及在文件系统对所述文件执行操作后生成的文件的元数据。在发生对元数据同步的触发事件时,文件系统可以将待处理操作日志中记录的文件标识、父目录标识和元数据发送至对象系统,由对象系统对文件的文件标识、父目录标识、元数据对应存储。在元数据中包括有文件在所述文件系统中的存储地址信息,这样,对象系统无需存储文件本身,在用户有文件获取需求时,只需根据存储的文件的存储地址信息去获取文件即可,有效节省了对象系统的存储资源。In the solution shown in the embodiment of the present application, the file system may store an operation log, and the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and after the file system performs an operation on the file Metadata for the generated file. When a trigger event for metadata synchronization occurs, the file system can send the file identifier, parent directory identifier, and metadata recorded in the pending operation log to the object system, and the object system can compare the file identifier, parent directory identifier, metadata, and metadata of the file to the object system. Data is stored accordingly. The metadata includes the storage address information of the file in the file system. In this way, the object system does not need to store the file itself. When the user has a file acquisition requirement, he only needs to acquire the file according to the storage address information of the stored file. , which effectively saves the storage resources of the object system.
在一种可能的实现方式中,在存储的操作日志中获取至少一个待处理操作日志之后,所述方法还包括:In a possible implementation, after obtaining at least one operation log to be processed in the stored operation log, the method further includes:
将存储的待处理操作日志进行删除。Delete the stored pending operation log.
在本申请实施例所示的方案中,在获取完待处理操作日志后,可以将其在磁盘中删除,以节省存储空间,同时避免一个操作日志被重复获取。In the solution shown in the embodiment of the present application, after the operation log to be processed is obtained, it can be deleted from the disk, so as to save storage space and avoid repeated acquisition of an operation log.
在一种可能的实现方式中,所述确定发生对元数据同步的触发事件,包括:In a possible implementation manner, the determining that a trigger event for metadata synchronization occurs includes:
确定文件系统重新启动;Make sure the file system is restarted;
所述在存储的操作日志中获取满足处理条件的至少一个待处理操作日志,包括:The obtaining at least one pending operation log that satisfies the processing condition in the stored operation log includes:
获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
在一种可能的实现方式中,所述操作日志中还记录有所述文件系统对所述文件的操作时间;In a possible implementation manner, the operation log further records the operation time of the file system on the file;
所述确定发生对元数据同步的触发事件,包括:The determining that a trigger event for metadata synchronization occurs includes:
接收终端发送的元数据同步请求,其中,元数据同步请求中携带有同步时间;receiving a metadata synchronization request sent by the terminal, wherein the metadata synchronization request carries the synchronization time;
所述在存储的操作日志中获取至少一个待处理操作日志,包括:The obtaining at least one pending operation log in the stored operation log includes:
在存储的操作日志中,获取记录的操作时间在所述同步时间之前的所有操作日志作为待处理操作日志。In the stored operation logs, all operation logs whose recorded operation time is before the synchronization time are acquired as pending operation logs.
在本申请实施例所示的方案中,可以根据用户需求,将对象系统中元数据同步至指定时间。In the solution shown in the embodiment of the present application, the metadata in the object system can be synchronized to a specified time according to user requirements.
在一种可能的实现方式中,所述确定发生对元数据同步的触发事件,包括:In a possible implementation manner, the determining that a trigger event for metadata synchronization occurs includes:
确定达到预设元数据同步周期;It is determined that the preset metadata synchronization period is reached;
所述在存储的操作日志中获取至少一个待处理操作日志,包括:The obtaining at least one pending operation log in the stored operation log includes:
获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
在本申请实施例所示的方案中,可以按照周期获取待处理操作日志,使得操作日志不会积累过多,同时文件系统和对象系统中的元数据也不会相差太多。In the solution shown in the embodiment of the present application, the operation logs to be processed can be obtained periodically, so that the operation logs will not accumulate too much, and the metadata in the file system and the object system will not differ too much.
在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
在对第一文件进行操作后,生成对应的第一操作日志,获取所述第一操作日志中记录的所述第一文件的父目录标识,获取当前存储周期对应的第一布隆过滤器,在所述第一布隆过滤器中记录所述第一文件的父目录标识,将所述第一文件存储至所述第一布隆过滤器对应的第一操作日志存储区;After the first file is operated, a corresponding first operation log is generated, the parent directory identifier of the first file recorded in the first operation log is obtained, and the first bloom filter corresponding to the current storage period is obtained, recording the parent directory identifier of the first file in the first bloom filter, and storing the first file in the first operation log storage area corresponding to the first bloom filter;
所述确定发生对元数据同步的触发事件,包括:The determining that a trigger event for metadata synchronization occurs includes:
接收对象系统发送的对第二文件的元数据同步请求,其中,元数据同步请求中携带有第二文件的父目录标识Receive a metadata synchronization request for the second file sent by the target system, where the metadata synchronization request carries the parent directory identifier of the second file
所述在存储的操作日志中获取至少一个待处理操作日志,包括:The obtaining at least one pending operation log in the stored operation log includes:
确定记录有第二文件的父目录标识的第二布隆过滤器,获取所述第二布隆过滤器对应的第二操作日志存储区中存储的操作日志和其他存储区中在所述第二操作日志存储区中存储的操作日志之前存储的操作日志,作为待处理操作日志。Determine the second bloom filter that records the parent directory identifier of the second file, and obtain the operation log stored in the second operation log storage area corresponding to the second bloom filter and other storage areas in the second bloom filter. The operation log stored before the operation log stored in the operation log storage area is used as the pending operation log.
在本申请实施例所示的方案中,文件系统可以使用布隆过滤器记录存储的操作日志中的父目录标识。这样,在对象系统有同步需求时,可以不同步全部存储的操作日志中的元数据,而只同步部分操作日志中的元数据即可,可以有效节省带宽。In the solution shown in the embodiment of the present application, the file system may use a Bloom filter to record the parent directory identifier in the stored operation log. In this way, when the target system has a synchronization requirement, the metadata in all the stored operation logs may not be synchronized, but only the metadata in part of the operation logs can be synchronized, which can effectively save bandwidth.
在一种可能的实现方式中,所述获取所述第二布隆过滤器对应的第二操作日志存储区中存储的操作日志和其他存储区中在所述第二操作日志存储区中存储的操作日志之前存储的操作日志,作为待处理操作日志之后,所述方法还包括:In a possible implementation manner, the acquiring operation logs stored in the second operation log storage area corresponding to the second bloom filter and the operation logs stored in the second operation log storage area in other storage areas After the operation log stored before the operation log is used as the pending operation log, the method further includes:
将所述待处理操作日志对应的操作日志存储区对应的布隆过滤器中数组的值全部置0。All the values of the arrays in the Bloom filter corresponding to the operation log storage area corresponding to the operation log to be processed are set to 0.
在本申请实施例所示的方案中,在获取完操作日志后,可以将对应的操作日志存储区对应的布隆过滤器中数组的值全部置0,以便后续对该布隆过滤器循环使用。In the solution shown in the embodiment of the present application, after the operation log is obtained, all the values of the array in the bloom filter corresponding to the corresponding operation log storage area can be set to 0, so that the bloom filter can be used cyclically in the future .
在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
接收所述对象系统发送的对第三文件的读取请求,其中,所述读取请求中携带有所述第三文件的存储地址信息;receiving a read request for a third file sent by the target system, wherein the read request carries storage address information of the third file;
根据第三文件的存储地址信息,获取所述第三文件,向对象系统发送所述第三文件。Obtain the third file according to the storage address information of the third file, and send the third file to the target system.
在本申请实施例所示的方案中,对象系统可以通过查询目标文件的元数据,以确定目标文件的存储地址,进而向文件系统中获取该目标文件。In the solution shown in the embodiment of the present application, the object system may query the metadata of the target file to determine the storage address of the target file, and then obtain the target file from the file system.
第二方面,提供了一种元数据同步的方法,所述方法应用于对象系统,所述方法包括:In a second aspect, a metadata synchronization method is provided, the method is applied to an object system, and the method includes:
接收文件系统发送的文件对应的文件标识、父目录标识以及元数据,其中,所述元数据包括所述文件在所述文件系统中的存储地址信息;receiving the file identifier, parent directory identifier and metadata corresponding to the file sent by the file system, wherein the metadata includes storage address information of the file in the file system;
对接收到的所述文件的文件标识、父目录标识、元数据对应存储。The received file identifier, parent directory identifier, and metadata of the file are stored correspondingly.
在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
接收终端发送的目标文件的第一读取请求,所述第一读取请求中携带有所述目标文件的文件标识和父目录标识;receiving the first read request of the target file sent by the terminal, where the first read request carries the file identifier and the parent directory identifier of the target file;
获取所述目标文件的元数据;obtain metadata of the target file;
向所述文件系统发送对所述目标文件的第二读取请求,所述第二读取请求中携带所述目标文件的存储地址信息;sending a second read request for the target file to the file system, where the second read request carries the storage address information of the target file;
接收所述文件系统返回的所述目标文件;receiving the target file returned by the file system;
向所述终端返回所述目标文件。Return the target file to the terminal.
第三方面,提供了一种元数据存储同步的装置,所述装置应用于文件系统,所述装置包括:In a third aspect, an apparatus for metadata storage and synchronization is provided, the apparatus is applied to a file system, and the apparatus includes:
确定模块,用于确定发生对元数据同步的触发事件;A determination module, used to determine the occurrence of a trigger event for metadata synchronization;
获取模块,用于在存储的操作日志中获取至少一个待处理操作日志,其中,所述操作日志中记录有被所述文件系统操作的文件对应的文件标识、所述文件对应的父目录标识以及在所述文件系统对所述文件执行操作后生成的所述文件的元数据,所述元数据包括所述文件在所述文件系统中的存储地址信息;The acquisition module is used to acquire at least one pending operation log in the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and metadata of the file generated after the file system performs an operation on the file, the metadata includes storage address information of the file in the file system;
发送模块,用于向对象系统发送所述至少一个待处理操作日志对应的各文件对应的文件标识、父目录标识以及元数据,以使所述对象系统对接收到的所述各文件的文件标识、父目录标识、元数据对应存储。A sending module, configured to send the file identifier, parent directory identifier and metadata corresponding to each file corresponding to the at least one operation log to be processed to the object system, so that the object system can identify the received file identifier of each file , parent directory ID, and metadata are stored accordingly.
在一种可能的实现方式中,所述装置还包括删除模块,用于:In a possible implementation, the device also includes a deletion module for:
将存储的所述待处理操作日志进行删除。Delete the stored operation log to be processed.
在一种可能的实现方式中,所述确定模块,用于:In a possible implementation manner, the determining module is used for:
确定所述文件系统重新启动;determine that the file system is restarted;
所述获取模块,用于:The acquisition module is used for:
获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
在一种可能的实现方式中,所述操作日志中还记录有所述文件系统对所述文件的操作时间;In a possible implementation manner, the operation log further records the operation time of the file system on the file;
所述确定模块,用于:The determining module is used for:
接收终端发送的元数据同步请求,其中,所述元数据同步请求中携带有同步时间;receiving a metadata synchronization request sent by a terminal, wherein the metadata synchronization request carries a synchronization time;
所述获取模块,用于:The acquisition module is used for:
在存储的操作日志中,获取记录的操作时间在所述同步时间之前的所有操作日志作为待处理操作日志。In the stored operation logs, all operation logs whose recorded operation time is before the synchronization time are acquired as pending operation logs.
在一种可能的实现方式中,所述确定模块,用于:In a possible implementation manner, the determining module is used for:
确定达到预设元数据同步周期;It is determined that the preset metadata synchronization period is reached;
所述获取模块,用于:The acquisition module is used for:
获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
在一种可能的实现方式中,所述装置还包括生成模块,用于:In a possible implementation manner, the apparatus further includes a generating module for:
在对第一文件进行操作后,生成对应的第一操作日志;After the first file is operated, a corresponding first operation log is generated;
获取所述第一操作日志中记录的所述第一文件的父目录标识;Obtain the parent directory identifier of the first file recorded in the first operation log;
获取当前存储周期对应的第一布隆过滤器,在所述第一布隆过滤器中记录所述第一文件的父目录标识;Obtain the first bloom filter corresponding to the current storage period, and record the parent directory identifier of the first file in the first bloom filter;
将所述第一文件存储至所述第一布隆过滤器对应的第一操作日志存储区;storing the first file in the first operation log storage area corresponding to the first bloom filter;
所述确定模块,用于:The determining module is used for:
接收所述对象系统发送的对第二文件的元数据同步请求,其中,所述元数据同步请求中携带有所述第二文件的父目录标识;receiving a metadata synchronization request for the second file sent by the object system, wherein the metadata synchronization request carries the parent directory identifier of the second file;
所述获取模块,用于:The acquisition module is used for:
确定记录有所述第二文件的父目录标识的第二布隆过滤器;determining a second bloom filter that records the parent directory identifier of the second file;
获取所述第二布隆过滤器对应的第二操作日志存储区中存储的操作日志和其他存储区中在所述第二操作日志存储区中存储的操作日志之前存储的操作日志,作为待处理操作日志。Obtain the operation log stored in the second operation log storage area corresponding to the second bloom filter and the operation log stored before the operation log stored in the second operation log storage area in other storage areas, as pending processing Operation log.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
置位模块,用于将所述待处理操作日志对应的存储区对应的布隆过滤器中的值全部置0。The setting module is configured to set all the values in the Bloom filter corresponding to the storage area corresponding to the operation log to be processed to 0.
在一种可能的实现方式中,所述装置还包括接收模块,用于:In a possible implementation manner, the apparatus further includes a receiving module for:
接收所述对象系统发送的对第三文件的读取请求,其中,所述读取请求中携带有所述第三文件的存储地址信息;receiving a read request for a third file sent by the target system, wherein the read request carries storage address information of the third file;
根据所述第三文件的存储地址信息,获取所述第三文件;obtaining the third file according to the storage address information of the third file;
向所述对象系统发送所述第三文件。The third file is sent to the subject system.
第四方面,提供了一种元数据同步的装置,所述装置应用于对象系统,所述装置包括接收模块,用于:In a fourth aspect, an apparatus for metadata synchronization is provided, the apparatus is applied to an object system, and the apparatus includes a receiving module for:
接收文件系统发送的文件对应的文件标识、父目录标识以及元数据,其中,所述元数据包括所述文件在所述文件系统中的存储地址信息;receiving the file identifier, parent directory identifier and metadata corresponding to the file sent by the file system, wherein the metadata includes storage address information of the file in the file system;
存储模块,用于对接收到的所述文件的文件标识、父目录标识、元数据对应存储。The storage module is used for correspondingly storing the received file identifier, parent directory identifier and metadata of the file.
在一种可能的实现方式中,所述装置还包括读取模块,用于:In a possible implementation manner, the apparatus further includes a reading module for:
接收终端发送的目标文件的第一读取请求,所述第一读取请求中携带有所述目标文件的文件标识和父目录标识;receiving the first read request of the target file sent by the terminal, where the first read request carries the file identifier and the parent directory identifier of the target file;
获取所述目标文件的元数据;obtain metadata of the target file;
向所述文件系统发送对所述目标文件的第二读取请求,所述第二读取请求中携带所述 目标文件的存储地址信息;Send the second read request to the target file to the file system, and carry the storage address information of the target file in the second read request;
接收所述文件系统返回的所述目标文件;receiving the target file returned by the file system;
向所述终端返回所述目标文件。Return the target file to the terminal.
第五方面,提供了一种文件系统,所述文件系统包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上述第一方面所述的元数据同步的方法。In a fifth aspect, a file system is provided, the file system includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to achieve the above-mentioned first The method of metadata synchronization described in the aspect.
第六方面,一种对象系统,所述对象系统包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上述第二方面所述的元数据同步的方法。In a sixth aspect, an object system, the object system includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the second aspect above. method for metadata synchronization described above.
第七方面,提供一种计算机可读存储介质,包括指令,当所述计算机可读存储介质在文件系统上运行时,使得所述文件系统执行上述第一方面所述的元数据同步的方法。In a seventh aspect, a computer-readable storage medium is provided, comprising instructions, when the computer-readable storage medium runs on a file system, the file system is caused to perform the method for synchronizing metadata in the first aspect.
第八方面,一种计算机可读存储介质,其特征在于,包括指令,当所述计算机可读存储介质在对象系统上运行时,使得所述文件系统执行上述第二方面所述的元数据同步的方法。An eighth aspect, a computer-readable storage medium, characterized by comprising instructions, when the computer-readable storage medium runs on an object system, causing the file system to perform the metadata synchronization described in the second aspect above Methods.
本申请实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solutions provided in the embodiments of the present application are:
在本申请实施例中文件系统可以存储操作日志,操作日志记录了被文件系统操作的文件对应的文件标识、文件对应的父目录标识以及在文件系统对所述文件执行操作后生成的文件的元数据。在发生对元数据同步的触发事件时,文件系统可以将待处理操作日志中记录的文件的文件标识、父目录标识、元数据发送至对象系统,由对象系统对文件的文件标识、父目录标识、元数据对应存储。在元数据中包括有文件在所述文件系统中的存储地址信息,这样,对象系统无需存储文件本身,在用户有文件获取需求时,只需根据存储的文件的存储地址信息去获取文件即可,有效节省了对象系统的存储资源。In the embodiment of the present application, the file system may store an operation log, and the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the metadata of the file generated after the file system performs an operation on the file. data. When a trigger event for metadata synchronization occurs, the file system can send the file identifier, parent directory identifier, and metadata of the file recorded in the operation log to be processed to the object system, and the object system can verify the file identifier and parent directory identifier of the file. , metadata corresponding to storage. The metadata includes the storage address information of the file in the file system. In this way, the object system does not need to store the file itself. When the user has a file acquisition requirement, he only needs to acquire the file according to the storage address information of the stored file. , which effectively saves the storage resources of the object system.
附图说明Description of drawings
图1是本申请实施例提供的一种实施场景图;FIG. 1 is an implementation scenario diagram provided by an embodiment of the present application;
图2是本申请实施例提供的一种元数据同步的方法流程图;2 is a flowchart of a method for synchronizing metadata provided by an embodiment of the present application;
图3是本申请实施例提供的一种文件读取的方法流程图;3 is a flowchart of a method for reading a file provided by an embodiment of the present application;
图4是本申请实施例提供的一种前缀查询的方法流程图;4 is a flowchart of a method for prefix query provided by an embodiment of the present application;
图5是本申请实施例提供的一种元数据同步的装置结构示意图;5 is a schematic structural diagram of an apparatus for metadata synchronization provided by an embodiment of the present application;
图6是本申请实施例提供的一种元数据同步的装置结构示意图;6 is a schematic structural diagram of an apparatus for metadata synchronization provided by an embodiment of the present application;
图7是本申请实施例提供的一种文件系统的结构示意图;7 is a schematic structural diagram of a file system provided by an embodiment of the present application;
图8是本申请实施例提供的一种对象系统的结构示意图。FIG. 8 is a schematic structural diagram of an object system provided by an embodiment of the present application.
具体实施方式detailed description
本申请实施例提供了一种元数据同步的方法,该方法可以由文件系统和对象系统共同实现。参见图1所示的实施场景图,在本申请实施例中,文件系统在对文件执行操作时会生成相应的操作日志,并将操作日志进行存储。即,在本申请实施例中文件系统除存储文件、元数据外,还可以存储操作日志。在操作日志中可以记录本次操作完成后文件的元数据。此外,通过多种触发事件,触发文件系统将操作日志中元数据写入到对象系统中,以使得对象系统和文件系统中的元数据保持一致。The embodiment of the present application provides a method for synchronizing metadata, and the method can be jointly implemented by a file system and an object system. Referring to the implementation scenario diagram shown in FIG. 1 , in this embodiment of the present application, the file system will generate a corresponding operation log when performing an operation on a file, and store the operation log. That is, in the embodiment of the present application, the file system may store operation logs in addition to files and metadata. The metadata of the file after the operation is completed can be recorded in the operation log. In addition, through various trigger events, the file system is triggered to write the metadata in the operation log into the object system, so that the metadata in the object system and the file system are consistent.
下面结合图1对本申请实施例提供的元数据同步的方法的处理流程进行说明:The following describes the processing flow of the metadata synchronization method provided by the embodiment of the present application with reference to FIG. 1 :
步骤201、文件系统确定发生元数据同步的触发事件。Step 201: The file system determines a trigger event for metadata synchronization to occur.
在实施中,用户可以通过终端实现对文件系统中指定文件的操作。文件系统在对文件执行操作后,可以生成相应的操作日志,并进行存储。例如,可以将生成的操作日志存储在磁盘中。操作日志中可以记录有被文件系统操作的文件对应的文件标识、文件对应的父目录标识以及文件系统对文件执行操作后生成的文件的元数据。元数据中可以记录有文件的属性信息,如创建时间、修改时间、所有者、读写权限以及存储地址信息等等。其中,存储地址信息指示文件在文件系统中的存储位置。In the implementation, the user can operate the specified file in the file system through the terminal. After the file system performs operations on the files, the corresponding operation logs can be generated and stored. For example, the generated operation log can be stored on disk. The operation log may record the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the metadata of the file generated after the file system performs an operation on the file. Metadata can record file attribute information, such as creation time, modification time, owner, read and write permissions, and storage address information. The storage address information indicates the storage location of the file in the file system.
此外,在操作日志中还可以记录有操作类型等。其中,操作类型可以包括有创建、删除、修改等等。In addition, the operation type and the like may also be recorded in the operation log. The operation type may include create, delete, modify, and so on.
为了使对象系统中存储的文件的元数据和文件系统中存储的文件的元数据保持一致,可以设置元数据同步的触发事件,每当元数据同步的触发事件发生时,则获取操作日志将元数据同步至对象系统。具体的,元数据同步的触发事件可以有多种。下面列举几种可能的触发事件。In order to keep the metadata of the files stored in the object system consistent with the metadata of the files stored in the file system, you can set a trigger event for metadata synchronization. Data is synchronized to the target system. Specifically, there may be various trigger events for metadata synchronization. Several possible trigger events are listed below.
一、检测到文件系统重启或者故障恢复。1. A file system restart or failure recovery is detected.
二、达到预设元数据同步周期。2. The preset metadata synchronization period is reached.
三、接收到终端发送的元数据同步请求。3. Receive a metadata synchronization request sent by the terminal.
在此情况下,用户可以通过终端直接给文件系统发送元数据同步请求,以触发文件系统执行元数据同步处理。In this case, the user can directly send a metadata synchronization request to the file system through the terminal, so as to trigger the file system to perform metadata synchronization processing.
四、接收到对象系统发送的元数据同步请求。4. Receive the metadata synchronization request sent by the target system.
在此情况下,用户在通过对象系统查询指定文件时,对象系统可以先向文件系统发送元数据同步请求,以触发文件系统执行元数据同步处理。In this case, when a user queries a specified file through the object system, the object system may first send a metadata synchronization request to the file system, so as to trigger the file system to perform metadata synchronization processing.
步骤202、在存储的操作日志中获取至少一个待处理操作日志。Step 202: Acquire at least one pending operation log from the stored operation log.
在实施中,每当有元数据同步的触发事件发送时,可以将存储的全部操作日志作为待处理操作日志。In implementation, whenever a trigger event for metadata synchronization is sent, all stored operation logs may be used as pending operation logs.
在一种可能的实现方式中,在对操作日志进行存储时,可以结合布隆过滤器(BloomFilter)进行记录。从而,在获取待处理日志时,可以不获取存储的全部操作日志。相应的,具体处理可以如下:In a possible implementation manner, when the operation log is stored, the operation log may be recorded in combination with a Bloom Filter. Therefore, when acquiring the log to be processed, it is not necessary to acquire all the stored operation logs. Correspondingly, the specific processing can be as follows:
为了便于理解,下面对于BloomFilter的使用方法进行简要说明:In order to facilitate understanding, the following is a brief description of the use of BloomFilter:
BloomFilter本质是一种数据结构,由一个很长数组和多个哈希函数组成。在需要将一个元素记录在BloomFilter时,可以先使用该BloomFilter里中每个哈希函数,分别计算出该元素的一个哈希值。然后,将该BloomFilter的数组中的对应位置处置1即可。在需要查询某元素是否记录在该BloomFilter里时,同样要先使用该BloomFilter里的每个哈希函数,分 别计算出该元素的一个哈希值,然后,查询该BloomFilter的数组中与哈希值对应的位置处是否为1,如果全为1,则表示该BloomFilter可能记录了该元素,如果不是全为1,则表示该BloomFilter一定没有记录该元素。BloomFilter is essentially a data structure consisting of a very long array and multiple hash functions. When an element needs to be recorded in the BloomFilter, each hash function in the BloomFilter can be used to calculate a hash value of the element. Then, the corresponding position in the BloomFilter array can be disposed of by 1. When you need to query whether an element is recorded in the BloomFilter, you must first use each hash function in the BloomFilter to calculate a hash value of the element, and then query the BloomFilter array with the hash value. Whether the corresponding position is 1, if it is all 1, it means that the BloomFilter may have recorded the element, if it is not all 1, it means that the BloomFilter must not have recorded the element.
文件系统可以在内存中存储有多个BloomFilter,BloomFilter用于记录操作日志中记录的父目录标识。此处,文件的父目录标识即可以认为是上述对BloomFilter使用方法的简要说明中的元素。The file system can store multiple BloomFilters in memory, and BloomFilters are used to record the parent directory identifier recorded in the operation log. Here, the parent directory identifier of the file can be considered as the element in the above-mentioned brief description of the usage method of BloomFilter.
每个BloomFilter在磁盘中对应一个操作日志存储区。每个BloomFilter又对应有操作日志写入周期。每个操作日志写入周期可以为几十秒、或者几分钟,该操作日志写入周期可以根据实际需求进行设置。Each BloomFilter corresponds to an operation log store on disk. Each BloomFilter corresponds to an operation log write cycle. Each operation log writing period can be tens of seconds or several minutes, and the operation log writing period can be set according to actual requirements.
需要说明的是,这些BloomFilter可以循环使用,即在最后一个BloomFilter对应的操作日志写入周期结束后,可以切换至第一个BloomFilter继续使用,以此循环。It should be noted that these BloomFilters can be used cyclically, that is, after the operation log writing cycle corresponding to the last BloomFilter ends, it is possible to switch to the first BloomFilter to continue to use, so as to cycle.
下面对于操作日志写入操作日志存储区的过程进行说明,以存储有N个BloomFilter为例:The following describes the process of writing the operation log into the operation log storage area, taking N BloomFilters stored as an example:
从文件系统启动时,操作日志写入周期开始进行计时,在第一个操作日志写入周期内生成的操作日志,获取其中记录的父目录标识,并记录在第一个BloomFilter中,具体的记录方式如上述BloomFilter的使用方法的简要说明中所述,在此不做赘述。同时,将操作日志写入该第一个BloomFilter对应的操作日志存储区中。此处还需说明的是,在每个操作日志存储区中,需要对按照其写入顺序进行存储。When the file system is started, the operation log writing cycle starts to time, and the operation log generated in the first operation log writing cycle obtains the parent directory identifier recorded in it, and records it in the first BloomFilter, the specific record The method is as described in the above-mentioned brief description of the usage method of BloomFilter, and will not be repeated here. At the same time, the operation log is written into the operation log storage area corresponding to the first BloomFilter. It should also be noted here that, in each operation log storage area, it needs to be stored in the order in which it is written.
在第N个操作日志写入周期内生成的操作日志,获取其中记录的父目录标识,并记录在第N个BloomFilter中。同时,将操作日志写入该第N个BloomFilter对应的操作日志存储区中。For the operation log generated in the Nth operation log writing cycle, obtain the parent directory ID recorded in it, and record it in the Nth BloomFilter. At the same time, the operation log is written into the operation log storage area corresponding to the Nth BloomFilter.
接下来,在第N+1个操作日志写入周期内生成的操作日志,获取其中记录的父目录标识,生成其哈希值,并记录在第一个BloomFilter中。同时,将操作日志写入该第一个BloomFilter对应的操作日志存储区中。Next, for the operation log generated in the N+1th operation log writing cycle, obtain the parent directory ID recorded in it, generate its hash value, and record it in the first BloomFilter. At the same time, the operation log is written into the operation log storage area corresponding to the first BloomFilter.
对应于上述步骤101中的几种触发事件,此处对于根据每种触发事件,在存储的操作日志中获取待处理操作日志的具体实现进行说明:Corresponding to several trigger events in the above step 101, the specific implementation of obtaining the pending operation log in the stored operation log according to each trigger event is described here:
对应于上述第一种触发事件:Corresponding to the first trigger event above:
在获取待处理操作日志时,可以获取存储的所有操作日志作为待处理操作日志。When obtaining pending operation logs, you can obtain all stored operation logs as pending operation logs.
对应于上述第二种触发事件:Corresponding to the above-mentioned second trigger event:
在此情况下,在获取待处理操作日志时,可以有如下实现:In this case, when obtaining the pending operation log, the following implementations can be implemented:
实现一、获取存储的所有操作日志作为待处理操作日志。Implementation 1. Obtain all stored operation logs as pending operation logs.
实现二、获取最先的预设数目个操作日志写入周期内写入的操作日志,作为待处理操作日志。Implementation 2: Obtain the first preset number of operation logs written in the operation log writing cycle as the pending operation logs.
在该实现二中,还可以设置有第一存储阈值和第二存储阈值,第一存储阈值大于第二存储阈值,当达到预设元数据同步周期时,如果检测到磁盘中存储的操作日志大于第一存储阈值,则可以增加上述预设数目,例如在上述预设数目基础上加1。当达到预设元数据同步周期时,如果检测到磁盘中存储的操作日志小于第二存储阈值,则可以再将元数据同步周期数量调整为上述预设数目。In the second implementation, a first storage threshold and a second storage threshold may also be set. The first storage threshold is greater than the second storage threshold. When the preset metadata synchronization period is reached, if it is detected that the operation log stored in the disk is greater than For the first storage threshold, the above-mentioned preset number may be increased, for example, 1 is added to the above-mentioned preset number. When the preset metadata synchronization period is reached, if it is detected that the operation log stored in the disk is smaller than the second storage threshold, the number of metadata synchronization periods may be adjusted to the above-mentioned preset number.
对应于上述第三种触发事件:Corresponds to the third trigger event above:
在终端发送的元数据同步请求中可以携带有同步时间,该同步时间即表示用户需要将对象系统中的元数据同步至该时间。此外,在操作日志中可以记录有文件的操作时间,文件的操作时间即文件系统对文件执行操作的时间。相应的,文件系统在获取待处理操作日志时,可以将记录的操作时间在上述同步时间之前的所有操作日志,作为待处理操作日志。The metadata synchronization request sent by the terminal may carry the synchronization time, and the synchronization time indicates that the user needs to synchronize the metadata in the target system to this time. In addition, the operation time of the file may be recorded in the operation log, and the operation time of the file is the time when the file system performs an operation on the file. Correspondingly, when acquiring the pending operation logs, the file system may use all the operation logs whose recorded operation time is before the above synchronization time as the pending operation logs.
或者,在操作日志中未记录有文件的操作时间,而文件系统在存储操作日志时可以记录操作日志的写入时间,写入时间即文件系统将操作日志写入磁盘的时间,文件系统可以将写入时间在上述同步时间之前的所有操作日志,作为待处理操作日志。Alternatively, the operation time of the file is not recorded in the operation log, but the file system can record the writing time of the operation log when storing the operation log. The writing time is the time when the file system writes the operation log to the disk. All operation logs whose writing time is before the above synchronization time are regarded as pending operation logs.
对应于上述第四种触发事件:Corresponding to the above fourth trigger event:
对象系统在接收到用户对某文件的读取请求后,可以向文件系统发送对该文件的元数据同步请求,该元数据同步请求中携带有该文件的父目录标识。文件系统获取该元数据同步请求中携带的父目录标识,生成该父目录标识的哈希值,并根据该哈希值确定出哪个BloomFilter记录有该父目录标识。具体的确定方法如上述BloomFilter的使用方法的简要说明中所述,在此不做赘述。After receiving a user's read request for a file, the object system can send a metadata synchronization request for the file to the file system, and the metadata synchronization request carries the parent directory identifier of the file. The file system obtains the parent directory identifier carried in the metadata synchronization request, generates a hash value of the parent directory identifier, and determines which BloomFilter records the parent directory identifier according to the hash value. The specific determination method is as described in the above-mentioned brief description of the usage method of BloomFilter, which is not repeated here.
如果只确定出一个BloomFilter,则将该BloomFilter对应的操作日志存储区中的操作日志,以及写入时间在该操作日志存储区中的操作日志之前的其他操作日志存储区的操作日志,作为待处理操作日志。If only one BloomFilter is determined, the operation log in the operation log storage area corresponding to the BloomFilter and the operation logs of other operation log storage areas whose writing time is before the operation log in the operation log storage area are regarded as pending processing. Operation log.
如果同时确定出多个BloomFilter,则将对应的操作日志写入周期最靠后的BloomFilter对应的操作日志存储区中的目标操作日志,以及写入时间在这些目标操作日志之前的其他操作日志存储区中的操作日志,作为待处理操作日志。If multiple BloomFilters are determined at the same time, the corresponding operation logs are written to the target operation log in the operation log storage area corresponding to the BloomFilter with the last cycle, and other operation log storage areas whose writing time is before these target operation logs The operation log in , as the pending operation log.
这样,可以减少一次同步的元数据数量,尽量避免同时同步过多元数据,导致的带宽占量过大的问题。In this way, the amount of metadata to be synchronized at one time can be reduced, and the problem of excessive bandwidth occupation caused by synchronizing multiple pieces of data at the same time can be avoided as much as possible.
步骤203、文件系统向对象系统发送至少一个待处理操作日志对应的各文件对应的文件标识、父目录标识以及元数据。Step 203: The file system sends the file identifier, parent directory identifier, and metadata corresponding to each file corresponding to at least one operation log to be processed to the target system.
在实施中,在获取到待处理操作日志后,可以提取其中记录的文件标识、父目录标识以及元数据,并发送至对象系统进行同步存储。同时,文件系统还可以将待处理操作日志在磁盘中删除,并将对应的BloomFilter中的数组中各值置0。In implementation, after the operation log to be processed is acquired, the file identifier, parent directory identifier and metadata recorded therein can be extracted, and sent to the target system for synchronous storage. At the same time, the file system can also delete the pending operation log from the disk, and set each value in the corresponding BloomFilter array to 0.
此外,为了节省带宽,对于记录的父目录标识和文件标识均相同的操作日志中的元数据,可以仅取最后生成的元数据,发送至对象系统进行同步存储。In addition, in order to save bandwidth, for the metadata in the operation log with the same parent directory ID and file ID, only the last generated metadata can be taken and sent to the target system for synchronous storage.
步骤204、对象系统对接收到的各文件的文件标识、父目录标识和元数据对应存储。Step 204: The object system stores correspondingly the file identifier, parent directory identifier and metadata of each file received.
在实施中,对象系统可以对接收到的各文件的文件标识、父目录标识和元数据对应存储。即将“父目录标识+文件标识”作为索引,对应的元数据作为存储数据。In implementation, the object system may store correspondingly the file identifier, parent directory identifier and metadata of each file received. That is, the "parent directory identifier + file identifier" is used as an index, and the corresponding metadata is used as storage data.
此处,对于文件系统将所有待处理操作日志中的元数据均发送至对象系统的情况,对象系统可以进行覆盖存储,即对于父目录标识和文件标识均相同的元数据,使用在后接收到的元数据覆盖在前接收到的元数据。Here, in the case where the file system sends the metadata in all pending operation logs to the object system, the object system can perform overwrite storage, that is, for the metadata with the same parent directory ID and file ID, use the metadata received later. The metadata overwrites the previously received metadata.
在一种可能的实现方式中,用户可以通过对象系统读取目标文件,相应的,处理可以如下:In a possible implementation manner, the user can read the target file through the object system, and the corresponding processing can be as follows:
S301、终端向对象系统发送对目标文件的第一读取请求,其中,第一读取请求中携带有目标文件的父目录标识和目标文件的文件标识。S301. The terminal sends a first read request for the target file to the target system, where the first read request carries the parent directory identifier of the target file and the file identifier of the target file.
S302、对象系统可以向文件系统发送对目标文件的元数据同步请求,元数据同步请求 中携带目标文件的父目录标识。S302, the object system may send a metadata synchronization request to the target file to the file system, where the metadata synchronization request carries the parent directory identifier of the target file.
S303、文件系统根据目标文件的父目录标识,获取待处理操作日志。S303, the file system acquires the pending operation log according to the parent directory identifier of the target file.
此处,文件系统可以按照上述步骤102中对应于第四种触发事件获取待处理操作日志的方法,获取待处理操作日志。Here, the file system may obtain the pending operation log according to the method for obtaining the pending operation log corresponding to the fourth trigger event in the foregoing step 102 .
S304、文件系统将待处理操作日志中记录是父目录标识、文件标识和元数据发送至对象系统。S304, the file system sends the parent directory identifier, file identifier and metadata recorded in the operation log to be processed to the target system.
S305、对象系统对接收到的父目录标识、文件标识和元数据对应存储,并根据目标文件的父目录标识、文件标识,获取目标文件的元数据。S305. The object system stores the received parent directory identifier, file identifier and metadata correspondingly, and obtains the metadata of the target file according to the parent directory identifier and file identifier of the target file.
S306、对象系统向文件系统发送对目标文件的第二读取请求,该第二读取请求中携带目标文件的存储地址信息。S306. The object system sends a second read request for the target file to the file system, where the second read request carries the storage address information of the target file.
S307、文件系统根据目标文件的存储地址信息,获取目标文件。S307, the file system acquires the target file according to the storage address information of the target file.
S308、文件系统将目标文件发送至对象系统。S308, the file system sends the target file to the target system.
S309、对象系统向终端返回目标文件。S309, the target system returns the target file to the terminal.
在又一种可能的实现方式中,用户可以通过对象系统查询满足某前缀的文件有哪些,相应的,处理可以如下:In another possible implementation manner, the user can query the object system for which files satisfy a certain prefix. Correspondingly, the processing can be as follows:
S401、终端向对象系统发送前缀查询请求,其中,前缀查询请求中携带有目标前缀。S401. The terminal sends a prefix query request to the target system, wherein the prefix query request carries the target prefix.
S402、对象系统向文件系统发送元数据同步请求。S402. The object system sends a metadata synchronization request to the file system.
S403、文件系统获取存储的全部操作日志作为待处理操作日志。S403. The file system acquires all stored operation logs as pending operation logs.
S404、文件系统将待处理操作日志中记录的父目录标识、文件标识和元数据发送至对象系统。S404, the file system sends the parent directory identifier, file identifier and metadata recorded in the operation log to be processed to the object system.
S405、对象系统对接收到的父目录标识、文件标识和元数据对应存储。S405, the object system stores the received parent directory identifier, file identifier and metadata correspondingly.
S406、对象系统在记录的索引中查找到满足目标前缀的索引。S406, the target system finds an index satisfying the target prefix in the recorded indexes.
其中,索引即由文件的父目录标识和文件标识组成。Among them, the index is composed of the parent directory ID of the file and the file ID.
S407、对象系统以字典序将满足目标前缀的索引返回给终端。S407. The target system returns the index satisfying the target prefix to the terminal in lexicographical order.
在本申请实施例中文件系统可以存储操作日志,操作日志记录了被文件系统操作的文件对应的文件标识、文件对应的父目录标识以及在文件系统对所述文件执行操作后生成的文件的元数据。在发生对元数据同步的触发事件时,文件系统可以将待处理操作日志中记录的文件的文件标识、父目录标识、元数据发送至对象系统,由对象系统对文件的文件标识、父目录标识、元数据对应存储。在元数据中包括有文件在所述文件系统中的存储地址信息,这样,对象系统无需存储文件本身,在用户有文件获取需求时,只需根据存储的文件的存储地址信息去获取文件即可,有效节省了对象系统的存储资源。In the embodiment of the present application, the file system may store an operation log, and the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the metadata of the file generated after the file system performs an operation on the file. data. When a trigger event for metadata synchronization occurs, the file system can send the file identifier, parent directory identifier, and metadata of the file recorded in the operation log to be processed to the object system, and the object system can verify the file identifier and parent directory identifier of the file. , metadata corresponding to storage. The metadata includes the storage address information of the file in the file system. In this way, the object system does not need to store the file itself. When the user has a file acquisition requirement, he only needs to acquire the file according to the storage address information of the stored file. , which effectively saves the storage resources of the object system.
基于相同的技术构思,本申请实施例还提供了一种元数据存储同步的装置,所述装置应用于文件系统,所述装置包括:Based on the same technical concept, an embodiment of the present application also provides an apparatus for storing and synchronizing metadata. The apparatus is applied to a file system, and the apparatus includes:
确定模块510,用于确定发生对元数据同步的触发事件,具体可以实现上述步骤201中文件系统的确定功能,以及其他隐含步骤;The determination module 510 is used to determine the occurrence of a trigger event for metadata synchronization, which can specifically implement the determination function of the file system in the above step 201, as well as other implicit steps;
获取模块520,用于在存储的操作日志中获取至少一个待处理操作日志,其中,所述操作日志中记录有被所述文件系统操作的文件对应的文件标识、所述文件对应的父目录标识以及在所述文件系统对所述文件执行操作后生成的所述文件的元数据,所述元数据包括所 述文件在所述文件系统中的存储地址信息,具体可以实现上述步骤202中文件系统的获取功能,以及其他隐含步骤;The obtaining module 520 is configured to obtain at least one pending operation log in the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system and the parent directory identifier corresponding to the file And the metadata of the file generated after the file system performs an operation on the file, the metadata includes the storage address information of the file in the file system, and specifically the file system in the above step 202 can be implemented , and other implicit steps;
发送模块530,用于向对象系统发送所述至少一个待处理操作日志对应的各文件对应的文件标识、父目录标识以及元数据,以使所述对象系统对接收到的所述各文件的文件标识、父目录标识、元数据对应存储,具体可以实现上述步骤203中文件系统的发送功能,以及其他隐含步骤。The sending module 530 is configured to send the file identifier, parent directory identifier and metadata corresponding to each file corresponding to the at least one operation log to be processed to the target system, so that the target system can respond to the received files of each file The identifier, the parent directory identifier, and the metadata are stored correspondingly, and specifically, the sending function of the file system in the above step 203 and other implicit steps can be implemented.
在一种可能的实现方式中,所述装置还包括删除模块,用于:In a possible implementation, the device also includes a deletion module for:
将存储的所述待处理操作日志进行删除。Delete the stored operation log to be processed.
在一种可能的实现方式中,所述确定模块510,用于:In a possible implementation manner, the determining module 510 is configured to:
确定所述文件系统重新启动;determine that the file system is restarted;
所述获取模块520,用于:The obtaining module 520 is used for:
获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
在一种可能的实现方式中,所述操作日志中还记录有所述文件系统对所述文件的操作时间;In a possible implementation manner, the operation log further records the operation time of the file system on the file;
所述确定模块510,用于:The determining module 510 is used for:
接收终端发送的元数据同步请求,其中,所述元数据同步请求中携带有同步时间;receiving a metadata synchronization request sent by a terminal, wherein the metadata synchronization request carries a synchronization time;
所述获取模块520,用于:The obtaining module 520 is used for:
在存储的操作日志中,获取记录的操作时间在所述同步时间之前的所有操作日志作为待处理操作日志。In the stored operation logs, all operation logs whose recorded operation time is before the synchronization time are acquired as pending operation logs.
在一种可能的实现方式中,所述确定模块510,用于:In a possible implementation manner, the determining module 510 is configured to:
确定达到预设元数据同步周期;It is determined that the preset metadata synchronization period is reached;
所述获取模块520,用于:The obtaining module 520 is used for:
获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
在一种可能的实现方式中,所述装置还包括生成模块,用于:In a possible implementation manner, the apparatus further includes a generating module for:
在对第一文件进行操作后,生成对应的第一操作日志;After the first file is operated, a corresponding first operation log is generated;
获取所述第一操作日志中记录的所述第一文件的父目录标识;Obtain the parent directory identifier of the first file recorded in the first operation log;
获取当前存储周期对应的第一布隆过滤器,在所述第一布隆过滤器中记录所述第一文件的父目录标识;Obtain the first bloom filter corresponding to the current storage period, and record the parent directory identifier of the first file in the first bloom filter;
将所述第一文件存储至所述第一布隆过滤器对应的第一操作日志存储区;storing the first file in the first operation log storage area corresponding to the first bloom filter;
所述确定模块510,用于:The determining module 510 is used for:
接收所述对象系统发送的对第二文件的元数据同步请求,其中,所述元数据同步请求中携带有所述第二文件的父目录标识;receiving a metadata synchronization request for the second file sent by the object system, wherein the metadata synchronization request carries the parent directory identifier of the second file;
所述获取模块520,用于:The obtaining module 520 is used for:
确定记录有所述第二文件的父目录标识的第二布隆过滤器;determining a second bloom filter that records the parent directory identifier of the second file;
获取所述第二布隆过滤器对应的第二操作日志存储区中存储的操作日志和其他存储区中在所述第二操作日志存储区中存储的操作日志之前存储的操作日志,作为待处理操作日志。Obtain the operation log stored in the second operation log storage area corresponding to the second bloom filter and the operation log stored before the operation log stored in the second operation log storage area in other storage areas, as pending processing Operation log.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
置位模块,用于将所述待处理操作日志对应的操作日志存储区对应的布隆过滤器中的 值全部置0。The setting module is used to set all the values in the Bloom filter corresponding to the operation log storage area corresponding to the operation log to be processed to 0.
在一种可能的实现方式中,所述装置还包括接收模块,用于:In a possible implementation manner, the apparatus further includes a receiving module for:
接收所述对象系统发送的对第三文件的读取请求,其中,所述读取请求中携带有所述第三文件的存储地址信息;receiving a read request for a third file sent by the target system, wherein the read request carries storage address information of the third file;
根据所述第三文件的存储地址信息,获取所述第三文件;obtaining the third file according to the storage address information of the third file;
向所述对象系统发送所述第三文件。The third file is sent to the subject system.
需要说明的是:上述实施例提供的元数据同步的装置在同步元数据时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将文件系统的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的元数据同步的装置与元数据同步的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the metadata synchronization device provided in the above embodiments synchronizes metadata, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. Complete, that is, dividing the internal structure of the file system into different functional modules to complete all or part of the functions described above. In addition, the device for synchronizing metadata provided in the above embodiments and the method embodiments for synchronizing metadata belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
基于相同的技术构思,本申请实施例还提供了一种元数据同步的装置,所述装置应用于对象系统,所述装置包括接收模块610,用于:Based on the same technical concept, an embodiment of the present application also provides a metadata synchronization device, the device is applied to an object system, and the device includes a receiving module 610 for:
接收文件系统发送的文件对应的文件标识、父目录标识以及元数据,其中,所述元数据包括所述文件在所述文件系统中的存储地址信息,具体可以实现上述步骤204中对象系统的接收功能,以及其他隐含步骤;Receive the file identifier, parent directory identifier, and metadata corresponding to the file sent by the file system, wherein the metadata includes the storage address information of the file in the file system. Specifically, the receiving of the object system in the above step 204 can be realized. functions, and other implied steps;
存储模块620,用于对接收到的所述文件的文件标识、父目录标识、元数据对应存储,具体可以实现上述步骤204中对象系统的存储功能,以及其他隐含步骤。The storage module 620 is configured to store the received file identifier, parent directory identifier, and metadata correspondingly. Specifically, the storage function of the object system in the above step 204 and other implicit steps can be implemented.
在一种可能的实现方式中,所述装置还包括读取模块,用于:In a possible implementation manner, the apparatus further includes a reading module for:
接收终端发送的目标文件的第一读取请求,所述第一读取请求中携带有所述目标文件的文件标识和父目录标识;receiving the first read request of the target file sent by the terminal, where the first read request carries the file identifier and the parent directory identifier of the target file;
获取所述目标文件的元数据;obtain metadata of the target file;
向所述文件系统发送对所述目标文件的第二读取请求,所述第二读取请求中携带所述目标文件的存储地址信息;sending a second read request for the target file to the file system, where the second read request carries the storage address information of the target file;
接收所述文件系统返回的所述目标文件;receiving the target file returned by the file system;
向所述终端返回所述目标文件。Return the target file to the terminal.
需要说明的是:上述实施例提供的元数据同步的装置在同步元数据时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将对象系统的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的元数据同步的装置与元数据同步的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the metadata synchronization device provided in the above embodiments synchronizes metadata, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. To complete, that is, to divide the internal structure of the object system into different functional modules to complete all or part of the functions described above. In addition, the device for synchronizing metadata provided in the above embodiments and the method embodiments for synchronizing metadata belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
图7是本申请实施例提供的一种文件系统的结构示意图,该文件系统700可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)701和一个或一个以上的存储器702,其中,所述存储器702中存储有至少一条指令,所述至少一条指令由所述处理器701加载并执行以实现上述元数据同步的方法。7 is a schematic structural diagram of a file system provided by an embodiment of the present application. The file system 700 may vary greatly due to different configurations or performance, and may include one or more central processing units (CPU) 701 and one or more memories 702, wherein, at least one instruction is stored in the memory 702, and the at least one instruction is loaded and executed by the processor 701 to implement the above metadata synchronization method.
图8是本申请实施例提供的一种对象系统的结构示意图,该对象系统800可因配置或 性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)801和一个或一个以上的存储器802,其中,所述存储器802中存储有至少一条指令,所述至少一条指令由所述处理器801加载并执行以实现上述元数据同步的方法。FIG. 8 is a schematic structural diagram of an object system provided by an embodiment of the present application. The object system 800 may vary greatly due to different configurations or performance, and may include one or more central processing units (CPU) 801 and one or more memories 802, wherein the memory 802 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 801 to implement the above metadata synchronization method.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现,当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令,在设备上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴光缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是设备能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如软盘、硬盘和磁带等),也可以是光介质(如数字视盘(Digital Video Disk,DVD)等),或者半导体介质(如固态硬盘等)。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof, and when implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on a device, all or part of the processes or functions described in the embodiments of the present application are generated. The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that the device can access, or a data storage device such as a server, data center, or the like that includes an integration of one or more available media. The usable medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid-state disk, etc.).
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述仅为本申请一个实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above is only an embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. Inside.

Claims (24)

  1. 一种元数据同步的方法,其特征在于,所述方法应用于文件系统,所述方法包括:A method for metadata synchronization, wherein the method is applied to a file system, and the method includes:
    确定发生对元数据同步的触发事件;determine the occurrence of a trigger event for metadata synchronization;
    在存储的操作日志中获取至少一个待处理操作日志,其中,所述操作日志中记录有被所述文件系统操作的文件对应的文件标识、所述文件对应的父目录标识以及在所述文件系统对所述文件执行操作后生成的所述文件的元数据,所述元数据包括所述文件在所述文件系统中的存储地址信息;Obtain at least one operation log to be processed from the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and the file system in the file system. metadata of the file generated after performing an operation on the file, the metadata includes storage address information of the file in the file system;
    向对象系统发送所述至少一个待处理操作日志对应的各文件对应的文件标识、父目录标识以及元数据,以使所述对象系统对接收到的所述各文件的文件标识、父目录标识、元数据对应存储。Send the file identifier, parent directory identifier, and metadata corresponding to each file corresponding to the at least one operation log to be processed to the object system, so that the object system can compare the received file identifier, parent directory identifier, Metadata corresponds to storage.
  2. 根据权利要求1所述的方法,其特征在于,所述在存储的操作日志中获取至少一个待处理操作日志之后,所述方法还包括:method according to claim 1, is characterized in that, described in the operation log of storage after obtaining at least one to-be-processed operation log, described method also comprises:
    将存储的所述待处理操作日志进行删除。Delete the stored operation log to be processed.
  3. 根据权利要求2所述的方法,其特征在于,所述确定发生对元数据同步的触发事件,包括:The method according to claim 2, wherein the determining that a trigger event for metadata synchronization occurs comprises:
    确定所述文件系统重新启动;determine that the file system is restarted;
    所述在存储的操作日志中获取满足处理条件的至少一个待处理操作日志,包括:The obtaining at least one pending operation log that satisfies the processing condition in the stored operation log includes:
    获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
  4. 根据权利要求2所述的方法,其特征在于,所述操作日志中还记录有所述文件系统对所述文件的操作时间;The method according to claim 2, wherein the operation log further records the operation time of the file system on the file;
    所述确定发生对元数据同步的触发事件,包括:The determining that a trigger event for metadata synchronization occurs includes:
    接收终端发送的元数据同步请求,其中,所述元数据同步请求中携带有同步时间;receiving a metadata synchronization request sent by a terminal, wherein the metadata synchronization request carries a synchronization time;
    所述在存储的操作日志中获取至少一个待处理操作日志,包括:The obtaining at least one pending operation log in the stored operation log includes:
    在存储的操作日志中,获取记录的操作时间在所述同步时间之前的所有操作日志作为待处理操作日志。In the stored operation logs, all operation logs whose recorded operation time is before the synchronization time are acquired as pending operation logs.
  5. 根据权利要求2所述的方法,其特征在于,所述确定发生对元数据同步的触发事件,包括:The method according to claim 2, wherein the determining that a trigger event for metadata synchronization occurs comprises:
    确定达到预设元数据同步周期;It is determined that the preset metadata synchronization period is reached;
    所述在存储的操作日志中获取至少一个待处理操作日志,包括:The obtaining at least one pending operation log in the stored operation log includes:
    获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
  6. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    在对第一文件进行操作后,生成对应的第一操作日志;After the first file is operated, a corresponding first operation log is generated;
    获取所述第一操作日志中记录的所述第一文件的父目录标识;Obtain the parent directory identifier of the first file recorded in the first operation log;
    获取当前存储周期对应的第一布隆过滤器,在所述第一布隆过滤器中记录所述第一文 件的父目录标识;Obtain the first bloom filter corresponding to the current storage period, record the parent directory identification of the first file in the first bloom filter;
    将所述第一文件存储至所述第一布隆过滤器对应的第一操作日志存储区;storing the first file in the first operation log storage area corresponding to the first bloom filter;
    所述确定发生对元数据同步的触发事件,包括:The determining that a trigger event for metadata synchronization occurs includes:
    接收所述对象系统发送的对第二文件的元数据同步请求,其中,所述元数据同步请求中携带有所述第二文件的父目录标识;receiving a metadata synchronization request for the second file sent by the object system, wherein the metadata synchronization request carries the parent directory identifier of the second file;
    所述在存储的操作日志中获取至少一个待处理操作日志,包括:The obtaining at least one pending operation log in the stored operation log includes:
    确定记录有所述第二文件的父目录标识的第二布隆过滤器;determining a second bloom filter that records the parent directory identifier of the second file;
    获取所述第二布隆过滤器对应的第二操作日志存储区中存储的操作日志和其他存储区中在所述第二操作日志存储区中存储的操作日志之前存储的操作日志,作为待处理操作日志。Obtain the operation log stored in the second operation log storage area corresponding to the second bloom filter and the operation log stored before the operation log stored in the second operation log storage area in other storage areas, as pending processing Operation log.
  7. 根据权利要求6所述的方法,其特征在于,所述获取所述第二布隆过滤器对应的第二操作日志存储区中存储的操作日志和其他存储区中在所述第二操作日志存储区中存储的操作日志之前存储的操作日志,作为待处理操作日志之后,所述方法还包括:The method according to claim 6, wherein the acquiring the operation log stored in the second operation log storage area corresponding to the second bloom filter and other storage areas are stored in the second operation log After the operation log stored before the operation log stored in the area is used as the operation log to be processed, the method further includes:
    将所述待处理操作日志对应的操作日志存储区对应的布隆过滤器中的值全部置0。All values in the Bloom filter corresponding to the operation log storage area corresponding to the operation log to be processed are set to 0.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    接收所述对象系统发送的对第三文件的读取请求,其中,所述读取请求中携带有所述第三文件的存储地址信息;receiving a read request for a third file sent by the target system, wherein the read request carries storage address information of the third file;
    根据所述第三文件的存储地址信息,获取所述第三文件;obtaining the third file according to the storage address information of the third file;
    向所述对象系统发送所述第三文件。The third file is sent to the subject system.
  9. 一种元数据同步的方法,其特征在于,所述方法应用于对象系统,所述方法包括:A method for metadata synchronization, wherein the method is applied to an object system, and the method includes:
    接收文件系统发送的文件对应的文件标识、父目录标识以及元数据,其中,所述元数据包括所述文件在所述文件系统中的存储地址信息;receiving the file identifier, parent directory identifier and metadata corresponding to the file sent by the file system, wherein the metadata includes storage address information of the file in the file system;
    对接收到的所述文件的文件标识、父目录标识、元数据对应存储。The received file identifier, parent directory identifier, and metadata of the file are stored correspondingly.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    接收终端发送的目标文件的第一读取请求,所述第一读取请求中携带有所述目标文件的文件标识和父目录标识;receiving the first read request of the target file sent by the terminal, where the first read request carries the file identifier and the parent directory identifier of the target file;
    获取所述目标文件的元数据;obtain metadata of the target file;
    向所述文件系统发送对所述目标文件的第二读取请求,所述第二读取请求中携带所述目标文件的存储地址信息;sending a second read request for the target file to the file system, where the second read request carries the storage address information of the target file;
    接收所述文件系统返回的所述目标文件;receiving the target file returned by the file system;
    向所述终端返回所述目标文件。Return the target file to the terminal.
  11. 一种元数据存储同步的装置,其特征在于,所述装置应用于文件系统,所述装置包括:An apparatus for storing and synchronizing metadata, wherein the apparatus is applied to a file system, and the apparatus includes:
    确定模块,用于确定发生对元数据同步的触发事件;A determination module, used to determine the occurrence of a trigger event for metadata synchronization;
    获取模块,用于在存储的操作日志中获取至少一个待处理操作日志,其中,所述操作日志中记录有被所述文件系统操作的文件对应的文件标识、所述文件对应的父目录标识以及在所述文件系统对所述文件执行操作后生成的所述文件的元数据,所述元数据包括所述文件在所述文件系统中的存储地址信息;The acquisition module is used to acquire at least one pending operation log in the stored operation log, wherein the operation log records the file identifier corresponding to the file operated by the file system, the parent directory identifier corresponding to the file, and metadata of the file generated after the file system performs an operation on the file, the metadata includes storage address information of the file in the file system;
    发送模块,用于向对象系统发送所述至少一个待处理操作日志对应的各文件对应的文件标识、父目录标识以及元数据,以使所述对象系统对接收到的所述各文件的文件标识、父目录标识、元数据对应存储。A sending module, configured to send the file identifier, parent directory identifier and metadata corresponding to each file corresponding to the at least one operation log to be processed to the object system, so that the object system can identify the file identifiers of the files received by the object system , parent directory ID, and metadata are stored accordingly.
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括删除模块,用于:device according to claim 11, is characterized in that, described device also comprises deletion module, is used for:
    将存储的所述待处理操作日志进行删除。Delete the stored operation log to be processed.
  13. 根据权利要求12所述的装置,其特征在于,所述确定模块,用于:The device according to claim 12, wherein the determining module is configured to:
    确定所述文件系统重新启动;determine that the file system is restarted;
    所述获取模块,用于:The acquisition module is used for:
    获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
  14. 根据权利要求12所述的装置,其特征在于,所述操作日志中还记录有所述文件系统对所述文件的操作时间;The device according to claim 12, wherein the operation log further records the operation time of the file system on the file;
    所述确定模块,用于:The determining module is used for:
    接收终端发送的元数据同步请求,其中,所述元数据同步请求中携带有同步时间;receiving a metadata synchronization request sent by a terminal, wherein the metadata synchronization request carries a synchronization time;
    所述获取模块,用于:The acquisition module is used for:
    在存储的操作日志中,获取记录的操作时间在所述同步时间之前的所有操作日志作为待处理操作日志。In the stored operation logs, all operation logs whose recorded operation time is before the synchronization time are acquired as pending operation logs.
  15. 根据权利要求12所述的装置,其特征在于,所述确定模块,用于:The device according to claim 12, wherein the determining module is configured to:
    确定达到预设元数据同步周期;It is determined that the preset metadata synchronization period is reached;
    所述获取模块,用于:The acquisition module is used for:
    获取存储的所有操作日志作为待处理操作日志。Get all operation logs stored as pending operation logs.
  16. 根据权利要求12所述的装置,其特征在于,所述装置还包括生成模块,用于:The apparatus according to claim 12, wherein the apparatus further comprises a generating module for:
    在对第一文件进行操作后,生成对应的第一操作日志;After the first file is operated, a corresponding first operation log is generated;
    获取所述第一操作日志中记录的所述第一文件的父目录标识;Obtain the parent directory identifier of the first file recorded in the first operation log;
    获取当前存储周期对应的第一布隆过滤器,在所述第一布隆过滤器中记录所述第一文件的父目录标识;Obtain the first bloom filter corresponding to the current storage period, and record the parent directory identifier of the first file in the first bloom filter;
    将所述第一文件存储至所述第一布隆过滤器对应的第一操作日志存储区;storing the first file in the first operation log storage area corresponding to the first bloom filter;
    所述确定模块,用于:The determining module is used for:
    接收所述对象系统发送的对第二文件的元数据同步请求,其中,所述元数据同步请求中携带有所述第二文件的父目录标识;receiving a metadata synchronization request for the second file sent by the object system, wherein the metadata synchronization request carries the parent directory identifier of the second file;
    所述获取模块,用于:The acquisition module is used for:
    确定记录有所述第二文件的父目录标识的第二布隆过滤器;determining a second bloom filter that records the parent directory identifier of the second file;
    获取所述第二布隆过滤器对应的第二操作日志存储区中存储的操作日志和其他存储区中在所述第二操作日志存储区中存储的操作日志之前存储的操作日志,作为待处理操作日志。Obtain the operation log stored in the second operation log storage area corresponding to the second bloom filter and the operation log stored before the operation log stored in the second operation log storage area in other storage areas, as pending processing Operation log.
  17. 根据权利要求16所述的装置,其特征在于,所述装置还包括:The apparatus of claim 16, wherein the apparatus further comprises:
    置位模块,用于将所述待处理操作日志对应的操作日志存储区对应的布隆过滤器中的值全部置0。The setting module is configured to set all the values in the Bloom filter corresponding to the operation log storage area corresponding to the operation log to be processed to 0.
  18. 根据权利要求17所述的装置,其特征在于,所述装置还包括接收模块,用于:The device according to claim 17, wherein the device further comprises a receiving module for:
    接收所述对象系统发送的对第三文件的读取请求,其中,所述读取请求中携带有所述第三文件的存储地址信息;receiving a read request for a third file sent by the target system, wherein the read request carries storage address information of the third file;
    根据所述第三文件的存储地址信息,获取所述第三文件;obtaining the third file according to the storage address information of the third file;
    向所述对象系统发送所述第三文件。The third file is sent to the subject system.
  19. 一种元数据同步的装置,其特征在于,所述装置应用于对象系统,所述装置包括接收模块,用于:An apparatus for metadata synchronization, characterized in that the apparatus is applied to an object system, and the apparatus includes a receiving module for:
    接收文件系统发送的文件对应的文件标识、父目录标识以及元数据,其中,所述元数据包括所述文件在所述文件系统中的存储地址信息;receiving the file identifier, parent directory identifier and metadata corresponding to the file sent by the file system, wherein the metadata includes storage address information of the file in the file system;
    存储模块,用于对接收到的所述文件的文件标识、父目录标识、元数据对应存储。The storage module is used for correspondingly storing the received file identifier, parent directory identifier and metadata of the file.
  20. 根据权利要求19所述的装置,其特征在于,所述装置还包括读取模块,用于:The device according to claim 19, wherein the device further comprises a reading module for:
    接收终端发送的目标文件读的第一取请求,所述第一读取请求中携带有所述目标文件的文件标识和父目录标识;receiving a first fetch request for reading a target file sent by a terminal, where the first reading request carries a file identifier and a parent directory identifier of the target file;
    获取所述目标文件的元数据;obtain metadata of the target file;
    向所述文件系统发送对所述目标文件的第二读取请求,所述第二读取请求中携带所述目标文件的存储地址信息;sending a second read request for the target file to the file system, where the second read request carries the storage address information of the target file;
    接收所述文件系统返回的所述目标文件;receiving the target file returned by the file system;
    向所述终端返回所述目标文件。Return the target file to the terminal.
  21. 一种文件系统,其特征在于,所述文件系统包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如权利要求1至8任一权利要求所述的元数据同步的方法。A file system, characterized in that, the file system includes a processor and a memory, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement claims 1 to 8 The method for metadata synchronization according to any claim.
  22. 一种对象系统,其特征在于,所述对象系统包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如权利要求9至10任一所述的元数据同步的方法。An object system, characterized in that, the object system includes a processor and a memory, and the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement claims 9 to 10 Any of the described methods for metadata synchronization.
  23. 一种计算机可读存储介质,其特征在于,包括指令,当所述计算机可读存储介质 在文件系统上运行时,使得所述文件系统执行所述权利要求1至8中任一权利要求所述的元数据同步的方法。A computer-readable storage medium, comprising instructions, when the computer-readable storage medium runs on a file system, causing the file system to execute the file system described in any one of claims 1 to 8 Metadata synchronization method.
  24. 一种计算机可读存储介质,其特征在于,包括指令,当所述计算机可读存储介质在对象系统上运行时,使得所述文件系统执行所述权利要求9至10中任一权利要求所述的元数据同步的方法。A computer-readable storage medium, comprising instructions, when the computer-readable storage medium runs on an object system, causing the file system to execute the file system described in any one of claims 9 to 10 Metadata synchronization method.
PCT/CN2021/114190 2020-08-31 2021-08-24 Metadata synchronization method and apparatus WO2022042514A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010901025.4 2020-08-31
CN202010901025.4A CN114116641A (en) 2020-08-31 2020-08-31 Method and device for synchronizing metadata

Publications (1)

Publication Number Publication Date
WO2022042514A1 true WO2022042514A1 (en) 2022-03-03

Family

ID=80352671

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/114190 WO2022042514A1 (en) 2020-08-31 2021-08-24 Metadata synchronization method and apparatus

Country Status (2)

Country Link
CN (1) CN114116641A (en)
WO (1) WO2022042514A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108153804A (en) * 2017-11-17 2018-06-12 极道科技(北京)有限公司 A kind of metadata daily record update method of symmetric distributed file system
CN110781152A (en) * 2019-10-09 2020-02-11 济南浪潮数据技术有限公司 Multi-protocol data sharing architecture
CN110807000A (en) * 2019-10-25 2020-02-18 北京达佳互联信息技术有限公司 File repair method and device, electronic equipment and storage medium
US20200265023A1 (en) * 2019-02-19 2020-08-20 Oracle International Corporation System for transition from a hierarchical file system to an object store

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108153804A (en) * 2017-11-17 2018-06-12 极道科技(北京)有限公司 A kind of metadata daily record update method of symmetric distributed file system
US20200265023A1 (en) * 2019-02-19 2020-08-20 Oracle International Corporation System for transition from a hierarchical file system to an object store
CN110781152A (en) * 2019-10-09 2020-02-11 济南浪潮数据技术有限公司 Multi-protocol data sharing architecture
CN110807000A (en) * 2019-10-25 2020-02-18 北京达佳互联信息技术有限公司 File repair method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114116641A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
US11531482B2 (en) Data deduplication method and apparatus
WO2016086552A1 (en) File processing method and client
WO2019085471A1 (en) Database synchronization method, application server, and computer readable storage medium
US7861049B2 (en) Methods and apparatus for archiving digital data
CN111176549B (en) Data storage method and device based on cloud storage and storage medium
US20170031948A1 (en) File synchronization method, server, and terminal
US10013312B2 (en) Method and system for a safe archiving of data
US11615000B2 (en) Method and backup server for processing expired backups
US11886298B2 (en) Using a storage log to generate an incremental backup
US20190347167A1 (en) Primary Node-Standby Node Data Transmission Method, Control Node, and Database System
WO2017076223A1 (en) Indexing implementing method and system in file storage
CN108829720B (en) Data processing method and device
CN109885577B (en) Data processing method, device, terminal and storage medium
CN115599747B (en) Metadata synchronization method, system and equipment of distributed storage system
CN110597762A (en) File processing method, device, equipment and storage medium
US20230325363A1 (en) Time series data layered storage systems and methods
CN113239012B (en) Database migration method and device, electronic equipment and storage medium
CN109144403B (en) Method and equipment for switching cloud disk modes
CN111309799A (en) Method, device and system for realizing data merging and storage medium
US9870385B2 (en) Computer system, data management method, and computer
CN111831954B (en) Content data updating method, device, computer equipment and storage medium
WO2022042514A1 (en) Metadata synchronization method and apparatus
CN114116611A (en) File scanning method and related device
CN111147226A (en) Data storage method, device and storage medium
CN115098519A (en) Data storage method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21860349

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21860349

Country of ref document: EP

Kind code of ref document: A1