Metadata storage method and device, computer equipment and storage medium

By allocating data storage fragments and metadata storage pages for the data to be written in a distributed storage system and generating a metadata storage solution, the problems of large occupancy of metadata storage space, complex deployment and serious write amplification in the prior art are solved, and efficient metadata storage and simplified deployment are achieved.

CN119576235APending Publication Date: 2025-03-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411701385.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

When the existing distributed storage engine realizes consistent persistence of metadata, it occupies a lot of storage capacity, consumes the read and write bandwidth of the main storage cluster, increases system deployment dependence, and has serious write amplification.

Method used

By assigning a data storage fragment to the data to be written in the physical disk and configuring a fragment identification, a metadata storage page for the selected virtual disk to store metadata is determined. The metadata storage page is the minimum input and output unit of the physical disk, and metadata is generated based on the fragment identification and page identification, and stored in the metadata storage page after the data is written.

Benefits of technology

It realizes the completion of storage and write transactions without relying on external K-V DB or WAL, effectively saving storage space during metadata storage, simplifying the deployment of storage components, and reducing the write amplification effect during metadata storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576235A_ABST
    Figure CN119576235A_ABST
Patent Text Reader

Abstract

The invention relates to a metadata storage method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring to-be-written data in response to a data writing operation for a selected virtual disk; distributing a data storage fragment for the to-be-written data in a physical disk corresponding to the selected virtual disk, and configuring a fragment identifier; determining a metadata storage page, used for storing metadata, of the selected virtual disk, wherein the metadata storage page is a minimum input / output unit of the physical disk; generating metadata of the to-be-written data based on the fragment identifier and the page identifier of the metadata storage page; and after the to-be-written data is written into the data storage fragment, storing the metadata into the metadata storage page. By adopting the method, the storage space occupied during metadata storage can be reduced, the deployment of the storage component is simplified, and the write amplification effect is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud storage technology, and in particular to a metadata storage method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] In a distributed storage system, data may be stored on multiple nodes, so how to ensure the data consistency of the storage system is of great significance for maintaining the continuity and stability of the system business. The traditional way is often to use the Write-Ahead Logging (WAL) mechanism or a database system based on key-value pair storage (K-VDB, Key-Value Database) to implement write transactions and ensure the data consistency of the storage system.

[0003] When implementing write transactions based on WAL, WAL logs can be used to restore to a consistent state in the event of a failure. Implementing transactions based on KV DB completely borrows the transaction characteristics of KV DB. However, existing distributed storage engines rely on WAL or K-VDB components to achieve metadata consistency and persistence, which will take up more storage capacity, consume the read and write bandwidth of the main storage cluster, and increase the deployment dependency of the system. At the same time, there will be serious write amplification. Summary of the invention

[0004] Based on this, it is necessary to provide a metadata storage method, apparatus, computer device, computer-readable storage medium and computer program product that can reduce the storage space occupied by metadata storage, simplify the deployment of storage components and reduce the write amplification effect in response to the above technical problems.

[0005] In a first aspect, the present application provides a metadata storage method, the method comprising:

[0006] In response to a data writing operation on the selected virtual disk, acquiring data to be written;

[0007] In the physical disk corresponding to the selected virtual disk, allocating a data storage segment for the data to be written, and configuring a segment identifier;

[0008] Determine a metadata storage page of the selected virtual disk for storing metadata, wherein the metadata storage page is a minimum input and output unit of the physical disk;

[0009] Generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page;

[0010] After the data to be written is written into the data storage segment, the metadata is stored in the metadata storage page.

[0011] In some embodiments, determining a metadata storage page of the selected virtual disk for storing metadata includes:

[0012] Determining candidate metadata storage pages for the selected virtual disk;

[0013] When the storage capacity of the candidate metadata storage page reaches a preset capacity threshold, generating a new storage page for the selected virtual disk;

[0014] The newly added storage page is determined as a metadata storage page for storing metadata, and the newly added storage page is linked to the candidate metadata storage page.

[0015] In some embodiments, determining the candidate metadata storage page of the selected virtual disk includes:

[0016] Determining a selected initial storage page corresponding to the selected virtual disk according to the selected virtual disk and the correspondence between the virtual disk and the initial storage page;

[0017] When it is determined based on the selected initial storage page that the selected virtual disk does not have a storage page linked list, the selected initial storage page is determined as a candidate metadata storage page of the selected virtual disk.

[0018] In some embodiments, the method further comprises:

[0019] When it is determined that the selected virtual disk has a storage page linked list based on the selected initial storage page, the end storage page of the storage page linked list is determined as a candidate metadata storage page of the selected virtual disk.

[0020] In some embodiments, the disk interval of the physical disk includes a table header interval and a table page interval, and the method further includes:

[0021] In response to an initialization instruction for each virtual disk in the physical disk, configuring a corresponding initial storage page for each virtual disk in a header section of the physical disk;

[0022] For each of the initial storage pages, a linked list structure is configured for the initial storage page, a head pointer of the linked list structure is set in the table header interval, and a tail pointer is set in the table page interval; the table page interval is used to store newly added storage pages of each virtual disk.

[0023] In some embodiments, the disk range of the physical disk further includes a super block, and the super block is used to store partition information of the physical disk; the method further includes:

[0024] When a distributed storage system to which the physical disk belongs has a system abnormality, obtaining partition information of the physical disk from the super block;

[0025] Determine, according to the partition information, the interval position of the header interval on the physical disk;

[0026] Based on the interval position, performing interval scanning on the header interval to obtain the initial storage page of each virtual disk;

[0027] For each of the initial storage pages, according to the linked list structure of the initial storage page, obtaining the storage page linked list to which the initial storage page belongs;

[0028] Based on each of the storage page linked lists, metadata of each of the virtual disks is rebuilt.

[0029] In a second aspect, the present application further provides a metadata storage device, the device comprising:

[0030] An operation response module, used for obtaining data to be written in response to a data writing operation on a selected virtual disk;

[0031] A storage segment allocation module, used to allocate data storage segments for the data to be written in the physical disk corresponding to the selected virtual disk, and configure segment identifiers;

[0032] A metadata storage page determination module, used to determine a metadata storage page of the selected virtual disk for storing metadata, wherein the metadata storage page is a minimum input and output unit of the physical disk;

[0033] A metadata generation module, used to generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page;

[0034] The metadata storage module is used to store the metadata in the metadata storage page after the data to be written is written into the data storage segment.

[0035] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0037] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0038] In the above-mentioned metadata storage method, apparatus, computer equipment, storage medium and computer program product, the distributed storage engine obtains the data to be written in response to the data write operation for the selected virtual disk, allocates a data storage segment for the data to be written in the physical disk corresponding to the selected virtual disk, and configures a segment identifier, and at the same time determines the metadata storage page of the selected virtual disk for storing metadata, wherein the metadata storage page is the smallest input and output unit of the physical disk, and therefore the metadata storage page has the atomic update capability, and the distributed storage engine generates metadata for the data to be written based on the segment identifier and the page identifier of the metadata storage page, and after the data to be written is written to the data storage segment, the metadata is stored in the metadata storage page, and storage write transactions can be implemented without relying on an external KV DB or WAL, effectively saving storage space during metadata storage, simplifying storage component deployment, and at the same time, because the metadata storage page has the atomic update capability, it can also effectively reduce the write amplification effect during metadata storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A diagram of an application environment of a metadata storage method in some embodiments;

[0040] Figure 2 A schematic diagram of a metadata storage method in some embodiments;

[0041] Figure 3 A schematic diagram of a process for determining a metadata storage page of a selected virtual disk for storing metadata in some embodiments;

[0042] Figure 4 is a flowchart of a metadata storage method in some other embodiments;

[0043] Figure 5 It is a flowchart of a write transaction process based on WAL in some embodiments;

[0044] Figure 6 A flowchart of a write transaction process that relies on a KV DB in some embodiments;

[0045] Figure 7 is a flowchart of a metadata storage method in some other embodiments;

[0046] Figure 8 A schematic diagram of the organizational structure of a physical disk in some embodiments;

[0047] Fig. 9 is a structural block diagram of a metadata storage device in some embodiments;

[0048] Fig.10 1 is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0050] The metadata storage method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the distributed storage engine 102 can be communicatively connected with the storage server 104, and the data storage system can store the data that the distributed storage engine 102 needs to process. The data storage system can be integrated on the distributed storage engine 102, or it can be placed on the cloud or other network servers. In response to the data write operation for the selected virtual disk, the distributed storage engine 102 obtains the data to be written from the storage server 104, allocates a data storage segment for the data to be written in the physical disk corresponding to the selected virtual disk, and configures the segment identifier, determines the metadata storage page of the selected virtual disk for storing metadata, and the metadata storage page is the smallest input and output unit of the physical disk. Based on the segment identifier and the page identifier of the metadata storage page, the metadata of the data to be written is generated, and after the data to be written is written to the data storage segment, the metadata is stored in the metadata storage page.

[0051] In some embodiments, Figure 2 As shown, a metadata storage method is provided, which is applied to Figure 1 The distributed storage engine 102 in the example is used as an example to illustrate, and the following steps are included:

[0052] S202 : In response to a data writing operation on a selected virtual disk, obtaining data to be written.

[0053] Among them, the virtual disk is a virtual disk formed by logical disks, which can also be called a logical volume. It is a mechanism used by the distributed engine to manage disk space. The logical disk is a regional disk obtained by dividing the real physical disk into several logical parts. Each logical part is regarded as an independent logical disk or logical partition. Therefore, each physical disk will correspond to multiple logical disks. By creating multiple logical disks for a physical disk, data and file systems can be better managed.

[0054] Among them, the data writing operation for the selected virtual disk refers to the operation of updating the data of the selected virtual disk, which can be triggered by the user through the client. For example, the user can perform data writing operations through the client's file manager, command line tool or application, such as saving files, copying and pasting data, etc. These operations will trigger the file system call at the operating system level, and then write the data to the specified logical disk.

[0055] The data to be written is update data that needs to be written into the selected virtual disk.

[0056] Specifically, the distributed storage engine obtains the to-be-written data that needs to be written to the selected virtual disk in response to the data writing operation for the selected virtual disk.

[0057] S204: Allocate data storage segments for the data to be written in the physical disk corresponding to the selected virtual disk, and configure segment identifiers.

[0058] Among them, the data storage fragment can also be called a segment, which is a logical unit of data storage, used to divide the data interval of the disk into units that are easier to manage and access, so that data can be read and written in the form of blocks or segments, thereby improving the efficiency and flexibility of data processing. In the case of data to be written, the distributed storage engine will split the data interval in the physical disk according to the preset fragment size, and allocate corresponding data storage fragments to the data to be written. It can be understood that the data storage fragments allocated to the data to be written can be single or multiple, which can be determined according to the data size of the data to be written.

[0059] In order to improve the efficiency of data management and control, the distributed storage engine will configure a unique fragment identifier for each data storage fragment, which can accurately represent the physical address of the data to be written in the physical disk. It can be understood that the specific form of the fragment identifier can be set according to the actual situation, for example, the fragment identifier can be a number, a character or a string.

[0060] Specifically, after obtaining the data to be written, the distributed storage engine can allocate data storage fragments for the data to be written in the data interval of the physical disk corresponding to the selected virtual disk according to the data size of the data to be written, and configure a unique fragment identifier for each data storage fragment.

[0061] S206: Determine a metadata storage page of the selected virtual disk for storing metadata, where the metadata storage page is the smallest input and output unit of the physical disk.

[0062] Among them, the metadata storage page is a storage page in the physical disk, which is the smallest input and output unit of the physical disk, that is, the smallest read and write unit. The size of the storage page usually corresponds to the page size of the memory, such as 4KB, 8KB, etc. In the distributed storage system, the physical disk has the ability to atomically update at the page granularity, that is, to ensure that data is atomically updated in units of pages. Atomic update means that an operation is either completed in full or not completed in full, and will not be interrupted by other operations or events.

[0063] Specifically, the distributed storage engine may determine, according to the selected virtual disk, a metadata storage page of the selected virtual disk for storing metadata.

[0064] S208 , generating metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page.

[0065] Among them, the page identifier is the unique identification information used to mark the storage page. When setting the storage page, the distributed storage engine will set a corresponding page identifier for each storage page. Similarly, the specific form of the page identifier can be set according to the actual situation. For example, the page identifier can be a number, character or string.

[0066] Metadata, also known as intermediary data or relay data, is data that describes data. It is mainly used to describe data attributes and to support functions such as indicating storage location, historical data, resource search, and file records. The metadata of the data to be written can represent the mapping relationship between the logical address of the data to be written and the identifier of the physical data storage segment.

[0067] Specifically, the distributed storage engine can determine the mapping relationship between the segment identifier and the page identifier based on the segment identifier of the data storage segment corresponding to the data to be written and the page identifier of the metadata storage page, and generate the metadata of the data to be written.

[0068] S210 , after the data to be written is written into the data storage segment, the metadata is stored into the metadata storage page.

[0069] Specifically, after obtaining the metadata of the data to be written, the distributed storage engine can store the metadata in the metadata storage page after the data to be written is written to the data storage segment. Since the metadata storage page can be updated atomically, if the metadata storage page fails to be updated, the writing of the data to be written fails this time, and the corresponding data storage segment can be recovered through scanning later.

[0070] In the above metadata storage method, the distributed storage engine obtains the data to be written in response to the data write operation for the selected virtual disk, allocates a data storage segment for the data to be written in the physical disk corresponding to the selected virtual disk, configures a segment identifier, and determines the metadata storage page of the selected virtual disk for storing metadata, wherein the metadata storage page is the smallest input and output unit of the physical disk. Therefore, the metadata storage page has the atomic update capability. The distributed storage engine generates metadata for the data to be written based on the segment identifier and the page identifier of the metadata storage page. After the data to be written is written to the data storage segment, the metadata is stored in the metadata storage page. Storage write transactions can be implemented without relying on external KV DB or WAL, which effectively saves storage space during metadata storage and simplifies storage component deployment. At the same time, since the metadata storage page has the atomic update capability, the write amplification effect during metadata storage can also be effectively reduced.

[0071] In some embodiments, Figure 3 As shown, S206, determining the metadata storage page of the selected virtual disk for storing metadata includes:

[0072] S302: Determine a candidate metadata storage page for the selected virtual disk.

[0073] The candidate metadata storage page is a storage page corresponding to the selected virtual disk that may have metadata storage capability. The selected virtual disk may correspond to a single or multiple storage pages for storing metadata corresponding to actual data written into the selected virtual disk.

[0074] Specifically, the distributed storage engine may determine a candidate metadata storage page from storage pages corresponding to the selected virtual disk according to the selected virtual disk.

[0075] S304: When the storage capacity of the candidate metadata storage page reaches a preset capacity threshold, generate a new storage page for the selected virtual disk.

[0076] Among them, the stored capacity refers to the storage capacity that has been consumed by the candidate metadata storage page at the current moment due to the storage of metadata. The preset capacity threshold refers to the maximum storage capacity value that can be used by the storage page. When the stored capacity of the storage page reaches the preset capacity threshold, it means that the corresponding storage page can no longer store metadata. It can be understood that the preset capacity threshold can be predetermined by the designer based on the total page storage capacity of the storage page, and configured in the distributed storage engine so that the distributed storage engine can call it at any time. For example, the designer can directly determine the total page storage capacity of the storage page as the preset capacity threshold, or determine the stable operating capacity of the storage page based on the total page storage capacity of the storage page, and determine the stable operating capacity of the storage page as the preset capacity threshold.

[0077] Specifically, when determining the candidate metadata storage page of the selected virtual disk, the distributed storage engine can determine the stored capacity of the candidate metadata storage page, and call the preset capacity threshold to compare the stored capacity of the candidate metadata storage page with the preset capacity threshold. When the stored capacity of the candidate metadata storage page reaches the preset capacity threshold, it means that the candidate metadata storage page cannot store the metadata of the data to be written. At this time, the distributed storage engine can generate a new storage page for the selected virtual disk to store the metadata of the data to be written.

[0078] S306: Determine the newly added storage page as a metadata storage page for storing metadata, and link the newly added storage page with the candidate metadata storage page.

[0079] Linking the newly added storage page with the candidate metadata storage page means linking the newly added storage page to the back end of the candidate metadata storage page, and linking the two to the same linked list, so as to facilitate extended management of each storage page of the selected virtual disk through the linked list structure.

[0080] Specifically, after generating a new storage page for the selected virtual disk, the distributed storage engine can directly determine the new storage page as a metadata storage page for storing metadata, and link the new storage page with the candidate metadata storage page, and perform extended management on each storage page of the selected virtual disk through a linked list structure.

[0081] In the above embodiment, when the candidate metadata storage page cannot store metadata, the storage page can be dynamically expanded for the selected virtual disk, and the newly added storage page can be managed through the link structure, which can effectively improve the success rate of metadata storage and improve the management efficiency of each storage page.

[0082] In some of the embodiments, when the stored capacity of the candidate metadata storage page does not reach a preset capacity threshold, it indicates that the candidate metadata storage page can store metadata of the data to be written, and the distributed storage engine can directly determine the candidate metadata storage page as the metadata storage page of the selected virtual disk for storing metadata.

[0083] In some embodiments, S302, determining a candidate metadata storage page of the selected virtual disk includes: determining a selected initial storage page corresponding to the selected virtual disk according to the selected virtual disk and the correspondence between the virtual disk and the initial storage page. If it is determined based on the selected initial storage page that the selected virtual disk does not have a storage page linked list, the selected initial storage page is determined as a candidate metadata storage page of the selected virtual disk.

[0084] Among them, the correspondence between the virtual disk and the initial storage page refers to the mapping relationship between each virtual disk of the physical disk and the initial storage page of each virtual disk. It can be understood that each virtual disk has a corresponding initial storage page, which is obtained by the distributed storage engine when the physical disk is initialized. The distributed storage engine binds each virtual disk to its own initial storage page to obtain the correspondence between the virtual disk and the initial storage page.

[0085] Among them, the storage page linked list refers to a linked list structure formed by multiple storage pages when there are multiple storage pages in the virtual disk. The storage page linked list contains multiple storage pages with sequential link relationships. It can be understood that the initial storage page of the virtual disk is the header of the storage page linked list of the virtual disk.

[0086] Specifically, the distributed storage engine can call the correspondence between the virtual disk and the initial storage page, and search for the selected initial storage page that matches the selected virtual disk according to the correspondence between the virtual disk and the initial storage page of the selected virtual disk. After determining the selected initial storage page of the selected virtual disk, it can be determined based on the selected initial storage page whether there is a storage page linked list for the selected virtual disk. When it is determined that the selected virtual disk does not have a storage page linked list, it means that the selected virtual disk currently has only one storage page, namely the selected initial storage page, and the selected virtual disk has not added any storage page on the basis of the selected initial storage page. The selected initial storage page may still have a certain storage capacity. The distributed storage engine can directly determine the selected initial storage page of the selected virtual disk as the candidate metadata storage page of the selected virtual disk.

[0087] In some of the embodiments, after obtaining the selected initial storage page of the selected virtual disk, the distributed storage engine can determine whether there is a connection link for the selected initial storage page, and the connection link is used to link the Xiamen East initial storage page with the newly added storage page of the selected virtual disk after the selected initial storage page. Therefore, when it is determined that there is a connection link for the selected initial storage page, the distributed storage engine can determine that there is a storage page linked list for the selected virtual disk; when it is determined that there is no connection link for the selected initial storage page, the distributed storage engine can determine that there is no storage page linked list for the selected virtual disk.

[0088] In the above embodiment, when it is determined that there is no storage page linked list for the selected virtual disk based on the selected initial storage page of the selected virtual disk, the distributed storage engine can directly determine the selected initial storage page as the candidate metadata storage page of the selected virtual disk, thereby effectively improving the efficiency and accuracy of determining the candidate metadata storage page.

[0089] In some embodiments, the metadata storage method further includes: when it is determined that a storage page linked list exists in the selected virtual disk based on the selected initial storage page, determining the end storage page of the storage page linked list as a candidate metadata storage page of the selected virtual disk.

[0090] Among them, when the selected virtual disk has a storage page linked list, it means that the selected virtual disk has at least two storage pages. Since the distributed storage engine will only add a new storage page when the storage capacity of each existing storage page in the selected virtual disk reaches the preset capacity threshold, it can be determined that in the storage page linked list of the selected virtual disk, only the end storage page at the end of the storage page linked list may have storage capacity and can be used as a candidate metadata storage page for the selected virtual disk.

[0091] Specifically, when the distributed storage engine determines that the selected virtual disk does not have a storage page linked list based on the selected initial page, the selected initial page may be determined as a candidate metadata storage page of the selected virtual disk.

[0092] In the above embodiment, the candidate metadata storage pages of the selected virtual disk can be quickly determined only by determining whether the selected virtual disk has a storage page linked list, which can effectively improve the efficiency and accuracy of determining the candidate metadata storage pages.

[0093] In some embodiments, the disk interval of the physical disk includes a header interval and a table page interval, and the metadata storage method further includes: in response to an initialization instruction for each virtual disk in the physical disk, configuring a corresponding initial storage page for each virtual disk in the header interval of the physical disk. For each initial storage page, configuring a linked list structure for the initial storage page, the head pointer of the linked list structure is set in the header interval, and the tail pointer is set in the table page interval.

[0094] The initialization instruction for each virtual disk in the physical disk is an instruction signal for instructing to configure a corresponding initial storage page for each virtual disk and to configure a linked list structure for each initial storage page. The initialization instruction can be triggered by a user based on a client.

[0095] The distributed storage engine may perform initialization operations on the physical disk, partition the physical disk, and obtain various disk intervals of the physical disk. The disk intervals of the physical disk include a table header interval and a table page interval.

[0096] The header interval, as the name implies, is a storage interval for storing the header of the storage page linked list of each virtual disk corresponding to the physical disk. As mentioned above, the header of the storage page linked list of the virtual disk refers to the initial storage page of the virtual disk. Since each virtual disk corresponds to its own unique initial storage page, the initial storage page can also take into account the index function of the virtual disk storage page linked list. In order to improve the index efficiency of the storage page linked list, the initial storage pages of all virtual disks can be stored in the same disk interval for subsequent index queries.

[0097] Among them, the table page interval, as the name implies, is a storage interval used to store the newly added storage pages of the physical disk corresponding to each virtual disk. When the storage capacity of the initial storage page of the virtual disk is insufficient, the distributed storage engine will allocate the corresponding newly added storage pages to the virtual disk and store the newly added storage pages in the table page interval of the physical disk.

[0098] Among them, the head pointer and tail pointer of the linked list structure are two important pointer variables in the linked list structure, which are used to point to the starting position and the ending position of the linked list structure respectively.

[0099] The head pointer is a pointer to the first node in the linked list. For example, each node in the storage page linked list is a storage page, and the head pointer is a pointer variable used to point to the initial storage page of the storage page linked list. The existence of the head pointer enables the distributed storage engine to quickly find the starting position of the storage page linked list, so as to facilitate subsequent insertion, deletion, and traversal operations.

[0100] The tail pointer of the linked list structure is a pointer to the last node in the linked list. The next field of the tail pointer is usually set to NULL, indicating the end of the linked list. The existence of the tail pointer is particularly useful for inserting operations at the end of the linked list. The distributed storage engine can add new nodes to the linked list by directly modifying the next field of the tail pointer, that is, adding new storage pages.

[0101] Specifically, the distributed storage engine responds to the initialization instruction for each virtual disk in the physical disk, and configures the initial storage page corresponding to each virtual disk in the header section of the physical disk. For each initial storage page, the distributed storage engine can configure a linked list structure for each initial storage page, wherein the head pointer of the linked list structure is set in the header section, and the tail pointer is set in the table page section, so as to link the newly added storage page stored in the table page section with the corresponding initial storage page in the generation order to form a storage page linked list.

[0102] In the above embodiment, by partitioning the physical disk, allocating a dedicated header interval for the initial storage page and a dedicated table page interval for the newly added storage page, each initial storage page and each newly added storage page can be isolated from the storage interval, thereby reducing the storage pressure of the header interval and providing an environmental basis for subsequently improving the indexing efficiency of the initial storage page.

[0103] In some embodiments, Figure 4 As shown, the disk range of the physical disk also includes a super block, and the super block is used to store the partition information of the physical disk. The metadata storage method also includes:

[0104] S402: When a system abnormality occurs in the distributed storage system to which the physical disk belongs, partition information of the physical disk is obtained from a super block.

[0105] Among them, the super block is the first block in the physical disk, which records the overall information of the physical disk, such as the usage, remaining capacity, partition information, etc. of the physical disk.

[0106] The partition information of the physical disk may include the number of partitions of the physical disk, the name of each partition, the location of each partition, the size of each partition, etc.

[0107] Specifically, when the distributed storage engine determines that a distributed storage system to which the physical disk belongs has a system abnormality, such as a system crash or a process abnormality in the distributed storage system, the distributed storage engine can obtain the partition information of the physical disk from the super block of the physical disk.

[0108] S404: Determine the interval position of the header interval on the physical disk according to the partition information.

[0109] Specifically, the distributed storage engine may read the interval position information of the header interval from the partition information of the physical disk, and locate the interval position of the header interval on the physical disk according to the interval position information of the header interval.

[0110] S406 , based on the interval position, perform interval scanning on the header interval to obtain the initial storage page of each virtual disk.

[0111] Specifically, after determining the interval position of the header interval on the physical disk, the distributed storage engine can perform an interval scan on the header interval based on the interval position, that is, traverse the storage information of the header interval. Since the header interval is a storage interval used to store the initial storage page of each virtual disk, the distributed storage engine can obtain the initial storage page of each virtual disk by scanning the header interval.

[0112] S408 , for each initial storage page, according to the linked list structure of the initial storage page, obtain the storage page linked list to which the initial storage page belongs.

[0113] Specifically, for each initial storage page, the distributed storage engine can obtain the storage page linked list to which the initial storage page belongs according to the head pointer and tail pointer in the linked list structure of the initial storage page. It can be understood that when metadata reconstruction is performed, the storage page linked list may include only one initial storage page.

[0114] S410, rebuilding metadata of each virtual disk based on each storage page linked list.

[0115] Specifically, after obtaining each storage page linked list, the distributed storage engine can read the metadata stored in each storage page according to each storage page included in the storage page linked list corresponding to the virtual disk for each virtual disk, so as to reconstruct the metadata of the virtual disk.

[0116] In the above embodiment, when an abnormality occurs in the distributed storage system, the distributed storage engine only needs to scan the super block and the header interval to complete the metadata reconstruction of each virtual disk, which effectively improves the stability of maintaining data consistency of the distributed storage system.

[0117] Existing distributed storage engines often rely on WAL or KV DB components to achieve metadata consistency and persistence. Among them, the existing WAL-based write transaction process is as follows: Figure 5 As shown, for an external write request, the WAL is written first in the storage, and then the data to be written, that is, the actual data, is written. If a failure occurs before the WAL is written, the write fails. If a failure occurs after the WAL is written but before the actual write is completed, the log can be replayed as needed, or the log can be discarded and the write failure is returned. If a failure occurs after the actual write, the entire write process is successful.

[0118] Among them, the existing write transaction process that relies on KV DB is as follows Figure 6 As shown in the figure, the distributed storage engine will first allocate physical space to the virtual disk in memory, then write the actual data to the physical space, and finally update the index of the KV DB to indicate that the physical space is occupied, and associate the physical address with the virtual disk address. If a failure occurs after the data to be written is actually written but before the index data is updated to the KV DB, the write is invalid here and the write is determined to have failed.

[0119] The existing write transaction solutions that rely on WAL or KV DB components have the following defects: First, WAL and KV DB often require independent disks or disk partitions and require more storage capacity. Second, due to the need to rely on WAL or K-VDB, system deployment is more complicated. Third, the process of writing WAL and KV DB has a more serious write amplification.

[0120] Based on this, Figure 7 As shown, in some embodiments, a metadata storage method is provided, which uses the minimum disk IO unit as the minimum unit of metadata persistence, called a page, and the physical disk has the ability to atomically update at the page granularity. The method specifically includes the following steps:

[0121] The distributed storage engine initializes the entire physical disk, and divides the physical disk into super blocks, header intervals, page intervals, and data intervals. For each virtual disk corresponding to the physical disk, the distributed storage engine configures the corresponding initial storage page p0 in the header interval for each virtual disk. For the data interval of the physical disk, the distributed storage engine splits the data interval according to a fixed segment size to obtain multiple storage fragments, and configures a corresponding unique ID number for each storage fragment. Among them, the storage page of each virtual disk, that is, the content of the page page is a mapping table, including the mapping of the virtual disk logical address to the physical segment ID. If a single page page cannot store all mappings, it will be expanded in a linked list manner. For example Figure 8 The page pages p1, p2, ... pn are shown. Page p0 is stored in the header section, and all page pages except page p0 are stored in the table page section.

[0122] When the user triggers a data write operation for the selected virtual disk through the client, that is, when writing to the selected virtual disk, the distributed storage engine responds to the data write operation for the selected virtual disk, obtains the data to be written, and allocates a Segment for the data to be written from the data partition.

[0123] Subsequently, the distributed storage engine determines p0 of the selected virtual disk according to the selected virtual disk and the correspondence between the virtual disk and the initial storage page p0, and determines whether a storage page linked list exists for the selected virtual disk according to p0 of the selected virtual disk.

[0124] If the selected virtual disk does not have a storage page linked list, the storage capacity of p0 of the selected virtual disk is obtained, and the storage capacity of p0 is compared with the preset capacity threshold. If the storage capacity of p0 does not reach the preset capacity threshold, p0 is determined as a metadata storage page for storing metadata. If the storage capacity of p0 reaches the preset capacity threshold, a new storage page is generated for the selected virtual disk, the new storage page is determined as a metadata storage page for storing metadata, and the new storage page is linked to p0 and stored as p1 in the table page interval of the physical disk.

[0125] If the selected virtual disk has a storage page linked list, then obtain the end of the terminal storage page page in the storage page linked list of the selected virtual disk, compare the stored capacity of the end of the page with the preset capacity threshold, and if the stored capacity of the end of the page does not reach the preset capacity threshold, determine the end of the page as a metadata storage page for storing metadata. If the stored capacity of the end of the page reaches the preset capacity threshold, generate a new storage page for the selected virtual disk, link the new storage page with the end of the page, and store it as a new page end in the table page interval of the physical disk. For example, if the selected virtual disk has a storage page linked list p0→p1→p2→p3, then the stored capacity of p3 can be compared with the preset capacity threshold. If the stored capacity of p3 does not reach the preset capacity threshold, determine p3 as a metadata storage page for storing metadata. When the storage capacity of p3 reaches the preset capacity threshold, a new storage page is generated for the selected virtual disk, and the new storage page is linked to the p3 row to become p4 and stored in the table page interval of the physical disk. At this time, the page end of the storage page linked list of the virtual disk is p4, and the distributed storage engine determines p4 as the metadata storage page for storing metadata.

[0126] After the distributed storage engine determines the metadata storage page of the selected virtual disk for storing metadata, it can generate metadata for the data to be written based on the Segment ID of the Segment corresponding to the data to be written and the page ID of the metadata storage page. After the data to be written is written to the corresponding Segment, the distributed storage engine can store the metadata to the metadata storage page and perform storage updates on the metadata storage page. Because the page can be updated atomically, if the metadata storage page fails to be updated, the write fails this time, and the corresponding Sgement can be recovered by scanning later.

[0127] In the above embodiment, by introducing object metadata to update in page form and expanding management in linked list form, a set of storage write transactions that does not rely on external KV DB and WAL mode is implemented, which greatly saves metadata storage space and simplifies storage component deployment.

[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0129] Based on the same inventive concept, the embodiment of the present application also provides a metadata storage device for implementing the metadata storage method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more metadata storage device embodiments provided below can refer to the limitations on the metadata storage method above, and will not be repeated here.

[0130] In some embodiments, Fig. 9 As shown, a metadata storage device 900 is provided, comprising: an operation response module 901, a storage segment allocation module 902, a metadata storage page determination module 903, a metadata generation module 904 and a metadata storage module 905, wherein:

[0131] The operation response module 901 is used to obtain the data to be written in response to the data writing operation for the selected virtual disk.

[0132] The storage segment allocation module 902 is used to allocate data storage segments for the data to be written in the physical disk corresponding to the selected virtual disk, and configure segment identifiers.

[0133] The metadata storage page determination module 903 is used to determine the metadata storage page of the selected virtual disk for storing metadata. The metadata storage page is the smallest input and output unit of the physical disk.

[0134] The metadata generation module 904 is used to generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page.

[0135] The metadata storage module 905 is used to store metadata in a metadata storage page after the data to be written is written into the data storage segment.

[0136] In some embodiments, the metadata storage page determination module 903 is used to: determine candidate metadata storage pages for a selected virtual disk; generate new storage pages for the selected virtual disk when the stored capacity of the candidate metadata storage pages reaches a preset capacity threshold; determine the new storage pages as metadata storage pages for storing metadata, and link the new storage pages with the candidate metadata storage pages.

[0137] In some embodiments, the metadata storage page determination module 903 is also used to: determine the selected initial storage page corresponding to the selected virtual disk based on the selected virtual disk and the correspondence between the virtual disk and the initial storage page; when it is determined based on the selected initial storage page that there is no storage page linked list for the selected virtual disk, determine the selected initial storage page as a candidate metadata storage page for the selected virtual disk.

[0138] In some embodiments, the metadata storage page determination module 903 is further used to: when it is determined that a storage page linked list exists for the selected virtual disk based on the selected initial storage page, determine the end storage page of the storage page linked list as a candidate metadata storage page for the selected virtual disk.

[0139] In some embodiments, the disk interval of the physical disk includes a table header interval and a table page interval. The metadata storage device also includes:

[0140] The instruction response module is used to respond to the initialization instruction for each virtual disk in the physical disk, and configure a corresponding initial storage page for each virtual disk in the header area of ​​the physical disk.

[0141] The linked list structure configuration module is used to configure a linked list structure for each initial storage page. The head pointer of the linked list structure is set in the table header interval, and the tail pointer is set in the table page interval; the table page interval is used to store the newly added storage pages of each virtual disk.

[0142] In some embodiments, the disk area of ​​the physical disk also includes a super block, and the super block is used to store partition information of the physical disk. The metadata storage device also includes:

[0143] The partition information acquisition module is used to acquire the partition information of the physical disk from the super block when a system abnormality occurs in the distributed storage system to which the physical disk belongs.

[0144] The interval position determination module is used to determine the interval position of the header interval on the physical disk according to the partition information.

[0145] The header interval scanning module is used to perform interval scanning on the header interval based on the interval position to obtain the initial storage page of each virtual disk.

[0146] The storage page linked list acquisition module is used to acquire the storage page linked list to which the initial storage page belongs according to the linked list structure of the initial storage page for each initial storage page.

[0147] The metadata reconstruction module is used to rebuild the metadata of each virtual disk based on each storage page linked list.

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

[0149] In some embodiments, a computer device is provided. The computer device may be a server integrated with a distributed storage engine. The internal structure diagram thereof may be as follows: Fig.10 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as data to be written, fragment identifiers, metadata storage pages, and page identifiers of metadata storage pages. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a metadata storage method is implemented.

[0150] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0151] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0152] In response to a data writing operation on the selected virtual disk, acquiring data to be written;

[0153] In the physical disk corresponding to the selected virtual disk, a data storage segment is allocated for the data to be written, and a segment identifier is configured;

[0154] Determine a metadata storage page of the selected virtual disk for storing metadata, where the metadata storage page is the minimum input and output unit of the physical disk;

[0155] Generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page;

[0156] After the data to be written is written to the data storage segment, the metadata is stored in the metadata storage page.

[0157] In some embodiments, when the processor executes the computer program, the processor further implements the following steps:

[0158] determining candidate metadata storage pages for the selected virtual disk;

[0159] When the storage capacity of the candidate metadata storage page reaches a preset capacity threshold, generating a new storage page for the selected virtual disk;

[0160] The newly added storage page is determined as a metadata storage page for storing metadata, and the newly added storage page is linked to the candidate metadata storage page.

[0161] In some embodiments, when the processor executes the computer program, the processor further implements the following steps:

[0162] Determine the selected initial storage page corresponding to the selected virtual disk according to the selected virtual disk and the correspondence between the virtual disk and the initial storage page;

[0163] When it is determined based on the selected initial storage page that the selected virtual disk does not have a storage page linked list, the selected initial storage page is determined as a candidate metadata storage page of the selected virtual disk.

[0164] In some embodiments, when the processor executes the computer program, the processor further implements the following steps:

[0165] When it is determined that the selected virtual disk has a storage page linked list based on the selected initial storage page, the end storage page of the storage page linked list is determined as a candidate metadata storage page of the selected virtual disk.

[0166] In some embodiments, when the processor executes the computer program, the processor further implements the following steps:

[0167] In response to the initialization instruction for each virtual disk in the physical disk, a corresponding initial storage page is configured for each virtual disk in the header section of the physical disk;

[0168] For each initial storage page, a linked list structure is configured for the initial storage page, the head pointer of the linked list structure is set in the table header interval, and the tail pointer is set in the table page interval; the table page interval is used to store the newly added storage pages of each virtual disk.

[0169] In some embodiments, when the processor executes the computer program, the processor further implements the following steps:

[0170] When a distributed storage system to which a physical disk belongs has a system abnormality, partition information of the physical disk is obtained from a super block;

[0171] According to the partition information, determine the interval position of the header interval on the physical disk;

[0172] Based on the interval position, the header interval is scanned to obtain the initial storage page of each virtual disk;

[0173] For each initial storage page, according to the linked list structure of the initial storage page, obtain the storage page linked list to which the initial storage page belongs;

[0174] Based on each storage page linked list, the metadata of each virtual disk is rebuilt.

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

[0176] In response to a data writing operation on the selected virtual disk, acquiring data to be written;

[0177] In the physical disk corresponding to the selected virtual disk, a data storage segment is allocated for the data to be written, and a segment identifier is configured;

[0178] Determine a metadata storage page of the selected virtual disk for storing metadata, where the metadata storage page is the minimum input and output unit of the physical disk;

[0179] Generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page;

[0180] After the data to be written is written to the data storage segment, the metadata is stored in the metadata storage page.

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

[0182] determining candidate metadata storage pages for the selected virtual disk;

[0183] When the storage capacity of the candidate metadata storage page reaches a preset capacity threshold, generating a new storage page for the selected virtual disk;

[0184] The newly added storage page is determined as a metadata storage page for storing metadata, and the newly added storage page is linked to the candidate metadata storage page.

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

[0186] Determine the selected initial storage page corresponding to the selected virtual disk according to the selected virtual disk and the correspondence between the virtual disk and the initial storage page;

[0187] When it is determined based on the selected initial storage page that the selected virtual disk does not have a storage page linked list, the selected initial storage page is determined as a candidate metadata storage page of the selected virtual disk.

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

[0189] When it is determined that the selected virtual disk has a storage page linked list based on the selected initial storage page, the end storage page of the storage page linked list is determined as a candidate metadata storage page of the selected virtual disk.

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

[0191] In response to the initialization instruction for each virtual disk in the physical disk, a corresponding initial storage page is configured for each virtual disk in the header section of the physical disk;

[0192] For each initial storage page, a linked list structure is configured for the initial storage page, the head pointer of the linked list structure is set in the table header interval, and the tail pointer is set in the table page interval; the table page interval is used to store the newly added storage pages of each virtual disk.

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

[0194] When a distributed storage system to which a physical disk belongs has a system abnormality, partition information of the physical disk is obtained from a super block;

[0195] According to the partition information, determine the interval position of the header interval on the physical disk;

[0196] Based on the interval position, the header interval is scanned to obtain the initial storage page of each virtual disk;

[0197] For each initial storage page, according to the linked list structure of the initial storage page, obtain the storage page linked list to which the initial storage page belongs;

[0198] Based on each storage page linked list, the metadata of each virtual disk is rebuilt.

[0199] In some embodiments, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0200] In response to a data writing operation on the selected virtual disk, acquiring data to be written;

[0201] In the physical disk corresponding to the selected virtual disk, a data storage segment is allocated for the data to be written, and a segment identifier is configured;

[0202] Determine a metadata storage page of the selected virtual disk for storing metadata, where the metadata storage page is the minimum input and output unit of the physical disk;

[0203] Generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page;

[0204] After the data to be written is written to the data storage segment, the metadata is stored in the metadata storage page.

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

[0206] determining candidate metadata storage pages for the selected virtual disk;

[0207] When the storage capacity of the candidate metadata storage page reaches a preset capacity threshold, generating a new storage page for the selected virtual disk;

[0208] The newly added storage page is determined as a metadata storage page for storing metadata, and the newly added storage page is linked to the candidate metadata storage page.

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

[0210] Determine the selected initial storage page corresponding to the selected virtual disk according to the selected virtual disk and the correspondence between the virtual disk and the initial storage page;

[0211] When it is determined based on the selected initial storage page that the selected virtual disk does not have a storage page linked list, the selected initial storage page is determined as a candidate metadata storage page of the selected virtual disk.

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

[0213] When it is determined that the selected virtual disk has a storage page linked list based on the selected initial storage page, the end storage page of the storage page linked list is determined as a candidate metadata storage page of the selected virtual disk.

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

[0215] In response to the initialization instruction for each virtual disk in the physical disk, a corresponding initial storage page is configured for each virtual disk in the header section of the physical disk;

[0216] For each initial storage page, a linked list structure is configured for the initial storage page, the head pointer of the linked list structure is set in the table header interval, and the tail pointer is set in the table page interval; the table page interval is used to store the newly added storage pages of each virtual disk.

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

[0218] When a distributed storage system to which a physical disk belongs has a system abnormality, partition information of the physical disk is obtained from a super block;

[0219] According to the partition information, determine the interval position of the header interval on the physical disk;

[0220] Based on the interval position, the header interval is scanned to obtain the initial storage page of each virtual disk;

[0221] For each initial storage page, according to the linked list structure of the initial storage page, obtain the storage page linked list to which the initial storage page belongs;

[0222] Based on each storage page linked list, the metadata of each virtual disk is rebuilt.

[0223] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. In addition, the acquisition, storage, processing, and transmission of data are in compliance with relevant laws and regulations.

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

[0225] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0226] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A metadata storage method, characterized in that: The method comprises: In response to a data writing operation on the selected virtual disk, acquiring data to be written; In the physical disk corresponding to the selected virtual disk, allocating a data storage segment for the data to be written, and configuring a segment identifier; Determine a metadata storage page of the selected virtual disk for storing metadata, wherein the metadata storage page is a minimum input and output unit of the physical disk; Generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page; After the data to be written is written into the data storage segment, the metadata is stored in the metadata storage page.

2. The method according to claim 1, characterized in that The determining of the metadata storage page of the selected virtual disk for storing metadata comprises: Determining candidate metadata storage pages for the selected virtual disk; When the storage capacity of the candidate metadata storage page reaches a preset capacity threshold, generating a new storage page for the selected virtual disk; The newly added storage page is determined as a metadata storage page for storing metadata, and the newly added storage page is linked to the candidate metadata storage page.

3. The method according to claim 2, characterized in that The determining of the candidate metadata storage page of the selected virtual disk includes: Determining a selected initial storage page corresponding to the selected virtual disk according to the selected virtual disk and the correspondence between the virtual disk and the initial storage page; When it is determined based on the selected initial storage page that the selected virtual disk does not have a storage page linked list, the selected initial storage page is determined as a candidate metadata storage page of the selected virtual disk.

4. The method according to claim 3, characterized in that The method further comprises: When it is determined that the selected virtual disk has a storage page linked list based on the selected initial storage page, the end storage page of the storage page linked list is determined as a candidate metadata storage page of the selected virtual disk.

5. The method according to any one of claims 1 to 4, characterized in that: The disk interval of the physical disk includes a table header interval and a table page interval, and the method further includes: In response to an initialization instruction for each virtual disk in the physical disk, configuring a corresponding initial storage page for each virtual disk in a header section of the physical disk; For each of the initial storage pages, a linked list structure is configured for the initial storage page, a head pointer of the linked list structure is set in the table header interval, and a tail pointer is set in the table page interval; the table page interval is used to store newly added storage pages of each virtual disk.

6. The method according to claim 5, characterized in that The disk area of ​​the physical disk also includes a super block, and the super block is used to store partition information of the physical disk; the method also includes: When a distributed storage system to which the physical disk belongs has a system abnormality, obtaining partition information of the physical disk from the super block; Determine, according to the partition information, the interval position of the header interval on the physical disk; Based on the interval position, performing interval scanning on the header interval to obtain the initial storage page of each virtual disk; For each of the initial storage pages, according to the linked list structure of the initial storage page, obtaining the storage page linked list to which the initial storage page belongs; Based on each of the storage page linked lists, metadata of each of the virtual disks is rebuilt.

7. A metadata storage device, characterized in that: The device comprises: An operation response module, used for obtaining data to be written in response to a data writing operation on a selected virtual disk; A storage segment allocation module, used to allocate data storage segments for the data to be written in the physical disk corresponding to the selected virtual disk, and configure segment identifiers; A metadata storage page determination module, used to determine a metadata storage page of the selected virtual disk for storing metadata, wherein the metadata storage page is a minimum input and output unit of the physical disk; A metadata generation module, used to generate metadata of the data to be written based on the segment identifier and the page identifier of the metadata storage page; The metadata storage module is used to store the metadata in the metadata storage page after the data to be written is written into the data storage segment.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

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