Storage system, data storage method and storage device
By using tape disks as backup storage devices in the storage system and combining reserved space design, the high deployment cost and data reliability problems caused by hard disk media are solved, and cost reduction and space utilization are improved.
Patent Information
- Application Number
- CN202410123479.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-07-29
AI Technical Summary
The media of the source storage device and backup storage device in existing storage systems are hard disks, which leads to high deployment costs and the risk of data corruption at the same time due to hardware or software failures.
The tape disk is used as a backup storage device, combined with the reserved space design, and the storage space utilization is improved by recycling garbage data nearby, and the source storage devices and backup storage devices of different media are avoided simultaneous failures, thereby improving system reliability.
It reduces the deployment cost of the storage system, and improves the utilization rate of storage space and the reliability of data recovery through dynamic adjustment of reserved space and nearby garbage collection.
Smart Images

Figure CN120386481A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technologies, and in particular, to a storage system, a data storage method, and a storage device. Background Art
[0002] A storage system usually includes a source storage device and a backup storage device. Among them, the source storage device is used to store production data, and the backup storage device is used to store copy data of the production data. Through this system redundancy design, the production data is backed up and protected to improve the high reliability of the storage system.
[0003] Currently, the media of the source storage device and the backup storage device in the storage system are hard disks, such as flash memory or magnetic disks, resulting in a high deployment cost. Summary of the Invention
[0004] This application provides a storage system, a data storage method, and a storage device to reduce the networking cost of the storage system.
[0005] In a first aspect, an embodiment of this application provides a storage system, including: a source storage device for storing production data; a backup storage device including a tape disk. Using a tape disk as the backup storage device can reduce the networking cost of the storage system. Further, the tape disk includes a plurality of consecutive physical storage spaces. Any one of the plurality of physical storage spaces includes a first space and a second space. The first space is used to store backup data, and the second space is a reserved space. The reserved space can be used to organize the data in the first space, such as recycling garbage data in the first space. Compared with the prior art where the reserved space is set at the end of the entire physical storage space, in the embodiment of this application, the distance between the reserved space and the first space is relatively close, so that the reserved space nearby can be used to recycle the garbage data in the first space, improving the garbage collection efficiency, and further improving the utilization rate of the storage space of the tape disk.
[0006] It should be noted here that both the source storage device and the backup storage device provided in the embodiment of this application can be used to store production data.
[0007] In a possible implementation, the storage medium of the source storage device is different from that of the backup storage device, which can avoid the production data and the copy data being damaged simultaneously due to hardware failures or software failures of the source storage device and the backup storage device, thereby improving the reliability of the storage system.
[0008] In a possible implementation, the reserved space in the embodiment of this application can be used for garbage collection, or storing bad track data, or other operations for optimizing the physical storage space.
[0009] In a possible implementation, the ratio of the capacity of the first space to the capacity of the second space is preset.
[0010] In a possible implementation, the ratio can be dynamically adjusted according to the amount of replicated data already stored in the physical storage space until the ratio is the ratio of the capacity of the actually used storage space of the physical storage space to the capacity of the overall storage space. By dynamically adjusting the ratio, the utilization rate of the storage space can be improved.
[0011] In a possible implementation, the first space includes a plurality of first space blocks, and the second space includes a plurality of second space blocks; the plurality of first space blocks and the plurality of second space blocks are arranged at intervals, which can further reduce the distance between the first space block and the second space block, so that it is more convenient to use the second space block to organize the data in the first space block, and the utilization rate of the storage space can be further improved.
[0012] In a possible implementation, the backup storage device can also obtain the usage information of a plurality of first space blocks. Since the usage information of the plurality of first space blocks changes frequently and dynamically, and the read / write latency of the source storage device is less than that of the backup storage device, in the embodiments of the present application, sending the usage information to and storing it in the source storage device can improve the read / write rate of the usage information.
[0013] In a possible implementation, when the amount of garbage in the replicated data stored in the first space exceeds a certain threshold, the valid data of the replicated data stored in the first space can be copied to the second space, realizing in-place garbage collection and improving the garbage collection efficiency.
[0014] In a possible implementation, the storage system further includes a controller for sending backup request information to the storage device, and the backup storage device stores the replicated data and the metadata of the replicated data in the first space. Among them, the metadata includes the metadata of the replicated data. When the replicated data and the metadata are stored together, the replicated data corresponding to the metadata can be quickly found according to the metadata, improving the data search efficiency. When data recovery is required, data recovery can be quickly performed.
[0015] In a possible implementation, the metadata further includes the time when the source storage device receives the production data. When performing data recovery, the source storage device can determine the replicated data with the most recent time from multiple replicated data corresponding to the same logical address according to the time of receiving the production data, so as to ensure the accuracy of the recovered data and improve the reliability of the storage system.
[0016] In a possible implementation, the backup storage device stores the copy data and metadata in the first space block pointed to by the running direction of the magnetic tape of the magnetic tape disk, so as to improve the data writing rate of the backup storage device.
[0017] In a possible implementation, the source storage device is a hard disk, and the hard disk can be a solid state drive or a mechanical hard disk.
[0018] In a second aspect, an embodiment of the present application further provides a data storage method, which is executed by a storage device. The storage device may be a backup storage device in the first aspect that provides a magnetic tape disk, and the magnetic tape disk includes a plurality of consecutive physical storage spaces; any one of the plurality of consecutive physical storage spaces is divided into a first space and a second space; data is acquired; the data is stored in the first space; and the second space is used as a reserved space OP. The functions or technical effects achieved during the execution of this data storage method by the storage device may refer to the functions or technical effects brought by the first aspect and any possible implementation manner in the first aspect.
[0019] In a third aspect, an embodiment of the present application further provides a storage device, which may be the backup storage device in the first aspect, and includes: one or more magnetic tape disks, and any one of the one or more magnetic tape disks includes a plurality of consecutive physical storage spaces; one of the one or more magnetic tape disks includes a control device for dividing any one of the plurality of consecutive physical storage spaces into a first space and a second space, where the first space is used to store the data acquired by the control device, and the second space is used as a reserved space. The functions or technical effects achieved by the control device included in the magnetic tape disk during the execution of the above steps may refer to the functions or technical effects brought by the first aspect and any possible implementation manner in the first aspect. Description of the Drawings
[0020] Figure 1 It is an architecture diagram of a storage system provided by an embodiment of the present application;
[0021] Figure 2 It is a structural schematic diagram of a magnetic tape disk in the storage system provided by an embodiment of the present application;
[0022] Figure 3 It is a flowchart of a data storage method provided by an embodiment of the present application;
[0023] Figure 4 It is a partial schematic diagram of the physical storage space of the magnetic tape included in the magnetic tape disk provided by an embodiment of the present application;
[0024] Figure 5 It is a schematic diagram of an overwrite area provided by an embodiment of the present application;
[0025] Figure 6 Schematic diagram of the layout of the first space and the second space in the physical storage space provided by the embodiment of the present application;
[0026] Figure 7 Schematic diagram of garbage collection provided by the embodiment of the present application;
[0027] Figure 8 Schematic diagram of organizing data in the first space provided by the embodiment of the present application;
[0028] Figures 9A - 9B Schematic diagram of the correspondence between the logical address and the physical address of the SSD and the correspondence between the logical address and the physical address of the magnetic tape provided by the embodiment of the present application. Detailed implementation manners
[0029] To make the objectives, technical solutions and advantages of the present application clearer, the following further describes the specific embodiments of the present application in detail with reference to the accompanying drawings.
[0030] First, a possible application scenario of the embodiment of the present application is briefly introduced. The storage system provided by the present application can be applied to the edge computing scenario. Among them, edge computing provides cloud services and IT environment services for application developers and service providers at the edge side of the network; the goal is to provide computing, storage and network bandwidth close to the data input or users. Typical edge computing scenarios include but are not limited to the following: wind turbine power generation scenario; scenarios that require instant interaction, such as unmanned driving scenarios; intelligent transportation scenarios; services with high security requirements, such as face recognition scenarios. For any of the above scenarios, high reliability is required for data storage. If the data in any scenario is damaged, it will cause very huge losses. Therefore, the storage system provided by the present application is applied to the above edge scenarios to solve the problem of high-reliability deployment of data in the edge scenarios.
[0031] Please refer to Figure 1 , where the user stores data through an application program, and the computer running these application programs is called an "application server". The application server 100 can be a physical machine or a virtual machine. The physical application server includes but is not limited to desktop computers, servers, laptop computers, and mobile devices. The application server 100 accesses the storage system 120 through the fiber optic switch 110 to store and retrieve data. Here, it should be noted that the fiber optic switch 110 is an optional device, and the application server 100 can also directly communicate with the storage system 120 through the network. Among them, the storage system 120 can be a centralized storage system or a distributed storage system. Among them, the centralized storage system includes a disk control separation architecture and a disk control integrated architecture. Here, the disk control integrated architecture is used for description.
[0032] Figure 1 The storage system 120 shown is a centralized storage system. The characteristic of a centralized storage system is that there is a unified entry point, and all data coming from external devices must pass through this entry point, which is the engine of the centralized storage system. The engine 121 is the most core component in the centralized storage system, and many advanced functions of the storage system are implemented therein.
[0033] As Figure 1 shown, there is one or more controllers in the engine 121. Figure 1 Taking the example that the engine 121 includes two controllers for illustration. There is a mirror channel between controller 0 and controller 1. Then when controller 0 writes a piece of data into its memory 124, it can send a copy of the data to controller 1 through the mirror channel, and controller 1 stores the copy in its own local memory 124. Thus, controller 0 and controller 1 back up each other. When controller 0 fails, controller 1 can take over the business of controller 0. When controller 1 fails, controller 0 can take over the business of controller 1, thereby avoiding the unavailability of the entire storage system caused by hardware failures. When there are 4 controllers deployed in the engine 121, there is a mirror channel between any two controllers, so any two controllers back up each other.
[0034] The engine 121 also includes a front-end interface 125 and a back-end interface 126. The front-end interface 125 is used to communicate with the application server 100, so as to provide storage services for the application server 100. The back-end interface 126 is used to communicate with storage devices to expand the capacity of the storage system. Through the back-end interface 126, the engine 121 can connect more storage devices, thus forming a very large storage resource pool.
[0035] The engine 121 also includes a processor 123. The processor 123 can be a central processing unit (CPU), which is used to process data access requests from outside the storage system (servers or other storage systems), and is also used to process requests generated inside the storage system. As an example, when the processor 123 receives a write data request sent by the application server 100 through the front-end port 125, it will temporarily save the data in these write data requests in the memory 124. When the total amount of data in the memory 124 reaches a certain threshold, the processor 123 sends the data stored in the memory 124 to the storage device through the back-end port 126 for persistent storage.
[0036] It should be noted that Figure 1 only one engine 121 is shown in, however, in actual applications, the storage system may include two or more engines 121, and redundancy or load balancing is performed between multiple engines 121.
[0037] In this system, the storage device includes two parts, one is the source storage device 134, and the other is the backup storage device 135. When the engine 121 has hard disk slots, the source storage device 134 and the backup storage device 135 can be directly deployed in the engine 121, or the source storage device 134 is deployed in the engine 121, and the backup storage device 135 is placed in the hard disk enclosure, and the hard disk enclosure is communicatively connected to the backend interface 126; when the engine 121 does not have hard disk slots, the source storage device 134 and the backup storage device 135 are placed in a hard disk enclosure and communicatively connected to the backend interface 126, or the source storage device 134 is placed in one hard disk enclosure, and the backup storage device 135 is placed in another hard disk enclosure, and they are respectively communicatively connected to the backend interface 126. Among them, the backup storage device 135 is used to backup and store the data in the source storage device 134. The source storage device 134 can be a solid-state drive (SSD) array or a hard disk drive (HDD). The backup storage device 135 includes one or more tape cartridges. A tape cartridge refers to a storage device in which a magnetic tape and a magnetic head are integrally packaged. Compared with the existing tape system, the tape cartridge can be deployed more simply, without the need to introduce methods such as manual or robotic arms for tape replacement, nor does it require a large amount of space for deployment. In the following introduction, taking the source storage device 134 as an SSD and the backup storage device as a tape cartridge as an example, the tape cartridge is relatively cheap compared to other hard disk devices, and can reduce the deployment cost of the storage system. Further, when the source storage device 134 is an SSD and the backup storage device 135 is a tape cartridge, the SSD and the tape cartridge are storage devices of different media, which can avoid all the data stored on the SSD and the tape cartridge being damaged due to hardware failures or software failures, thereby improving the reliability of the storage system.
[0038] For the hardware, please refer to Figure 2 , the tape cartridge includes: a magnetic tape 200, a magnetic head module 201, a control device 202, and a traveling device 203.
[0039] The magnetic tape 200 has a magnetic layer, a base film, and a back coating. The magnetic layer is formed on one side of the base film, and the back coating is formed on the other side of the base film. Data is recorded in the magnetic layer, which is usually made of metal oxides such as iron oxide or chromium dioxide. The base film, also known as the support, is a substrate that provides flexibility and strength, and it can be made of polyethylene terephthalate, polyethylene naphthalate, or polyamide. The back coating is a layer containing non-magnetic powder such as carbon black. It should be noted that a non-magnetic layer can also be formed between the base film and the magnetic layer. In the magnetic tape, the side with the magnetic layer formed is the front side of the magnetic tape, and the side with the back coating formed is the back side of the magnetic tape.
[0040] The control device 202 is used to control the magnetic tape 200, the magnetic head module 201, and the traveling device 203. The control device 202 includes a processor and a memory. The processor can be an Application Specific Integrated Circuit (ASIC), or a Field Programmable Gate Array (FPGA), or a Programmable Logic Controller (PLC), or a combination of any two or more of the above implementation methods.
[0041] The traveling device 203 is a device that selectively moves the magnetic tape along a specified path in the forward or backward direction, and includes a take-up reel 2031, a take-up motor 2032, and a plurality of rollers. It should be noted that here, the forward direction refers to the direction in which the magnetic tape is fed out, and the backward direction refers to the direction in which the magnetic tape is rewound.
[0042] The take-up motor 2032 rotates the take-up reel 2031 under the control of the control device 202, and the controller 202 controls the take-up motor 2032 to control the rotation direction, rotation speed, rotation torque, etc. of the take-up reel 2031.
[0043] When the magnetic tape is wound by the take-up reel 2031, the control device 202 rotates the take-up motor 2032 so that the magnetic tape travels along the specified path in the forward direction. In addition, when the magnetic tape is rewound, the control device 202 rotates the take-up motor 2032 to move the magnetic tape along the specified path backward.
[0044] The magnetic head module 201 includes at least one magnetic head. The magnetic head includes a magnetic element and a bracket, and the magnetic element is held by a holder to contact the traveling magnetic tape. The magnetic element unit records data in the magnetic tape traveling along the specified path by the traveling device 203, or reads data from the magnetic tape traveling along the specified path by the traveling device 203.
[0045] Further, the magnetic tape further includes a moving mechanism 204. The moving mechanism 204 includes a moving actuator. The moving actuator may be a voice coil motor (VCM) and / or a piezoelectric actuator. The moving actuator is connected to the control device 202, and the control device 202 controls the moving actuator such that the moving controller generates power to move the head module 201 in the width direction of the magnetic tape.
[0046] Further, the magnetic tape cartridge further includes a communication interface 205. The communication interface 205 is connected to an external device via a communication network such as a wide area network (WAN) or a local area network (LAN). In the embodiment of the present application, the external device may be the back-end interface 126 of the storage system to receive data sent by the controller of the storage system through the back-end reception.
[0047] In the embodiment of the present application, Figure 1 the storage system shown can provide the following two uses, including but not limited to:
[0048] First, Figure 1 the storage system shown can be used to store production data. As an example, the SSD is used to store the hot data in the production data, and the magnetic tape cartridge is used to store the cold data in the production data, where the hot data is the data frequently updated by users, and the cold data is the data infrequently updated by users; correspondingly, when reading data, in this system, first query from the SSD, if available, read from the SSD, if not, read from the magnetic tape cartridge.
[0049] Second, Figure 1 the storage system shown is used both for storing production data and for backing up production data. As an example, the SSD is used to store production data, and the magnetic tape cartridge is used to store the replica data of the production data to perform data recovery using the replica data in the magnetic tape cartridge when the production data stored in the SSD is damaged.
[0050] The process of the magnetic tape cartridge for storing production data is similar to the process for storing replica data. In the following introduction, the process of the magnetic tape cartridge for storing replica data is taken as an example for description, and this process can be referred to Figure 3 . The process of the magnetic tape cartridge for storing production data can be referred to the following description process and will not be elaborated here.
[0051] Further, the controller 0 or the controller 1 included in the storage system receives a write request sent by the application server 100. The write request includes the production data to be stored. In the appendix Figure 3Among them, the step of the application server 100 sending a write request to the controller 1 is marked as ①. The controller first stores the production data to be stored in the memory 124 of the controller, and then sends the production data to the SSD through the backend interface 126 and stores it in the flash array of the SSD. This step is marked as ②. In the embodiments of the present application, the storage form of the production data in the SSD is not limited. Specifically, it can be block storage or file storage. Block storage is to store data in one or more blocks of a fixed length. The block is based on a page, and one or more consecutive pages form a block. File storage is to store data in files of variable length. A single file may consist of one or more logical blocks, and the logical blocks are discontinuously distributed.
[0052] Among them, the production data can be the data collected in the edge scenarios introduced above. For example, the face data collected in the face recognition scenario, or the road data collected in the autonomous driving scenario, or the environmental data collected through sensors, etc. After storing the production data in the SSD, the controller can back up the copy data of the production data to the magnetic tape disk according to a certain strategy. As an example, at a fixed time point every day, for example, at 1 am, the copy data of the production data stored in the SSD before this time point is backed up to the magnetic tape disk for easy display on the attachment. Taking the production data as AA as an example. Figure 3 For display on the attachment, taking the production data as AA as an example.
[0053] The process of the SSD storing the production data is introduced above. Next, the process of the magnetic tape disk in the storage system provided by the present application storing the copy data will be continued. Before introducing this process, the storage space layout of the magnetic tape in the magnetic tape disk will be introduced first. Please refer to Figure 3 , the magnetic tape includes a plurality of consecutive physical storage spaces. Any physical storage space in the plurality of consecutive physical storage spaces includes a space 301 and a space 302. The space 301 is used to store the copy data, and the space 302 is a reserved space (Over Provisioning, OP), which refers to the space that cannot be operated by the user and is invisible to the user. Its capacity size is the actual capacity minus the user-available capacity. The OP area is generally used for optimization operations. For example, the reserved space is used to organize the data in the space. More specifically, the reserved space is used to recycle the garbage data in the space 301. Since the distance between the reserved space 302 and the space 301 is relatively close, compared with the prior art where the reserved space 302 is set at the end of the entire physical storage space, in the embodiments of the present application, the nearby reserved space 302 can be used to recycle the garbage data in the space 301, improving the garbage collection efficiency and thus improving the space utilization rate of the magnetic tape disk. It should be noted here that the space 301 refers to the first space, and the space 302 refers to the second space. In the subsequent introduction, the reserved space is also represented by 302.
[0054] As an example, the reserved space 302 is used to store the valid data in the copy data stored in the space 301 during the garbage collection process. When there is garbage data in the space 301, in order to improve the space utilization rate of the space 301, it is necessary to recycle the garbage data. Among them, the garbage data can be invalid data in the copy data, and the invalid data can be data with expired backups. Since the magnetic tape is written sequentially, if the data stored in the space 301 needs to be modified, the valid data in the copy data stored in the space 301 needs to be copied to the blank space. The blank space refers to the space that has not been written, that is, the reserved space 302 in the embodiment of the present application, and then the data in the space 301 is overwritten, otherwise the valid data in the stored copy data will be lost.
[0055] As another example, the reserved space is used to store the copy data stored in the space 301 when the space 301 is damaged. When the backup storage device leaves the factory or the space 301 is damaged during use, the copy data stored in the space 301 can be copied to the reserved space 302, which can avoid the loss of the copy data stored in the space 301.
[0056] Any physical storage space may include the space 301 and the reserved space 302. How to determine the ratio of the capacity of the space 301 to the capacity of the reserved space 302. In the embodiment of the present application, when no data has been written to any physical storage space, the ratio of the capacity of the space 301 to the capacity of the reserved space 302 can be preset. As an example, half of the physical storage space is used as the space 301 to store copy data, and the other half is used as the reserved space 302 to organize the data stored in the space 301. The ratio is 1. During the data storage process, this ratio can be fixed or dynamically changed according to the amount of written data. As an example, the total storage capacity of the physical storage space is 120TB, and the capacity of the space with written data is 50TB. The ratio is 5 / 12. Then the ratio is adjusted from 1 to 5 / 12. At this ratio, the capacity of the space 301 in the physical storage space is 50TB, and the capacity of the reserved space 302 is 70TB. Further, taking the physical storage space as 120TB and the user available space as 100TB as an example, the remaining 20TB is the user unavailable space, that is, the OP space. When the user available space is full, the capacity of the space 301 is 100TB, and the reserved space 302 is 20TB. The ratio is 5. Therefore, when the preset value is 1, this ratio can be dynamically adjusted until the ratio is 5, and then the adjustment is no longer continued. The above is only one implementation method for adjusting the ratio of the capacity of the space 301 to the capacity of the space 302. Of course, in the specific implementation process, there may be other adjustment methods, which are not limited here.
[0057] As described above, the comparison value can be adjusted. As for when to adjust the comparison value, no specific limitation is imposed in the embodiments of the present application. It can be when writing copy data into the physical storage space, that is, adjusting the ratio of the capacity of space 301 to the capacity of reserved space 302. It can also be dynamically adjusting the ratio of the capacity of space 301 to the capacity of space 302 at preset time intervals, such as 5 hours, 12 hours, 24 hours, or one week. It can also be adjusted by other means.
[0058] Please continue to refer to Figure 3 , space 301 and reserved space 302 are continuous physical spaces divided from any physical storage space. In other words, the physical addresses of space 302 and reserved space 301 are continuous. Figure 3 In , the physical address of space 302 is behind the physical address of space 301. Of course, it can also be that the physical address of space 301 is behind the physical address of space 302.
[0059] As another example, space 301 can be multiple logically continuous physical spaces, and space 302 can be multiple logically continuous physical spaces. In other words, space 301 includes multiple space blocks 3011 with discontinuous physical addresses, and reserved space 302 includes multiple space blocks 3021 with discontinuous physical addresses. The multiple space blocks 3011 and the multiple space blocks 3021 are arranged at intervals. The arrangement method at intervals can be 3011, 3021, 3011, 3021,... 3011, 3021; it can also be 3011, 3011, 3021, 3011, 3011, 3021,... 3011, 3011, 3021. For details, please refer to Figure 4 . When the multiple space blocks 3011 and the multiple space blocks 3021 are arranged at intervals, the distance between space block 3011 and space block 3021 is further reduced, which makes it more convenient to use space block 3021 to organize the data stored in space block 3011, and further improves the utilization rate of space 301. It should be noted here that space block 3011 refers to the first space block included in space 301, and space block 3021 refers to the second space block included in space 302.
[0060] When space 301 is divided into multiple space blocks 3011 and space 302 is divided into multiple space blocks 3021, the multiple space blocks 3011 and the multiple space blocks 3021 can be set according to the above initial ratio and setting method. When dynamically adjusting the ratio subsequently, only the usage purposes of the multiple space blocks 3021 need to be dynamically adjusted. As an example, the usage purposes of the space blocks 3021 can be represented by numerical symbols. 1 represents reserved space, and 2 represents used for storing replica data. Of course, there can be other representation methods, which are not limited herein.
[0061] In the case where the ratio of the capacity of space 301 to the capacity of the reserved space 302 is determined, in the embodiments of the present application, the capacities of the multiple space blocks 3011 are the same, the capacities of the multiple space blocks 3021 are the same, and the capacity of the space block 3011 can be the same as the capacity of the space block 3021. Among them, the capacity of the space block 3021 can be based on the size of the overwrite area as the basic unit. For the overwrite area, please refer to Figure 5 , which includes multiple tracks. The tracks are stacked on top of each other to form a structure like tiles. Each track ensures that a part of the space is exposed to allow the read head to read data normally. Since the tracks are stacked on top of each other and the width of the write head is greater than the width of the read head, when data is stored on each track (track 0 - track 4), if the data on the track needs to be modified, there will be certain problems. Taking track 1 as an example, when writing data on track 1, it will overwrite the data that has been written on track 2. The overwrite area here refers to the area where the write head overwrites the next track when writing the current track.
[0062] After introducing the space layout of the magnetic tape, it further introduces how the magnetic tape disk stores data, performs garbage collection, and assists in data recovery based on the running direction of the magnetic tape and the space layout of the magnetic tape storage space after receiving the replica data.
[0063] (1) Replica data storage
[0064] When data backup is required, the controller of the storage system sends backup request information to the control device 202 of the magnetic tape drive. After receiving the request information, the control device 202 stores the copy data and metadata in the request information in space 301, and marks this step as ③. The copy data here includes a batch of data blocks. Correspondingly, each data block in the batch of data blocks corresponds to metadata. Among them, metadata refers to data that describes business data, mainly information that describes data attributes, and is used to support functions such as indicating storage locations, historical data, resource search, and file records. For example, the metadata used to indicate a piece of business data includes the length of the business data and the physical location of the business data on the storage device. In the embodiment of the present application, the metadata includes the logical addresses of each data block stored in the SSD.
[0065] When the copy data is a batch of data blocks, the magnetic tape drive stores each data block and the metadata of each data block in space 301 in sequence. Referring to the attached Figure 3 figure, when space 301 includes multiple space blocks 3011, the control device 202 stores the data blocks and the metadata corresponding to the data blocks in the space block 3011 pointed to by the running direction of the magnetic tape in sequence according to the running direction of the magnetic tape. When the capacity of the space block 3011 is insufficient, it is then stored in the next space block 3011 of the space block 3011. Since the writing method of the magnetic tape drive is sequential writing, determining the space block for storage in this way improves the writing efficiency of the magnetic tape drive.
[0066] In the embodiment of the present application, in addition to including the logical address corresponding to the data block, the metadata also includes the time when the SSD receives the data block, that is, the time when the data block included in the copy data is received by the SSD, so as to determine the final data to be recovered according to the time when the SSD receives the data block during data recovery. Further, the metadata may also include the size of the data block, or other description information of the data block.
[0067] (2) Garbage collection
[0068] The above introduced how the magnetic tape drive stores the copy data. Next, it further introduces how to perform garbage collection when there is garbage data in the stored copy data and how to monitor the usage status of each space block 3011 in space 301.
[0069] The control device 202 is used to obtain the usage information of the space block 3011, including the write status of the space block 3011. Based on the obtained write status of the space block 3011, the used space capacity and unused space capacity of the physical storage space can be obtained, so that the physical storage space can be further planned. The write status of the space block 3011 can be identified by corresponding symbols. The symbols can be data symbols. For example, "0" represents not written, and "1" represents written; or the symbols can also be letter symbols, "Y" represents written, and "N" represents not written.
[0070] Furthermore, the usage information also includes the amount of garbage in the space block 3011. The garbage collection algorithm for multiple space blocks 3011 can adopt the mark-sweep algorithm. After the control device 202 obtains the usage information, it sends the usage information to the controller of the storage system, and the controller of the storage system stores it in the SSD. Since the read / write latency of the SSD is less than that of the magnetic tape, and the usage information of the space block 3011 is information that needs to be updated frequently. Therefore, after storing the usage information on the SSD, the controller can quickly obtain the usage information and, according to the usage information, require the magnetic tape disk to write the obtained copy data or organize the data in the space 301, thereby improving the utilization rate of the magnetic tape storage space.
[0071] Furthermore, in the specific implementation process, the control device 202 can regularly send request information to the controller to obtain the usage information of the space 301 stored in the SSD, and then obtain the amount of garbage in the space 301 and determine whether to perform garbage collection. When the amount of garbage in the copy data stored in the space 301 exceeds a certain threshold, the valid data in the copy data stored in the space 301 is copied to the space 302, and the copy data stored in the space 301 is erased. Please refer to Figure 6 , to Figure 3 Taking any space block 3011 in the space 301 and any space block 3021 in the space 302 as an example, when the amount of garbage in the space block 3011 exceeds a certain threshold, the valid data in the copy data stored in the space block 3011 is copied to the space block 3021, and then the space block 3011 is overwritten to obtain a blank space block 3011 for subsequent data writing. Among them, when the space block 3021 is not full, to improve the space utilization rate, it can be filled with user data, or filled by padding with zeros, or left blank, that is, no filling is done.
[0072] In the embodiment of the present application, the space block 3021 for garbage collection is determined based on the current running direction of the magnetic tape, the current running position, and the space block 3021 adjacent to the space block 3011 that needs to perform garbage collection. Specifically, please refer toFigure 7 , Figure 7 When the amount of garbage on the first spatial block 3011 exceeds a certain threshold and garbage collection is required, there are two spatial blocks 3021 adjacent to the spatial block 3011 that can be used for garbage collection. For the convenience of distinction and description, these two spatial blocks 3021 are respectively marked as 3021-1 and 3021-2. For the spatial block 3021-1 and the spatial block 3021-2, to determine which one is used as the spatial block for garbage collection, as Figure 7 shown by the arrow above, the direction pointed by the arrow is the current running direction of the magnetic tape, and the position where the arrow is located is the current running position of the magnetic tape. Based on this, it is further determined that the spatial block 3021-2 is used for garbage collection, thus realizing near garbage collection and improving the efficiency of garbage collection.
[0073] In the embodiment of the present application, in addition to performing garbage collection to improve the utilization efficiency of the storage space, data sorting can also be used to improve the utilization efficiency of the storage space. Please refer to Figure 8 , for the convenience of description, the spatial blocks included in the space 301 shown in Figure 3 are marked as 3011-1 and 3011-2. If neither the spatial block 3011-1 nor the spatial block 3011-2 is full of data, since the magnetic tape is written in a sequential manner, even if there are blank spaces in the above two spatial blocks, data cannot be written continuously. Then, in order to improve the utilization rate of the storage space, the copy data stored in the spatial block 3011-1 and the copy data stored in the spatial block 3011-2 are copied to the spatial block 3021, so that the spatial block 3011-1 and the spatial block 3011-2 can be overwritten to obtain a blank spatial block 3011-1 and a blank spatial block 3011-2.
[0074] (3) Data recovery
[0075] The purpose of the backup storage device set in the storage system is to perform data recovery based on the copy data stored in the backup storage device when the source storage device fails and the production data stored in the source storage device is damaged. Suppose the SSD fails due to a hardware device failure, resulting in the loss of production data stored in the SSD. After the SSD failure is repaired, it is necessary to recover the production data stored on the SSD. In this case, the controller sends a data recovery request to the control device 202. The data recovery request may include failure device information and data to be recovered information. The failure device information may be a failure device identifier used to identify which SSDs have failed; the data to be recovered information is the time period or logical address of the data to be recovered, etc. The following will be described in different cases.
[0076] Before describing the data recovery process, let's briefly describe how the modified production data stored in the SSD is backed up on the tape drive. As an example, assume that for some reason, the production data stored on the SSD needs to be modified. For instance, a character A in the production data is modified to character B. After the modification is successful on the SSD, is the character A directly modified to character B on the tape drive? The answer is no. As mentioned above, the tape cannot perform random writes but only sequential writes. This determines that the tape drive cannot modify the character A in place. Instead, the character B is stored in a blank area. Thus, both the original character A and the modified character B exist on the tape. Since the logical addresses corresponding to character A and character B when stored on the SSD are the same, the character A and character B on the tape drive also correspond to the same logical address. Here, let's briefly introduce the correspondence between the logical address and the physical address when character A is stored on the SSD. The so-called logical address refers to the address presented by a storage device, such as an SSD or a tape drive, to the controller. Since the controller is not aware of the actual address where the data is stored in the storage device, it can access the storage device only through the logical address. The physical address, on the other hand, refers to the actual address where the data is stored in the SSD or the tape drive, which is not perceivable to the controller. For an SSD, the physical address includes the block ID and the page ID. For a tape drive, the physical address includes the track ID and the space block ID. Please refer to Figure 9A , assume that the logical address of character A stored on the SSD is 0002, and the physical address stored on the SSD is page 2 on block 0. Correspondingly, please refer to Figure 9B , assume that the logical addresses of character C and character D stored on the tape drive are 0002 and 0003, the physical address of character C stored on the tape drive is space block 2 on track 0, and the physical address of character D stored on the tape drive is space block 3 on track 0.
[0077] Case 1: All the production data stored on the SSD needs to be recovered
[0078] In the case where all the production data stored on the SSD needs to be restored, it is also called full recovery. In this case, after the control device 202 receives a data recovery request, it traverses the metadata stored on the tape, locates the corresponding data blocks according to the metadata, and then sends the metadata and the corresponding data blocks to the controller of the storage system. After the controller receives the metadata and the corresponding data blocks, since not all of the received data blocks need to be restored. As described above, the character A, which is the data modified and abandoned on the SSD, is also stored on the tape. Of course, the character A does not need to be restored. Therefore, before storing the received data blocks on the SSD, the controller can determine a final data block to be restored according to the time when each data block was received on the SSD recorded in the metadata. As an example, for the same logical address, there are three corresponding data on the tape, and the times when these three data were received on the SSD are January 1, 2024, January 6, 2024, and January 8, 2024 respectively. Then the controller selects the data corresponding to the latest time as the data to be restored according to these times, that is, the data corresponding to the time of January 8, 2024 is used as the data to be restored. After the screening is completed, the controller stores the corresponding data in the SSD according to the logical address recorded in the metadata.
[0079] Case 2: Part of the production data stored on the SSD needs to be restored
[0080] When part of the production data stored on the SSD needs to be restored, it is also called partial recovery. Here, the partial data can refer to the data stored on the SSD during a certain time period. The partial recovery process is similar to the full recovery process, and the only difference is that the control device 202 sends the data blocks that meet the requirements and the corresponding metadata to the SSD, and the requirement is the one for a certain time period mentioned above. The control device 202 can query the metadata that meets the requirements by scanning, and then read the corresponding data blocks, or accelerate the query of the metadata that meets the requirements through the index of the faulty device, and then read the corresponding data blocks.
[0081] The embodiment of the present application also includes a tape, which includes a plurality of consecutive physical storage spaces. Any one of the plurality of consecutive physical storage spaces includes the Figure 3 shown space 301 and space 302. Space 301 is used to store data, and the process of storing its data can refer to Figure 3 the storage process of the copy data shown. Space 302 is used as a reserved space, which can be used to optimize the data stored in space 301. Specifically, it can also refer to the relevant content described above, which will not be elaborated here.
[0082] The embodiment of the present application further provides a control device, which is used to divide the storage space of the magnetic tape shown in the second aspect into multiple consecutive physical storage spaces, and divide any one of the multiple consecutive physical storage spaces into space 301 and space 302. Space 301 is used to store data, and the process of storing its data can be referred to Figure 3 the storage process of the replica data shown. Space 302 is used as a reserved space for optimizing the data stored in space 301. Specifically, it can also refer to the relevant content described above and will not be elaborated here. It should be noted here that the control device in the third aspect and the magnetic tape in the second aspect can be integrated into one body, that is Figure 2 the magnetic tape disk shown. Of course, the control device in the third aspect and the magnetic tape in the second aspect may not be integrated into one body, and the two implementation manners can be selected according to the actual situation and are not limited here.
[0083] As mentioned above, the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any change or replacement within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A storage system, characterized in that, Including: A source storage device for storing production data; A backup storage device for storing copy data of the production data; Wherein, the backup storage device includes a magnetic tape disk, the magnetic tape disk includes a plurality of consecutive physical storage spaces, and any one of the plurality of consecutive physical storage spaces includes a first space and a second space, the first space is used for storing the copy data, and the second space is a reserved space OP.
2. The storage system according to claim 1, wherein The reserved space is used for storing valid data in the copy data stored in the first space during the garbage collection process; or The reserved space is used for storing the copy data stored in the first space when the first space is damaged.
3. The storage system according to claim 1, wherein The ratio of the capacity of the first space to the capacity of the second space is preset.
4. The storage system according to claim 3, characterized in that, The backup storage device is further used for: Adjusting the ratio, and the ratio is less than or equal to the ratio of the capacity of the actually used storage space of the physical storage space to the total capacity of the physical storage space.
5. The storage system according to any one of claims 1-4, characterized in that, The first space includes a plurality of first space blocks, and the second space includes a plurality of second space blocks; The plurality of first space blocks and the plurality of second space blocks are arranged at intervals.
6. The storage system according to claim 5, wherein The backup storage device is further used for: Obtaining usage information of the plurality of first space blocks, wherein the usage information includes the write status of each first space block in the plurality of first space blocks and the amount of garbage in each first space block; Sending the usage information to the source storage device and storing it in the source storage device, wherein the read / write latency of the source storage device is less than the read / write latency of the backup storage device.
7. The storage system according to any one of claims 1-4, characterized in that, The backup storage device is further used for, when the amount of garbage in the copy data stored in the first space exceeds a certain threshold, copying the valid data in the copy data stored in the first space to the second space and erasing the copy data stored in the first space.
8. The storage system according to claim 1, wherein The storage system further includes a controller, and the controller is used for: Sending backup request information to the backup storage device, wherein the backup request information includes the copy data and metadata of the copy data, and the metadata includes the logical address of the data to be backed up; The backup storage device is specifically used for storing the copy data and the metadata in the first space.
9. The storage system according to claim 8, wherein, The backup storage device is specifically used for: Determining the first space block pointed to by the running direction according to the running direction of the magnetic tape included in the magnetic tape disk; Storing the copy data and the metadata in the first space block pointed to by the running direction.
10. The storage system according to claim 1, wherein The source storage device is a hard disk.
11. A data storage method, characterized in that, Executed by a storage device, the method includes: Providing a magnetic tape disk, the magnetic tape disk including a plurality of consecutive physical storage spaces; Dividing any one of the plurality of consecutive physical storage spaces into a first space and a second space; Obtaining data; Storing the data in the first space; Using the second space as the reserved space OP.
12. The data storage method according to claim 11, wherein: the reserved space is used to store valid data among the data stored in the first space during the garbage collection process; or the reserved space is used to store the data stored in the first space when the first space is damaged.
13. The data storage method according to claim 11, wherein The first space includes a plurality of first space blocks. Storing the data in the first space includes: determining a first space block pointed to by the running direction according to the running direction of the tape included in the magnetic tape disk; storing the data in the first space block pointed to by the running direction.
14. The data storage method according to claim 11, wherein When the amount of garbage in the data stored in the first space exceeds a certain threshold, copying the valid data among the data stored in the first space to the second space, and erasing the data stored in the first space.
15. The data backup method according to claim 11, characterized in that, The data is backup data of production data stored in a source storage device. The method further includes: receiving backup request information, where the backup request information includes the data and metadata of the data, and the metadata includes the logical address of the data; storing the data and the metadata in the first space.
16. A storage device, characterized in that, including: one or more magnetic tape disks, any one of the one or more magnetic tape disks including a plurality of consecutive physical storage spaces; one of the one or more magnetic tapes includes a control device for dividing any one of the plurality of consecutive physical storage spaces into a first space and a second space, where the first space is used to store data acquired by the control device, and the second space is used as a reserved space.
17. The storage device according to claim 16, wherein: the reserved space is used to store valid data among the data stored in the first space during the garbage collection process; or the reserved space is used to store the data stored in the first space when the first space is damaged.
18. The storage device according to claim 16, wherein: the ratio of the capacity of the first space to the capacity of the second space is preset.
19. The storage device according to claim 18, wherein The control device is further configured to: adjust the ratio, and the ratio is less than or equal to the ratio of the capacity of the actually used storage space of the backup storage device to the capacity of the total storage space.
20. The storage device according to any one of claims 16-19, characterized in that, The first space includes a plurality of first space blocks, and the second space includes a plurality of second space blocks; the plurality of first space blocks and the plurality of second space blocks are arranged at intervals.
21. The storage device according to claim 20, wherein Specifically, the control device is configured to: determine a first space block pointed to by the running direction according to the running direction of the tape included in the magnetic tape disk; store the data in the first space block pointed to by the running direction.
22. The storage device according to claim 16, wherein, The control device is further configured to: when the amount of garbage in the data stored in the first space exceeds a certain threshold, copy the valid data among the data stored in the first space to the second space, and erase the data stored in the first space.
23. The storage device according to claim 16, wherein The data is backup data of production data stored in a source storage device. The control device is further configured to: Receive backup request information, where the backup request information includes the data and the metadata of the data, and the metadata includes the logical address of the data; Store the data and the metadata in the first space.
Citation Information
Cited By
Storage system, data storage method and storage device
WO2025161381A1