Virtual large-capacity disk access method, device, equipment and storage medium
By introducing virtual space and address mapping in storage devices, the problem of small-capacity disks being unable to simulate large-capacity disks is solved, enabling the simulation of large-capacity disk access effects on small-capacity disks. It also supports the replacement of large-capacity disks during project operation, meeting development and testing needs.
Patent Information
- Application Number
- CN202210728813.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-06-24
AI Technical Summary
Existing file systems struggle to simulate large-capacity disks from small ones, leading to inconsistencies between development and testing environments, and making it difficult to replace them with larger-capacity disks during project execution.
By introducing virtual space into the storage device, an address mapping relationship is established between the physical space and the target storage space, simulating the effect of large-capacity disk access. The address translation module is used to convert the first write address into the second write address, thereby expanding the target storage space.
It simulates the access effect of a large-capacity disk on a small-capacity disk, meeting development and testing needs, and supports the replacement with a large-capacity disk during project operation to achieve cluster capacity expansion.
Smart Images

Figure CN115185454B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage, and more specifically, to a method, apparatus, device, and storage medium for accessing a virtual mass disk. Background Technology
[0002] In existing technologies, when using file systems (EXT4, XFS, etc.) to directly manage disks, the existing file systems can only manage disks of fixed capacity. This makes it difficult for the existing file systems to simulate small-capacity disks as large-capacity disks, which in turn leads to inconsistencies between development and testing environments, and makes it difficult to replace a disk with a larger capacity disk during project operation. Summary of the Invention
[0003] To overcome at least one deficiency in the prior art, this application provides a virtual mass disk access method, apparatus, device, and storage medium for achieving the access effect of a mass disk on a small-capacity disk, specifically including:
[0004] In a first aspect, this application provides a virtual mass disk access method applied to a storage device, wherein the target storage space provided by the storage device includes physical space and virtual space, and the target storage space and the physical space satisfy a preset address mapping relationship, the method comprising:
[0005] Receive a data write request to the target storage space;
[0006] In response to the data write request, a first write address is allocated from the physical space for the data write request;
[0007] Based on the address mapping relationship, the first write address is converted into a second write address in the target storage space;
[0008] The second write address is used as feedback information for the data write request.
[0009] Secondly, this application provides a virtual mass disk access device applied to a storage device, wherein the target storage space provided by the storage device includes physical space and virtual space, and the target storage space and the physical space satisfy a preset address mapping relationship, and the device includes:
[0010] The request processing module is used to receive data write requests to the target storage space;
[0011] The request processing module is also used to respond to the data write request and allocate a first write address from the physical space for the data write request;
[0012] The address translation module is used to convert the first write address into a second write address in the target storage space according to the address mapping relationship;
[0013] The request feedback module is used to use the second write address as feedback information for the data write request.
[0014] Thirdly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the virtual mass disk access method.
[0015] Fourthly, this application provides a storage device, which includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, it implements the virtual mass disk access method.
[0016] Compared with the prior art, this application has the following beneficial effects:
[0017] In the virtual mass disk access method, apparatus, device, and storage medium proposed in this embodiment, the target storage space provided by the storage device includes both physical space and virtual space, thereby expanding a smaller physical space into a larger target storage space. Then, for a data write request to the target storage space, a corresponding first write address is allocated from the physical space. Then, according to the address mapping relationship between the physical space and the target storage space, the first write address is converted into a second write address of the target storage space. Since the physical space actually corresponds to a smaller capacity disk, and the target storage space is expanded based on the physical space, the converted second write address can simulate the access effect of a large capacity disk on a smaller capacity disk. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic diagram of the principle of an existing file system provided in the embodiments of this application;
[0020] Figure 2 This is a schematic diagram of the method flow provided in the embodiments of this application;
[0021] Figure 3 This is one of the target storage space diagrams provided in the embodiments of this application;
[0022] Figure 4 A second schematic diagram of the target storage space provided in the embodiments of this application;
[0023] Figure 5 The third schematic diagram of the target storage space provided in the embodiments of this application;
[0024] Figure 6 This is a schematic diagram of the actual EVFS file system principle provided in the embodiments of this application;
[0025] Figure 7 This is a schematic diagram comparing the real EVFS file system and the virtual EVFS file system provided in the embodiments of this application;
[0026] Figure 8 This is a schematic diagram illustrating the principle of second block replication and migration provided in an embodiment of this application.
[0027] Figure 9 This is a schematic diagram of the device structure provided in the embodiments of this application;
[0028] Figure 10 This is a schematic diagram of the storage device structure provided in an embodiment of this application.
[0029] Icons: 201 - Request processing module; 202 - Address translation module; 203 - Request feedback module; 320 - Memory; 330 - Processor; 340 - Communication unit. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0031] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0032] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0033] In the description of this application, it should be noted that the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0034] Because existing file systems can only manage disks of fixed capacity, they are unable to simulate large-capacity disks with small-capacity disks, leading to inconsistencies between development and testing environments; and making it difficult to replace a disk with a larger capacity disk during project execution.
[0035] For existing document systems, such as Figure 1 As shown, assuming the disk has a capacity of 8TB, when managing this disk using file systems such as EXT4 and XFS, the 8TB disk will be divided into multiple blocks and organized according to their respective management methods. However, regardless of the file system used, if the disk capacity is 8TB, the target storage space available to the user corresponds to the disk capacity and is only 8TB.
[0036] However, the above file system management methods are not well adapted to some use cases. For example, for projects that require large amounts of data storage on disk, in order to reduce testing costs during project testing, disks of the same capacity as the actual deployment scenario are often not purchased. Instead, smaller capacity disks are used instead of the larger capacity disks used in the actual deployment scenario. This leads to a certain difference between the actual deployment scenario and the testing scenario, and thus cannot well meet the development and testing needs.
[0037] For example, if the project deployment initially didn't anticipate the need to store so much data and only configured a small-capacity disk, and later discovered that the small disk couldn't meet the data storage requirements, the current file management system doesn't support arbitrary disk capacity expansion; instead, complex configuration is required. Alternatively, if the required large-capacity disk wasn't procured at the beginning of the project deployment, but the project needed to be deployed quickly, a small-capacity disk had to be configured initially. Even after the large-capacity disk has been procured for some time, the disk capacity cannot be arbitrarily expanded; instead, the project needs to be adaptively configured to utilize the entire storage space of the newly procured large-capacity disk.
[0038] In view of the discovery of the above-mentioned technical problems, the inventors, through creative labor, have proposed the following technical solutions to solve or improve the above-mentioned problems. However, it should be noted that the defects in the solutions in the prior art are all the results of the inventors' practice and careful research. Therefore, the discovery process of the above-mentioned problems and the solutions proposed by the embodiments of this application in the following text should be considered as the inventors' contributions to this application during the invention process, and should not be construed as technical content known to those skilled in the art.
[0039] This embodiment proposes a virtual mass disk access method. In this method, the storage device simulates a small-capacity disk as a large-capacity disk to meet development and testing needs. Furthermore, during project operation, the small-capacity disk can be replaced with a large-capacity disk to expand the cluster capacity without requiring adaptive configuration of the application layer.
[0040] In this embodiment, the storage device can be of different types depending on the application scenario. In some implementations, the storage device can be a server, used to communicate with user terminals via a network to achieve data communication, interaction, and storage between the server and the user terminal. In other implementations, the storage device can also be a user terminal, such as a mobile terminal, tablet computer, laptop computer, or any combination thereof.
[0041] When the storage device is a server, the server can be a single server or a group of servers. The server group can be centralized or distributed (e.g., the servers can be a distributed system). In some embodiments, the server can be local or remote relative to a user terminal. In some embodiments, the server can be implemented on a cloud platform; by way of example only, a cloud platform can include private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, multi-cloud, etc., or any combination thereof. In some embodiments, the server can be implemented on an electronic device having one or more components.
[0042] Based on the above introduction, the following will combine... Figure 2 The flowchart shown illustrates in detail the virtual mass disk access method provided in this embodiment. This method is applied to a storage device, where the target storage space includes both physical and virtual space, and a preset address mapping relationship exists between the target storage space and the physical space. Based on this, as... Figure 2 As shown, the method includes:
[0043] S104, Receive data write request to target storage space.
[0044] As described in the above embodiments, the target storage space includes physical space and virtual space. Physical space refers to the actual storage space that the disk can provide, while virtual space refers to the storage space that does not have a corresponding hard disk; that is, virtual space is the storage space simulated in this embodiment. For the user, the target storage space that is accessible to the user is the sum of the physical space and the virtual space.
[0045] For example, assuming the physical space size is 8TB and the virtual space size is 8TB, the space ultimately presented to the user is 16TB. Therefore, for a data write request to the target storage space, the theoretical maximum write address corresponds to 8TB. However, the purpose of this example is to provide a data write address greater than 8TB for the data write request, thereby simulating the access effect of 16TB of storage space for the user.
[0046] S105, responding to the data write request, allocates a first write address from the physical space for the data write request.
[0047] Since the virtual space does not have a corresponding hard drive, a data write request can only allocate storage space for that write request from the physical space for data writing. To facilitate differentiation from addresses in the target storage space, this embodiment refers to the write address allocated from the physical space for the data write request as the first write address.
[0048] S106, according to the address mapping relationship, convert the first write address into the second write address in the target storage space.
[0049] S107, the second write address is used as feedback information for the data write request.
[0050] For example, suppose the connection between virtual space and physical space is as follows: Figure 3 As shown, this virtual space is positioned at the beginning of the physical space. When the first write address allocated for a data write request is located at position p1 in the physical space, the following address mapping relationship between the target storage space and the physical space applies:
[0051] offset2 = offset1 + offset x
[0052] In the formula, offset1 represents the first write address, offset2 represents the second write address, and offset... x This indicates the offset position of the physical space within the target storage space.
[0053] Therefore, based on the above address mapping relationship, the storage device converts p1 into p1′ in the target storage space and provides p1′ as feedback information for the data write request to the user.
[0054] Thus, the target storage space provided by this storage device includes both physical and virtual space, thereby expanding a smaller physical space into a larger target storage space. Then, for data write requests to the target storage space, a corresponding first write address is allocated from the physical space. Next, based on the address mapping relationship between the physical space and the target storage space, the first write address is converted into a second write address for the target storage space. Since the physical space actually corresponds to a smaller capacity disk, and the target storage space is expanded from the physical space, the converted second write address can simulate the access effect of a larger capacity disk on a smaller capacity disk.
[0055] Depend on Figure 3 The address mapping relationship between the target storage space and the physical space shown can be seen to be related to the connection between the virtual space and the physical space. In the connection relationship provided in this embodiment, the expansion location of the virtual space includes any one of the head, tail, and middle positions of the physical space.
[0056] like Figure 4 As shown, the virtual space can also be located at the end of the physical space. In this case, when the virtual space is located at the end of the physical space, the first write address and the second write address are the same.
[0057] like Figure 5 As shown, the virtual space can also be located in the middle of the physical space, that is, the physical space is divided into a first part and a second part, and the virtual space is located between the first part and the second part. In this case, when the first write address is located in the first part, the first write address and the second write address are the same; when the first write address is located in the second part, the converted second write address and the first write address are different addresses.
[0058] Therefore, in Figure 2 Before step S104, the virtual mass disk access method further includes:
[0059] S101, receive a request to expand the physical space.
[0060] S102, respond to the expansion request and obtain the expansion capacity and expansion location corresponding to the expansion request.
[0061] Among them, expansion capacity represents the size of the virtual space, and expansion location represents the connection position between the virtual space and the physical space.
[0062] S103, determine the address mapping relationship based on the expansion capacity and expansion location.
[0063] Therefore, the expansion capacity determines the size of the target storage space after expansion, and together with the connection position between the virtual space and the physical space, it determines the address mapping relationship between the target storage space and the physical space.
[0064] As described in the above embodiments, the expanded target storage space in this embodiment is only temporary. Once a second disk capable of providing the target storage space is procured, the first disk currently providing the physical space will need to be replaced. Therefore, this virtual mass disk access method further includes:
[0065] S108, if the first disk is replaced by a second disk that can provide the target storage space, then the data in the first disk is copied to the second disk according to the address mapping relationship.
[0066] It is worth noting that in this embodiment, the storage device provides the target storage space to the application layer for access. The target storage space and the physical space satisfy a preset address mapping relationship, which is recorded in the disk management layer of the storage device. The disk management layer is used to shield the application layer from access operations to the target storage space.
[0067] Furthermore, in this embodiment, the file management system located at the disk management layer is called EVFS. For example... Figure 6 As shown, EVFS divides the disk into Reserved areas, two Super areas, and several block groups (N), where:
[0068] Reserved area: Space is reserved;
[0069] Super: Records basic layout information, such as disk capacity, number of Block Groups, starting address, etc.
[0070] Block Group: The area for reading and writing file indexes and file data. The first disk consists of several BlockGroups.
[0071] Therefore, as Figure 7 As shown, for the disk providing physical space, the storage device constructs a real EVFS for it, which is actually responsible for reading and writing operations on the disk. For the target storage space that has been expanded by M Block Groups, a virtual EVFS is provided for it, which is used by the application layer for IO reading and writing. This allows the application layer to only be aware of the capacity of the target storage space, while shielding it from the actual capacity of the physical space.
[0072] For this block group, see [link to relevant documentation]. Figure 6Each block group includes two index blocks (Inodes) and several data blocks (Block*N). In this embodiment, the size of each data block can be 64MB, but those skilled in the art can adjust it appropriately as needed.
[0073] Therefore, the first disk includes multiple block groups, each block group including index blocks for storing index information and data blocks for storing data, wherein the size of the index blocks is positively correlated with the number of data blocks. Based on this file system, if the multiple block groups include a first block group with a preset capacity and a second block group with a capacity less than the preset capacity, step S108 includes the following implementation:
[0074] S108-1, For the first block group, determine the first target block group from the second disk according to the address mapping relationship.
[0075] S108-2, Copy the data in the first block group as a whole to the first target block group.
[0076] It should be understood here that in an ideal block group, the size of each index block is aByte, and the size of each of the n blocks is 64MB. Therefore, the size of the ideal block group is 2*aByte + n*64MB.
[0077] Assuming the capacity of the first disk is x, the number of block groups is N = x / (2*aByte + n*64MB). However, when the number cannot be divided evenly, a second block group that does not reach the preset capacity will be generated. In this embodiment, to improve replication efficiency, for the first block group that reaches the preset capacity, the index blocks and data blocks are not distinguished, and they are directly copied from the first disk to the second disk as a whole according to the address mapping relationship. For the second block group, the index blocks and data blocks need to be distinguished and copied and migrated separately.
[0078] S108-3, For the second block, determine the second target block group from the second disk according to the address mapping relationship.
[0079] S108-4, Copy the index information of the index block in the second block group to the index block of the second target block group.
[0080] S108-5, Copy the data of the data block in the second block group to the data block of the second target block group.
[0081] For example, such as Figure 8As shown, assume the number of Blocks in the second block group is q, and the number of Blocks in the second target block group is p, where q < p. Since the size of the index block is positively correlated with the number of data blocks, it means that the Inode in the second block group is smaller than the Inode in the second target block group. Therefore, to ensure normal access after data migration, Blocks and Inodes need to be migrated separately.
[0082] In this way, by directly copying and migrating the first block group that has reached the preset capacity as a whole, while copying and migrating the second block group that has not reached the preset capacity separately, the migration efficiency can be improved.
[0083] For the target storage space in this embodiment, when it needs to be accessed, the storage device receives the access request of the target storage space; responds to the access request and obtains the first access address corresponding to the access request; determines whether the first access address needs to be converted; if so, the first access address is converted into a second access address in the physical space; and accesses the physical space through the second access address.
[0084] Therefore, since the physical space is invisible to the application layer, the application layer can only access the physical space using the address in the target storage space located in the application layer. Therefore, it is necessary to use this address mapping relationship to convert the first access address in the target storage space into the second access address in the physical space, so as to access the data actually stored in the physical space.
[0085] As described in the above embodiments, when a second disk with a larger capacity replaces the first disk, the capacity of the second disk is consistent with the target storage space, and address translation is no longer required. Therefore, after receiving the first access request for the target storage space, the storage device obtains the capacity of the current disk. If the capacity of the current disk is consistent with the target storage space, address translation is not required; otherwise, address translation is required.
[0086] Based on the same inventive concept as the virtual mass disk access method, this embodiment also provides a virtual mass disk access device applied to a storage device. The target storage space provided by the storage device includes physical space and virtual space, and the target storage space and physical space satisfy a preset address mapping relationship.
[0087] The virtual mass disk access device includes at least one software function module that can be stored in software form in the memory 320 or embedded in the operating system (OS) of the storage device. The processor 330 in the storage device is used to execute the executable modules stored in the memory 320, such as the software function modules and computer programs included in the virtual mass disk access device. Please refer to... Figure 9 Functionally, virtual mass disk access devices include:
[0088] The request processing module 201 is used to receive data write requests to the target storage space.
[0089] The request processing module 201 is also used to respond to data write requests and allocate a first write address from the physical space for the data write request.
[0090] In this embodiment, the request processing module 201 is used to implement Figure 2 For a detailed description of the request processing module 201, see steps S104-S105.
[0091] Address translation module 202 is used to convert the first write address into the second write address in the target storage space according to the address mapping relationship.
[0092] In this embodiment, the address translation module 202 is used to implement Figure 2 For a detailed description of the address translation module 202, see step S106.
[0093] The request feedback module 203 is used to send the second write address as feedback information for the data write request.
[0094] In this embodiment, the request feedback module 203 is used to implement Figure 2 For a detailed description of step S107, which is the request feedback module 203, please refer to the detailed description of step S107.
[0095] In addition, it is worth noting that since the virtual mass disk access device and the virtual mass disk access method have the same inventive concept, the above-mentioned request processing module 201, address translation module 202 and request feedback module 203 can also be used to implement other steps or sub-steps of the virtual mass disk access method, which will not be described in detail in this embodiment.
[0096] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0097] It should also be understood that if the above embodiments are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0098] Therefore, this embodiment also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the virtual mass disk access method provided in this embodiment. The computer-readable storage medium can be any medium capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0099] This embodiment also provides a storage device. For example... Figure 10 As shown, the storage device includes a processor 330 and a memory 320. The processor 330 and the memory 320 can communicate via a system bus. Furthermore, the memory 320 stores a computer program, and the processor implements the virtual mass disk access method provided in this embodiment by reading and executing the computer program corresponding to the above-described embodiments in the memory 320.
[0100] See also Figure 10 The memory 320, processor 330, and communication unit 340 in this storage device are electrically connected to each other directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0101] The memory 320 can be an information recording device based on any electronic, magnetic, optical, or other physical principles, used to record execution instructions, data, etc. In some embodiments, the memory 320 can be, but is not limited to, volatile memory, non-volatile memory, memory drive, etc.
[0102] In some embodiments, the volatile memory may be random access memory (RAM); in some embodiments, the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, etc.; in some embodiments, the storage drive may be a disk drive, solid-state drive, any type of storage disk (such as optical disc, DVD, etc.), or similar storage media, or a combination thereof.
[0103] The communication unit 340 is used to send and receive data over a network. In some embodiments, the network may include a wired network, a wireless network, a fiber optic network, a telecommunications network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, or a near field communication (NFC) network, or any combination thereof. In some embodiments, the network may include one or more network access points. For example, the network may include wired or wireless network access points, such as base stations and / or network switching nodes, through which one or more components of the service request processing system can connect to the network to exchange data and / or information.
[0104] The processor 330 may be an integrated circuit chip with signal processing capabilities, and the processor may include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor described above may include a Central Processing Unit (CPU), an Application-Specific Integrated Circuit (ASIC), an Application-Specific Instruction-set Processor (ASIP), a Graphics Processing Unit (GPU), a Physics Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller unit, a Reduced Instruction Set Computing (RISC) computer, or a microprocessor, or any combination thereof.
[0105] It should be understood that the apparatus and methods disclosed in the above embodiments can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0106] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A virtual large capacity disk access method, characterized by, The application is applied to a storage device, a target storage space provided by the storage device includes a physical space and a virtual space simulating a small-capacity disk into a large-capacity disk, the physical space corresponds to a first disk, a preset address mapping relationship is met between the target storage space and the physical space, and the method comprises the following steps: receiving an expansion request for the physical space; obtaining an expansion capacity corresponding to the expansion request and an expansion position in response to the expansion request, wherein the expansion capacity represents the size of the virtual space, and the expansion position includes any one of a head position, a tail position and an intermediate position of the physical space; determining the address mapping relationship according to the expansion capacity and the expansion position; receiving a data write request of the target storage space; allocating a first write address for the data write request from the physical space in response to the data write request; converting the first write address into a second write address in the target storage space according to the address mapping relationship; taking the second write address as feedback information of the data write request; wherein the first disk includes a plurality of block groups, each block group includes an index block for storing index information and a data block for storing data, and the size of the index block is positively correlated with the number of the data block; if the first disk is replaced by a second disk capable of providing the target storage space, and if the plurality of block groups include a first block group with a preset capacity and a second block group that does not reach the preset capacity, then for the first block group, a first target block group is determined from the second disk according to the address mapping relationship; copying the data in the first block group as a whole to the first target block group; for the second block, a second target block group is determined from the second disk according to the address mapping relationship; copying the index information of the index block in the second block group to the index block of the second target block group; copying the data of the data block in the second block group to the data block of the second target block group.
2. The virtual large capacity disk access method according to claim 1, wherein, The storage device provides the target storage space to an application layer for access, a preset address mapping relationship between the target storage space and the physical space is recorded in a disk management layer of the storage device, and the disk management layer is used for shielding access operations of the target storage space for the application layer.
3. The virtual JBOD access method of claim 1, wherein, The method further comprises the following steps: receiving an access request of the target storage space; obtaining a first access address corresponding to the access request in response to the access request; determining whether the first access address needs to be converted; if yes, converting the first access address into a second access address in the physical space; accessing the physical space through the second access address.
4. A virtual large capacity disk access device characterized by comprising: The application is applied to a storage device, a target storage space provided by the storage device includes a physical space corresponding to a first disk and a virtual space simulating a small-capacity disk into a large-capacity disk, a preset address mapping relationship is met between the target storage space and the physical space, and the virtual large-capacity disk access device is used to receive an expansion request for the physical space; in response to the expansion request, an expansion capacity corresponding to the expansion request and an expansion position are obtained, wherein the expansion capacity represents the size of the virtual space, and the expansion position represents a connection position between the virtual space and the physical space; and the address mapping relationship is determined according to the expansion capacity and the expansion position. The device comprises: A request processing module is used to receive a data write request of the target storage space; The request processing module is also used to allocate a first write address for the data write request from the physical space in response to the data write request; An address conversion module is used to convert the first write address into a second write address in the target storage space according to the address mapping relationship; A request feedback module is used to take the second write address as feedback information of the data write request, wherein the first disk includes a plurality of block groups, each block group includes an index block used to store index information and a data block used to store data, and the size of the index block is positively correlated with the number of the data block; The virtual large-capacity disk access device is also used to, if the first disk is replaced by a second disk capable of providing the target storage space, and if the plurality of block groups include a first block group with a preset capacity and a second block group not reaching the preset capacity, then for the first block group, a first target block group is determined from the second disk according to the address mapping relationship; Data in the first block group is copied as a whole to the first target block group; For the second block, a second target block group is determined from the second disk according to the address mapping relationship; Index information of the index block in the second block group is copied to the index block of the second target block group; Data of the data block in the second block group is copied to the data block of the second target block group.
5. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the virtual large-capacity disk access method in any one of claims 1-3.
6. A storage device, comprising: The storage device comprises a processor and a memory, the memory stores a computer program, and the computer program is executed by the processor to implement the virtual large-capacity disk access method in any one of claims 1-3.
Citation Information
Patent Citations
Storage space management method, data processing chip, equipment and storage medium
CN114490433A