Storage system, data storage method and storage device
By using tape disks as backup storage devices in the storage system and optimizing the reserved space, the high cost problems caused by hard disk media are solved, and more efficient data storage and reliability recovery are achieved.
Patent Information
- Application Number
- PCT/CN2024/116492
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-29
- Filing Date
- 2024-09-03
- Publication Date
- 2025-08-07
AI Technical Summary
The media of the source storage device and backup storage device in existing storage systems is a hard disk, which leads to high deployment costs and the risk of data corruption due to hardware or software failures.
The tape disk is used as a backup storage device, combined with the optimized design of reserved space, 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 used to backup each other, improving system reliability.
It reduces the deployment cost of storage systems, improves the reliability of data storage and garbage collection efficiency, and ensures rapid data recovery in case of failure.
Smart Images

Figure CN2024116492_07082025_PF_FP_ABST
Abstract
Description
Storage system, data storage method and storage device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 29, 2024, with application number 202410123479.1 and application name “A storage system, data storage method and storage device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of storage technology, and in particular to a storage system, a data storage method, and a storage device. Background Art
[0003] A storage system typically includes a source storage device and a backup storage device. The source storage device is used to store production data, while the backup storage device is used to store copies of production data. This system redundancy design is used to back up and protect production data, thereby improving the reliability of the storage system.
[0004] Currently, the media of source storage devices and backup storage devices in storage systems are hard disks, such as flash memory or magnetic disks, which leads to high deployment costs.
[0005] Summary of the Invention
[0006] The present application provides a storage system, a data storage method, and a storage device to reduce the networking cost of the storage system.
[0007] In one aspect, an embodiment of the present application provides a storage system comprising: a source storage device for storing production data; a backup storage device comprising a tape disk. Using the tape disk as a backup storage device can reduce the networking cost of the storage system. Furthermore, the tape disk comprises a plurality of continuous physical storage spaces, and any of the plurality of physical storage spaces comprises 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, for example, to recycle garbage data in the first space. Compared with the prior art in which the reserved space is set at the end of the entire physical storage space, the reserved space in the embodiment of the present application is closer to the first space, so that the nearby reserved space can be used to recycle garbage data in the first space, thereby improving the garbage recovery efficiency and thereby improving the utilization rate of the tape disk storage space.
[0008] It should be noted here that both the source storage device and the backup storage device provided in the embodiments of the present application can be used to store production data.
[0009] In one possible implementation, the storage medium of the source storage device is different from the storage medium of the backup storage device. This can prevent the source storage device and the backup storage device from being destroyed simultaneously due to hardware failure or software failure, thereby improving the reliability of the storage system.
[0010] In a possible implementation, the reserved space in the embodiment of the present application can be used for garbage collection, or storage of bad sector data, or other operations for optimizing physical storage space.
[0011] In a possible implementation, a ratio of the capacity of the first space to the capacity of the second space is preset.
[0012] In one possible implementation, the ratio can be dynamically adjusted based on the amount of duplicate data stored in the physical storage space until it reaches the ratio of the actual used storage capacity of the physical storage space to the total storage capacity. By dynamically adjusting this ratio, storage space utilization can be improved.
[0013] In one possible implementation, the first space includes multiple first space blocks, and the second space includes multiple second space blocks; the multiple first space blocks and the multiple second space blocks are arranged at intervals, which can further shorten the distance between the first space blocks and the second space blocks, so that the second space blocks can be used more conveniently to organize the data in the first space blocks, which can further improve the utilization of the storage space.
[0014] In one possible implementation, the backup storage device can also obtain usage information of multiple first space blocks. Since the usage information of multiple first space blocks changes frequently and dynamically, and the read and write latency of the source storage device is less than the read and write latency of the backup storage device, the usage information is sent and stored in the source storage device in an embodiment of the present application, which can improve the read and write rate of the usage information.
[0015] In one possible implementation, when the amount of garbage in the replica data stored in the first space exceeds a certain threshold, the valid data of the replica data stored in the first space can be copied to the second space, thereby realizing local garbage collection and improving garbage collection efficiency.
[0016] In one possible implementation, the storage system also includes a controller for sending backup request information to the storage device, and the backup storage device stores the copy data and metadata of the copy data in the backup request information in a first space, wherein the metadata includes metadata of the copy data. When the copy data and metadata are stored together, the copy data corresponding to the metadata can be quickly found based on the metadata, thereby improving data search efficiency and enabling data recovery to be performed quickly when data recovery is needed.
[0017] In one possible implementation, the metadata also includes the time when the source storage device receives the production data. When performing data recovery, the source storage device can determine the most recent copy data from multiple copies of data corresponding to the same logical address based on the time when the production data was received, thereby ensuring the accuracy of the recovered data and improving the reliability of the storage system.
[0018] In one possible implementation, the backup storage device stores the copy data and metadata in a first space block pointed to by the running direction of the tape on the tape reel, thereby increasing the data writing rate of the backup storage device.
[0019] In a possible implementation, the source storage device is a hard disk, which may be a solid-state drive or a mechanical hard disk.
[0020] In a second aspect, embodiments of the present application further provide a data storage method, performed by a storage device, which may be the backup storage device described in the first aspect, providing a tape reel comprising multiple contiguous physical storage spaces; dividing any one of the multiple contiguous physical storage spaces into a first space and a second space; acquiring data; storing the data in the first space; and using the second space as a reserved space (OP). The functions or technical effects achieved by the storage device during execution of this data storage method can refer to the functions or technical effects achieved by the first aspect and any possible implementation of the first aspect.
[0021] 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, comprising: one or more tape reels, any one of the one or more tape reels comprising a plurality of continuous physical storage spaces; one of the one or more tape reels comprising a control device for dividing any one of the plurality of continuous physical storage spaces into a first space and a second space, wherein the first space is used to store 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 tape reel during the execution of the above steps can be referred to the functions or technical effects brought about by the above-mentioned first aspect and any possible implementation method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] FIG1 is an architecture diagram of a storage system provided in an embodiment of the present application;
[0023] FIG2 is a schematic diagram of the structure of a tape reel in a storage system provided in an embodiment of the present application;
[0024] FIG3 is a schematic diagram of a flow chart of a data storage method provided in an embodiment of the present application;
[0025] FIG4 is a schematic diagram of the physical storage space of the magnetic tape included in the magnetic tape reel according to an embodiment of the present application;
[0026] FIG5 is a schematic diagram of an overlay writing area provided in an embodiment of the present application;
[0027] FIG6 is a schematic diagram of the layout of a first space and a second space in a physical storage space provided in an embodiment of the present application;
[0028] FIG7 is a schematic diagram of garbage collection provided by an embodiment of the present application;
[0029] FIG8 is a schematic diagram of organizing data in the first space according to an embodiment of the present application;
[0030] 9A-9B are schematic diagrams showing the correspondence between the logical address and the physical address of an SSD and the correspondence between the logical address and the physical address of a tape disk provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the objectives, technical solutions and advantages of this application clearer, the specific embodiments of this application are further described in detail below with reference to the accompanying drawings.
[0032] The following is a brief introduction to the possible application scenarios of the embodiments of the present application. The storage system provided by the present application can be applied to edge computing scenarios, wherein edge computing provides cloud services and IT environment services to application developers and service providers on the edge side of the network; the goal is to provide computing, storage and network bandwidth close to data input or users. Typical edge computing scenarios include but are not limited to the following: wind turbine power generation scenarios; scenarios that require instant interaction, such as unmanned driving scenarios; smart transportation scenarios; businesses with relatively high security requirements, such as face recognition scenarios. For any of the above scenarios, data storage is required to have high reliability, and data corruption in any scenario will bring very huge losses. Therefore, the storage system provided by the present application is applied to the above-mentioned edge scenarios to solve the problem of high-reliability data deployment in edge scenarios.
[0033] Please refer to Figure 1. Users store data through applications, and the computers that run these applications are called "application servers." The application server 100 can be a physical machine or a virtual machine. Physical application servers include but are not limited to desktop computers, servers, laptops, and mobile devices. The application server 100 accesses the storage system 120 through the fiber optic switch 110 to access data. It should be noted here that the fiber optic switch 110 is an optional device, and the application server 100 can also communicate directly 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-controller separation architecture and a disk-controller integrated architecture. Here, the disk-controller integrated architecture is used for description.
[0034] The storage system 120 shown in Figure 1 is a centralized storage system. A centralized storage system is characterized by a unified entry point through which all data from external devices must pass. This entry point is the engine of the centralized storage system. The engine 121 is the core component of the centralized storage system, implementing many of the system's advanced functions.
[0035] As shown in Figure 1, there are one or more controllers in the engine 121. Figure 1 takes the example of an engine 121 containing two controllers for explanation. There is a mirror channel between controller 0 and controller 1. Then, when controller 0 writes a copy 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. In this way, 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 due to hardware failure. 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.
[0036] Engine 121 also includes a front-end interface 125 and a back-end interface 126. Front-end interface 125 is used to communicate with application server 100, thereby providing storage services for application server 100. Back-end interface 126 is used to communicate with storage devices to expand the capacity of the storage system. Through back-end interface 126, engine 121 can connect to more storage devices, thereby forming a very large storage resource pool.
[0037] The engine 121 also includes a processor 123, which can be a central processing unit (CPU) and is used to process data access requests from outside the storage system (servers or other storage systems), as well as requests generated within the storage system. For example, when the processor 123 receives write data requests from the application server 100 via the front-end port 125, it temporarily stores 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 via the back-end port 126 for persistent storage.
[0038] It should be noted that FIG1 only shows one engine 121 . However, in actual applications, the storage system may include two or more engines 121 , and redundancy or load balancing may be performed between the multiple engines 121 .
[0039] In this system, the storage device includes two parts: a source storage device 134 and a backup storage device 135. When the engine 121 has a hard disk slot, 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 can be deployed in the engine 121 and the backup storage device 135 can be placed in a hard disk frame, and the hard disk frame is communicatively connected to the back-end interface 126. When the engine 121 does not have a hard disk slot, the source storage device 134 and the backup storage device 135 can be placed in one hard disk frame and communicatively connected to the back-end interface 126, or the source storage device 134 can be placed in one hard disk frame and the backup storage device 135 can be placed in another hard disk frame, and each can be communicatively connected to the back-end interface 126. The backup storage device 135 is used to back up and store 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 reels, which are storage devices that integrate a magnetic tape and a magnetic head. Compared to existing tape systems, tape reels can be deployed more simply, eliminating the need for manual or robotic methods to replace the tape, and also eliminating the need to occupy a large amount of space for deployment. In the following description, the source storage device 134 is an SSD, and the backup storage device is a tape reel. Compared to other hard disk devices, tape reels are relatively inexpensive, which can reduce the deployment cost of the storage system. Furthermore, when the source storage device 134 is an SSD and the backup storage device 135 is a tape reel, the SSD and the tape reel are storage devices of different media. This can prevent the complete corruption of data stored on the SSD and tape reels due to hardware or software failures, thereby improving the reliability of the storage system.
[0040] In terms of hardware, please refer to FIG. 2 , the tape reel includes: a magnetic tape 200 , a magnetic head module 201 , a control device 202 and a moving device 203 .
[0041] The magnetic tape 200 has a magnetic layer, a base film and a back coating layer. The magnetic layer is formed on one side of the base film, and the back coating layer 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 can be made of polyethylene terephthalate, polyethylene naphthalate or polyamide. The back coating layer 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 on which the magnetic layer is formed is the front side of the tape, and the side on which the back coating layer is formed is the back side of the tape.
[0042] The control device 202 is used to control the magnetic tape 200, the magnetic head module 201, and the travel device 203. The control device 202 includes a processor and a memory, wherein the processor can be an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a programmable logic controller (PLC), or a combination of any two or more of the above implementations.
[0043] The travel device 203 selectively moves the tape forward or backward along a designated path, and includes a tape reel 2031, a tape motor 2032, and a plurality of rollers. It should be noted that the forward direction refers to the direction in which the tape is fed out, and the backward direction refers to the direction in which the tape is rewound.
[0044] The tape motor 2032 rotates the tape reel 2031 under the control of the control device 202 . The controller 202 controls the tape motor 2032 to control the rotation direction, rotation speed, rotation torque, etc. of the tape reel 2031 .
[0045] When the magnetic tape is wound around the reel 2031, the control device 202 rotates the reel motor 2032 to move the magnetic tape forward along a predetermined path. When the magnetic tape is rewound, the control device 202 rotates the reel motor 2032 to move the magnetic tape backward along a predetermined path.
[0046] The magnetic head module 201 includes at least one magnetic head, which includes a magnetic element and a bracket. The magnetic element is held by a holder so as to contact the traveling magnetic tape. The magnetic element unit records data on the magnetic tape traveling along a predetermined path by the traveling device 203, or reads data from the magnetic tape traveling along a predetermined path by the traveling device 203.
[0047] Furthermore, the magnetic tape also includes a moving mechanism 204. The moving mechanism 204 includes a moving actuator. The moving actuator can be a voice coil motor (VCM) and / or a piezoelectric actuator. The moving actuator is connected to the control device 202, which controls the moving actuator to generate power to move the magnetic head module 201 in the width direction of the magnetic tape.
[0048] Furthermore, the tape disk also includes a communication interface 205, which is connected to an external device via a communication network such as a wide area network (WAN) or a local area network (LAN). In an embodiment of the present application, the external device can 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.
[0049] In the embodiment of the present application, the storage system shown in FIG1 can provide but is not limited to the following two purposes:
[0050] First, the storage system shown in Figure 1 can be used to store production data. As an example, SSDs are used to store hot data in production data, and tape disks are used to store cold data in production data. Hot data is data that users update frequently, and cold data is data that users update infrequently. Correspondingly, when reading data, in this system, the data is first queried from the SSD. If the data is available, it is read from the SSD. If not, it is read from the tape disk.
[0051] The second type is that the storage system shown in Figure 1 is used for both storage and backup of production data. As an example, the SSD is used to store production data, and the tape disk is used to store copy data of the production data, so that when the production data stored in the SSD is damaged, the copy data in the tape disk can be used for data recovery.
[0052] The process of using a tape disk to store production data is similar to the process of using a tape disk to store duplicate data. In the following description, the use of a tape disk to store duplicate data is used as an example for explanation. This process can be seen in Figure 3. The process of using a tape disk to store production data can be referred to the following description and will not be repeated here.
[0053] Furthermore, the controller 0 or controller 1 included in the storage system receives a write request sent by the application server 100, and the write request includes the production data to be stored. In FIG3 , 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 controller's memory 124, and then sends the production data to the SSD through the back-end interface 126, and stores it in the flash memory array of the SSD. This step is marked as ②. In the embodiment of the present application, there is no restriction on the form of storage of production data in the SSD. Specifically, it can be block storage or file storage. Block storage is to store data in one or more blocks of fixed length. Blocks are based on pages, and one or more consecutive pages constitute a block. File storage is to store data in files of non-fixed length. A single file may be composed of one or more logical blocks, and the logical blocks are discontinuously distributed.
[0054] The production data can be data collected in the edge scenarios described above, such as facial data collected in face recognition scenarios, road data collected in autonomous driving scenarios, or environmental data collected by sensors. After storing the production data in the SSD, the controller can back up a copy of the production data to a tape disk according to a specific strategy. For example, at a fixed time each day, such as 1:00 a.m., a copy of the production data stored in the SSD before that time is backed up to the tape disk. For ease of illustration in Figure 3, the production data is AA as an example.
[0055] The above describes the process of SSD storage of production data. The following describes the process of tape disk storage of copy data in the storage system provided by the present application. Before introducing this process, the storage space layout of the tape in the tape disk is first introduced. Referring to Figure 3, the tape includes multiple continuous physical storage spaces. Any physical storage space in the multiple continuous physical storage spaces includes space 301 and space 302. Space 301 is used to store the copy data. Space 302 is reserved space (Over Provisioning, OP), which refers to space that is not user-operable and invisible to the user. Its capacity is the actual capacity minus the user's available capacity. The OP area is generally used for optimization operations, such as using the reserved space to organize the data in the space. More specifically, the reserved space is used to recycle garbage data in space 301. Since the reserved space 302 is close to space 301, compared with the prior art where the reserved space 302 is set at the end of the entire physical storage space, in the embodiment of the present application, the nearby reserved space 302 can be used to recycle garbage data in space 301, thereby improving the garbage collection efficiency and thereby improving the space utilization of the tape disk. It should be noted here that space 301 refers to the first space, and space 302 refers to the second space. In the subsequent introduction, the reserved space is also represented by 302.
[0056] As an example, the reserved space 302 is used to store valid data in the copy data stored in the storage space 301 during the garbage collection process. When there is garbage data in the space 301, in order to improve the space utilization of the space 301, the garbage data needs to be recycled. The garbage data can be invalid data in the copy data, and the invalid data can be data that has expired backup. Since the tape disk is written sequentially, if the data stored in the space 301 is 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.
[0057] As another example, the reserved space is used to store the duplicate data stored in space 301 when space 301 is damaged. When the backup storage device leaves the factory, or when space 301 is damaged during use, the duplicate data stored in space 301 can be copied to the reserved space 302, thereby preventing the loss of the duplicate data stored in space 301.
[0058] Any physical storage space may include space 301 and reserved space 302. How is the ratio of the capacity of space 301 to the capacity of reserved space 302 determined? In an embodiment of the present application, when any physical storage space has not yet written data, the ratio of the capacity of space 301 to the capacity of reserved space 302 can be pre-set. As an example, half of the space in the physical storage space is used as space 301 for storing duplicate data, and the other half is used as reserved space 302 for organizing the data stored in space 301. The ratio is 1. During the data storage process, the ratio can be fixed or dynamically change with the amount of written data. As an example, the total storage space capacity of the physical storage space is 120TB, the capacity of the space with written data is 50TB, and the ratio is 5 / 12. In this case, the ratio is adjusted from 1 to 5 / 12. Under this ratio, the capacity of space 301 in the physical storage space is 50TB, and the capacity of reserved space 302 is 70TB. Furthermore, taking the example of a physical storage space of 120TB and a user available space of 100TB, the remaining 20TB is the user unavailable space, that is, the OP space. When the user available space is full, the capacity of space 301 is 100TB and the reserved space 302 is 20TB. The ratio is 5, so when the preset value is 1, the ratio can be dynamically adjusted until the ratio reaches 5, and then no further adjustment is made. The above is only one implementation method for adjusting the ratio of the capacity of space 301 to the capacity of space 302. Of course, in the specific implementation process, other adjustment methods can also be used, which are not limited here.
[0059] What is described above is that the comparison value can be adjusted. There is no specific limitation on when the comparison value is adjusted in the embodiment of the present application. It can be when the copy data is written to the physical storage space, that is, the ratio of the capacity of space 301 to the capacity of reserved space 302 is adjusted. It can also be dynamically adjusted according to preset time intervals of 5 hours, 12 hours, 24 hours or one week. It can also be adjusted in other ways.
[0060] 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 address of space 302 and the physical address of reserved space 301 are continuous. In Figure 3, the physical address of space 302 is behind the physical address of space 301. Of course, the physical address of space 301 may also be behind the physical address of space 302.
[0061] As another example, space 301 may be a plurality of logically continuous physical spaces, and space 302 may be a plurality of logically continuous physical spaces. In other words, space 301 includes a plurality of space blocks 3011 with discontinuous physical addresses, and reserved space 302 includes a plurality of space blocks 3021 with discontinuous physical addresses, and the plurality of space blocks 3011 are spaced apart from the plurality of space blocks 3021. The spacing may be 3011, 3021, 3011, 3021, ... 3011, 3021; or 3011, 3011, 3021, 3011, 3011, 3021, ... 3011, 3011, 3021. Please refer to FIG. 4 for details. When multiple space blocks 3011 and multiple space blocks 3021 are spaced apart, the distance between space blocks 3011 and 3021 is further reduced, making it easier to use space blocks 3021 to organize the data stored in space blocks 3011, further improving the utilization of space 301. It should be noted 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.
[0062] When space 301 is divided into multiple space blocks 3011 and space 302 is divided into multiple space blocks 3021, multiple space blocks 3011 and multiple space blocks 3021 can be set according to the above-mentioned initial ratio and setting method. When the comparison value is dynamically adjusted subsequently, the use of the multiple space blocks 3021 can be dynamically adjusted. As an example, the use of the space block 3021 can be represented by a digital symbol, 1 represents used as reserved space, 2 represents used to store copy data, and of course there can be other representation methods, which are not limited here.
[0063] When the ratio of the capacity of space 301 to the capacity of reserved space 302 is determined, in this embodiment of the present application, the capacity of multiple space blocks 3011 is the same, and the capacity of multiple space blocks 3021 is the same. The capacity of space block 3011 can be the same as the capacity of space block 3021. The capacity of space block 3021 can be based on the size of the overwrite area. The overwrite area, as shown in Figure 5, includes multiple tracks, which are stacked together to form a tile-like structure. Each track ensures that a portion of the space is exposed to allow the read head to read data normally. Because the tracks are stacked on each other and the width of the write head is greater than that of the read head, there will be certain problems if you want to modify the data on the track when data is stored on each track (track 0-track 4). Taking track 1 as an example, when writing data on track 1, the data already written on track 2 will be overwritten. The overwrite area here refers to the area that the write head overwrites on the next track when writing the current track.
[0064] After introducing the spatial layout of the tape, we will further explain how the tape disk, after receiving the copy data, performs data storage, garbage collection, and assists in data recovery based on the tape's running direction and the spatial layout of the tape storage space.
[0065] (1) Replica Data Storage
[0066] When data backup is required, the controller of the storage system will send a backup request message to the control device 202 of the tape disk. After receiving the request message, the copy data and metadata in the request message will be stored in the space 301, and this step is marked as ③. The copy data here includes batches of data blocks. Accordingly, each data block in the batch of data blocks corresponds to metadata, where metadata refers to data that describes business data, mainly information that describes data attributes, and is used to support functions such as indicating storage location, historical data, resource search, and file records. For example, the metadata used to indicate a business data includes the length of the business data and the physical location of the business data on the storage device. In an embodiment of the present application, the metadata includes the logical address of each data block stored in the SSD.
[0067] When the replicated data consists of batches of data blocks, the tape disk sequentially stores each data block and its metadata in space 301. Referring to FIG3 , when space 301 includes multiple space blocks 3011, control device 202 sequentially stores the data blocks and their corresponding metadata in the space block 3011 indicated by the tape's running direction. If the capacity of a space block 3011 is insufficient, the data blocks are stored in the space block 3011 immediately following the previous one. Because the tape disk writes sequentially, determining the space blocks for storage in this manner improves the tape disk's writing efficiency.
[0068] In this embodiment of the present application, the metadata includes not only the logical address corresponding to the data block but also the time when the SSD received the data block. Specifically, this information is used to determine the final data to be recovered based on the time when the SSD received the data block during data recovery. Furthermore, the metadata may also include the size of the data block or other descriptive information about the data block.
[0069] (2) Garbage Collection
[0070] The above describes how the tape disk stores the copy data. The following further describes how to perform garbage collection and monitor the usage status of each space block 3011 in space 301 when there is garbage data in the stored copy data after the copy data is stored.
[0071] The control device 202 is used to obtain usage information of the space block 3011, including the write status of the space block 3011. Based on the acquisition of the write status of the space block 3011, the used space capacity and the unused space capacity of the physical storage space can be obtained, thereby enabling further planning of the physical storage space. The write status of the space block 3011 can be identified by a corresponding symbol. The symbol can be a data symbol, such as "0" for unwritten and "1" for written; or the symbol can be an alphabetic symbol, such as "Y" for written and "N" for unwritten.
[0072] Furthermore, the usage information also includes the amount of garbage in the space block 3011, and the garbage collection algorithm in the multiple space blocks 3011 can adopt a mark-and-sweep algorithm. After the control device 202 obtains the usage information, it sends the usage information to the controller of the storage system, which stores it in the SSD. Since the read and write delay of the SSD is shorter than the read and write delay of the tape, and the usage information of the space block 3011 is information that needs to be updated frequently, after the usage information is stored on the SSD, the controller can quickly obtain the usage information and, based on the usage information, require the tape disk to write the obtained copy data or organize the data in the space 301, thereby improving the utilization rate of the tape storage space.
[0073] Furthermore, in the specific implementation process, the control device 202 can periodically send request information to the controller to obtain 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 replica data stored in the space 301 exceeds a certain threshold, the valid data in the replica data stored in the space 301 is copied to the space 302, and the replica data stored in the space 301 is erased. Please refer to Figure 6. Taking any space block 3011 in the space 301 and any space block 3021 in the space 302 in Figure 3 as an example, when the amount of garbage in the space block 3011 exceeds a certain threshold, the valid data in the replica 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 fully written, in order to improve space utilization, it can be filled with user data, or filled with zeros, or left blank, that is, no filling is done.
[0074] In the embodiment of the present application, a space block 3021 for garbage collection is determined based on the tape's current running direction, current running position, and a space block 3021 adjacent to the space block 3011 requiring garbage collection. Specifically, referring to FIG7 , when the amount of garbage on the first space block 3011 in FIG7 exceeds a certain threshold and garbage collection is required, there are two space blocks 3021 adjacent to the space block 3011 that can be used for garbage collection. For ease of description, these two space blocks 3021 are labeled 3021-1 and 3021-2, respectively. As shown by the arrows in FIG7 , the direction indicated by the arrows is the tape's current running direction, and the position of the arrows is the tape's current running position. Based on this, space block 3021-2 is further determined to be used for garbage collection, thereby achieving local garbage collection and improving garbage collection efficiency.
[0075] In the embodiment of the present application, in addition to performing garbage collection to improve the utilization efficiency of storage space, the utilization efficiency of storage space can also be improved by data sorting. Please refer to Figure 8. For ease of description, the space blocks included in the space 301 shown in Figure 3 are marked as 3011-1 and 3011-2. If the space blocks 3011-1 and 3011-2 are not full of data, since the tape is written in a sequential manner, even if there is blank space in the above two space blocks, data cannot be written any further. In order to improve the utilization of storage space, the copy data stored in the space block 3011-1 and the copy data stored in the space block 3011-2 are copied to the space block 3021. In this way, the space block 3011-1 and the space block 3011-2 can be overwritten to obtain the blank space block 3011-1 and the blank space block 3011-2.
[0076] (3) Data recovery
[0077] The purpose of the backup storage device set up in the storage system is to be able 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. Assume that the production data stored in the SSD is lost due to a hardware failure of the SSD. After the SSD failure is repaired, the production data stored on the SSD needs to be restored. In this case, the controller sends a data recovery request to the control device 202. The data recovery request may include faulty device information and data information to be recovered. The faulty device information may be a faulty device identifier, which is used to identify which SSDs have failed; the data information to be recovered is the time period or logical address of the data information to be recovered, etc., which is described below in different situations.
[0078] Before describing the data recovery process, let's first briefly describe how the modified data stored on the SSD is backed up on the tape disk when the production data stored on the SSD needs to be modified. As an example, suppose for some reason, the production data stored on the SSD needs to be modified, such as changing a character A in the production data to character B. After the modification is successful on the SSD, will the tape disk also directly change character A to character B? No. As mentioned above, the tape cannot be written randomly, but rather sequentially. This means that the tape disk cannot modify character A in place, but instead stores character B in a blank area. In this way, both the unmodified character A and the modified character B are stored on the tape. Since characters A and B correspond to the same logical address when stored on the SSD, characters A and B on the tape disk also correspond to the same logical address. Here we will briefly explain the correspondence between the logical address and physical address of character A when stored on the SSD. A logical address refers to the address presented to a controller by a storage device, such as an SSD or tape reel. Because the controller is unaware of the actual address at which data is stored on the storage device, it only needs to use the logical address to access the storage device. A physical address, on the other hand, refers to the address at which data is actually stored on the SSD or tape reel and is not perceptible to the controller. For an SSD, a physical address consists of a block ID and a page ID. For a tape reel, a physical address consists of a track ID and a space block ID. Referring to Figure 9A , assume that character A is stored at logical address 0002 on the SSD and at physical address page 2 on block 0. Correspondingly, referring to Figure 9B , assume that characters C and D are stored at logical addresses 0002 and 0003 on the tape reel. The physical address at which character C is stored on the tape reel is space block 2 on track 0, and the physical address at which character D is stored on the tape reel is space block 3 on track 0.
[0079] Scenario 1: All production data stored on the SSD needs to be restored
[0080] The situation where all production data stored on the SSD needs to be restored is also called a full restore. In this case, after receiving the data restore request, the control device 202 traverses the metadata stored on the tape and finds the corresponding data blocks based on the metadata. The metadata and corresponding data blocks are then sent to the storage system controller. After receiving the metadata and corresponding data blocks, the controller considers that not all of the received data blocks need to be restored. As mentioned above, character A is modified and discarded data on the SSD and is also stored on the tape. Naturally, character A does not need to be restored. Therefore, before storing the received data blocks on the SSD, the controller can determine the final data block to be restored based on the time each data block was received on the SSD, as recorded in the metadata. For example, if there are three corresponding data blocks on the tape corresponding to the same logical address, and the times these three data blocks were received on the SSD are January 1, 2024, January 6, 2024, and January 8, 2024, respectively, the controller selects the data corresponding to the most recent time as the data to be restored, that is, the data corresponding to January 8, 2024, 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.
[0081] Case 2: Some production data stored on the SSD needs to be restored
[0082] Partial recovery of the production data stored on the SSD is also called partial recovery, where "partial" refers to data stored on the SSD for a certain time period. The partial recovery process is similar to the full recovery process, differing only in that the control device 202 sends the required data blocks and corresponding metadata to the SSD, where the requirement is the aforementioned time period. The control device 202 can scan to query for metadata that meets the requirements and then read the corresponding data blocks, or it can accelerate the query of metadata that meets the requirements by using the index of the faulty device and then read the corresponding data blocks.
[0083] An embodiment of the present application also includes a magnetic tape comprising a plurality of continuous physical storage spaces, wherein any one of the plurality of continuous physical storage spaces comprises space 301 and space 302 shown in FIG3 above. Space 301 is used to store data, and the process of storing data can refer to the storage process of copy data shown in FIG3 . Space 302 is used as a reserved space and can be used to optimize the data stored in space 301. For details, please refer to the relevant content recorded above, which will not be repeated here.
[0084] The embodiment of the present application also provides a control device for dividing the storage space of the magnetic tape shown in the second aspect into a plurality of continuous physical storage spaces, and dividing any one of the plurality of continuous physical storage spaces into space 301 and space 302. Space 301 is used to store data, and the process of storing data can refer to the storage process of the copy data shown in FIG3 . Space 302 is used as a reserved space for optimizing the data stored in space 301. For details, please refer to the relevant content recorded above, which will not be repeated 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, that is, the tape reel shown in FIG2 . Of course, the control device in the third aspect and the magnetic tape in the second aspect may not be integrated into one. The two implementation methods can be selected according to actual conditions and are not limited here.
[0085] The above is only a specific embodiment of the present application, but the scope of protection of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A storage system, characterized in that: include: Source storage device, used to store production data; A backup storage device, used for storing duplicate data of the production data; The backup storage device includes a tape disk, which includes multiple continuous physical storage spaces. Any physical storage space in the multiple continuous physical storage spaces includes a first space and a second space. The first space is used to store 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 to store valid data in the copy data stored in the first space during garbage collection; or The reserved space is used to store the duplicate 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, wherein: The backup storage device is also used for: The ratio is adjusted to be less than or equal to a 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 to 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 spaced apart from each other.
6. The storage system according to claim 5, wherein: The backup storage device is also used for: Obtaining usage information of the plurality of first space blocks, wherein the usage information includes a write status of each first space block in the plurality of first space blocks and an amount of garbage in each first space block; The usage information is sent to the source storage device and stored in the source storage device, wherein the read and write latency of the source storage device is smaller than the read and write latency of the backup storage device.
7. The storage system according to any one of claims 1 to 4, characterized in that: The backup storage device is further configured to copy valid data in the copy data stored in the first space to the second space and erase the copy data stored in the first space when the amount of garbage in the copy data stored in the first space exceeds a certain threshold.
8. The storage system according to claim 1, wherein: The storage system further includes a controller, configured to: Sending a backup request message to the backup storage device, wherein the backup request message includes the copy data and metadata of the copy data, and the metadata includes a logical address of the data to be backed up; The backup storage device is specifically configured to store 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, according to a running direction of the magnetic tape included in the magnetic tape reel, a first spatial block to which the running direction points; The copy data and the metadata are stored in a 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 reel, the magnetic tape reel comprising a plurality of contiguous physical storage spaces; Dividing any physical storage space among the plurality of continuous physical storage spaces into a first space and a second space; Get data; storing the data in the first space; The second space is used as the reserved space OP.
12. The data storage method according to claim 11, characterized in that: The reserved space is used to store valid data in the data stored in the first space during garbage collection; or The reserved space is used to store 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, and storing the data in the first space includes: Determining, according to a running direction of a magnetic tape included in the tape reel, a first spatial block to which the running direction points; The data is stored in a first space block pointed to by the running direction.
14. The data storage method according to claim 11, characterized in that: When the amount of garbage in the data stored in the first space exceeds a certain threshold, valid data in the data stored in the first space is copied to the second space, and the data stored in the first space is erased.
15. The data storage method according to claim 11, wherein: The data is backup data of production data stored in a source storage device, and the method further includes: receiving a backup request message, wherein the backup request message includes the data and metadata of the data, wherein the metadata includes a logical address of the data; The data and the metadata are stored in the first space.
16. A storage device, characterized in that: include: One or more magnetic tape reels, each of the one or more magnetic tape reels comprising a plurality of continuous physical storage spaces; One of the one or more tape reels includes a control device for dividing any one of the multiple continuous physical storage spaces into a first space and a second space, wherein the first space is used to store data obtained 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 in the data stored in the first space during garbage collection; or The reserved space is used to store 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 also used for: The ratio is adjusted to be 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 overall storage space.
20. The storage device according to any one of claims 16 to 19, wherein: 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 spaced apart from each other.
21. The storage device according to claim 20, wherein: The control device is specifically used for: Determining, according to a running direction of a magnetic tape included in the tape reel, a first spatial block to which the running direction points; The data is stored in a first space block pointed to by the running direction.
22. The storage device according to claim 16, wherein: The control device is also used for: When the amount of garbage in the data stored in the first space exceeds a certain threshold, valid data in the data stored in the first space is copied to the second space, and the data stored in the first space is erased.
23. The storage device according to claim 16, wherein: The data is backup data of production data stored in the source storage device, and the control device is further used to: receiving a backup request message, wherein the backup request message includes the data and metadata of the data, wherein the metadata includes a logical address of the data; The data and the metadata are stored in the first space.
Citation Information
Patent Citations
Storage system, data storage method and storage device
CN120386481A
Method for storage device storing data and storage device
CN107003809A
Disk array, data reconstruction method based on disk array and storage device
CN107239233A
Data writing method and device
CN115079936A
Configuration method of solid state disk, solid state disk and partition storage method
CN117130553A