Address mapping method and device, storage system, program product and storage medium
By receiving the starting logical block address and disk array identifier, querying the stripe size and using a preset mapping table to determine the physical address, the complex problem of logical block address conversion caused by inconsistent disk arrays in the storage system is solved, and efficient data operations are achieved.
Patent Information
- Application Number
- CN202511262361.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-05
AI Technical Summary
Due to the inconsistency of disk array construction and stripe size in storage systems, the conversion of the starting logical block address is complex, affecting data access efficiency.
By receiving the starting logical block address and disk array identifier, querying the stripe size, and using a preset mapping table to determine the stripe identifier and physical address information, efficient conversion of the logical block address to the physical block address is achieved.
In scenarios with different disk arrays and stripe sizes, the conversion efficiency of the starting logical block address is improved, thereby increasing data operation efficiency.
Smart Images

Figure CN120743812A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to an address mapping method, device, storage system, program product, and storage medium. Background Art
[0002] To improve data storage security, a storage system can configure multiple RAID arrays (Redundant Arrays of Independent Disks) and form a storage pool based on these disk arrays. Furthermore, when a host operates on user data in a storage system, it must provide the storage system with a Starting Logical Block Address (SLBA), indicating the starting location for access. The storage system then converts the Starting Logical Block Address into a Physical Block Address (PBA) on the disk to perform operations on the data.
[0003] In the related art, since the construction methods and stripe sizes of the disk arrays in the storage system may be different, the conversion of the starting logical block address in the related art is relatively complicated, which is not conducive to efficient data access. Summary of the Invention
[0004] The present invention provides an address mapping method, device, storage system, program product, and storage medium, which can improve the conversion efficiency of the starting logical block address in a scenario where different disk arrays are provided in the storage system and different disk arrays correspond to different stripe sizes.
[0005] The present invention provides an address mapping method, which is applied to a storage system and includes: Receive input starting logical block address and disk array identifier; Querying the stripe size configured for the disk array corresponding to the disk array identifier, and determining the stripe identifier using the starting logical block address, the disk array identifier, and the stripe size; The stripe physical address information corresponding to the stripe identifier is searched in a preset mapping table, and the physical block address corresponding to the starting logical block address is determined according to the stripe physical address information.
[0006] The present invention also provides an address mapping device, applied to a storage system, comprising: A receiving module, configured to receive an input starting logical block address and a disk array identifier; a stripe identifier determination module, configured to query the stripe size configured for the disk array corresponding to the disk array identifier, and determine the stripe identifier using the starting logical block address, the disk array identifier, and the stripe size; The physical block address conversion module is used to query the stripe physical address information corresponding to the stripe identifier in a preset mapping table, and determine the physical block address corresponding to the starting logical block address according to the stripe physical address information.
[0007] The present invention also provides a storage system, comprising: Data storage, used to set up disk arrays; Program memory, used to store computer programs; The processor is used to implement the above-mentioned address mapping method when executing a computer program.
[0008] The present invention also provides a computer program product, including a computer program or instructions, which implements the above-mentioned address mapping method when executed by a processor.
[0009] The present invention also provides a non-volatile computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the above-mentioned address mapping method is implemented.
[0010] The beneficial effect of the present invention is that the storage system can first receive the input starting logical block address and disk array identifier, and the disk array identifier indicates the disk array where the starting logical block address is located. Subsequently, the storage system can query the stripe size configured for the disk array corresponding to the disk array identifier, and determine the stripe identifier using the starting logical block address, disk array identifier and stripe size. The stripe where the starting logical block address is located can be determined in combination with the disk array identifiers and stripe sizes of different disk arrays. Finally, the storage system can query the stripe physical address information corresponding to the stripe identifier in the preset mapping table, and determine the physical block address corresponding to the starting logical block address based on the stripe physical address information. The stripe physical address information corresponding to the stripe identifier can be recorded in the preset mapping table in advance, and the stripe physical address information corresponding to the stripe identifier can be efficiently queried later, and then the physical block address corresponding to the starting logical block address can be efficiently converted. In this way, the present invention can improve the conversion efficiency of the starting logical block address in scenarios where different disk arrays are provided in the storage system and different disk arrays can be provided with different stripe sizes, thereby improving data operation efficiency.
[0011] The present invention also provides an address mapping device, a storage system, a program product, and a storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Figure 1 A flowchart of an address mapping method provided by an embodiment of the present invention; Figure 2 A schematic diagram of an address mapping process provided by an embodiment of the present invention; Figure 3 This is a structural block diagram of an address mapping device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0015] It should be noted that, in the description of the present invention, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. The terms "first," "second," etc., in the present invention are used to distinguish similar objects, and are not used to describe a particular order or precedence.
[0016] In order to enable those skilled in the art to better understand the solutions of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0017] To improve the security of data storage, multiple disk arrays can be set up in the storage system, and a storage pool can be formed based on these disk arrays. In addition, when the host operates on user data in the storage system, it needs to provide the storage system with a starting logical block address to indicate the starting location of the host's access to the storage system. The storage system can convert the starting logical address into a physical block address on the disk to operate on the data on the disk. In the related art, since the construction methods and stripe sizes corresponding to the disk arrays in the storage system may be different, the related art is more complicated in converting the starting logical block address, which is not conducive to efficient data access.
[0018] In view of this, in order to solve the technical problem of how to improve the efficiency of mapping the starting logical block address, the present invention can provide an address mapping method. For the scenario where different disk arrays are provided in the storage system and different disk arrays may correspond to different stripe sizes, the present invention can determine the stripe where the starting logical block address is located in combination with the disk array identifiers and stripe sizes of different disk arrays, ensuring that the stripe setting is related to the disk array. In addition, the stripe physical address information corresponding to the stripe identifier can be queried in the preset mapping table, and the physical block address corresponding to the starting logical block address can be determined based on the stripe physical address information, thereby improving the efficiency of mapping the starting logical block address to the physical block address and improving data operation efficiency.
[0019] For easier understanding, please refer to Figure 1 , Figure 1 A flowchart of an address mapping method provided in an embodiment of the present invention, which is applied to a storage system, may include: S101: Receive an input starting logical block address and a disk array identifier.
[0020] In this embodiment, the storage system uses a disk array identifier when performing the initial logical block address mapping conversion. This disk array identifier uniquely identifies the disk array. This embodiment does not limit the specific form and configuration of the disk array identifier; it can be set according to actual application requirements.
[0021] Furthermore, the aforementioned starting logical block address can come from a data processing request (NVMe request, Non-Volatile Memory Host Controller Interface Specification), such as a data read request or a data write request. Furthermore, to facilitate storage space management, the storage system can map portions of the logical address range to corresponding disk arrays, with each disk array corresponding to a set of logical address ranges. Therefore, after extracting the starting logical block address from the data processing request, the disk array corresponding to the starting logical block address can be further queried to obtain the disk array identifier.
[0022] In one embodiment, receiving the input starting logical block address and disk array identifier may include: Step 11: Receive a data processing request and extract a starting logical block address from the data processing request; Step 12: Query the disk array corresponding to the starting logical block address to obtain the disk array identifier.
[0023] In a specific implementation, querying the disk array corresponding to the starting logical block address may include: Step 21: According to the preset address mapping table, determine the logical address range where the starting logical block address is located, and determine the disk array corresponding to the address range.
[0024] It is understandable that the preset address mapping table records the logical address range corresponding to each disk array, and then the disk array corresponding to the starting logical block address can be determined by simply matching the starting logical block address in the request with the logical address range in the preset address mapping table.
[0025] Furthermore, when a new disk array is added to the storage system, a correspondence between the disk array and the logical address range may be created and saved in a preset address mapping table.
[0026] In one embodiment, the method may further include: Step 31: When adding a disk array to the storage system, create a correspondence between the disk array and the logical address range and save it in a preset address mapping table.
[0027] S102: Query the stripe size configured for the disk array corresponding to the disk array identifier, and determine the stripe identifier using the starting logical block address, the disk array identifier, and the stripe size.
[0028] In this embodiment, multiple disk arrays can be configured in the storage system. Different disk arrays can have different disk array levels, such as RAID 0, RAID 1, RAID 5, RAID 6, and RAID 10. Each level has its own emphasis on performance, redundancy, and cost. Setting different disk array levels for different disk arrays can meet the data storage needs of different users. Furthermore, depending on the number of disks and the disk array level, the stripe size corresponding to each disk array may also be different. This results in the existence of multiple disk array levels and multiple stripe sizes in the storage system, which in turn increases the difficulty of mapping and converting the starting logical block address in related technologies.
[0029] Therefore, in this embodiment, when converting the starting logical block address, the storage system also needs to obtain the disk array identifier and the stripe size configured for the disk array corresponding to the disk array identifier, and then use the starting logical block address, disk array identifier, and stripe size to determine the stripe identifier. This configuration has the effect of, on the one hand, using different disk array identifiers to distinguish the stripe identifiers of different disk arrays in a storage system with multiple stripe sizes, and on the other hand, retaining the method of determining the stripe identifier through calculation, which can ensure the efficiency of stripe identifier determination.
[0030] In a specific embodiment, determining the stripe identifier using the starting logical block address, the disk array identifier, and the stripe size may include: Step 41: concatenate the disk array identifier to the highest bit of the starting logical block address to obtain a concatenated value; Step 42: Perform a right shift operation on the splicing value according to the stripe size to obtain a stripe identifier; wherein the number of binary bits of the stripe size is the number of right shift bits of the splicing value.
[0031] For example, if the starting logical block address SLBA = 0x12345678, the disk array identifier is 0x01, and the stripe length is 0x1000, then the splicing value can be 0x112345678, the number of binary bits of the stripe size log2(0x1000) = 12, and the result of the right shift operation is 0x112345, so 0x112345 can be used as the stripe identifier.
[0032] S103: Query the stripe physical address information corresponding to the stripe identifier in a preset mapping table, and determine the physical block address corresponding to the starting logical block address according to the stripe physical address information.
[0033] In an embodiment, a preset mapping table can be used to store the stripe physical address information of each stripe, such as the physical address of each physical block in the stripe, and the stripe physical address information can be marked with a stripe identifier. Furthermore, after calculating and obtaining the stripe identifier in step S102, the stripe physical address information corresponding to the stripe identifier can be queried in the preset mapping table, and the physical block address corresponding to the starting logical block address can be determined based on the stripe physical address information. In this way, this embodiment can quickly achieve the conversion of the starting logical block address to the physical block address through stripe identifier calculation and stripe physical address information query, thereby quickly achieving the mapping conversion of the logical address to the physical address in a scenario where different disk arrays are provided in the storage system and different disk arrays can correspond to different stripe sizes.
[0034] In a specific implementation, querying the stripe physical address information corresponding to the stripe identifier in the preset mapping table includes: Step 51: Query the target stripe entry corresponding to the stripe identifier in the preset master mapping table, and read the stripe starting physical address and metadata pointer from the target stripe entry; the preset master mapping table saves the stripe entry corresponding to the stripe in the storage system, and the stripe entry contains the stripe identifier, the stripe starting physical address and the metadata pointer, and the metadata pointer records the storage location of the metadata entry.
[0035] Step 52: Read the target metadata entry corresponding to the metadata pointer in the preset metadata table, and read the disk information and disk offset value corresponding to the physical block in the entry from the target metadata entry; the preset metadata table stores the metadata entries corresponding to the stripes in the storage system, and the metadata entries sequentially record the disk information and disk offset values of each physical block in the entry.
[0036] In this embodiment, the preset mapping table specifically includes a preset master mapping table and a preset metadata table. The preset master mapping table can store stripe entries corresponding to each stripe in the storage system. The stripe entries contain at least a stripe identifier, a stripe starting physical address, and a metadata pointer. The preset metadata table stores metadata entries corresponding to the stripes in the storage system. The metadata entries sequentially record at least the disk information and disk offset value of each physical block in the entry. The metadata pointer in the stripe entry points to the storage location of the metadata entry, so that after querying the stripe entry, the metadata entry can be quickly read.
[0037] When querying the mapping table, this embodiment first searches for the target stripe entry corresponding to the stripe identifier in the preset master mapping table, and reads the stripe starting physical address and metadata pointer from the target stripe entry. The stripe starting physical address indicates the starting physical address of the stripe in the storage system. Subsequently, this embodiment accesses the corresponding target metadata entry based on the metadata pointer and reads the disk information and disk offset value corresponding to the physical block in the target metadata entry. The disk information indicates the disk where the physical block is located, and the disk offset value indicates the physical address offset of the physical block within the disk.
[0038] Then, after obtaining the stripe starting physical address and the disk offset value, the physical address corresponding to the starting logical block address can be determined.
[0039] In a specific implementation, determining the physical block address corresponding to the starting logical block address according to the stripe physical address information includes: Step 61: Determine the offset value within the stripe using the starting logical block address and the stripe size, and determine the target disk information and the target disk offset value corresponding to the target physical block corresponding to the starting logical block address.
[0040] Step 62: Determine the physical block address of the starting logical block address in the target disk corresponding to the target disk information using the stripe starting physical address, the target disk offset value, and the stripe internal offset value.
[0041] Specifically, the physical block address is determined as follows: PBA = stripe start address + disk offset + (SLBA % stripe size); Among them, PBA represents physical block address, and SLBA represents starting logical block address.
[0042] Furthermore, after obtaining the physical block address, data operations can be performed on the corresponding physical block in the target disk according to the operation type of the data operation request including the starting logical block address.
[0043] In one embodiment, the method may further include: Step 71: Perform data operations on the corresponding physical block in the target disk according to the physical block address.
[0044] For example, data can be written to or read from the physical block.
[0045] Furthermore, since this embodiment is suitable for setting up multiple disk arrays in the storage system, each disk array corresponds to a different disk array level and a different stripe size, this embodiment can flexibly set up disk arrays in the storage system without affecting the efficiency of logical address conversion. For example, at least two groups of disk arrays can be set up based on different storage spaces of the same group of disks.
[0046] Based on the above embodiment, the storage system can first receive the input starting logical block address and disk array identifier, and the disk array identifier indicates the disk array where the starting logical block address is located. Subsequently, the storage system can query the stripe size configured for the disk array corresponding to the disk array identifier, and determine the stripe identifier using the starting logical block address, disk array identifier and stripe size. The stripe where the starting logical block address is located can be determined in combination with the disk array identifiers and stripe sizes of different disk arrays. Finally, the storage system can query the stripe physical address information corresponding to the stripe identifier in the preset mapping table, and determine the physical block address corresponding to the starting logical block address based on the stripe physical address information. The stripe physical address information corresponding to the stripe identifier can be recorded in the preset mapping table in advance, and the stripe physical address information corresponding to the stripe identifier can be efficiently queried later, and then the physical block address corresponding to the starting logical block address can be efficiently converted. In this way, the present invention can improve the conversion efficiency of the starting logical block address in scenarios where different disk arrays are provided in the storage system and different disk arrays can be provided with different stripe sizes, thereby improving data operation efficiency.
[0047] Based on the above embodiment, the stripe entry also includes the disk array level of the disk array to which the stripe belongs, and the metadata entry also includes the data type of the physical block. The data type includes user data and redundant data, and different disk array levels correspond to different redundant data types. The redundant data can be PQ check data and hot backup data. At this time, the redundant data contained in the stripe and the physical block address corresponding to the redundant data can also be determined based on the stripe entry and metadata entry, so that the redundant data can be used. The process of determining redundant data is described below. In one embodiment, the method can also include: S201 : Read the disk array level from the target stripe entry, and determine the corresponding redundant data type according to the disk array level.
[0048] In this step, the disk array level may be read from the target stripe entry, so that the stripe layout may be determined according to the disk array level, and the corresponding redundant data type may be determined according to the disk array level.
[0049] S202: Read the first disk information and the first disk offset value corresponding to the physical block of each redundant data type in the target metadata entry.
[0050] S203: Determine the redundant physical block address of the physical block of each redundant data type in the first disk corresponding to the first disk information by using the stripe start physical address and the first disk offset value.
[0051] In S202 and S203, similar to determining the physical block address of the starting logical block address, the first disk information and first disk offset value corresponding to the physical block of each redundant data type can be read from the target metadata entry. The first disk information can indicate the disk where the redundant data is located, and the first disk offset value can indicate the internal physical address offset value of the physical block of the redundant data within the disk. Subsequently, the stripe starting physical address and the first disk offset value can be used to determine the redundant physical block address of the physical block of each redundant data type on the first disk corresponding to the first disk information.
[0052] Furthermore, after obtaining the physical block address corresponding to the starting logical block address and the redundant physical block address corresponding to the redundant data, data operations such as data verification operations, data backup operations, data recovery operations, etc. can be performed on the corresponding user data physical blocks in the target disk and the corresponding redundant data physical blocks in the first disk according to the physical block address and the redundant physical block address.
[0053] In one embodiment, the method may further include: Step 81: Perform data operations on the corresponding user data physical block in the target disk and the corresponding redundant data physical block in the first disk according to the physical block address and the redundant physical block address.
[0054] Based on the above embodiment, the following describes the update method of the preset main mapping table and the preset metadata table. In one embodiment, the method may further include: S301. When the starting logical block address comes from a data write request, if the target stripe entry corresponding to the stripe identifier cannot be found in the preset master mapping table, a stripe entry is created in the preset master mapping table using the stripe identifier, a metadata entry is created in the preset metadata table, and the disk array level of the disk array corresponding to the disk array identifier and the metadata pointer of the newly created metadata entry are recorded in the newly created stripe entry.
[0055] S302: Write the data in the data write request into the disk array in the form of an entry, and record the data type, disk information, and disk offset corresponding to each physical block in the entry into a newly created metadata entry.
[0056] In this embodiment, when processing a data write request, since the data may be written to a new location in the storage system, the starting logical block address may not yet be mapped to the stripe, and thus the corresponding entry cannot be found in the main mapping table or the metadata table. In this regard, when this embodiment determines that the target stripe entry corresponding to the stripe identifier cannot be found in the preset main mapping table, the stripe identifier can be used to create a stripe entry in the preset main mapping table and a metadata entry in the preset metadata table, and the disk array level of the disk array corresponding to the disk array identifier and the metadata pointer of the newly created metadata entry are recorded in the newly created stripe entry. Subsequently, the data in the data write request can be written to the corresponding disk array in the form of an entry, and after the writing is completed, the data type, disk information, and disk offset corresponding to each physical block in the entry are recorded in the newly created metadata entry, thereby completing the creation of the stripe entry and the metadata entry.
[0057] Based on the above embodiment, the address mapping method is described below based on a specific schematic diagram. Figure 2 , Figure 2 This is a schematic diagram of an address mapping process provided by an embodiment of the present invention. The address mapping mechanism provided by this embodiment may include: 1. Hash mapping mechanism: The SLBA and RAID group ID (a system may have multiple RAID groups) are input and a shift operation (such as SLBA>>log2(stripe size)) is performed to generate the stripe number (StripeID) instead of the traditional modulo operation.
[0058] 2. Multi-stage pipeline architecture: Phase 1 (stripe number calculation): The SLBA and RAID group IDs are input to the conversion module, and the stripe number is generated through shift operations.
[0059] Phase 2 (master mapping table query): Based on the stripe number, the stripe metadata pointer, RAID level, and stripe size are obtained from the master mapping table built in SRAM (Static Random-Access Memory).
[0060] Phase 3 (metadata parsing): Access the metadata storage module through the metadata pointer to extract the disk layout information of the target stripe (data block, parity block location).
[0061] Phase 4 (physical address generation): Calculate the target physical block addresses of the operation data and the corresponding parity block and hot spare block based on the intra-stripe offset (SLBA% stripe size) and the disk offset in the metadata.
[0062] 3. Core module design: Main mapping table (SRAM): Entry format: metadata pointer | RAID level | stripe size | stripe start address |.
[0063] Metadata storage module (SRAM): Data structure: indexed by stripe number. Each entry contains disk data type information (data / RAID5P block / RAID6Q block / hot spare disk) and corresponding offset. The encoding format is: |Disk number|Disk 1 data type|Disk 1 offset|...|.
[0064] Physical address generation module: Logical formula: PBA = stripe start address + disk offset + (SLBA% stripe size); Supports multiple types of RAID distribution, such as left / right symmetry / rotational parity and other dynamic strategies.
[0065] This embodiment can provide an address mapping device with a clock frequency of 1 GHz (period = 1 ns). The address mapping operation can be executed in a pipeline. The pipeline stages can be divided into: Phase 1 (stripe number calculation): 1 cycle, hash function bit operation.
[0066] Phase 2 (main mapping table query): 2 cycles, SRAM access.
[0067] Phase 3 (metadata parsing): 2 cycles, SRAM access.
[0068] Phase 4 (physical address generation): 2 cycles, offset calculation.
[0069] The address mapping method described above will be described below based on specific example values.
[0070] Step 1: Initialize configuration: 1. Configure hash registers: set stripe size = 0x1000.
[0071] 2. Load the main mapping table.
[0072] 3. Load the metadata table.
[0073] Step 2: SLBA input and stripe number calculation: 1. Enter SLBA=0x1234_5678.
[0074] 2. Shift calculation: Strip number = SLBA >> log2(0x1000) = 0x1234_5678 >> 12 = 0x12345.
[0075] Step 3: Main mapping table query: Access the SRAM entry with the stripe number 0x12345 as the index: |Metadata pointer=0x8000_1000|RAID level=01 (RAID5)|Stripe size=0x1000|.
[0076] Step 4: Metadata parsing: Read metadata from SRAM according to pointer 0x8000_1000: |Number of disks = 4|Disk 1 type = 00 (Data) |Disk 1 offset = 0x2000||Disk 2 type = 00|Disk 2 offset = 0x3000|Disk 3 type = 00|Disk 3 offset = 0x4000||Disk 4 type = 01 (RAID5P block) |Disk 4 offset = 0x5000|.
[0077] Step 5: Physical address generation: 1. Calculate the intra-strip offset: SLBA%0x1000=0x678.
[0078] 2. The target disk is disk 1 (data block), and its offset is 0x2000, then: PBA = stripe start address (0x8000_0000) + disk offset (0x2000) + 0x678 = 0x8000_2678.
[0079] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0080] Please refer to Figure 3 , Figure 3 This is a structural block diagram of an address mapping device provided in an embodiment of the present invention. The device is applied to a storage system and may include: Receiving module 301, used for receiving input starting logical block address and disk array identifier; The stripe identifier determination module 302 is used to query the stripe size configured for the disk array corresponding to the disk array identifier, and determine the stripe identifier using the starting logical block address, the disk array identifier and the stripe size; The physical block address conversion module 303 is configured to query the stripe physical address information corresponding to the stripe identifier in a preset mapping table, and determine the physical block address corresponding to the starting logical block address according to the stripe physical address information.
[0081] Optionally, the stripe identification determination module 302 includes: A splicing submodule is used to splice the disk array identifier to the highest bit of the starting logical block address to obtain a splicing value; The shift operation submodule is used to perform a right shift operation on the splicing value according to the stripe size to obtain a stripe identifier; wherein the binary digits of the stripe size are the right shift digits of the splicing value.
[0082] Optionally, the physical block address conversion module 303 includes: The master mapping table query submodule is used to query the target stripe entry corresponding to the stripe identifier in the preset master mapping table and read the stripe start physical address and metadata pointer from the target stripe entry; the preset master mapping table stores the stripe entry corresponding to the stripe in the storage system, and the stripe entry contains the stripe identifier, the stripe start physical address and the metadata pointer, and the metadata pointer records the storage location of the metadata entry; The metadata table query submodule is used to read the target metadata entry corresponding to the metadata pointer in the preset metadata table, and read the disk information and disk offset value corresponding to the physical block in the entry from the target metadata entry; the preset metadata table stores the metadata entries corresponding to the stripes in the storage system, and the metadata entries sequentially record the disk information and disk offset value of each physical block in the entry.
[0083] Optionally, the physical block address conversion module 303 includes: The first conversion submodule is configured to determine an offset value within the stripe by using the starting logical block address and the stripe size, and to determine target disk information and a target disk offset value corresponding to a target physical block corresponding to the starting logical block address; The first conversion submodule is used to determine the physical block address of the starting logical block address in the target disk corresponding to the target disk information by using the stripe starting physical address, the target disk offset value, and the stripe internal offset value.
[0084] Optionally, the device may further include: The first data operation module is used to perform data operations on corresponding physical blocks in the target disk according to the physical block addresses.
[0085] Optionally, the stripe entry further includes the disk array level of the disk array to which the stripe belongs, and the metadata entry further includes the data type of the physical block, the data type including user data and redundant data, and different disk array levels correspond to different redundant data types; The main mapping table query submodule is further used to read the disk array level from the target stripe entry and determine the corresponding redundant data type according to the disk array level; The metadata table query submodule is further configured to read the first disk information and the first disk offset value corresponding to the physical block of each redundant data type in the target metadata entry; The device may also include: The redundant physical block address determination module is used to determine the redundant physical block address of the physical block of each redundant data type in the first disk corresponding to the first disk information by using the stripe start physical address and the first disk offset value.
[0086] Optionally, the device may further include: The second data operation module is used to perform data operations on the corresponding user data physical block in the target disk and the corresponding redundant data physical block in the first disk according to the physical block address and the redundant physical block address.
[0087] Optionally, the device may further include: A first entry creation module is configured to, when a starting logical block address is received from a data write request, create a stripe entry in the preset main mapping table using the stripe identifier, create a metadata entry in the preset metadata table using the stripe identifier, and record the disk array level of the disk array corresponding to the disk array identifier and a metadata pointer of the newly created metadata entry in the newly created stripe entry if a target stripe entry corresponding to the stripe identifier cannot be found in the preset main mapping table; The second entry creation module is used to write the data in the data write request into the disk array in the form of an entry, and record the data type, disk information, and disk offset corresponding to each physical block in the entry into the newly created metadata entry.
[0088] Optionally, the receiving module 301 may include: A request receiving submodule is used to receive a data processing request and extract a starting logical block address from the data processing request; The disk array query submodule is used to query the disk array corresponding to the starting logical block address and obtain the disk array identifier.
[0089] Optionally, the disk array query submodule can be used to: According to the preset address mapping table, the logical address range where the starting logical block address is located is determined, and the disk array corresponding to the address range is determined.
[0090] Optionally, the device may further include: The address mapping table updating module is used to create a correspondence between the disk array and the logical address range when adding a disk array to the storage system, and save the correspondence in the preset address mapping table.
[0091] For the description of the features in the embodiment corresponding to the address mapping device, reference can be made to the relevant description of the embodiment corresponding to the address mapping method, which will not be repeated here.
[0092] An embodiment of the present invention also provides a storage system including a data memory, a program memory and a processor, wherein the data memory is used to set up a disk array, the program memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned address mapping method embodiments.
[0093] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned address mapping method embodiments when running.
[0094] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0095] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned address mapping method embodiments are implemented.
[0096] An embodiment of the present invention also provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned address mapping method embodiments are implemented.
[0097] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0098] The above is a detailed introduction to the address mapping method, device, storage system, program product, and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. An address mapping method, characterized in that: Applied to storage systems, including: Receive input starting logical block address and disk array identifier; querying a stripe size configured for the disk array corresponding to the disk array identifier, and determining the stripe identifier using the starting logical block address, the disk array identifier, and the stripe size; The stripe physical address information corresponding to the stripe identifier is searched in a preset mapping table, and the physical block address corresponding to the starting logical block address is determined according to the stripe physical address information.
2. The address mapping method according to claim 1, wherein: Determining a stripe identifier using the starting logical block address, the disk array identifier, and the stripe size includes: splicing the disk array identifier to the highest bit of the starting logical block address to obtain a splicing value; The splicing value is right-shifted according to the stripe size to obtain the stripe identifier; wherein the number of binary bits of the stripe size is the number of right-shifted bits of the splicing value.
3. The address mapping method according to claim 1, wherein: Querying the stripe physical address information corresponding to the stripe identifier in the preset mapping table includes: Querying a target stripe entry corresponding to the stripe identifier in a preset master mapping table, and reading a stripe start physical address and a metadata pointer from the target stripe entry; the preset master mapping table stores a stripe entry corresponding to a stripe in the storage system, the stripe entry including the stripe identifier, the stripe start physical address and a metadata pointer, the metadata pointer recording a storage location of the metadata entry; The target metadata entry corresponding to the metadata pointer is read in the preset metadata table, and the disk information and disk offset value corresponding to the physical block in the entry are read from the target metadata entry; the preset metadata table stores the metadata entries corresponding to the stripes in the storage system, and the metadata entries sequentially record the disk information and disk offset values of each physical block in the entry.
4. The address mapping method according to claim 3, wherein: Determining the physical block address corresponding to the starting logical block address according to the stripe physical address information includes: Determine an offset value within a stripe by using the starting logical block address and the stripe size, and determine target disk information and a target disk offset value corresponding to a target physical block corresponding to the starting logical block address; The physical block address of the starting logical block address in the target disk corresponding to the target disk information is determined by using the stripe starting physical address, the target disk offset value, and the intra-stripe offset value.
5. The address mapping method according to claim 4, characterized in that: Also includes: According to the physical block address, data operation is performed on the corresponding physical block in the target disk.
6. The address mapping method according to claim 4, characterized in that: The stripe entry further includes the disk array level of the disk array to which the stripe belongs, and the metadata entry further includes the data type of the physical block, the data type including user data and redundant data, and different disk array levels correspond to different redundant data types; the method further includes: Reading the disk array level from the target stripe entry, and determining a corresponding redundant data type according to the disk array level; Reading first disk information and first disk offset values corresponding to physical blocks of each redundant data type in the target metadata entry; The redundant physical block addresses of the physical blocks of each redundant data type in the first disk corresponding to the first disk information are determined by using the stripe start physical address and the first disk offset value.
7. The address mapping method according to claim 6, characterized in that: Also includes: According to the physical block address and the redundant physical block address, data operations are performed on the corresponding user data physical block in the target disk and the corresponding redundant data physical block in the first disk.
8. The address mapping method according to claim 6, wherein: Also includes: When the starting logical block address comes from a data write request, if a target stripe entry corresponding to the stripe identifier cannot be found in the preset master mapping table, the stripe entry is created in the preset master mapping table using the stripe identifier, the metadata entry is created in the preset metadata table, and the disk array level of the disk array corresponding to the disk array identifier and a metadata pointer of the newly created metadata entry are recorded in the newly created stripe entry; The data in the data write request is written into the disk array in the form of an entry, and the data type, disk information, and disk offset corresponding to each physical block in the entry are recorded in a newly created metadata entry.
9. The address mapping method according to claim 1, wherein: Receive the input starting logical block address and disk array identifier, including: receiving a data processing request, and extracting the starting logical block address from the data processing request; The disk array corresponding to the starting logical block address is queried to obtain the disk array identifier.
10. The address mapping method according to claim 9, characterized in that: Querying the disk array corresponding to the starting logical block address includes: According to a preset address mapping table, a logical address range where the starting logical block address is located is determined, and a disk array corresponding to the address range is determined.
11. The address mapping method according to claim 10, characterized in that: Also includes: When a disk array is added to the storage system, a correspondence between the disk array and the logical address range is created and saved in the preset address mapping table.
12. An address mapping device, characterized in that: Applied to storage systems, including: A receiving module, configured to receive an input starting logical block address and a disk array identifier; a stripe identifier determining module, configured to query a stripe size configured for the disk array corresponding to the disk array identifier, and determine the stripe identifier using the starting logical block address, the disk array identifier, and the stripe size; The physical block address conversion module is used to query the stripe physical address information corresponding to the stripe identifier in a preset mapping table, and determine the physical block address corresponding to the starting logical block address according to the stripe physical address information.
13. A storage system, characterized in that: include: Data storage, used to set up disk arrays; Program memory, used to store computer programs; A processor, configured to implement the address mapping method according to any one of claims 1 to 11 when executing the computer program.
14. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the address mapping method according to any one of claims 1 to 11 is implemented.
15. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the address mapping method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Disk array access method and device, equipment and storage medium
CN113342279A
Domain address change method, device and equipment and readable storage medium
CN115129267A
Method, device and equipment for realizing memory address mapping
CN116627856A
Data management method, system, device and equipment and computer storage medium
CN116893789A
Data processing method of combined disk array, terminal and storage medium
CN119292519A
Cited By
Control method of disk array and electronic equipment
CN120929347A