Data management method and apparatus

By creating storage areas for traditional magnetic recording disks and managing data in the form of files, the problem of low management efficiency of CMR disks is solved, realizing unified management and efficient data storage of CMR and SMR disks.

CN116501252BActive Publication Date: 2026-11-27ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310423776.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2026-11-27
Estimated Expiration
2043-04-17

AI Technical Summary

Technical Problem

In the existing technology, the management of expired file blocks on CMR disks is too cumbersome, resulting in low management efficiency of storage devices for CMR disks.

Method used

It creates storage areas for traditional magnetic recording disks, writes the data to be stored into the storage areas in the form of files, establishes the correspondence between the stored data and the storage areas, manages the data with the storage area as the management unit, and supports unified management of CMR and SMR disks.

Benefits of technology

It improves the management efficiency of storage devices for CMR disks, simplifies the management process of expired file blocks, enhances the distributed storage efficiency of metadata nodes, and supports compatible management of different types of disks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116501252B_ABST
    Figure CN116501252B_ABST
Patent Text Reader

Abstract

The application discloses a data management method and device. The data management method comprises the following steps: creating at least one storage area for a traditional magnetic recording disk; writing to-be-stored data in the form of a file into the storage area; and storing the correspondence between the to-be-stored data and the storage area, so as to manage the data in the traditional magnetic recording disk based on the correspondence and taking the storage area as a management unit. The application can improve the management efficiency of a storage device on a CMR magnetic disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data management technology, and in particular to a data management method and apparatus. Background Technology

[0002] CMR (Conventional Magnetic Recording) is a conventional magnetic recording disk with independent tracks and gaps between them, allowing random access and freeing of storage space at any location. It can be managed by a general file system. Currently, CMR disks are typically managed directly through standard file systems for read / write operations and deletion of expired blocks. However, managing expired blocks on CMR disks is overly cumbersome, resulting in low efficiency for storage device management of CMR disks. Summary of the Invention

[0003] This application provides a data management method and apparatus that can improve the management efficiency of storage devices for CMR disks.

[0004] To achieve the above objectives, this application provides a data management method, which includes:

[0005] Create at least one storage area within a traditional magnetic recording disk;

[0006] Write the data to be stored into the storage area as a file;

[0007] The system stores the correspondence between data to be stored and storage areas, and manages the data in the traditional magnetic recording disk based on the correspondence and using the storage area as the management unit.

[0008] In one embodiment, the method further includes:

[0009] The preset disk is managed using the same partition management logic as the traditional magnetic recording disk, but the disk type of the preset disk is different from that of the traditional magnetic recording disk.

[0010] In one embodiment, the data to be stored is written to the storage area in the form of a file, so that the traditional magnetic recording disk can manage files using the storage area as the management unit, including:

[0011] If the used space of a storage area is greater than or equal to the preset space threshold, a new storage area is created, and the data to be stored is written to the new storage area.

[0012] If the used space in the storage area is less than the preset space threshold, the data to be stored will be written to the storage area.

[0013] The data management method is applied to a storage device, which has at least two types of disks, or the storage device is located on a distributed data management system that has at least two types of disks; the method also includes:

[0014] Retrieve the file block to be stored;

[0015] If the file block to be stored is a recovered corrupted file block, determine whether there is a disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored on the storage device;

[0016] If it exists, store the file block to be stored on a disk that meets the preset requirements;

[0017] If it does not exist, store the file block to be stored on a disk that meets the preset requirements, except for the type of the file block to be stored.

[0018] The file block type corresponds to the storage disk type of the original damaged file block.

[0019] The process of determining whether a disk meeting a preset requirement exists among all disks of the type corresponding to the file block to be stored on the storage device includes:

[0020] Select a disk from all disks of the type corresponding to the file block to be stored according to the load balancing strategy;

[0021] If a disk is selected from all disks of the type corresponding to the file block to be stored, the selected disk is the disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored, and the step of storing the file block to be stored on the disk that meets the preset requirements is executed.

[0022] If none of the disks of the type corresponding to the file block to be stored meet the load balancing strategy, then proceed to the step of storing the file block to be stored on a disk that meets the preset requirements among all disks of types other than the type corresponding to the file block to be stored.

[0023] The file blocks to be stored, which are retrieved from the file, include:

[0024] In response to a file recovery task, read the undamaged blocks of the file.

[0025] Based on the undamaged file blocks, the damaged file blocks of the file are recovered, resulting in at least one repaired file block of the file;

[0026] The repaired file blocks with the preset storage node as the storage device are used as the file blocks to be stored.

[0027] This process involves recovering corrupted file blocks from uncorrupted file blocks to obtain at least one repaired file block, followed by:

[0028] If there is a repaired file block whose preset storage node is not a storage device, the repaired file block and its corresponding type information are sent to the preset storage node of the repaired file block so that the preset storage node stores the repaired file block on the disk based on the corresponding type information of the repaired file block.

[0029] The method also includes:

[0030] The system tracks the progress of recovery tasks and limits read / write traffic and / or the number of recovery tasks based on this progress.

[0031] The recovery task processing status includes the current number of tasks and / or the current read / write traffic during recovery. It also includes statistics on its own recovery task processing and limits on read / write traffic and / or the number of recovery tasks based on this status, including:

[0032] In response to the acquisition of a file recovery task, determine whether the current number of tasks has reached the first threshold; if so, wait for the resources to be refreshed before executing the file recovery task.

[0033] And / or, during file recovery, the current read and write traffic is counted. If the read and write traffic reaches the second threshold, the read and write operations are performed only after the resources are refreshed.

[0034] To achieve the above objectives, this application also provides an electronic device including a processor; the processor is configured to execute instructions to implement the above methods.

[0035] To achieve the above objectives, this application also provides a computer-readable storage medium for storing instruction / program data that can be executed to implement the above methods.

[0036] In this application, by creating at least one storage area for a traditional magnetic recording disk and writing the data to be stored into the storage area in the form of a file, and by storing the correspondence between the data to be stored and the storage area after writing the data to be stored into the storage area, the storage device can quickly find the corresponding stored data based on the correspondence between the stored data and the storage area, thereby facilitating the storage device to manage the stored data. This allows the traditional magnetic recording disk to manage data using the storage area as the management unit, thus facilitating the management of data in the traditional magnetic recording disk. Attached Figure Description

[0037] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0038] Figure 1This is a schematic diagram of one embodiment of the distributed data management system of this application;

[0039] Figure 2 This is a flowchart illustrating one implementation method of the data management method of this application;

[0040] Figure 3 This is a flowchart illustrating an embodiment of the data management method of this application;

[0041] Figure 4 This is a schematic diagram of the unified storage base for storage nodes in the distributed data management system of this application;

[0042] Figure 5 This is a flowchart illustrating the file block reading process in the data management method of this application;

[0043] Figure 6 This is a flowchart illustrating another embodiment of the data management method of this application;

[0044] Figure 7 This is a flowchart illustrating another embodiment of the data management method of this application;

[0045] Figure 8 This is a flowchart illustrating another implementation of the data management method of this application;

[0046] Figure 9 This is a schematic diagram of the structure of one embodiment of the electronic device of this application;

[0047] Figure 10 This is a schematic diagram of one embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application. In addition, unless otherwise specified (e.g., "or additionally" or "or in alternatives"), the term "or" as used herein refers to a non-exclusive "or" (i.e., "and / or"). Furthermore, the various embodiments described herein are not necessarily mutually exclusive, as some embodiments can be combined with one or more other embodiments to form new embodiments.

[0049] SMR divides its internal physical storage area into a series of logical "regions" called Zones. Data within a Zone can only be read and written sequentially, not randomly; the write pointer moves sequentially forward. The size of a Zone is typically fixed at 256MB. Random reads are supported within a Zone.

[0050] Currently, distributed object storage systems using SMR disks are based on ZoneGroup (ZG) design. A group of newly initialized Zones are linked by ZGIDs. Erasure coding-corruption-corrupted data is concurrently written to these Zones in batches. This provides unified load balancing and management capabilities at the ZG level. Furthermore, it manages the native SMR disk Zone space through policy management to support erasure coding. However, this requires metadata nodes to manage and maintain all storage areas of the SMR disks on all storage nodes, resulting in a heavy management burden for the metadata nodes. Consequently, the distributed storage efficiency of the metadata nodes is relatively poor. Moreover, this method makes the distributed storage solution incompatible with other types of disks (such as CMR disks).

[0051] Based on this, this application proposes a data management method in which the metadata node only needs to determine a predetermined number of storage nodes to store the client's data based on the client's data write request. Each of the predetermined number of storage nodes then determines whether to allocate the client's data to its own SMR disk and which storage area of ​​its own SMR disk to allocate the client's data to. In this way, the metadata node does not need to manage and maintain all storage areas of all SMR disks. Thus, the metadata node can manage all storage nodes uniformly through conventional distributed file management methods, regardless of the disk type on the storage nodes. This achieves complete transparency and awareness of the disk type on the storage nodes to the metadata node, greatly reducing the management burden of the metadata node, improving the distributed storage efficiency of the metadata node, and enabling the distributed data management system including the metadata node and storage nodes to be compatible with other types of disks such as CMR (Conventional Magnetic Recording).

[0052] First, this application provides a distributed data management system. For example... Figure 1 As shown, the distributed data management system includes metadata nodes and storage nodes.

[0053] A distributed data management system may contain one or more storage nodes, which are responsible for storing data, managing data, and managing hard drives. Externally, storage nodes may also provide functions such as data stream write response, disk management, and / or periodic file block scan reporting. Each storage node can support the management of a single type of disk or a mixture of disk types.

[0054] A distributed data management system may contain one or more metadata nodes. These metadata nodes can be organized in various ways, such as as a single machine, master-slave, or cluster.

[0055] Metadata nodes can be responsible for managing file information, metadata information, and task scheduling in a distributed data management system.

[0056] In other words, metadata nodes can be used to respond to metadata requests from the entire distributed data management system, internally maintaining a metadata mirror of the entire system. The metadata maintained by the metadata node can include file states within the distributed data management system; that is, the metadata node controls and manages the global file view of the distributed data management system. The global file view may contain information such as file block identifiers, file block status bits, file block offsets within the file, and the length and position of the file blocks contained within a file block.

[0057] The metadata node, responsible for managing task scheduling in the distributed data management system, can be understood as follows: In response to client data storage requests, the metadata node determines the storage nodes for storing client data, thus achieving load balancing among storage nodes. Specifically, in response to data storage requests, the metadata node considers the load of all storage nodes in the entire system and selects a target number of storage nodes using a load balancing strategy (round-robin, weighted selection, load selection), returning this list to the metadata node so that the metadata node can write data to the corresponding storage nodes. After the metadata node returns the storage node list, the client directly writes concurrent business data to at least one storage node on the list, which is one reason for the high efficiency of the distributed file system. The file reading process is similar. After the client requests the storage node list from the metadata node, it directly reads data from the relevant storage nodes. That is, when a file is written to the distributed data management system, the metadata node writes the contents of each file block to the storage nodes according to configuration rules. Preferably, the metadata node uses a load balancing strategy to write different file blocks of the same file to different storage nodes.

[0058] Based on the file storage and file reading processes described above, it can be seen that the metadata node can only provide metadata management functions, i.e., the management of the corresponding signaling flow. The data flow interaction, which involves writing actual business data, is handled by the corresponding storage node.

[0059] In addition, the metadata node can also control the execution of processes such as file recovery. Here, metadata node control of file recovery can be understood as: the metadata node executes the file recovery process and monitors its progress. In other embodiments, metadata node control of file recovery can also be understood as: the metadata node distributes the recovery task to the target storage node, allowing the target storage node to execute the file recovery task.

[0060] For the distributed data management system of this application, when a storage node starts registration, it reports storage file information (e.g., block information in the file) to the metadata node. Based on this information, the metadata node updates its internal block-in-memory metadata cache and updates the real-time file status. Storage nodes can also periodically report internal storage file information (e.g., block information in the file) for the metadata node to verify and update its cache. After real-time business flow IO writes are completed, the storage node also reports the real-time write data information to the metadata node. Thus, the periodic reporting and / or real-time reporting by the storage node ensures the correctness of the metadata cache within the metadata node, thereby guaranteeing the correctness and accuracy of the metadata node's load balancing.

[0061] This application provides a data management method, such as Figure 2 As shown, the data management method of this embodiment includes the following steps. This data management method can be applied to a storage device, which can be an independent storage device or a storage node in the aforementioned distributed data management system. It should be noted that the step numbers are for simplification only and are not intended to limit the execution order of the steps. The execution order of the steps in this embodiment can be arbitrarily changed without departing from the technical concept of this application.

[0062] S101: Create at least one storage area for a conventional magnetic recording disk.

[0063] S102: Write the data to be stored into the storage area as a file.

[0064] S103: Store the correspondence between the data to be stored and the storage area, so as to manage the data in the traditional magnetic recording disk based on the correspondence and with the storage area as the management unit.

[0065] Compared to related technologies that directly write data transmitted from the client to a conventional magnetic recording disk (CMR disk) through a standard file system, this embodiment creates at least one storage area for the conventional magnetic recording disk, writes the data to be stored into the storage area in the form of a file, and stores the correspondence between the data to be stored and the storage area after the data to be stored is written into the storage area. This allows the storage device to quickly find the corresponding stored data based on the correspondence between the stored data and the storage area, thereby facilitating the management of the stored data by the storage device. This allows the conventional magnetic recording disk to manage data by using the storage area as the management unit, thus simplifying the management of data in the conventional magnetic recording disk.

[0066] In one feasible approach, the storage space of a traditional magnetic recording disk can be directly divided into multiple storage areas. When data needs to be entered, it is written to a storage area with sufficient storage space.

[0067] In another feasible approach, for a new conventional magnetic recording disk, when data needs to be entered, a storage area can be created for the new conventional magnetic recording disk, and then the data can be written to that storage area. When the unused storage space of the newly created storage area is insufficient, if new data needs to be entered, another storage area can be created for the conventional magnetic recording disk, and the new data can be entered into the newly created storage area. In this way, all the data to be entered can be entered into the various storage areas of the conventional magnetic recording disk, so that the conventional magnetic recording disk can manage data by using storage areas as management units.

[0068] When creating a storage area, the storage space of the created storage area can be set to a preset value so that multiple storage areas on a traditional magnetic recording disk are the same size, thus facilitating the management of multiple storage areas on a traditional magnetic recording disk.

[0069] Determining that a storage area has insufficient unused storage space can refer to confirming whether the unused storage space of the storage area is less than the lower limit (e.g., 0 or the minimum size of a file block).

[0070] Of course, if the preset storage space of the storage area is a preset value, the availability of unused storage space in the newly created storage area can also be confirmed by checking whether the used space of the storage area is greater than or equal to a preset space threshold. Specifically, if the used space of the newly created storage area is greater than or equal to the preset space threshold, then the unused storage space of the newly created storage area is insufficient; if it is less than the preset space threshold, then the unused storage space of the newly created storage area is sufficient. The preset space threshold can be a preset value, such as the storage space of the SMR disk zone—125MB, or 250MB. In other embodiments, the preset space threshold can be equal to the difference between the preset value and the size of the data to be stored, to avoid the storage area's used storage space exceeding the preset value after storing the data to be stored, thus preventing the storage area from occupying more storage space than the preset value.

[0071] The aforementioned data management method can be applied to storage devices with at least two types of disks, or to distributed data management systems with at least two types of disks. That is, the method can be applied to traditional magnetic recording disks and preset disks, where the preset disk type differs from the traditional magnetic recording disk. This means that a unified partition management logic can be used to manage data on both disks, allowing at least two types of disks to be managed in the same way, which is beneficial for managing at least two types of disks. Managing data on both disks using a unified partition management logic can be understood as deleting expired data on both disks on a unit-by-unit basis. In some embodiments, managing data on both disks using a unified partition management logic can also be understood as performing read or write operations on data on both disks based on the correspondence between stored data and its storage area.

[0072] The preset disk may include SMR disks, that is, these at least two types of disks may include the aforementioned CMR disks and SMR disks. In this way, both CMR disks and SMR disks are managed on a storage area basis, which can facilitate data management in storage devices or distributed data management systems.

[0073] For example, referring to the size of the Zone block in an SMR disk (typically 256MB), a CMR disk can also create Zone directories as needed, with the corresponding Zone directory containing the file block data and the metadata files corresponding to the data blocks. Figure 3As shown: When file block data is written to the CMR disk, the Zone1 directory is created first, and the file block data is written to the Zone1 directory in the form of a file and the corresponding file block metadata file is generated; when the Zone1 directory reaches the size of the SMR disk Zone block, the Zone2 directory is created, and subsequent file block data is written to the Zone2 directory in the form of a file and the corresponding file block metadata file is generated, and so on in a loop.

[0074] For CMR disks, file blocks within the same time period can be placed in the same storage area. If a file block within a time period expires, expired file blocks can be managed by deleting all file blocks in the storage area corresponding to that time period. This solves the problem of overly cumbersome expired file block management when managing CMR disks through a standard file system, which requires finding and deleting expired file blocks one by one based on their storage time.

[0075] To facilitate the reading and storage of file blocks by storage nodes, a unified storage base can be set up on the storage nodes, so that the storage nodes can store and read file blocks through the unified storage base.

[0076] Among them, the unified storage platform for the storage node service layer can be like Figure 4 As shown, an SMR disk is divided into CMR zones and SMR zones (Zone block areas). The CMR zone is formatted separately as a standard file system (such as xfs, ext3, ext4, etc.) and used as a KV index partition, supporting random read / write operations. It manages the metadata information of file blocks in the SMR data partition (e.g., the correspondence between file blocks and Zone blocks). The SMR zone is a raw block device without a file system, used to store the file block content. Because the CMR disk supports random read / write operations, it can be directly formatted as a standard file system, and the corresponding file block data and its metadata information are directly written to the disk as files. In this way, the storage device can perceive different types of disk media, automatically load and manage the metadata information of file blocks, and read and write data from different media. Furthermore, the metadata information of the SMR disk is stored in the CMR area of ​​the SMR disk in a key-value (KV) manner. The file block information can be used to index the Zone block where the file block data is located and its position within the Zone block. Based on this, the file block data can be read from the Zone block area of ​​the SMR. When a node writes file block data, it first allocates a Zone, then writes the data, and then updates the KV index. Similarly, the metadata information and file block content on the CMR disk are stored in the corresponding Zone directory as files. Reading and writing file block data can be done by directly operating on the file corresponding to the file block name in the corresponding Zone directory.

[0077] The process by which a storage node reads a file block based on the aforementioned unified storage platform can be described as follows: Figure 5As shown, the storage node can first find the disk / directory corresponding to the file block from the global file block and disk index mapping, and then read data from the corresponding disk by calling different disk management interfaces through the general storage interface: When reading data from an SMR disk, it first finds the storage unit (i.e., the Zone) where the file block is located from the metadata information of the record in the KV index partition according to the file block name, as well as the offset, length and other information of the file block in the Zone, and then reads the file block data of the corresponding length from the corresponding offset in the corresponding Zone; When reading data from a CMR disk, it first finds the Zone directory corresponding to the file block from the global file block and disk index mapping, and then finds the data file with the corresponding name from the corresponding Zone directory according to the file block name and then directly reads the file content.

[0078] Regarding the aforementioned storage device with at least two types of disks, or the distributed data management system with at least two types of disks, this application also proposes a data management method with another embodiment. In the case of a file to be stored that is a recovered, damaged file block, this data management method prioritizes storing the file block on a disk of the type corresponding to the file block. Only when none of the disks of the type corresponding to the file block meet the preset conditions will the file block be stored on a disk of another type. This minimizes the need to modify the storage disk type of the file block during file block recovery, thus enabling the file blocks of a file to be stored on as many disks of one type as possible, facilitating file management.

[0079] like Figure 6 As shown, the data management method of this other embodiment may include the following steps.

[0080] S201: Obtain the file block to be stored.

[0081] File blocks to be stored can be obtained. These file blocks can include various types of file blocks, such as new file blocks to be entered, or file blocks that have been entered but damaged and then repaired (i.e., recovered damaged file blocks). If the obtained file block to be stored is a recovered damaged file block, step S202 can be performed to store the recovered damaged file block through the following steps.

[0082] S202: If the file block to be stored is a recovered corrupted file block, determine whether there is a disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored on the storage device.

[0083] If the file block to be stored is a recovered corrupted file block, it can be determined whether there is a disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored on the storage device; if there is, proceed to step S203 to store the file block to be stored on the disk of the corresponding type that meets the preset requirements; otherwise, proceed to step S204 to store the file block to be stored on the disk of the type other than the type corresponding to the file block to be stored.

[0084] The file block type corresponds to the disk type on which the original damaged file block was stored. For example, if the original damaged file block was stored on an SMR disk, then the file block type is SMR; if the original damaged file was stored on a CMR disk, then the file block type is CMR.

[0085] Whether a disk meets the preset requirements can be determined by whether the remaining storage space on the disk is greater than or equal to the size of the file block to be stored. In this case, if the remaining storage space of all disks of the type corresponding to the file block to be stored is less than the size of the file block to be stored, then there is no disk of the type corresponding to the file block to be stored on the storage device that meets the preset requirements, and the process can proceed to step S204; otherwise, the process proceeds to step S203.

[0086] Currently, in other embodiments, the disk that meets the preset requirements for the type of file block to be stored can also refer to a disk selected from all disks of the type of file block to be stored based on a load balancing strategy. In this case, if a disk is selected from all disks of the type of file block to be stored using the load balancing strategy, then the selected disk meets the preset requirements, and the process can proceed to step S203 to store the file block to be stored on the selected disk; if no disk is selected from all disks of the type of file block to be stored using the load balancing strategy, that is, none of the disks of the type of file block to be stored meet the load balancing strategy, then the process can proceed to step S204. The load balancing strategy can comprehensively select a suitable disk based on various factors such as disk capacity and disk load.

[0087] S203: Store the file block to be stored on a disk that meets the preset requirements.

[0088] After confirming that there is a disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored on the storage device, the file block to be stored can be written to the corresponding disk through the universal storage interface (i.e., unified storage dock).

[0089] If the corresponding type of the file block to be stored is SMR, then a suitable Zone block can be selected from the SMR disks that meet the preset requirements, and then the file block to be stored can be written into the selected Zone block, and the disk content index information (such as the KV index information of the SMR disk) can be updated.

[0090] If the corresponding type of the file block to be stored is CMR, you can select a suitable Zone directory on a CMR disk that meets the preset requirements, then create a file directly with the file block name, write the data to the file, and then write the corresponding metadata information to the corresponding metadata file.

[0091] After the file blocks to be stored are written, the mapping information between the file blocks and the disk / directory can be updated in the global index.

[0092] S204: Store the file block to be stored on a disk that meets the preset requirements, except for the type of disk to be stored.

[0093] If there is no disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored on the storage device, then a disk that meets the preset requirements among all disks of types other than the type corresponding to the file block to be stored can be determined, and then the file block to be stored can be stored on the disk that meets the preset requirements among all disks of types other than the type corresponding to the file block to be stored.

[0094] Similarly, in step S204, whether the disk meets the preset requirements can also refer to whether the remaining storage space on the disk is greater than or equal to the size of the file block to be stored. Alternatively, a disk that meets the preset requirements can also refer to a disk selected from all disks of types other than the type corresponding to the file block to be stored based on a load balancing strategy.

[0095] To facilitate understanding of the data management method described above by those skilled in the art, this application also provides specific examples of the data management method. In a specific example, if the storage device contains only SMR disks and CMR disks, and if the original damaged file block of the file block to be stored is on an SMR disk, then a disk is preferentially selected from the SMR disk list according to the load balancing strategy. If none of the SMR disks on the node meet the load balancing strategy, then a suitable disk is selected from the CMR disk list according to the load balancing strategy and the file block to be stored is stored. Conversely, if the original damaged file block is on a CMR disk, then a disk is preferentially selected from the CMR disk list according to the load balancing strategy. If none of the CMR disks on the node meet the load balancing strategy, then a suitable disk is selected from the SMR disk list according to the load balancing strategy and the file block to be stored is stored.

[0096] Furthermore, if the file block to be stored is a recovered corrupted file block, such as Figure 7 As shown, in step S201, in response to the file recovery task issued by the metadata node, the undamaged file blocks of the file can be read; the damaged file blocks of the file can be recovered based on the undamaged file blocks to obtain at least one repaired file block of the file; and the repaired file blocks with the preset storage node as the storage device can be used as the file blocks to be stored.

[0097] File recovery tasks can be initiated by the metadata node. Specifically, when a file is in a state of pending recovery due to file block corruption or missing data, the metadata node can determine the target storage node (i.e., the aforementioned storage device) from all storage nodes in the distributed storage system; it then controls the storage device to recover the corrupted and / or missing file blocks in the file, allowing the storage device to control the current round of file data recovery. This recovery scheme enables file block-level data recovery and, without the management node being aware of the differences between CMR and SMR disk types, achieves file recovery functionality based on SMR raw disk management, simplifying system architecture design.

[0098] The file recovery task issued by the metadata node can carry information about the normal / damaged file blocks in the entire file. Based on this information, the storage device can read the normal file block data. The information about the undamaged file blocks can include the storage node information of the undamaged file blocks. Based on this information, the storage device can locate the storage node storing the undamaged file blocks and then read the corresponding undamaged file blocks from that storage node. If the storage device and the storage node storing at least one undamaged file block are not the same storage node, the storage device can send a request to the storage node storing the at least one undamaged file block via the network to read the undamaged file block, thereby reading the undamaged file block via the network. If the storage device and the storage node storing at least one undamaged file block are the same storage node, i.e., the at least one undamaged file block is on the storage device, the at least one undamaged file block stored therein can be read via network loopback.

[0099] Furthermore, based on the data management method of the previous embodiment, both CMR and SMR in this application are managed on a unit-by-unit basis. When reading normal file block data, the corresponding storage node can read undamaged file block data for recovery from disks of different media types (without distinguishing between CMR and SMR disks) through a unified storage dock. Moreover, the storage node can call different interfaces to operate the disk according to different storage media, realizing data read / write / recovery functions across SMR and CMR disk media types, thereby improving the scalability and compatibility of the distributed storage system and reducing data loss.

[0100] After reading a sufficient number of undamaged file blocks—for example, N or more undamaged file blocks—the damaged file blocks of the file can be recovered based on these undamaged blocks. In one embodiment, the file is stored by dividing it into N file blocks, calculating M redundant file blocks using EC erasure coding, and then writing N+M file blocks to at least one storage node. The management node uses a load balancing strategy to write these N+M file blocks to different storage nodes to maintain data uniformity and improve fault tolerance. That is, multiple file blocks of a file are evenly distributed across the storage nodes, and the failure of any one storage node will not cause all file blocks of the file to be corrupted. In this case, when the number of undamaged file blocks of the file is greater than or equal to N, [1, M] damaged file block data can be calculated based on the N undamaged file blocks of the file using EC erasure coding, thereby obtaining at least one repaired file block of the file. Therefore, if a file is corrupted due to hard drive failure, storage node or metadata node failure, network outage, or other reasons, the file can be completely recovered as long as the number of corrupted file blocks is less than or equal to M.

[0101] After obtaining at least one repaired file block of a file, this at least one repaired file block can be distributed to various storage nodes and stored. When the preset storage node for at least one repaired file block is a storage device, this at least one repaired file block can be stored in the storage device based on the data management method of the above embodiment.

[0102] For repaired file blocks whose preset storage node is not a storage device, the repaired file blocks can be sent to the preset storage node via the network so that the preset storage node can store the repaired file blocks. The storage device can send the repaired file blocks and their corresponding type information to the preset storage node so that the preset storage node can store the repaired file blocks on the disk based on the corresponding type information. Alternatively, the preset storage node can also write the repaired file blocks to disks of different media types using a unified storage dock.

[0103] In this embodiment, the preset storage node for each repaired file block can be determined by the metadata node. In this case, the file recovery task issued by the metadata node can carry the preset storage node for each repaired file block. In other embodiments, the preset storage node for each repaired file block can also be determined by the storage device itself.

[0104] In addition, to prevent recovery tasks from consuming excessive system resources, storage devices can monitor their own recovery task processing status and limit read / write traffic and / or the number of recovery tasks based on this data. This helps prevent recovery storms and other resource-intensive operations, ensuring that normal storage services are not affected. The recovery task processing status monitored by the storage device can include information such as read / write traffic per second and the number of recovery tasks per second. Figure 8 As shown. After the recovery task is issued, the storage node first determines whether the current number of tasks has reached the set threshold per second (i.e., the first threshold). If it has reached the set upper limit, it waits for the resource to be refreshed in the next second before executing the recovery task. During the recovery process, the current read and write traffic is counted. If the current read and write traffic reaches the set threshold per second (i.e., the second threshold), it waits for the resource to be refreshed in the next second before executing the read and write operation.

[0105] Please see Figure 9 , Figure 9 This is a schematic diagram of one embodiment of the electronic device 20 of this application. The electronic device 20 of this application includes a processor 22, which is used to execute instructions to implement the methods provided by any of the above embodiments of this application and any non-conflicting combinations thereof.

[0106] Processor 22 can also be referred to as CPU (Central Processing Unit). Processor 22 may be an integrated circuit chip with signal processing capabilities. Processor 22 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor can be a microprocessor, or processor 22 can be any conventional processor, etc.

[0107] The electronic device 20 may further include a memory 21 for storing instructions and data required for the processor 22 to run.

[0108] Please see Figure 10 , Figure 10This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of this application. The computer-readable storage medium 30 in this embodiment stores instruction / program data 31. When executed, this instruction / program data 31 implements the methods provided in any embodiment of the above-described method of this application, as well as any non-conflicting combination thereof. The instruction / program data 31 can be formed into a program file and stored in the storage medium 30 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) or processor can execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage medium 30 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or devices such as computers, servers, mobile phones, and tablets.

[0109] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0111] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0112] The above are merely embodiments of this application and do not limit the scope of this patent application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A data management method, characterized in that, The method includes: Create at least one storage area for a traditional magnetic recording disk; Write the data to be stored into the storage area as a file; The system stores the correspondence between the data to be stored and the storage area, so as to manage the data in the traditional magnetic recording disk based on the correspondence and using the storage area as the management unit; The data management method is applied to a storage device, wherein the storage device is provided with at least two types of disks, or the distributed data management system on which the storage device is located is provided with at least two types of disks; the method further includes: Retrieve the file block to be stored; If the file block to be stored is a recovered corrupted file block, determine whether there is a disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored on the storage device; If it exists, store the file block to be stored on the disk that meets the preset requirements; If it does not exist, store the file block to be stored on a disk that meets the preset requirements, except for the type of the file block to be stored. The file block type corresponds to the storage disk type of the original damaged file block.

2. The data management method according to claim 1, characterized in that, The method further includes: The preset disk is managed using the same partition management logic as the traditional magnetic recording disk, but the disk type of the preset disk is different from that of the traditional magnetic recording disk.

3. The data management method according to claim 1, characterized in that, The step of writing the data to be stored into the storage area in the form of a file, so that the traditional magnetic recording disk can manage files using the storage area as the management unit, includes: If the used space of the storage area is greater than or equal to the preset space threshold, a new storage area is created, and the data to be stored is written into the new storage area. If the used space in the storage area is less than a preset space threshold, the data to be stored is written into the storage area.

4. The data management method according to claim 1, characterized in that, The step of determining whether there exists a disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored on the storage device includes: Disks are selected from all disks of the type corresponding to the file blocks to be stored according to the load balancing strategy; If a disk is selected from all disks of the type corresponding to the file block to be stored, the selected disk is the disk that meets the preset requirements among all disks of the type corresponding to the file block to be stored, and the step of storing the file block to be stored on the disk that meets the preset requirements is executed; If none of the disks of the type corresponding to the file block to be stored meet the load balancing strategy, then the step of storing the file block to be stored on a disk that meets the preset requirements among all disks of types other than the type corresponding to the file block to be stored is executed.

5. The data management method according to claim 1, characterized in that, The step of obtaining the file block to be stored includes: In response to a file recovery task being acquired, read the undamaged blocks of the file. Based on the undamaged file blocks, the damaged file blocks of the file are recovered to obtain at least one repaired file block of the file; Use the repaired file blocks of the storage device as the preset storage node as the file blocks to be stored; or... If there is a repaired file block that is not a preset storage node of the storage device, the step of recovering the damaged file block of the file based on the undamaged file block to obtain at least one repaired file block of the file includes: if there is a repaired file block that is not a preset storage node of the storage device, sending the repaired file block and its corresponding type information to the preset storage node of the repaired file block, so that the preset storage node stores the repaired file block on the disk based on the corresponding type information of the repaired file block.

6. The data management method according to claim 1, characterized in that, The method further includes: The system tracks the progress of its own recovery tasks and limits read / write traffic and / or the number of recovery tasks based on this progress.

7. The data management method according to claim 6, characterized in that, The recovery task processing status includes the current number of tasks and / or the current read / write traffic during recovery. The process of statistically analyzing its own recovery task processing status and limiting read / write traffic and / or the number of recovery tasks based on this status includes: In response to the acquisition of a file recovery task, it is determined whether the current number of tasks has reached a first threshold; if so, the file recovery task is executed after the resources are refreshed. And / or, during the file recovery process, the current read and write traffic is counted. If the read and write traffic reaches a second threshold, the read and write operations are performed again after the resources are refreshed.

8. An electronic device, characterized in that, The electronic device includes a processor for executing instructions to implement the method of any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instruction / program data for execution to implement the method of any one of claims 1-7.

Citation Information

Patent Citations

  • File management among different zones of storage media

    US9128820B1