WO2015027817A1 - 自管理存储方法和系统 - Google Patents

自管理存储方法和系统 Download PDF

Info

Publication number
WO2015027817A1
WO2015027817A1 PCT/CN2014/084225 CN2014084225W WO2015027817A1 WO 2015027817 A1 WO2015027817 A1 WO 2015027817A1 CN 2014084225 W CN2014084225 W CN 2014084225W WO 2015027817 A1 WO2015027817 A1 WO 2015027817A1
Authority
WO
WIPO (PCT)
Prior art keywords
logical address
address
chunk
user
block device
Prior art date
Application number
PCT/CN2014/084225
Other languages
English (en)
French (fr)
Inventor
刘扬宽
张子刚
岳银亮
潘锋烽
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015027817A1 publication Critical patent/WO2015027817A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a self-managed storage method and system.
  • computer storage resources to be composed of a plurality of heterogeneous block devices, which are different in storage reliability and access speed, for example: Solid State Drive (SSD) is faster than Hard Disk Drive (HDD), but the reliability of SSD is low.
  • SSD Solid State Drive
  • HDD Hard Disk Drive
  • HDD is also the HDD read/write speed of different models of different manufacturers.
  • RAID Redundant Array of Independent Disks
  • a heterogeneous cloud storage resource is integrated by constructing a storage management device and an adapter for accessing heterogeneous cloud storage system resources between a virtual file system and a public cloud storage system, that is, providing a unified logical abstraction to the user through the adapter. Layers, and management of heterogeneous cloud storage resources through storage management devices, making it easy and convenient for users to access heterogeneous cloud storage resources.
  • the embodiments of the present invention provide a self-management storage method and system, which are used to solve the technical problem that the prior art cannot provide corresponding storage resources to users according to storage requirements of users.
  • a first aspect of the present invention provides a self-management storage method, including:
  • the address type parameter includes a speed requirement parameter, a reliability requirement parameter, and an address length requirement of the first logical address by the user; and the query is performed according to the first logical address type parameter, and the first logical is satisfied.
  • the first logical address of the address type parameter includes:
  • the determining, by the address length requirement parameter and the first chunk, the first logical address Includes:
  • the creating the second chunk that meets the speed requirement parameter and the reliability requirement parameter includes:
  • the mapping the second physical address segment to the second logic according to the reliability requirement parameter After the second chunk is generated the address segment further includes:
  • the second chunk is added to the chunk table and the second chunk is marked as free.
  • the receiving, by the receiving user, the first logical address allocation request is specifically:
  • a sixth possible implementation manner of the first aspect after the first logical address is sent to the user, also includes:
  • a seventh possible implementation manner of the first aspect after the first logical address is sent to the user, also includes:
  • Determining the chunk table according to the first logical address offset determining the first chunk corresponding to the first logical address offset
  • the first logical address offset is added to the first chunk.
  • a ninth possible implementation manner of the first aspect after the first logical address is sent to the user, Also includes:
  • the block device corresponding to the name of the block device to be deleted is deleted.
  • a second aspect of the present invention provides a self-management storage system, including:
  • a first receiving module configured to receive a first logical address allocation request sent by the user, where the allocation request carries a first logical address type parameter
  • a first obtaining module configured to perform, according to the first logical address type parameter, a first logical address that satisfies the first logical address type parameter
  • the first sending module is configured to send the first logical address to the user.
  • the first logical address type parameter includes a speed requirement parameter, a reliability requirement parameter, and an address length of the user to the first logical address
  • the parameter is required;
  • the first obtaining module includes:
  • a query unit configured to query, in the logical address segment chunk table, a first chunk that satisfies the speed requirement parameter and the reliability requirement parameter; wherein, all chunks in the chunk table establish a logical address and a physical address Mapping relations;
  • a determining unit configured to determine the first logical address according to the address length requirement parameter and the first chunk.
  • the determining unit is specifically configured to determine whether a length of the idle address of the first chunk satisfies the address Length requirement parameter
  • the determining unit includes:
  • a querying subunit configured to query a free physical address space table that is not mapped to the logical address, and determine a second physical address segment that satisfies the speed requirement parameter
  • the determining unit further includes:
  • Deleting a subunit configured to map the second physical address segment to a second logical address segment according to the reliability requirement parameter, and after the generating the second chunk, the second physical The address segment is deleted from the free physical address space table;
  • a chunk adds a subunit for adding the second chunk to the chunk table and marking the second chunk as free.
  • the first receiving module is specifically configured to receive the user input And applying, by the first interface command, the first interface command, where the first interface command carries the first logical address type parameter.
  • system further includes:
  • a second receiving module configured to: after the first sending module sends the first logical address to the user, receive a second interface command input by the user for indicating write data; wherein, the second The interface command includes first data to be written and the first logical address;
  • a second obtaining module configured to search the chunk table according to the first logical address, and obtain a first physical address corresponding to the first logical address
  • the system further includes: a third receiving module, configured to receive a third interface command input by the user for indicating read data, where the third interface command includes a byte length of the second data to be read and the first Logical address
  • a third obtaining module configured to search the chunk table according to the first logical address, and obtain a first physical address corresponding to the first logical address
  • Read module used from the first?
  • the second data of the byte length is read in the block device corresponding to the address.
  • system further includes:
  • a fourth receiving module configured to receive, after the sending module sends the first logical address to the user, a four interface command input by the user, where the fourth interface command includes a first logical address to be released Offset
  • An address adding module configured to: add a logical address offset to the foregoing; chunk combines the second aspect to the four possible implementation manners of the second aspect
  • system further includes:
  • a fifth receiving module configured to receive, after the sending module sends the first logical address to the user, a fifth interface command that is input by the user to indicate that the block device is deleted; wherein, the fifth The interface command carries the name of the block device to be deleted.
  • a deleting module configured to delete the block device corresponding to the name of the block device to be deleted.
  • system further includes:
  • a sixth receiving module configured to: after the first sending module sends the first logical address to the user, receive a sixth interface command that is input by the user to indicate that the block device is added;
  • the six interface command carries the name of the block device to be added;
  • a device adding module configured to determine a physical address space of the block device to be added according to the name of the block device to be added, and increase a physical address space of the block device to be added to the free physical address space table.
  • Embodiments of the present invention provide a self-management storage method and system, which are distributed by receiving users.
  • the first logical address type parameter is carried in the request, and is queried according to the first logical address type parameter to obtain a first logical address that satisfies the first logical address type parameter, and the first logical address is sent to the user, so that the user can
  • the corresponding storage resources are obtained according to their storage requirements, thereby ensuring that the storage resources can be allocated to users as needed.
  • FIG. 1 of the present invention provides: a method for storing a processing flow example of embodiment
  • FIG 2 of the present invention provides a self-: flow according to a second embodiment of the method of storage management
  • FIG 3 since the present invention provides: a storage processing flow according to a third embodiment of the method
  • FIG. 4 of the present invention provides: a storage processing flow according to a fourth embodiment of the method
  • FIG 5 from the present invention provides: a storage processing flow according to a fifth embodiment of the method
  • FIG 6 the present invention provides a self-: flow according to a sixth embodiment of the method of storage management
  • FIG 7 of the present invention provides a self-: the processing flow according to a seventh embodiment of the storage method
  • FIG. 8 from the present invention provides
  • FIG. 9 of the present invention provides: a small knot Zhong physical storage system according to the second embodiment
  • FIG. 10 is a structural diagram of Embodiment 3 of a self-care storage system provided by the present invention.
  • FIG. 11 is a structural diagram of Embodiment 4 of a self-care storage system provided by the present invention.
  • FIG. 12 is a structural diagram of Embodiment 5 of a self-care storage system provided by the present invention.
  • Embodiment 13 is a structure of Embodiment 6 of a self-care storage system provided by the present invention.
  • FIG. 14 is a small structural embodiment of a seventh embodiment of a self-care storage system provided by the present invention.
  • FIG. 1 is a schematic flowchart of Embodiment 1 of a self-management storage method provided by the present invention.
  • the embodiment of the present invention provides a process for a user to obtain a corresponding storage resource according to its storage requirement.
  • the executor of the embodiment of the present invention may be a self-managed storage system, which may be located in the host. The method includes:
  • S101 Receive a first logical address allocation request sent by a user, where the allocation request carries a first logical address type parameter.
  • the self-management storage system in the embodiment of the present invention is located between the file system of the host and the common block layer (the file system herein may also be other upper layer systems, for example: a key-value storage system, the present invention
  • the driver of multiple block devices and block devices is connected under the common block layer; the self-management storage system can organize the physical block devices to provide users with a unified logical address and byte-access interface. And the above logical address has a certain mapping relationship with the physical address of the block device.
  • the first logical address allocation request is sent to the self-managed storage system, where the allocation request carries a first logical address type parameter, where the first logical address type parameter is requested by the user.
  • the first logical address may be a logical address segment, and may be a single logical address.
  • the first logical address type parameter may be the speed of the user to the first logical address. At least one of a required parameter of the level, a required parameter of a reliability level when the first logical address stores data, and a required parameter of an address length of the first logical address.
  • S102 Perform a query according to the first logical address type parameter, and obtain a first logical address that satisfies the first logical address type parameter.
  • the self-management storage system queries the first logical address type parameter of the first logical address to be acquired by the user, to obtain a first logical address that satisfies the first logical address type parameter, and allocates the logical address.
  • the first logical address is marked as allocated; since the acquired first logical address has been mapped with the physical address of the plurality of block devices under the common block layer, when the user obtains the first
  • the self-managed storage system finds the same according to the above mapping relationship. A physical address corresponding to a logical address, and then a block device corresponding to the physical address is found, and data is written to the block device.
  • the method provided by the embodiment of the present invention receives a first logical address type parameter carried by a user in an allocation request, and performs a query according to the first logical address type parameter to obtain a first logical address that satisfies the first logical address type parameter.
  • the first logical address is sent to the user, so that the user can obtain the corresponding storage resource according to the storage requirement of the user, thereby ensuring that the storage resource can be allocated to the user as needed.
  • the first logical address type parameter may include a speed requirement parameter, a reliability requirement parameter, and an address length requirement parameter of the user for the first logical address; on the basis of the embodiment shown in FIG. 1, as the present invention
  • a specific implementation manner is provided.
  • the embodiment provides a specific process for the self-management storage system to obtain the first logical address according to the first logical address type parameter. That is,
  • S102 specifically includes: querying, in a logical address segment (chunk) table, a first chunk that satisfies a parameter according to the foregoing speed requirement parameter and a reliability requirement; wherein, all the chunks in the chunk table establish a mapping relationship between a logical address and a physical address The first logical address is determined according to the address length requirement parameter and the first chunk.
  • a logical address segment (chunk) table a first chunk that satisfies a parameter according to the foregoing speed requirement parameter and a reliability requirement
  • the self-management storage system queries the chunk table according to the speed requirement parameter and the reliability requirement parameter of the first logical address to be applied by the user, so as to obtain the first chunk that meets the foregoing speed requirement parameter and the reliability requirement parameter;
  • the chunk table contains at least one chunk, and all the chunks in the chunk table establish a mapping relationship between the logical address and the physical address; and a chunk is a logical address that is mapped to the physical address of the block device.
  • the self-management storage system determines the first chunk that meets the speed requirement and reliability requirement of the first logical address by the user, determining the length of the address in the first chunk according to the address length requirement parameter of the first logical address by the user. A logical address that matches the parameters is required as the first logical address.
  • the embodiment further provides a specific process for determining the first logical address according to the address length requirement parameter and the first chunk, which is specifically: determining a free address of the first chunk Whether the length satisfies the address length requirement parameter; if yes, determining the first logical address from the idle address of the first chunk according to the address length requirement parameter; or, if not, creating the speed requirement parameter and the reliability requirement Second parameter Chunk, and determining the first logical address from the second chunk according to the above address length requirement parameter.
  • the self-management storage system determines the first chunk that meets the speed requirement parameter and the reliability requirement parameter of the first logical address
  • the user determines the first chunk according to the address length requirement parameter of the first logical address.
  • the self-management storage system itself can predict that all chunks in the chunk table are idle or allocated; when the first chunk is idle When the length of the address satisfies the address length requirement parameter (that is, the length of the idle address in the first chunk is greater than or equal to the address length specified by the address length requirement), the self-management storage system determines the address from the idle address of the first chunk.
  • the length requires a logical address matching the parameter as the first logical address; or, when the length of the free address in the first chunk does not satisfy the address length requirement parameter (that is, the length of the free address in the first chunk is less than the length of the address Requires the address length specified by the parameter), self-managed storage
  • the system needs to establish a second chunk according to the speed parameter and the reliability requirement parameter of the first logical address, and determine a logical address matching the address length requirement parameter from the second chunk as the first logical address.
  • the implementation provides a specific creation process of the second chunk.
  • the method includes: querying a free physical address space table that is not mapped to a logical address, determining a second physical address segment that satisfies the speed requirement parameter; mapping the second physical address segment to the second logic according to the reliability requirement parameter An address segment, generating a second chunk; deleting the second physical address segment from the free physical address space table; adding a second chunk to the chunk table, and marking the second chunk as idle.
  • the self-management storage system searches for a mapping relationship between the physical address of the block device and the physical address of the block device in all the address spaces of the self-managed storage system.
  • a free physical address space table in which a second physical address segment that satisfies the above speed requirement parameter is determined.
  • mapping the second physical address segment to the corresponding second logical address according to the reliability requirement parameter of the first logical address for example: Assume that the reliability requirement parameter of the first logical address sent by the user to the self-managed storage system is A data storage 2 copies, here also assumes that the length of the second physical address segment is 20 GB, then the self-management storage system constructs a corresponding level of RAID according to the reliability requirement parameter, and then establishes a second physical address segment and the second through the RAID. Mapping of two logical address segments; therefore, The length of the mapped second logical address segment is 10 GB, that is, data stored at a logical address of the second logical address segment, and the corresponding physical address can be allocated from the second physical address segment to store the data. . Meanwhile, a second logical address has been established mapping relationship is the second segment c hunk physical address and a second segment.
  • the self-management storage system deletes the second physical address segment from the original free physical address space table, and adds the second chunk created above to the previous chunk table, and marks the second chunk as an idle state. So that the self-managed storage system can determine the first logical address from the second chunk according to the address length requirement described above.
  • the first logical address allocation request sent by the user is received by the user from the management storage system, and the user may invoke the first interface command in the self-management storage system, where the first interface command carries the first logical address type parameter. And the first interface command may enable the user to apply to the self-managed storage system for the first logical address that meets the first logical address type parameter.
  • the first interface command may be Alloc(uint64_t alloc_size, int reliability_level, int speed_level, uint64-t result-offset/*output*/), meaning that the application allocates a first size of alloc_size.
  • FIG. 2 is a schematic flowchart diagram of Embodiment 2 of a self-management storage method provided by the present invention.
  • the executive body of an embodiment of the present invention may be a self-managed storage system. This embodiment provides an overall process for a user to obtain a first logical address that satisfies a first logical address type parameter.
  • the method specifically includes:
  • S201 Receive a first interface command of a first logical address that is input by a user, where the first interface command carries a first logical address type parameter, and the first logical address type parameter includes a speed of the user to the first logical address. Requires parameters, reliability requirements, and address length requirements.
  • the user invokes a first interface command for applying the first logical address in the self-management storage system, where the first interface command carries a first logical address type parameter, and the first logical address type parameter may be a user to the first logical address.
  • the first interface command may be Alloc (uint64-t alloc_size, int reliability_level, int speed-level, uint64_t result-offset/* output*/), meaning that the application allocates a size of alloc_size.
  • First logical address, reliability requirement parameter of the first logical address And the speed requirement parameters are reliability_level and speed_leve, respectively, and the first logical address after successful application is stored in result_offset.
  • S202 Query, in the logical address segment chunk table, a first chunk that satisfies the foregoing speed requirement parameter and the reliability requirement parameter; wherein all the chunks in the chunk table establish a mapping relationship between the logical address and the physical address.
  • S203 Determine whether the length of the free address of the first chunk satisfies the address length requirement parameter; if yes, execute S204; if no, execute S206.
  • the self-management storage system performs a query in the chunk table according to the speed requirement and the reliability requirement of the first logical address to be applied by the user, to obtain a first chunk that meets the foregoing speed requirement parameter and the reliability requirement parameter;
  • the chunk table contains at least one chunk, and all the chunks in the chunk table establish a mapping relationship between the logical address and the physical address; and a chunk is a logical address that is mapped to the physical address of the block device.
  • the self-management storage system determines the first chunk that meets the speed requirement and the reliability requirement of the first logical address, the user determines the idle address length in the first chunk according to the address length requirement parameter of the first logical address. Whether the address length requirement parameter is satisfied; It should be noted that the self-management storage system itself can predict that all the chunk addresses in the chunk table are idle or allocated.
  • S204 Determine a first logical address from the idle address of the first chunk according to the address length requirement parameter.
  • the self-management storage system when the length of the idle address in the first chunk satisfies the address length requirement parameter (that is, the length of the idle address in the first chunk is greater than or equal to the address length specified by the address length requirement), the self-management storage system will be A logical address matching the above address length requirement parameter is determined in a free address of a chunk as the first logical address.
  • the self-management storage system allocates the first logical address determined to the user, and after the user obtains the first logical address, to write data to the first logical address, the self-management storage system searches according to the mapping relationship. A physical address corresponding to the first logical address, and then a block device corresponding to the physical address is found, and data is written to the block device.
  • S206 Query a free physical address space table that is not mapped to the logical address, and determine a second physical address segment that satisfies the speed requirement parameter.
  • S207 Map the second physical address segment to the second logical address segment according to the reliability requirement parameter to generate a second clnmk.
  • the self-management storage system searches for a mapping relationship between the physical address of the block device and the physical address of the block device in all the address spaces of the self-managed storage system.
  • a free physical address space table in which a second physical address segment that satisfies the above speed requirement is determined.
  • the second physical address segment to the corresponding second logical address according to the reliability requirement parameter of the first logical address, for example: Assume that the reliability requirement of the first logical address sent by the user to the self-managed storage system is one.
  • the data storage 2 copies here also assumes that the length of the second physical address segment is 20 GB, the self-management storage system constructs a corresponding level of RAID according to the reliability requirement parameter, and then establishes a second physical address segment and a second through RAID. Mapping of logical address segments; therefore, the length of the mapped second logical address segment is 10 GB, that is, data stored at a logical address of the second logical address segment, and two data addresses can be allocated from the second physical address segment.
  • the corresponding physical address stores the data.
  • the second logical address segment g ⁇ that has been mapped with the second physical address segment is the second chunk o
  • the self-management storage system deletes the second physical address segment from the original free physical address space table, and adds the second chunk created above to the previous chunk table, and marks the second chunk as an idle state. So that the self-managed storage system can determine the first logical address from the second chunk according to the address length requirement parameter.
  • the method provided by the embodiment of the present invention receives a first logical address type parameter carried by a user in an allocation request, and performs a query according to the first logical address type parameter to obtain a first logic that satisfies the first logical address type parameter.
  • the address, the first logical address is sent to the user, so that the user can obtain the corresponding storage resource according to the storage requirement of the user, thereby ensuring that the storage resource can be allocated as needed; meanwhile, since all address spaces in the self-management storage system are managed by the self-management system Self-management simplifies the burden of managing the address space of the upper system; on the other hand, dynamically creates physical The mapping from the address to the logical address (that is, the process of creating the second chunk) realizes the expansion of the self-managed storage system.
  • FIG. 3 is a schematic flowchart of a third embodiment of the self-management storage method provided by the present invention.
  • the embodiment provides a process for a user to write data into the self-management storage system. .
  • the method further includes:
  • S301 Receive a second interface command input by the user for indicating write data; the second interface command includes the first data to be written and the first logical address.
  • S302 Find a chunk table according to the first logical address, and obtain a first physical address corresponding to the first logical address.
  • the self-management storage system in this embodiment provides the user with a write data interface that is accessed by the byte.
  • the user implements the corresponding operation by calling the interface, specifically: the user sends the first data to be written and the first
  • the second interface command of the logical address is given to the self-managed storage system, indicating that the user wants to write the first data into the first logical address.
  • the self-managed storage system is only a logical address for the user, that is, for the user, only the first data is written to the first logical address, but the self-managed storage system actually writes the first data. In the block device corresponding to the first logical address.
  • the second interface command may be Write (uint64-t offset, char* buf, uint64_t len), and the first data of the len byte length in the host memory buf of the management storage system is written to the len length from the offset address.
  • the storage space is the first logical address; when receiving the second interface command, the self-management storage system searches the chunk table according to the obtained first logical address to obtain the first logical address.
  • the self-managed storage system sets the len byte in the buf The first data of the length is written into the block device corresponding to the first physical address.
  • the access strength of the block device is in units of blocks, and the size of one block device is 4K.
  • Bytes that is, the user can only access 4K bytes as a whole when accessing the block device;
  • the upper file system needs to write tens of bytes of data into the block device, the storage system in the prior art The entire block device will still be provided to the user, causing waste of block device space;
  • the upper file system needs to take some bytes of data from other disks, and mark the data of the partial bytes as invalid, in order to The partial byte data marked as invalid and the tens of bytes of data to be written in advance are combined to generate 4K bytes of data to be written into the block device, that is, the upper file system is required to handle block alignment.
  • the user sends a second interface command for instructing to write data to the self-managed storage system by using a byte-access interface provided by the management storage system, so that the upper-layer system of the self-managed storage system There is no need to deal with the problem of block alignment, which saves the storage space of the block device.
  • Embodiment 4 is a schematic flowchart of Embodiment 4 of a self-management storage method provided by the present invention. On the basis of the foregoing embodiment shown in FIG. 2, this embodiment provides a process for a user to read data from a first logical address. . After the above S211, the method further includes:
  • S401 Receive a third interface command input by the user for instructing to read data; the third interface command includes a byte length of the second data to be read and a first logical address.
  • S402 Find a chunk table according to the first logical address, and obtain a first physical address corresponding to the first logical address.
  • S403 Read the second data of the byte length from the block device corresponding to the first physical address.
  • the self-management storage system in this embodiment provides the user with a read data interface that is accessed by the byte.
  • the user implements the corresponding operation by calling the interface, specifically: the user sends the byte carrying the second data to be read.
  • the third interface command of the length and the first logical address is given to the self-managed storage system, indicating that the user wants to read the second data of the byte length from the first logical address.
  • the self-managed storage system is only a logical address facing the user, that is, for the user, only the second data is stored in the first logical address, and then the second data is read from the first logical address, and the actual The second data in the upper management storage system is stored in the block device corresponding to the first logical address.
  • the self-management storage system searches the chunk table according to the first logical address to obtain the first a first chunk in which the logical address is located, and in the first chunk, according to the mapping relationship between the established logical address and the physical address, the first physical address corresponding to the first logical address is found; finally, the self-management storage system is from the first The second data of the corresponding byte length is read from the block device corresponding to the physical address and sent to the user.
  • the third interface command may be Read (uint64_t offset, char* buf, uint64_t len), and the data that reads the len byte from the offset address is stored in the buf; wherein, the first logical address is Offset is the starting address, offset+len is the logical address of the cutoff address.
  • the user sends a third interface command for instructing to read data to the self-management storage system by using a byte-access interface provided by the management storage system, so that the upper layer system of the self-managed storage system No need to deal with block alignment issues, saving system overhead.
  • FIG. 5 is a schematic flowchart of Embodiment 5 of the self-management storage method provided by the present invention.
  • the embodiment provides that the user releases a logical address and the logic is The process of adding an address to the first chunk.
  • the method further includes:
  • S501 Receive a fourth interface command input by the user, where the fourth interface command includes a first logical address offset to be released.
  • S502 Determine, according to the first logical address offset, the first chunk corresponding to the first logical address offset.
  • the self-management storage system in this embodiment provides the user with an interface for releasing the address space by byte access.
  • the user invokes the interface provided by the management storage system to release the address space, and releases the logical address back to the self-managed storage system.
  • the logical address of the segment is called the first logical address offset.
  • the user inputs a fourth interface command that carries the first logical address offset to the self-management storage system, and the fourth interface command may be Free (uint64_t offset, uint64_t len), indicating that the user wants to release a segment with an offset as a starting point. Shift, an address space of length len; wherein, the segment address space is the first logical address offset.
  • the self-management storage system searches the chunk table according to the first logical address offset, determines the first chunk to which it belongs, and increases the first logical address offset to the first chunk, and The first logical address offset is marked as idle.
  • the method provided in this embodiment is a byte-by-byte access provided by a user through a self-management storage system.
  • the interface sends a fourth interface command for instructing to release the first logical address offset to the self-managed storage system to increase the first logical address offset to the first chunk, thereby saving the overhead of the logical address space.
  • the self-management storage system in the embodiment of the present invention further provides an interface for initializing a system, an interface for adding and deleting a block device, an interface for uninstalling a named system, and the like; wherein, the interface corresponding to the system is initialized.
  • FIG. 6 is a schematic flowchart of the sixth embodiment of the self-management storage method provided by the present invention.
  • the embodiment provides a method for deleting a storage resource of a host from a management storage system.
  • the specific process of a partial block device. After the above S211, the method further includes:
  • S601 Receive a fifth interface command that is input by the user to indicate that the block device is deleted.
  • the fifth interface command carries the name of the block device to be deleted.
  • S602 Delete the block device corresponding to the name of the block device to be deleted.
  • the user when the user needs to delete a block device from the storage resource of the host, the user inputs a fifth interface command of deleting the block device to the self-management storage system, that is, the user invokes a Del_d eV ( C har* device_name) interface command,
  • the command carries the name of the device to be deleted (device_name), and the self-management storage system searches for the block device according to the block device name in the fifth interface command of the deleted block device, and further determines the physical address space A corresponding to the block device.
  • the logical address space B corresponding to the physical address space A is determined according to the mapping relationship between the logical address and the physical address in the self-managed storage system; after that, the block device with the same speed level as the block device to be deleted is searched from the free physical address space.
  • Physical address space C the data stored on the block device to be deleted is migrated to the physical address space C, and the mapping relationship is modified, that is, the physical address space C and the logical address space B are mapped;
  • the self-managed storage system Deleting the block device to be deleted; wherein the above idle physical location Physical address space did not establish the mapping between the logical address.
  • FIG. 7 is a schematic flowchart of Embodiment 7 of a self-management storage method provided by the present invention, in the foregoing figure
  • the present embodiment provides a specific process for adding a partial block device from the management storage system to the storage resource of the host. After the above S211, the method further includes:
  • S701 Receive a sixth interface command that is input by the user to indicate that the block device is added.
  • the sixth interface command carries the name of the block device to be added.
  • S702 Determine a physical address space of the block device to be added according to the name of the block device to be added, and add a physical address space of the block device to be added to the free physical address space table.
  • the user when the user needs to add a block device to the storage resource of the host (the storage resource of the host includes multiple block devices), the user inputs a sixth interface command for adding the block device to the self-management storage system, that is, the user calls Add_dev (char*).
  • the device_name) interface command the command carries the name of the block device to be added (device_name), and the self-management storage system determines the block device to be added according to the name of the block device to be added, and further determines the block device to be added.
  • the physical address space and the speed level of the physical address space to be added searches for a list of free physical address spaces of the same speed level in the storage resource of the host, and adds the list of free physical address spaces to the list of free physical addresses.
  • the physical address space of the block device wherein the physical addresses in the free physical address space list are not mapped to the logical address.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as ROM, RAM, disk or optical disk.
  • FIG. 8 is a schematic structural diagram of Embodiment 1 of a self-management storage system according to the present invention; as shown in FIG. 8, the system includes: a first receiving module 10, configured to receive a first logical address allocation request sent by a user; The first requesting module 11 is configured to carry a query according to the first logical address type parameter, and obtain a first logical address that satisfies the first logical address type parameter. The first sending module 12 , is used to send the first logical address to the user.
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 9 is a schematic structural diagram of Embodiment 2 of a self-management storage system provided by the present invention.
  • the first logical address type parameter includes a speed requirement parameter, a reliability requirement parameter, and an address length requirement parameter of the user for the first logical address; on the basis of the embodiment shown in FIG.
  • the first obtaining module 11 includes: a query unit 110, configured to query, in the logical address segment chunk table, a first chunk that satisfies the parameter according to the speed requirement and the reliability requirement parameter; wherein all the chunks in the chunk table establish a logical address a mapping relationship between the physical address and the physical address; the determining unit 111 is configured to determine the first logical address according to the address length requirement parameter and the first chunk; and the determining unit 111 is specifically configured to determine whether the length of the free address of the first chunk satisfies the foregoing The address length requirement parameter; if yes, determining the first logical address from the idle address of the first chunk according to the address length requirement parameter; or, if not, creating a second chunk that satisfies the speed requirement parameter and the reliability requirement parameter, and according to The address length requirement parameter determines the first logical address from the second chunk.
  • a query unit 110 configured to query, in the logical address segment chunk table, a first chunk that satisfies the parameter according to the speed
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • the determining unit 111 further includes: a query subunit 1110, configured to query a free physical address space table that is not mapped to a logical address, and determine that the speed requirement parameter is met. a second physical address segment; a generating sub-unit 1111, configured to map the second physical address segment to the second logical address segment according to the foregoing reliability requirement parameter, to generate a second chunk; the determining unit 111 may further include: deleting the subunit The first physical address segment is mapped from the second physical address segment to the second logical address segment according to the foregoing reliability requirement parameter, and the second physical address segment is obtained from the free physical address space table. Delete; the chunk addition subunit 1113 is configured to add the second chunk above to the chunk table, and mark the second chunk as idle.
  • the first receiving module 10 is configured to receive a first interface command of the first logical address that is input by the user, where the first interface command carries the first logical address type parameter.
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 10 is a schematic structural diagram of Embodiment 3 of a self-management storage system according to the present invention.
  • the system further includes: a second receiving module 20, configured to receive, after the first sending module 12 sends the first logical address to the user, the user input for indicating writing
  • the second interface command includes: the second interface command includes the first data to be written and the first logical address; the second obtaining module 21 is configured to search the chunk table according to the first logical address to obtain the first interface a first physical address corresponding to the logical address; a writing module 22, configured to A data is written to the block device corresponding to the first physical address.
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 11 is a schematic structural diagram of Embodiment 4 of a self-management storage system according to the present invention.
  • the system further includes: a third receiving module 30, configured to receive a user. Inputting a third interface command for instructing to read data; wherein the third interface command includes a byte length of the second data to be read and the first logical address; the third obtaining module 31 is configured to A logical address is used to search the chunk table to obtain a first physical address corresponding to the first logical address.
  • the reading module 32 is configured to read the second data of the byte length from the block device corresponding to the first physical address.
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • the system further includes: a fourth receiving module 40, configured to be used in the foregoing After the first sending module 12 sends the first logical address to the user, receiving a fourth interface command input by the user, the fourth interface command includes a first logical address offset to be released, and a determining module 41, configured to The first logical address offset determines a first chunk corresponding to the first logical address offset; and the address adding module 42 is configured to increase the first logical address offset to the first chunk.
  • a fourth receiving module 40 configured to be used in the foregoing After the first sending module 12 sends the first logical address to the user, receiving a fourth interface command input by the user, the fourth interface command includes a first logical address offset to be released, and a determining module 41, configured to The first logical address offset determines a first chunk corresponding to the first logical address offset; and the address adding module 42 is configured to increase the first logical address offset to the first chunk.
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 13 is a schematic structural diagram of Embodiment 6 of a self-management storage system according to the present invention.
  • the system further includes: a fifth receiving module 50, configured to receive a user. The input of the fifth interface command for instructing the deletion of the block device; wherein the fifth interface command carries the name of the block device to be deleted; and the deleting module 51 is configured to delete the block device corresponding to the name of the block device to be deleted. .
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 14 is a schematic structural diagram of Embodiment 7 of the self-management storage system provided by the present invention.
  • the system further includes: a sixth receiving module 60, configured to receive a user. a sixth interface command input to indicate an increase block device; wherein the sixth interface The port command carries the name of the block device to be added; the device adding module 61 is configured to determine a physical address space of the block device to be added according to the name of the block device to be added, and increase the physical address space of the block device to be added to Free physical address space table.
  • the self-management storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • the self-management storage system may be further divided into a logical address allocator, a logical address space management module, and an input/output (I/O) processor according to functional division.
  • the first sending module 12 in the embodiment of the present invention may be a logical address allocator, and the first obtaining module 11, the determining module 41, and the address adding module 42 may be a logical address space management module, and the first acquiring module 11
  • the generating sub-unit 1111 may also be a logical address physical address mapping module; the second obtaining module 21 and the third obtaining module 31 may be a logical address physical address mapping module; the second receiving module 20, the third receiving module 30, and the fourth receiving module 40.
  • the fifth receiving module 50 and the sixth receiving module 60 may be an I/O processor; the deleting module 51 and the device adding module 61 may be a physical block device and a physical space management module; the reading module 32 and the writing module 22 may be Scheduling modules for I/O.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供一种自管理存储方法和系统,该包括:接收用户发送的第一逻辑地址分配请求;其中,所述分配请求中携带第一逻辑地址类型参数;根据所述第一逻辑地址类型参数进行查询,获取满足所述第一逻辑地址类型参数的所述第一逻辑地址;发送所述第一逻辑地址给所述用户。本发明实施例提供的方法,解决了现有技术无法根据用户的存储需求为用户提供相应的存储资源的技术问题。

Description

自管理存储方法和系统
技术领域 本发明实施例涉及通信技术领域,尤其涉及一种自管理存储方法和系统。 背景技术 随着通信技术的不断发展, 计算机的存储资源由多种异构块设备组成 的情况越来越普遍, 这些异构块设备在存储的可靠性以及被访问速度方面 各不相同, 例如: 固态硬盘 (Solid State Drive, 以下简称 SSD) 比硬盘驱 动器 (Hard Disk Drive, 以下简称 HDD) 的速度快, 但 SSD的可靠性低; 又例如: 同样是 HDD, 不同厂商不同型号的 HDD读写速度也不相同; 且不 同级别的独立磁盘冗余阵列 (Redundant Array of Independent Disks, 以下 简称 RAID ) 构建的块设备的可靠性也不尽相同。 因此需要对构成主机存 储资源的多个异构块设备进行统一管理, 以满足用户的访问需求
现有技术中, 通过在虚拟文件系统和公有云存储系统之间构建存储管 理装置和访问异构云存储系统资源的适配器来整合异构的云存储资源, 即 通过适配器对用户提供统一的逻辑抽象层, 并通过存储管理装置管理异构 云存储资源, 使得用户访问异构云存储资源简单方便。
然而现有技术无法根据用户的存储需求为用户提供相应的存储资源。 发明内容
本发明实施例提供一种自管理存储方法和系统, 用以解决现有技术无法 根据用户的存储需求为用户提供相应的存储资源的技术问题。
本发明第一方面提供一种自管理存储方法, 包括:
接收用户发送的第一逻辑地址分配请求; 其中, 所述分配请求中携带第 一逻辑地址类型参数;
根据所述第一逻辑地址类型参数进行查询, 获取满足所述第一逻辑地址 类型参数的所述第一逻辑地址;
发送所述第一逻辑地址给所述用户。
结合第一方面, 在第一方面的第一种可能的实施方式中, 所述第一逻辑 地址类型参数包括所述用户对所述第一逻辑地址的速度要求参数、 可靠性要 求参数以及地址长度要求;则所述根据所述第一逻辑地址类型参数进行查询, 获取满足所述第一逻辑地址类型参数的所述第一逻辑地址, 包括:
在逻辑地址段 chunk表中查询满足根据所述速度要求参数和所述可靠性 要求参数的第一 chunk; 其中, 所述 chunk表中的所有 chunk均建立逻辑地 址和物理地址的映射关系;
根据所述地址长度要求参数和所述第一 chunk确定所述第一逻辑地址。 结合第一方面的第一种可能的实施方式, 在第一方面的第二种可能的实 施方式中, 所述根据所述地址长度要求参数和所述第一 chunk确定所述第一 逻辑地址, 包括:
判断所述第一 chunk 的空闲地址的长度是否满足所述地址长度要求参 数;
若是, 则根据所述地址长度要求参数从所述第一 chunk的空闲地址中确 定所述第一逻辑地址; 或者,
若否, 创建满足所述速度要求参数和可靠性要求参数的第二 chunk , 并 根据所述地址长度要求参数从所述第二 chunk中确定第一逻辑地址。
结合第一方面的第二种可能的实施方式, 在第一方面的第三种可能的实 施方式中, 所述创建满足所述速度要求参数和可靠性要求参数的第二 chunk , 包括:
查询未与所述逻辑地址建立映关系的空闲物理地址空间表, 确定满足所 述速度要求参数的第二物理地址段;
根据所述可靠性要求参数, 将所述第二物理地址段映射到第二逻辑地址 段, 生成所述第二 chunk。
结合第一方面的第三种可能的实施方式, 在第一方面的第四种可能的实 施方式中, 所述根据所述可靠性要求参数, 将所述第二物理地址段映射到第 二逻辑地址段, 生成所述第二 chunk之后, 还包括:
将所述第二物理地址段从所述空闲物理地址空间表中删除;
将所述第二 chunk增加至所述 chunk表中, 并将所述第二 chunk标记为 空闲。
结合第一方面至第一方面的第四种可能的实施方式中的任一项, 在第一 方面的第五种可能的实施方式中, 所述接收用户发送的第一逻辑地址分配请 求, 具体为:
接收所述用户输入的申请所述第一逻辑地址的第一接口命令; 其中, 所 述第一接口命令中携带所述第一逻辑地址类型参数。
结合第一方面至第一方面的第四种可能的实施方式中的任一项, 在第一 方面的第六种可能的实施方式中,在发送所述第一逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示写入数据第二接口命令; 其中, 所述第二 接口命令包括待写入的第一数据和所述第一逻辑地址;
根据所述第一逻辑地址查找所述 chunk表, 获取所述第一逻辑地址对应 的第一物理地址;
将所述第一数据写入所述第一物理地址对应的块设备。
结合第一方面至第一方面的第四种可能的实施方式中的任一项, 在第一 方面的第七种可能的实施方式中,在发送所述第一逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示读取数据的第三接口命令; 其中, 所述第 三接口命令包括待读取的第二数据的字节长度和所述第一逻辑地址;
根据所述第一逻辑地址查找所述 chunk表, 获取所述第一逻辑地址对应 的第一物理地址;
从所述第一物理地址对应的块设备中读取所述字节长度的第二数据。 结合第一方面至第一方面的第四种可能的实施方式中的任一项, 在第一 方面的第八种可能的实施方式中,在发送所述第一逻辑地址给所述用户之后, 还包括:
接收所述用户输入的第四接口命令, 所述第四接口命令包括所要释放的 第一逻辑地址偏移;
根据所述第一逻辑地址偏移查找 chunk表, 确定所述第一逻辑地址偏移 对应的所述第一 chunk;
将所述第一逻辑地址偏移增加至所述第一 chunk。
结合第一方面至第一方面的第四种可能的实施方式中的任一项, 在第一 方面的第九种可能的实施方式中,在发送所述第一逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示删除块设备的第五接口命令; 其中, 所述 第五接口命令携带待删除的块设备的名称;
删除所述待删除的块设备的名称对应的块设备。
结合第一方面至第一方面的第四种可能的实施方式中的任一项, 在第一 方面的第十种可能的实施方式中,在发送所述第一逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示增加块设备的第六接口命令; 其中, 所述 第六接口命令携带待增加的块设备的名称;
根据所述待增加的块设备的名称确定所述待增加的块设备的物理地址空 间, 并将所述待增加的块设备的物理地址空间增加至所述空闲物理地址空间 表。
本发明第二方面提供一种自管理存储系统, 包括:
第一接收模块, 用于接收用户发送的第一逻辑地址分配请求; 其中, 所 述分配请求中携带第一逻辑地址类型参数;
第一获取模块, 用于根据所述第一逻辑地址类型参数进行查询, 获取满 足所述第一逻辑地址类型参数的所述第一逻辑地址;
第一发送模块, 用于发送所述第一逻辑地址给所述用户。
结合第二方面, 在第二方面的第一种可能的实施方式中, 所述第一逻辑 地址类型参数包括所述用户对所述第一逻辑地址的速度要求参数、 可靠性要 求参数以及地址长度要求参数; 则所述第一获取模块包括:
查询单元, 用于在逻辑地址段 chunk表中查询满足根据所述速度要求参 数和所述可靠性要求参数的第一 chunk; 其中, 所述 chunk表中的所有 chunk 均建立逻辑地址和物理地址的映射关系;
确定单元, 用于根据所述地址长度要求参数和所述第一 chunk确定所述 第一逻辑地址。
结合第二方面的第一种可能的实施方式, 在第二方面的第二种可能的实 施方式中, 所述确定单元具体用于判断所述第一 chunk的空闲地址的长度是 否满足所述地址长度要求参数;
若是, 则根据所述地址长度要求参数从所述第一 chunk的空闲地址中确 定所述第一逻辑地址; 或者,
若否, 创建满足所述速度要求参数和可靠性要求参数的第二 chunk , 并 根据所述地址长度要求参数从所述第二 chunk中确定第一逻辑地址。
结合第二方面的第二种可能的实施方式, 在第二方面的第三种可能的实 施方式中, 所述确定单元包括:
查询子单元, 用于查询未与所述逻辑地址建立映关系的空闲物理地址空 间表, 确定满足所述速度要求参数的第二物理地址段;
生成子单元, 用于根据所述可靠性要求参数, 将所述第二物理地址段映 射到第二逻辑地址段, 生成所述第二 chunk。
结合第二方面的第三种可能的实施方式, 在第二方面的第四种可能的实 施方式中, 所述确定单元还包括:
删除子单元, 用于在所述生成子单元根据所述可靠性要求参数, 将所述 第二物理地址段映射到第二逻辑地址段, 生成所述第二 chunk之后, 将所述 第二物理地址段从所述空闲物理地址空间表中删除;
chunk增加子单元, 用于将所述第二 chunk增加至所述 chunk表中, 并 将所述第二 chunk标记为空闲。
结合第二方面至第二方面的第四种可能的实施方式中的任一项, 在第二 方面的第五种可能的实施方式中, 所述第一接收模块具体用于接收所述用户 输入的申请所述第一逻辑地址的第一接口命令; 其中, 所述第一接口命令中 携带所述第一逻辑地址类型参数。
结合第二方面至第二方面的第四种可能的实施方式中的任一项, 在第二 方面的第六种可能的实施方式中, 所述系统还包括:
第二接收模块, 用于在所述第一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的用于指示写入数据第二接口命令; 其中, 所 述第二接口命令包括待写入的第一数据和所述第一逻辑地址;
第二获取模块, 用于根据所述第一逻辑地址查找所述 chunk表, 获取所 述第一逻辑地址对应的第一物理地址;
写入模块, 用于将所述第一数据写入所述第一物理地址对应的块设备。 结合第二方面至第二方面的第四种可能的实施方式中的任一项, 在第二 方面的第七种可能的实施方式中, 所述系统还包括: ;三接收模块, 用于接收所述用户输入的用于指示读取数据的第三接口 命令; 其中, 所述第三接口命令包括待读取的第二数据的字节长度和所述第 一逻辑地址;
第三获取模块, 用于根据所述第一逻辑地址查找所述 chunk表, 获取所 述第一逻辑地址对应的第一物理地址;
读取模块, 用于从所述第一 ?理地址对应的块设备中读取所述字节长度 的第二数据。
结合第二方面至第二方面的 四种可能的实施方式中的任一项, 在第二 方面的第八种可能的实施方式中 所述系统还包括:
第四接收模块, 用于在所述 一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的 四接口命令, 所述第四接口命令包括所要 释放的第一逻辑地址偏移;
确定模块, 用于根据所述第
Figure imgf000007_0001
对应的所述第一 chunk;
地址添加模块, 用于将所述: 一逻辑地址偏移增加至所述; chunk 结合第二方面至第二方面的 四种可能的实施方式中
Figure imgf000007_0002
方面的第九种可能的实施方式中 所述系统还包括:
第五接收模块, 用于在所述 一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的用于指示删除块设备的第五接口命令; 其中, 所述第五接口命令携带待删除的块设备的名称;
删除模块, 用于删除所述待删除的块设备的名称对应的块设备。
结合第二方面至第二方面的第四种可能的实施方式中的任一项, 在第二 方面的第十种可能的实施方式中, 所述系统还包括:
第六接收模块, 用于在所述第一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的用于指示增加块设备的第六接口命令; 其中, 所述第六接口命令携带待增加的块设备的名称;
设备增加模块, 用于根据所述待增加的块设备的名称确定所述待增加的 块设备的物理地址空间, 并将所述待增加的块设备的物理地址空间增加至所 述空闲物理地址空间表。
本发明实施例提供了一种自管理存储方法和系统, 通过接收用户在分配 请求中所携带第一逻辑地址类型参数, 并根据该第一逻辑地址类型参数进行 查询以获取满足该第一逻辑地址类型参数的第一逻辑地址, 将第一逻辑地址 发送给用户, 使得用户可以根据自身的存储需求获取相应的存储资源, 进而 确保存储资源能够按需分配给用户。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下 面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在 不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。 图 1为本发明提供的自 :理存储方法实施例一的流程
图 2为本发明提供的自 :理存储方法实施例二的流程
图 3为本发明提供的自 :理存储方法实施例三的流程
图 4为本发明提供的自 :理存储方法实施例四的流程
图 5为本发明提供的自 :理存储方法实施例五的流程
图 6为本发明提供的自 :理存储方法实施例六的流程
图 7为本发明提供的自 :理存储方法实施例七的流程
图 8为本发明提供的自 :理存储系统实施例一的结柊小
图 9为本发明提供的自 :理存储系统实施例二的结柊小
图 10为本发明提供的自 理存储系统实施例三的结构
图 11为本发明提供的自 理存储系统实施例四的结构
图 12为本发明提供的自 理存储系统实施例五的结构
图 13为本发明提供的自 理存储系统实施例六的结构
图 14为本发明提供的自 理存储系统实施例七的结构小 具体实施方式
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发 明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于 本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获 得的所有其他实施例, 都属于本发明保护的范围。
图 1为本发明提供的自管理存储方法实施例一的流程示意图, 本发明实 施例提供了用户根据自身的存储需求获取相应的存储资源的过程。 本发明实 施例的执行主体可以为自管理存储系统,该自管理存储系统可以位于主机中。 该方法包括:
S101 : 接收用户发送的第一逻辑地址分配请求; 其中, 该分配请求中携 带第一逻辑地址类型参数。
本发明实施例中的自管理存储系统处于主机的文件系统和通用块层之间 (这里的文件系统还可以是其他的上层系统, 例如: 键值(Key-Value)存储 系统, 本发明对此不做限制) , 通用块层之下连接的是多个块设备和块设备 的驱动程序; 自管理存储系统可以将物理块设备组织起来, 面向用户提供统 一的逻辑地址和按字节访问的接口, 并且上述逻辑地址与块设备的物理地址 有一定的映射关系。
具体的, 当用户需要申请第一逻辑地址时, 便向自管理存储系统发送第 一逻辑地址分配请求, 该分配请求携带第一逻辑地址类型参数, 该第一逻辑 地址类型参数即用户对所申请的第一逻辑地址的存储要求。 其中, 上述第一 逻辑地址可以是一个逻辑地址段, 还可以只是一个单独的逻辑地址, 本发明 实施例对此不做限制; 上述第一逻辑地址类型参数可以是用户对第一逻辑地 址的速度级别的要求参数、 对第一逻辑地址存储数据时的可靠性级别的要求 参数以及对第一逻辑地址的地址长度的要求参数中的至少一种参数。
S102 : 根据第一逻辑地址类型参数进行査询, 获取满足第一逻辑地址类 型参数的第一逻辑地址。
S103: 发送第一逻辑地址给用户。
具体的, 自管理存储系统根据上述用户对所要获取的第一逻辑地址的第 一逻辑地址类型参数进行查询, 以获取满足上述第一逻辑地址类型参数的第 一逻辑地址, 并将该逻辑地址分配给用户, 同时将第一逻辑地址标记为已分 配; 由于所获取的第一逻辑地址已经和通用块层下的多个块设备的物理地址 建立了相应的映射关系, 因此当用户获取到第一逻辑地址之后, 若要向该第 一逻辑地址写入数据, 则自管理存储系统会根据上述映射关系查找到与该第 一逻辑地址对应的物理地址, 进而找到该物理地址对应的块设备, 将数据写 入该块设备。
本发明实施例提供的方法, 通过接收用户在分配请求中所携带第一逻辑 地址类型参数, 并根据该第一逻辑地址类型参数进行查询以获取满足该第一 逻辑地址类型参数的第一逻辑地址, 将第一逻辑地址发送给用户, 使得用户 可以根据自身的存储需求获取相应的存储资源, 进而确保存储资源能够按需 分配给用户。 进一歩地, 上述第一逻辑地址类型参数可以包括用户对上述第一逻辑地 址的速度要求参数、 可靠性要求参数以及地址长度要求参数; 在图 1所示实 施例的基础上, 作为本发明的一种可行的实施方式, 本实施例提供了自管理 存储系统根据第一逻辑地址类型参数获取第一逻辑地址的具体过程。 即上述
S 102 具体包括: 在逻辑地址段 (chunk ) 表中查询满足根据上述速度要求参 数和可靠性要求参数的第一 chunk; 其中, 该 chunk表中的所有 chunk均建 立逻辑地址和物理地址的映射关系; 根据地址长度要求参数和第一 chunk确 定第一逻辑地址。
具体的, 自管理存储系统根据用户对所要申请的第一逻辑地址的速度要 求参数和可靠性要求参数在 chunk表中进行查询, 以获取符合上述速度要求 参数和可靠性要求参数的第一 chunk ; 其中, chunk 表中包含了至少一个 chunk, chunk表中的所有 chunk均建立了逻辑地址和物理地址的映射关系; 且一个 chunk即为与块设备的物理地址建立了映射关系的一段逻辑地址。
在自管理存储系统确定符合上述用户对第一逻辑地址的速度要求和可靠 性要求的第一 chunk之后, 根据用户对第一逻辑地址的地址长度要求参数, 在第一 chunk中确定与该地址长度要求参数相匹配的一段逻辑地址, 作为第 一逻辑地址。
进一歩地, 在上述实施例的基础上, 本实施例进一歩提供了上述根据地 址长度要求参数和所述第一 chunk确定第一逻辑地址的具体流程, 具体为: 判断第一 chunk的空闲地址的长度是否满足所述地址长度要求参数; 若是, 则根据上述地址长度要求参数从上述第一 chunk的空闲地址中确定第一逻辑 地址; 或者, 若否, 创建满足上述速度要求参数和可靠性要求参数的第二 chunk, 并根据上述地址长度要求参数从第二 chunk中确定第一逻辑地址。 具体的, 在自管理存储系统确定符合上述用户对第一逻辑地址的速度要 求参数和可靠性要求参数的第一 chunk之后, 会根据用户对第一逻辑地址的 地址长度要求参数判断第一 chunk中的空闲的地址长度是否满足该地址长度 要求; 需要注意的是, 自管理存储系统自身可以预知上述 chunk表中的所有 chunk的地址是空闲状态或者是已分配的状态; 当第一 chunk中的空闲地址 的长度满足地址长度要求参数时 (即第一 chunk中的空闲地址的长度大于等 于上述地址长度要求所规定的地址长度) , 自管理存储系统将从第一 chunk 的空闲地址中确定与上述地址长度要求参数相匹配的一段逻辑地址, 作为第 一逻辑地址; 或者, 当第一 chunk中的空闲地址的长度不满足地址长度要求 参数时 (即第一 chunk中的空闲地址的长度小于上述地址长度要求参数所规 定的地址长度) , 自管理存储系统就需要根据用户对第一逻辑地址的速度参 数和可靠性要求参数建立第二 chunk, 并从第二 chunk中确定与上述地址长 度要求参数相匹配的一段逻辑地址, 作为第一逻辑地址。 在上述实施例的基础上, 作为本发明实施例的另一种可行的实施方式, 本实施提供了第二 chunk的具体创建过程。 该方法包括: 查询未与逻辑地址 建立映关系的空闲物理地址空间表, 确定满足上述速度要求参数的第二物理 地址段; 根据上述可靠性要求参数, 将第二物理地址段映射到第二逻辑地址 段, 生成第二 chunk; 将上述第二物理地址段从上述空闲物理地址空间表中 删除; 将第二 chunk增加至上述 chunk表中, 并将第二 chunk标记为空闲。
具体的, 自管理存储系统在判断第一 chunk的空闲地址的长度不满足上 述用户的地址长度要求参数时, 在自管理存储系统的所有地址空间中查找未 与块设备的物理地址建立映射关系的空闲物理地址空间表, 在该空闲物理地 址空间表中确定满足上述速度要求参数的第二物理地址段。
根据用户对第一逻辑地址的可靠性要求参数将上述第二物理地址段映射 到相应的第二逻辑地址, 例如: 假设用户发送给自管理存储系统的对第一逻 辑地址的可靠性要求参数为一份数据存储 2个副本, 此处也假设第二物理地 址段的长度为 20GB,则自管理存储系统根据该可靠性要求参数构建相应级别 的 RAID, 再通过 RAID建立第二物理地址段与第二逻辑地址段的映射; 因此, 所映射的第二逻辑地址段的长度就为 10GB, 也就是在第二逻辑地址段的某一 个逻辑地址上存的数据, 可以从第二物理地址段中分配两个对应的物理地址 存储该数据。 同时, 已经与第二物理地址段建立了映射关系的第二逻辑地址 段即为第二 chunk。
之后, 自管理存储系统将上述第二物理地址段从原来的空闲物理地址空 间表中删除, 并将上述所创建的第二 chunk增加至之前的 chunk表中, 且将 第二 chunk标记为空闲状态, 以使自管理存储系统可以根据上述地址长度要 求从该第二 chunk中确定第一逻辑地址。
需要注意的是, 上述实施例中自管理存储系统接收用户发送的第一逻辑 地址分配请求可以为用户在自管理存储系统调用第一接口命令, 该第一接口 命令中携带第一逻辑地址类型参数, 且该第一接口命令可以使得用户向自管 理存储系统申请符合第一逻辑地址类型参数的第一逻辑地址。 该第一接口命 令可以为 Alloc(uint64_t alloc— size, int reliability— level, int speed— level, uint64—t result— offset/* output*/),含义为申请分配一段大小为 alloc— size的第一 逻辑地址, 该第一逻辑地址的可靠性要求参数和速度要求参数分别为 reliability— level和 speed— leve, 申请成功后的第一逻辑地址存入 result— offset。 图 2为本发明提供的自管理存储方法实施例二的流程示意图。 本发明实 施例的执行主体可以为自管理存储系统。 本实施例提供了用户获取满足第一 逻辑地址类型参数的第一逻辑地址的整体过程。 该方法具体包括:
S201 : 接收用户输入的申请第一逻辑地址的第一接口命令; 其中, 该第 一接口命令中携带第一逻辑地址类型参数, 且该第一逻辑地址类型参数包括 用户对第一逻辑地址的速度要求参数、 可靠性要求参数以及地址长度要求参 数。
用户在自管理存储系统中调用用于申请第一逻辑地址的第一接口命令, 该第一接口命令携带第一逻辑地址类型参数, 该第一逻辑地址类型参数可以 为用户对第一逻辑地址的速度要求参数、 可靠性要求参数以及地址长度要求 参数。 其中, 上述第一接口命令可以是 Alloc(uint64— t alloc— size, int reliability— level, int speed— level, uint64_t result—offset/* output*/), 含义为申请分 配一段大小为 alloc— size的第一逻辑地址,该第一逻辑地址的可靠性要求参数 和速度要求参数分别为 reliability— level和 speed— leve,申请成功后的第一逻辑 地址存入 result— offset。
S202: 在逻辑地址段 chunk表中查询满足根据上述速度要求参数和可靠 性要求参数的第一 chunk; 其中, 该 chunk表中的所有 chunk均建立逻辑地 址和物理地址的映射关系。
S203: 判断上述第一 chunk的空闲地址的长度是否满足上述地址长度要 求参数; 若是, 则执行 S204; 若否, 则执行 S206。
具体的, 自管理存储系统根据用户对所要申请的第一逻辑地址的速度要 求和可靠性要求在 chunk表中进行查询, 以获取符合上述速度要求参数和可 靠性要求参数的第一 chunk; 其中, chunk表中包含了至少一个 chunk, chunk 表中的所有 chunk均建立了逻辑地址和物理地址的映射关系; 且一个 chunk 即为与块设备的物理地址建立了映射关系的一段逻辑地址。
在自管理存储系统确定符合上述用户对第一逻辑地址的速度要求和可靠 性要求的第一 chunk之后, 会根据用户对第一逻辑地址的地址长度要求参数 判断第一 chunk中的空闲的地址长度是否满足该地址长度要求参数; 需要注 意的是, 自管理存储系统自身可以预知上述 chunk表中的所有 chunk的地址 是空闲状态或者是已分配的状态。
S204: 根据上述地址长度要求参数从第一 chunk的空闲地址中确定第一 逻辑地址。
S205: 将第一逻辑地址分配给用户。 结束流程。
具体的,当第一 chunk中的空闲地址的长度满足地址长度要求参数时(即 第一 chunk中的空闲地址的长度大于等于上述地址长度要求所规定的地址长 度) , 自管理存储系统将从第一 chunk的空闲地址中确定与上述地址长度要 求参数相匹配的一段逻辑地址, 作为第一逻辑地址。
自管理存储系统将上述确定的第一逻辑地址分配给用户, 当用户获取到 第一逻辑地址之后, 若要向该第一逻辑地址写入数据, 则自管理存储系统会 根据上述映射关系查找到与该第一逻辑地址对应的物理地址, 进而找到该物 理地址对应的块设备, 将数据写入该块设备。
S206: 查询未与逻辑地址建立映关系的空闲物理地址空间表, 确定满足 上述速度要求参数的第二物理地址段。 S207: 根据上述可靠性要求参数, 将第二物理地址段映射到第二逻辑地 址段, 生成第二 clnmk。
S208: 将第二物理地址段从空闲物理地址空间表中删除。
S209: 将第二 chunk增加至上述 chunk表中, 并将第二 chunk标记为空 闲。
S210: 根据上述地址长度要求参数从第二 chunk中确定第一逻辑地址。 执行 S205 , 结束流程。
具体的, 自管理存储系统在判断第一 chunk的空闲地址的长度不满足上 述用户的地址长度要求参数时, 在自管理存储系统的所有地址空间中查找未 与块设备的物理地址建立映射关系的空闲物理地址空间表, 在该空闲物理地 址空间表中确定满足上述速度要求的第二物理地址段。
根据用户对第一逻辑地址的可靠性要求参数将上述第二物理地址段映射 到相应的第二逻辑地址, 例如: 假设用户发送给自管理存储系统的对第一逻 辑地址的可靠性要求为一份数据存储 2个副本, 此处也假设第二物理地址段 的长度为 20GB,则自管理存储系统根据该可靠性要求参数构建相应级别的 RAID, 再通过 RAID建立第二物理地址段与第二逻辑地址段的映射; 因此, 所 映射的第二逻辑地址段的长度就为 10GB, 也就是在第二逻辑地址段的某一个 逻辑地址上存的数据, 可以从第二物理地址段中分配两个对应的物理地址存 储该数据。 同时, 已经与第二物理地址段建立了映射关系的第二逻辑地址段 g卩为第二 chunk o
之后, 自管理存储系统将上述第二物理地址段从原来的空闲物理地址空 间表中删除, 并将上述所创建的第二 chunk增加至之前的 chunk表中, 且将 第二 chunk标记为空闲状态, 以使自管理存储系统可以根据上述地址长度要 求参数从该第二 chunk中确定第一逻辑地址。
本发明实施例提供的方法, 通过接收用户在分配请求中所携带的第一逻 辑地址类型参数, 并根据该第一逻辑地址类型参数进行查询以获取满足该第 一逻辑地址类型参数的第一逻辑地址, 将第一逻辑地址发送给用户, 使得用 户可以根据自身的存储需求获取相应的存储资源, 进而确保存储资源能够按 需分配; 同时, 由于自管理存储系统中的所有地址空间由自管理系统自身管 理, 简化了上层系统管理地址空间的负担; 另一方面, 通过动态创建物理地 址到逻辑地址的映射关系 (即创建第二 chunk的过程) , 实现了自管理存储 系统的扩容。
图 3为本发明提供的自管理存储方法实施例三的流程示意图, 在上述图 2 所示实施例的基础上, 进一歩地, 本实施例提供了用户将数据写入自管理 存储系统的流程。 在上述 S211之后, 还包括:
S301 : 接收用户输入的用于指示写入数据的第二接口命令; 该第二接口 命令包括待写入的第一数据和第一逻辑地址。
S302 : 根据第一逻辑地址查找 chunk表, 获取第一逻辑地址对应的第一 物理地址。
S303 : 将上述第一数据写入第一物理地址对应的块设备。
具体的, 本实施例中的自管理存储系统给用户提供按字节访问的写数据 接口, 用户通过调用该接口实现相应的操作, 具体为: 用户发送携带待写入 的第一数据和第一逻辑地址的第二接口命令给自管理存储系统, 表示用户要 将第一数据写入第一逻辑地址中。 需要注意的是, 自管理存储系统面向用户 的只是逻辑地址, 即对于用户来说, 只知道将第一数据写入第一逻辑地址, 而实际上自管理存储系统是将该第一数据写入与第一逻辑地址对应的块设备 中。
上述第二接口命令可以为 Write (uint64—t offset, char* buf , uint64_t len), 表示将自管理存储系统所属主机内存 buf 中 len字节长度的第一数据 写入从 offset地址开始的 len长度的存储空间内,该存储空间即为第一逻辑 地址; 自管理存储系统在接收到上述第二接口命令时, 根据所获知的第一逻 辑地址查找 chunk表, 以获得该第一逻辑地址所在的第一 chunk, 并在第一 chunk 中根据所建立的逻辑地址和物理地址的映射关系, 查找到与第一逻辑 地址对应的第一物理地址; 最后, 自管理存储系统将上述 buf 中 len字节长 度的第一数据写入第一物理地址对应的块设备中。
为了能够明确体现出本实施例的有益效果, 此处对现有技术做一简单介 绍, 具体为: 现有技术中, 块设备的访问力度是以块为单位的, 一个块设备 的大小为 4K个字节, 即用户在访问该块设备时只能将 4K个字节作为一个整 体; 当上层文件系统需要给块设备中写入几十个字节的数据时, 现有技术中 的存储系统仍然会将整个块设备提供给用户, 造成块设备空间的浪费; 另一 方面, 上层文件系统为了能将上述几十个字节的数据写入块设备, 还需要从 其他磁盘中取出部分字节的数据, 并将该部分字节的数据标记为无效, 目的 是为了将标记为无效的部分字节数据和前述要写入的几十个字节的数据结合 生成 4K个字节的数据写入块设备中, 即需要上层文件系统处理块对齐的问 题。 但是, 本实施例中只需用户调用自管理存储系统提供的写数据接口, 就 可以将这几十个字节的数据直接写入块设备。
本实施例提供的方法, 用户通过自管理存储系统所提供的按字节访问的 接口, 向自管理存储系统发送用于指示写入数据的第二接口命令, 使得该自 管理存储系统的上层系统无需处理块对齐的问题, 进而节约块设备的存储空 间。
图 4为本发明提供的自管理存储方法实施例四的流程示意图, 在上述图 2 所示实施例的基础上, 进一歩地, 本实施例提供了用户从第一逻辑地址读 取数据的流程。 在上述 S211之后, 还包括:
S401 : 接收用户输入的用于指示读取数据的第三接口命令; 该第三接口 命令包括待读取的第二数据的字节长度和第一逻辑地址。
S402: 根据第一逻辑地址查找 chunk表, 获取第一逻辑地址对应的第一 物理地址。
S403: 从第一物理地址对应的块设备中读取上述字节长度的第二数据。 具体的, 本实施例中的自管理存储系统给用户提供按字节访问的读数据 接口, 用户通过调用该接口实现相应的操作, 具体为: 用户发送携带待读取 的第二数据的字节长度和第一逻辑地址的第三接口命令给自管理存储系统, 表示用户要从第一逻辑地址中读取该字节长度的第二数据。 需要注意的是, 自管理存储系统面向用户的只是逻辑地址, 即对于用户来说, 只知道第二数 据存储在第一逻辑地址中, 然后从第一逻辑地址中读取第二数据, 而实际上 自管理存储系统中的第二数据存储在第一逻辑地址对应的块设备中, 当用户 输入第一逻辑地址时, 自管理存储系统根据该第一逻辑地址查找上述 chunk 表, 以获得该第一逻辑地址所在的第一 chunk, 并在第一 chunk中根据所建 立的逻辑地址和物理地址的映射关系, 查找到与第一逻辑地址对应的第一物 理地址; 最后, 自管理存储系统从第一物理地址对应的块设备中读取对应字 节长度的第二数据发送给用户。 需要注意的是, 上述第三接口命令可以为 Read (uint64_t offset, char* buf, uint64_t len),标识从 offset地址起读取 len字节的数据存入 buf 中; 其中, 第一逻辑地址为以 offset为起始地址, 以 offset+len为截止地址的 这一段逻辑地址。
现有技术在读取数据时, 若用户需要读取几十个字节的数据, 现有的上 层文件系统仍然会指示存储系统提供 4K个字节的数据给用户,增加了现有存 储系统的开销。
本实施例提供的方法, 用户通过自管理存储系统所提供的按字节访问的 接口, 向自管理存储系统发送用于指示读取数据的第三接口命令, 使得该自 管理存储系统的上层系统无需处理块对齐的问题, 节约系统开销。
图 5为本发明提供的自管理存储方法实施例五的流程示意图, 在上述图 2所示实施例的基础上, 进一歩地, 本实施例提供了用户释放一段逻辑地址, 并将该段逻辑地址增加至第一 chunk的过程。 在上述 S211之后, 还包括:
S501 : 接收用户输入的第四接口命令, 该第四接口命令包括所要释放的 第一逻辑地址偏移。
S502 : 根据第一逻辑地址偏移确定该第一逻辑地址偏移对应的第一 chunk
S503 : 将上述第一逻辑地址偏移增加至所述第一 chunk。
具体的, 本实施例中的自管理存储系统给用户提供按字节访问的释放地 址空间的接口, 当用户所申请的第一逻辑地址中某一段逻辑地址不经常使用 甚至用户基本不使用时, 用户会调用自管理存储系统提供的释放地址空间的 接口, 将该段逻辑地址释放回自管理存储系统中, 该段逻辑地址称为第一逻 辑地址偏移。 具体为: 用户输入携带第一逻辑地址偏移的第四接口命令给自 管理存储系统, 该第四接口命令可以为 Free (uint64_t offset, uint64_t len), 表示用户要释放一段以 offset为起始偏移, 长度为 len的地址空间; 其中, 该段地址空间即为第一逻辑地址偏移。
自管理存储系统在接收到第四接口命令时, 根据上述第一逻辑地址偏移 查找 chunk表, 确定其所属的第一 chunk, 并将该第一逻辑地址偏移增加至 第一 chunk, 并将该第一逻辑地址偏移标记为空闲。
本实施例提供的方法, 用户通过自管理存储系统所提供的按字节访问的 接口, 向自管理存储系统发送用于指示释放第一逻辑地址偏移的第四接口命 令, 以将第一逻辑地址偏移增加至第一 chunk, 进而节约逻辑地址空间的开 销。
除此之外,本发明实施例中的自管理存储系统还提供了初始化系统接口、 增加和删除块设备的接口、 卸载某命名的系统的接口等; 其中, 初始化系统 接□对应的接□命令为 Create (char** devicel ist , char* sys_name) , 表 示依据所给设备链表的块设备, 创建并初始化整个系统, 将此系统命名为 sys_name;增加块设备接口对应的接口命令为 Add_dev (char* device_name), 表示往系统中增加名字为 device—name块设备; 删除块设备接口对应的接口 命令为 Del_dev (char氺 device—name),表示从系统中删除名字为 device—name 块设备; 卸载某命名的系统的接口对应的接口命令为 DeStroy (Char* sys_name) , 表示关闭并卸载名字为 sys_name的系统并释放内存资源。
图 6为本发明提供的自管理存储方法实施例六的流程示意图, 在上述图 2 所示实施例的基础上, 进一歩地, 本实施例提供了自管理存储系统删除主 机的存储资源中的部分块设备的具体过程。 在上述 S211之后, 还包括:
S601 : 接收用户输入的用于指示删除块设备的第五接口命令; 其中, 该 第五接口命令携带待删除的块设备的名称。
S602 : 删除上述待删除的块设备的名称对应的块设备。
具体的, 当用户需要从主机的存储资源中删除某一个块设备时, 用户向 自管理存储系统输入删除块设备的第五接口命令,即用户调用 Del_deV (Char* device_name)接口命令, 该命令携带了待删除设备的名称 (device_name ) , 则自管理存储系统会根据该删除块设备的第五接口命令中的块设备名称查找 该块设备, 进而确定该块设备对应的物理地址空间 A , 然后根据自管理存储 系统中逻辑地址和物理地址的映射关系确定与该物理地址空间 A对应的逻辑 地址空间 B; 之后, 从空闲物理地址空间中査找与待删除块设备的速度级别 相同的块设备的物理地址空间 C , 将待删除块设备上存储的数据迁移至该物 理地址空间 C, 并将映射关系进行修改, 即将物理地址空间 C与逻辑地址空 间 B建立映射关系; 最后, 自管理存储系统将该待删除的块设备进行删除; 其中,上述空闲物理地址空间中的物理地址均没有与逻辑地址建立映射关系。
图 7为本发明提供的自管理存储方法实施例七的流程示意图, 在上述图 2 所示实施例的基础上, 进一歩地, 本实施例提供了自管理存储系统往主机 的存储资源中增加部分块设备的具体过程。 在上述 S211之后, 还包括:
S701 : 接收用户输入的用于指示增加块设备的第六接口命令; 其中, 该 第六接口命令携带待增加的块设备的名称。
S702 :根据待增加的块设备的名称确定待增加的块设备的物理地址空间, 并将待增加的块设备的物理地址空间增加至上述空闲物理地址空间表。
具体的, 在用户需要往主机的存储资源增加块设备时 (主机的存储资源 包括多个块设备), 用户向自管理存储系统输入增加块设备的第六接口命令, 即用户调用 Add_dev (char* device_name)接口命令, 该命令携带了待增加的 块设备的名称(device—name ) , 自管理存储系统根据该待增加的块设备的名 称确定待增加的块设备, 进而确定待增加的块设备的物理地址空间以及该待 增加的物理地址空间的速度级别, 则自管理存储系统在主机的存储资源中寻 找与之相同的速度级别的空闲物理地址空间列表, 并在该空闲物理地址空间 列表中增加该块设备的物理地址空间; 其中, 上述空闲物理地址空间列表中 的物理地址均没有与逻辑地址建立映射关系。
本领域普通技术人员可以理解: 实现上述各方法实施例的全部或部分歩 骤可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算机可 读取存储介质中。 该程序在执行时, 执行包括上述各方法实施例的歩骤; 而 前述的存储介质包括: R0M、 RAM, 磁碟或者光盘等各种可以存储程序代码的 介质。
图 8为本发明提供的自管理存储系统实施例一的结构示意图; 如图 8所 示, 该系统包括: 第一接收模块 10, 用于接收用户发送的第一逻辑地址分配 请求; 其中, 上述分配请求中携带第一逻辑地址类型参数; 第一获取模块 11, 用于根据上述第一逻辑地址类型参数进行查询, 获取满足该第一逻辑地址类 型参数的第一逻辑地址; 第一发送模块 12, 用于发送第一逻辑地址给用户。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
图 9为本发明提供的自管理存储系统实施例二的结构示意图。进一歩地, 上述第一逻辑地址类型参数包括所述用户对所述第一逻辑地址的速度要求参 数、 可靠性要求参数以及地址长度要求参数; 在图 8所示实施例的基础上, 上述第一获取模块 11包括: 查询单元 110, 用于在逻辑地址段 chunk表中查 询满足根据速度要求参数和可靠性要求参数的第一 chunk; 其中, 上述 chunk 表中的所有 chunk均建立逻辑地址和物理地址的映射关系; 确定单元 111, 用于根据上述地址长度要求参数和第一 chunk确定第一逻辑地址; 并且, 上 述确定单元 111具体用于判断第一 chunk的空闲地址的长度是否满足上述地 址长度要求参数; 若是, 则根据地址长度要求参数从第一 chunk的空闲地址 中确定第一逻辑地址; 或者, 若否, 创建满足上述速度要求参数和可靠性要 求参数的第二 chunk, 并根据地址长度要求参数从第二 chunk中确定第一逻 辑地址。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
在上述图 9所示实施例的基础上, 进一步地, 上述确定单元 111包括: 查询子单元 1110,用于查询未与逻辑地址建立映关系的空闲物理地址空间表, 确定满足上述速度要求参数的第二物理地址段; 生成子单元 1111, 用于根据 上述可靠性要求参数, 将第二物理地址段映射到第二逻辑地址段, 生成第二 chunk; 上述确定单元 111还可以包括: 删除子单元 1112, 用于在上述生成 子单元 1111根据上述可靠性要求参数,将第二物理地址段映射到第二逻辑地 址段, 生成第二 chunk之后, 将第二物理地址段从空闲物理地址空间表中删 除; chunk增加子单元 1113, 用于将上述第二 chunk增加至 chunk表中, 并 将第二 chunk标记为空闲。
同时,上述第一接收模块 10具体用于接收用户输入的申请第一逻辑地址 的第一接口命令; 其中, 该第一接口命令中携带第一逻辑地址类型参数。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
图 10为本发明提供的自管理存储系统实施例三的结构示意图,在上述图
9所示实施例的基础上, 进一歩地, 该系统还可以包括: 第二接收模块 20, 用于在第一发送模块 12发送第一逻辑地址给用户之后,接收用户输入的用于 指示写入数据第二接口命令; 其中, 该第二接口命令包括待写入的第一数据 和第一逻辑地址; 第二获取模块 21, 用于根据上述第一逻辑地址查找上述 chunk表, 获取第一逻辑地址对应的第一物理地址; 写入模块 22, 用于将第 一数据写入第一物理地址对应的块设备。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
图 11为本发明提供的自管理存储系统实施例四的结构示意图,在上述图 9所示实施例的基础上, 进一歩地, 该系统还可以包括: 第三接收模块 30, 用于接收用户输入的用于指示读取数据的第三接口命令; 其中, 该第三接口 命令包括待读取的第二数据的字节长度和上述第一逻辑地址; 第三获取模块 31, 用于根据第一逻辑地址查找所述 chunk表, 获取第一逻辑地址对应的第 一物理地址; 读取模块 32, 用于从第一物理地址对应的块设备中读取上述字 节长度的第二数据。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
图 12为本发明提供的自管理存储系统实施例五的结构示意图,在上述图 9所示实施例的基础上, 进一歩地, 该系统还可以包括: 第四接收模块 40, 用于在上述第一发送模块 12发送所述第一逻辑地址给所述用户之后,接收用 户输入的第四接口命令,该第四接口命令包括所要释放的第一逻辑地址偏移; 确定模块 41, 用于根据第一逻辑地址偏移确定上述第一逻辑地址偏移对应的 第一 chunk; 地址添加模块 42, 用于将第一逻辑地址偏移增加至第一 chunk。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
图 13为本发明提供的自管理存储系统实施例六的结构示意图,在上述图 9所示实施例的基础上, 进一歩地, 该系统还可以包括: 第五接收模块 50, 用于接收用户输入的用于指示删除块设备的第五接口命令; 其中, 该第五接 口命令携带待删除的块设备的名称; 删除模块 51, 用于删除所述待删除的块 设备的名称对应的块设备。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
图 14为本发明提供的自管理存储系统实施例七的结构示意图,在上述图 9所示实施例的基础上, 进一歩地, 该系统还可以包括: 第六接收模块 60, 用于接收用户输入的用于指示增加块设备的第六接口命令; 其中, 该第六接 口命令携带待增加的块设备的名称; 设备增加模块 61, 用于根据待增加的块 设备的名称确定待增加的块设备的物理地址空间, 并将待增加的块设备的物 理地址空间增加至空闲物理地址空间表。
本发明实施例提供的自管理存储系统可以执行上述方法实施例, 其实现 原理和技术效果类似, 在此不再赘述。
需要注意的是, 本发明实施例提供的自管理存储系统按照功能划分还可 以划分为逻辑地址分配器、 逻辑地址空间管理模块、 输入 /输出 ( Input/Output , 以下简称 I/O ) 处理器、 逻辑地址物理地址映射模块、 物 理块设备与物理空间管理模块、 I/O 调度模块; 其中, 逻辑地址分配器主要 用于为用户分配符合要求的逻辑地址; 逻辑地址空间管理模块主要用于管理 已建立好逻辑地址和物理地址的映射关系的 chunk的空闲空间和已分配给用 户的逻辑地址空间; I/O 处理器主要用于接收用户的读写数据请求, 查找逻 辑地址对应的物理地址, 还可以用于接收用户输入的其他访问请求; 逻辑地 址物理地址映射模块主要用于负责逻辑地址和物理地址的相互映射; 物理块 设备与物理空间管理模块主要用于管理作为主机存储资源的多个异构块设 备, 支持在线增加删除块设备, 并管理这些块设备中未映射到 chunk的空闲 物理空间; I/O 调度模块主要用于将用户的读写请求发送到块设备, 实现高 效率的 I/O。
因此, 本发明实施例中的第一发送模块 12可以为逻辑地址分配器, 第一 获取模块 11、确定模块 41和地址添加模块 42可以为逻辑地址空间管理模块, 且第一获取模块 11中的生成子单元 1111还可以为逻辑地址物理地址映射模 块;第二获取模块 21和第三获取模块 31可以为逻辑地址物理地址映射模块; 第二接收模块 20、 第三接收模块 30、 第四接收模块 40、 第五接收模块 50、 第六接收模块 60可以为 I/O处理器;删除模块 51和设备增加模块 61可以为 物理块设备与物理空间管理模块; 读取模块 32和写入模块 22可以为 I/O调 度模块。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并 不使相应技术方案的本质脱离本发明各实施例技术方案的范围

Claims

权 利 要 求
1、 一种自管理存储方法, 其特征在于, 包括:
接收用户发送的第一逻辑地址分配请求; 其中, 所述分配请求中携带第 一逻辑地址类型参数;
根据所述第一逻辑地址类型参数进行查询, 获取满足所述第一逻辑地址 类型参数的所述第一逻辑地址;
发送所述第一逻辑地址给所述用户。
2、 根据权利要求 1所述的方法, 其特征在于, 所述第一逻辑地址类型参 数包括所述用户对所述第一逻辑地址的速度要求参数、 可靠性要求参数以及 地址长度要求参数; 则所述根据所述第一逻辑地址类型参数进行查询, 获取 满足所述第一逻辑地址类型参数的所述第一逻辑地址, 包括:
在逻辑地址段 chunk表中查询满足根据所述速度要求参数和所述可靠性 要求参数的第一 chunk; 其中, 所述 chunk表中的所有 chunk均建立逻辑地 址和物理地址的映射关系;
根据所述地址长度要求参数和所述第一 chunk确定所述第一逻辑地址。
3、 根据权利要求 2所述的方法, 其特征在于, 所述根据所述地址长度要 求参数和所述第一 chunk确定所述第一逻辑地址, 包括:
判断所述第一 chunk 的空闲地址的长度是否满足所述地址长度要求参 数;
若是, 则根据所述地址长度要求参数从所述第一 chunk的空闲地址中确 定所述第一逻辑地址; 或者,
若否, 创建满足所述速度要求参数和可靠性要求参数的第二 chunk , 并 根据所述地址长度要求参数从所述第二 chunk中确定第一逻辑地址。
4、 根据权利要求 3所述的方法, 其特征在于, 所述创建满足所述速度要 求参数和可靠性要求参数的第二 chunk, 包括:
查询未与逻辑地址建立映射关系的空闲物理地址空间表, 确定满足所述 速度要求参数的第二物理地址段;
根据所述可靠性要求参数, 将所述第二物理地址段映射到第二逻辑地址 段, 生成所述第二 chunk。
5、 根据权利要求 4所述的方法, 其特征在于, 所述根据所述可靠性要求 参数, 将所述第二物理地址段映射到第二逻辑地址段, 生成所述第二 chunk 之后, 还包括:
将所述第二物理地址段从所述空闲物理地址空间表中删除;
将所述第二 chunk增加至所述 chunk表中, 并将所述第二 chunk标记为 空闲。
6、 根据权利要求 1-5任一项所述的方法, 其特征在于, 所述接收用户发 送的第一逻辑地址分配请求, 具体为:
接收所述用户输入的申请所述第一逻辑地址的第一接口命令; 其中, 所 述第一接口命令中携带所述第一逻辑地址类型参数。
7、 根据权利要求 1-5任一项所述的方法, 其特征在于, 在发送所述第一 逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示写入数据第二接口命令; 其中, 所述第二 接口命令包括待写入的第一数据和所述第一逻辑地址;
根据所述第一逻辑地址查找所述 chunk表, 获取所述第一逻辑地址对应 的第一物理地址;
将所述第一数据写入所述第一物理地址对应的块设备。
8、 根据权利要求 1-5任一项所述的方法, 其特征在于, 在发送所述第一 逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示读取数据的第三接口命令; 其中, 所述第 三接口命令包括待读取的第二数据的字节长度和所述第一逻辑地址;
根据所述第一逻辑地址查找所述 chunk表, 获取所述第一逻辑地址对应 的第一物理地址;
从所述第一物理地址对应的块设备中读取所述字节长度的第二数据。
9、 根据权利要求 1-5任一项所述的方法, 其特征在于, 在发送所述第一 逻辑地址给所述用户, 还包括:
接收所述用户输入的第四接口命令, 所述第四接口命令包括所要释放的 第一逻辑地址偏移;
根据所述第一逻辑地址偏移查找 chunk表, 确定所述第一逻辑地址偏移 对应的所述第一 chunk; 将所述第一逻辑地址偏移增加至所述第一 chunk。
10、 根据权利要求 1-5任一项所述的方法, 其特征在于, 在发送所述第 一逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示删除块设备的第五接口命令; 其中, 所述 第五接口命令携带待删除的块设备的名称;
删除所述待删除的块设备的名称对应的块设备。
11、 根据权利要求 1-5任一项所述的方法, 其特征在于, 在发送所述第 一逻辑地址给所述用户之后, 还包括:
接收所述用户输入的用于指示增加块设备的第六接口命令; 其中, 所述 第六接口命令携带待增加的块设备的名称;
根据所述待增加的块设备的名称确定所述待增加的块设备的物理地址空 间, 并将所述待增加的块设备的物理地址空间增加至所述空闲物理地址空间 表。
12、 一种自管理存储系统, 其特征在于, 包括
第一接收模块, 用于接收用户发送的第一逻辑地址分配请求; 其中, 所 述分配请求中携带第一逻辑地址类型参数;
第一获取模块, 用于根据所述第一逻辑地址类型参数进行查询, 获取满 足所述第一逻辑地址类型参数的所述第一逻辑地址;
第一发送模块, 用于发送所述第一逻辑地址给所述用户。
13、 根据权利要求 12所述的系统, 其特征在于, 所述第一逻辑地址类型 参数包括所述用户对所述第一逻辑地址的速度要求参数、 可靠性要求参数以 及地址长度要求参数; 则所述第一获取模块包括:
查询单元, 用于在逻辑地址段 chunk表中查询满足根据所述速度要求参 数和所述可靠性要求参数的第一 chunk; 其中, 所述 chunk表中的所有 chunk 均建立逻辑地址和物理地址的映射关系;
确定单元, 用于根据所述地址长度要求参数和所述第一 chunk确定所述 第一逻辑地址。
14、 根据权利要求 13所述的系统, 其特征在于, 所述确定单元具体用于 判断所述第一 chunk的空闲地址的长度是否满足所述地址长度要求参数; 若是, 则根据所述地址长度要求参数从所述第一 chunk的空闲地址中确 定所述第一逻辑地址; 或者,
若否, 创建满足所述速度要求参数和可靠性要求参数的第二 chunk , 并 根据所述地址长度要求参数从所述第二 chunk中确定第一逻辑地址。
15、 根据权利要求 14所述的系统, 其特征在于, 所述确定单元包括: 查询子单元, 用于查询未与所述逻辑地址建立映关系的空闲物理地址空 间表, 确定满足所述速度要求参数的第二物理地址段;
生成子单元, 用于根据所述可靠性要求参数, 将所述第二物理地址段映 射到第二逻辑地址段, 生成所述第二 chunk。
16、 根据权利要求 15所述的系统, 其特征在于, 所述确定单元还包括: 删除子单元, 用于在所述生成子单元根据所述可靠性要求参数, 将所述 第二物理地址段映射到第二逻辑地址段, 生成所述第二 chunk之后, 将所述 第二物理地址段从所述空闲物理地址空间表中删除;
chunk增加子单元, 用于将所述第二 chunk增加至所述 chunk表中, 并 将所述第二 chunk标记为空闲。
17、 根据权利要求 12-16任一项所述的系统, 其特征在于, 所述第一接 收模块具体用于接收所述用户输入的申请所述第一逻辑地址的第一接口命 令; 其中, 所述第一接口命令中携带所述第一逻辑地址类型参数。
18、 根据权利要求 12-16任一项所述的系统, 其特征在于, 所述系统还 包括:
第二接收模块, 用于在所述第一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的用于指示写入数据第二接口命令; 其中, 所 述第二接口命令包括待写入的第一数据和所述第一逻辑地址;
第二获取模块, 用于根据所述第一逻辑地址查找所述 chunk表, 获取所 述第一逻辑地址对应的第一物理地址;
写入模块, 用于将所述第一数据写入所述第一物理地址对应的块设备。
19、 根据权利要求 12-16任一项所述的系统, 其特征在于, 所述系统还 包括:
第三接收模块, 用于接收所述用户输入的用于指示读取数据的第三接口 命令; 其中, 所述第三接口命令包括待读取的第二数据的字节长度和所述第 一逻辑地址; 第三获取模块, 用于根据所述第一逻辑地址查找所述 chunk表, 获取所 述第一逻辑地址对应的第一物理地址;
读取模块, 用于从所述第一物理地址对应的块设备中读取所述字节长度 的第二数据。
20、 根据权利要求 12-16
Figure imgf000028_0001
包括:
第四接收模块, 用于在所述: ;一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的: ;四接口命令, 所述第四接口命令包括所要 释放的第一逻辑地址偏移;
确定模块, 用于根据所述第
Figure imgf000028_0002
对应的所述第一 chunk;
地址添加模块, 用于将所述 一逻辑地址偏移增加至所述 chunk
21、 根据权利要求 12-16任一项所述的
Figure imgf000028_0003
包括:
第五接收模块, 用于在所述第一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的用于指示删除块设备的第五接口命令; 其中, 所述第五接口命令携带待删除的块设备的名称;
删除模块, 用于删除所述待删除的块设备的名称对应的块设备。
22、 根据权利要求 12-16任一项所述的系统, 其特征在于, 所述系统还 包括:
第六接收模块, 用于在所述第一发送模块发送所述第一逻辑地址给所述 用户之后, 接收所述用户输入的用于指示增加块设备的第六接口命令; 其中, 所述第六接口命令携带待增加的块设备的名称;
设备增加模块, 用于根据所述待增加的块设备的名称确定所述待增加的 块设备的物理地址空间, 并将所述待增加的块设备的物理地址空间增加至所 述空闲物理地址空间表。
PCT/CN2014/084225 2013-08-30 2014-08-13 自管理存储方法和系统 WO2015027817A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310388769.0 2013-08-30
CN201310388769.0A CN104426965B (zh) 2013-08-30 2013-08-30 自管理存储方法和系统

Publications (1)

Publication Number Publication Date
WO2015027817A1 true WO2015027817A1 (zh) 2015-03-05

Family

ID=52585542

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/084225 WO2015027817A1 (zh) 2013-08-30 2014-08-13 自管理存储方法和系统

Country Status (2)

Country Link
CN (1) CN104426965B (zh)
WO (1) WO2015027817A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786409B (zh) * 2016-02-26 2018-12-14 联想(北京)有限公司 一种电子设备及资源共享方法
US9875190B2 (en) * 2016-03-31 2018-01-23 EMC IP Holding Company LLC Delegated media translation layer in a storage appliance
CN107632944B (zh) * 2017-09-22 2021-06-18 郑州云海信息技术有限公司 一种读取数据的方法及装置
CN111949557B (zh) * 2019-05-16 2024-01-23 兆易创新科技集团股份有限公司 一种数据读取方法、装置及存储设备

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101997918A (zh) * 2010-11-11 2011-03-30 清华大学 异构san环境中的海量存储资源按需分配的实现方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7181578B1 (en) * 2002-09-12 2007-02-20 Copan Systems, Inc. Method and apparatus for efficient scalable storage management
CN100428131C (zh) * 2006-10-13 2008-10-22 清华大学 海量存储系统中的资源分配方法
CN102420856B (zh) * 2011-11-17 2014-10-29 杭州华三通信技术有限公司 一种数据处理方法和设备
CN102520887A (zh) * 2011-12-19 2012-06-27 中山爱科数字科技股份有限公司 一种应用于云计算的存储空间配置与管理方法

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101997918A (zh) * 2010-11-11 2011-03-30 清华大学 异构san环境中的海量存储资源按需分配的实现方法

Also Published As

Publication number Publication date
CN104426965B (zh) 2018-03-16
CN104426965A (zh) 2015-03-18

Similar Documents

Publication Publication Date Title
KR102444832B1 (ko) 분산된 가상 명칭 공간 관리를 사용한 온-디맨드 스토리지 프로비져닝
EP3905054B1 (en) File management method, distributed storage system, and management node
US11287994B2 (en) Native key-value storage enabled distributed storage system
WO2016045096A1 (zh) 一种文件迁移方法、装置和存储设备
US9122415B2 (en) Storage system using real data storage area dynamic allocation method
US9329792B2 (en) Storage thin provisioning and space reclamation
US20090077327A1 (en) Method and apparatus for enabling a NAS system to utilize thin provisioning
WO2015176636A1 (zh) 分布式数据库服务管理系统
US8271559B2 (en) Storage system and method of controlling same
TW201935243A (zh) 固態驅動器、分散式資料儲存系統和利用鍵值儲存的方法
US11301421B2 (en) Scalable multi-tier storage structures and techniques for accessing entries therein
US8954706B2 (en) Storage apparatus, computer system, and control method for storage apparatus
US9582219B2 (en) Technique for rapidly converting between storage representations in a virtualized computing environment
US20140297984A1 (en) Storage apparatus and control method of the same
US11409454B1 (en) Container ownership protocol for independent node flushing
WO2015027817A1 (zh) 自管理存储方法和系统
JP2021144748A (ja) 分散型ブロックストレージシステム、方法、装置、デバイス、及び媒体
US8527732B2 (en) Storage system and method of controlling storage system
US10963177B2 (en) Deduplication using fingerprint tries
US10210007B2 (en) Parallel mapping of client partition memory to multiple physical adapters
WO2021142768A1 (zh) 一种文件系统的克隆方法及装置
JP5272185B2 (ja) 計算機システム及びストレージシステム
WO2014108935A1 (en) Data storage system, method of controlling a data storage system and management system for a data storage system
KR20120063946A (ko) 대용량 통합 메모리를 위한 메모리 장치 및 이의 메타데이터 관리 방법
US10268384B2 (en) File transfers between machines without target CPU intervention

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14840781

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14840781

Country of ref document: EP

Kind code of ref document: A1