WO2021088587A1 - 数据访问方法、装置及存储介质 - Google Patents

数据访问方法、装置及存储介质 Download PDF

Info

Publication number
WO2021088587A1
WO2021088587A1 PCT/CN2020/119935 CN2020119935W WO2021088587A1 WO 2021088587 A1 WO2021088587 A1 WO 2021088587A1 CN 2020119935 W CN2020119935 W CN 2020119935W WO 2021088587 A1 WO2021088587 A1 WO 2021088587A1
Authority
WO
WIPO (PCT)
Prior art keywords
hard disk
space
data
address
storage device
Prior art date
Application number
PCT/CN2020/119935
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 华为技术有限公司
Priority to EP20885263.2A priority Critical patent/EP4044039A4/en
Publication of WO2021088587A1 publication Critical patent/WO2021088587A1/zh
Priority to US17/662,267 priority patent/US12050539B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1081Address translation for peripheral access to main memory, e.g. direct memory access [DMA]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0615Address space extension
    • G06F12/0623Address space extension for memory modules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0688Non-volatile semiconductor memory arrays
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7208Multiple device management, e.g. distributing data over multiple flash devices

Definitions

  • This application relates to the field of data storage technology, and in particular to a data access method, device and storage medium.
  • the data in the storage device After the data is processed by the storage device and needs to be written to the hard disk, the data in the storage device must be organized on the hard disk.
  • the transformation of data organization That is, in the current data access process, it is necessary to convert the logical address accessed by the client into the logical address for accessing the storage device, and convert the logical address for accessing the storage device to the logical address for accessing the hard disk.
  • the cost of conversion is relatively large.
  • This application provides a data access method, device, and storage medium, which can save costs and improve data read and write efficiency.
  • the technical solution is as follows:
  • a data method method is provided.
  • the method is applied to a storage device.
  • the storage device includes a plurality of hard disks.
  • the method includes: the storage device receives a first data write request from a client, and the first data write request carries the data to be written.
  • the address of the logical space of the hard disk, the target data is written into the physical space corresponding to the logical space of the hard disk in the target hard disk by means of additional writing.
  • the business logic space is created by the storage device when the client needs to store data.
  • the address of the business logic space may include the identifier and offset of the business logic space.
  • the identifier of the business logic space is used to uniquely identify the business logic space
  • the offset is used to indicate the length information of the area where data is currently written in the physical space allocated for the business logic space.
  • the address of the logical space of the hard disk may also include the identifier and the offset of the logical space of the hard disk.
  • the offset included in the address of the logical space of the hard disk may be the offset included in the address of the business logical space.
  • additional writing can be understood as writing data in an additional manner, that is, the additional writing method means that the written data is organized according to the time sequence of writing. Moreover, after a process of a program writes data in this way, the subsequent process will no longer perform write operations on the area where the data is located, but will only perform read operations.
  • the offset is used to indicate the length information of the area where data is currently written in the physical space allocated for the business logic space.
  • the address of the hard disk logical space includes the identifier and offset of the hard disk logical space. Therefore, The storage device can determine a starting address from the physical space corresponding to the hard disk logical space in the target hard disk according to the address of the hard disk logical space, and then write the target data from the starting address.
  • the client accesses the storage device through the address of the business logic space, and the storage device determines the address of the hard disk logic space through the address of the business logic space, and then accesses the target hard disk according to the address of the hard disk logic space.
  • the business logic space is for the client
  • the hard disk logic space is for the target hard disk. Both are logical spaces, but different restrictions are added to facilitate the distinction. Therefore, it can be seen that the client accesses the storage device and the storage device accesses the target hard disk in the same way. Therefore, when the target data is written into the physical space corresponding to the logical space of the hard disk in the target hard disk by means of additional writing, No address conversion in the hard disk is performed. This will save overhead and increase the data write rate.
  • the client requests the storage device to create the business logic space to facilitate subsequent data access, and in general, the storage device can It includes multiple hard disks. Therefore, in order to ensure the reliability of subsequent data access, after the storage device creates the business logic space and the hard disk logic space, it can obtain the identifier of the business logic space and the hard disk logic space, and store the identifier of the business logic space Correspondence with the identifier of the logical space of the hard disk. That is, the corresponding relationship between the business logic space and the hard disk logic space is created.
  • the size of the physical space allocated by the target hard disk to the created hard disk logical space is an integer multiple of the size of an erase block.
  • the data stored in the one or more erase blocks have the same degree of cold and heat, or the same life cycle, the data in the same erase block will become invalid data at the same time with a high probability, or both are valid data at the same time , It is relatively rare that one part is invalid data and the other part is valid data. In this way, during garbage collection, data movement will be reduced, and write amplification will be reduced.
  • the write amplification in the garbage collection process can be reduced by the above-mentioned method, but also other methods can be used to reduce it.
  • the size of the logical space of the hard disk in the target hard disk is adjusted so that the size of the logical space of the hard disk is equal to an integer multiple of the size of an erase block.
  • a data access device in a second aspect, is provided, and the data access device has the function of realizing the behavior of the data access method in the first aspect.
  • the data access device includes one or module, and the one or more modules are used to implement the data access method provided in the first aspect.
  • a storage device in a third aspect, includes a processor and a memory.
  • the memory is used to store a program for executing the data access method provided in the first aspect, and to store a program for implementing the first aspect. Provide the data involved in the data access method.
  • the processor is configured to execute a program stored in the memory.
  • the operating device of the storage device may further include a communication bus, and the communication bus is used to establish a connection between the processor and the memory.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the data access method described in the first aspect.
  • a computer program product containing instructions which when running on a computer, causes the computer to execute the data access method described in the first aspect.
  • the storage device may determine the target hard disk and the address of the hard disk logical space corresponding to the business logic space according to the address of the business logic space carried in the first data write request sent by the client, and then according to the hard disk logic The address of the space to write the target data to the target hard disk. That is, the client accesses the storage device through the address of the business logic space. Inside the storage device, the address of the business logic space is converted to the address of the hard disk logic space. The hard disk writes data according to the address of the hard disk logic space. It can be seen that only one address conversion is required, which saves overhead and improves the efficiency of data reading and writing.
  • FIG. 1 is an architecture diagram of a storage system provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a data erasing process provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of another data erasing process provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a data access method provided by an embodiment of the present application.
  • FIG. 5 is an architecture diagram of another storage system provided by an embodiment of the present application.
  • Fig. 6 is a schematic structural diagram of a data access device provided by an embodiment of the present application.
  • FIG. 1 is an architecture diagram of a storage system according to a data access method provided by an embodiment of the present application. As shown in Figure 1, the system includes a client 01 and a storage device 02, and a communication connection is established between the client 01 and the storage device 02.
  • the client 01 can send a data read request or a data write request to the storage device 02.
  • the storage device 02 may include a processor 021, a memory 022, and a hard disk 023.
  • the processor 021 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, or may be one or more integrated circuits used to implement the solution of the present application, for example, a dedicated integrated circuit Circuit (application-specific integrated circuit, ASIC), programmable logic device (programmable logic device, PLD) or a combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
  • the storage device may include multiple processors 021.
  • processors 021 can be a single-core processor or a multi-core processor.
  • the processor here may refer to one or more devices, circuits, and/or devices including a processing core for processing data (for example, computer program instructions).
  • An operating system is installed on the memory 022, and the processor 021 can read and write data by running the operating system.
  • the memory 022 may also store the program code of the solution of the present application, and the processor 021 controls the execution. That is, the memory 022 is used to store program codes for executing the solutions of the present application, and the processor 021 can execute the program codes stored in the memory 022 to implement the data access method provided in the embodiment of FIG. 4 below.
  • the memory 022 may be a read-only memory (read-only memory, ROM), a random access memory (random access memory, RAM), or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory).
  • -only memory EEPROM
  • optical discs including compact disc (read-only memory, CD-ROM), compact discs, laser discs, digital universal discs, Blu-ray discs, etc.
  • magnetic disk storage media or other magnetic storage devices Or it can be any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this.
  • the memory 022 may exist independently and be connected to the processor 021.
  • the memory 022 may also be integrated with the processor 021.
  • the storage device 02 can be a storage array or a server.
  • the storage device 02 includes a controller and several hard disks.
  • the processor 021 and the memory 022 may be located in the controller of the storage array, and the controller and several hard disks are connected through a back-end interface card.
  • the processor 021, the storage 022 and several hard disks are all located inside the server.
  • FIG. 1 is only a schematic diagram of some components included in the device.
  • the storage device 02 may also include a communication bus and a communication interface (not shown in FIG. 1). Among them, the communication bus is used to transfer information between various components included in the storage device 02.
  • the communication interface is used to communicate with other devices or communication networks, such as Ethernet, wireless access network (RAN), wireless local area network (Wireless Local Area Networks, WLAN), etc.
  • devices or communication networks such as Ethernet, wireless access network (RAN), wireless local area network (Wireless Local Area Networks, WLAN), etc.
  • the method provided in the embodiment of the present application is applied to a storage device, and the storage device includes a plurality of hard disks. Since the embodiment of the present application mainly implements data access through the logical space, that is, the client accesses the data in the storage device through the logical space. Therefore, in order to facilitate understanding, first, the process of the client requesting to create a logical space is explained.
  • the storage device receives the first logical space creation request from the client, and the first logical space creation request carries the first logical space size.
  • the storage device creates a business logic space, assigns an identifier to the business logic space, and sends the identifier of the business logic space to the client.
  • the storage device can also determine the target hard disk from the included multiple hard disks according to the size of the first logical space, and create the hard disk logical space in the target hard disk, assign an identifier to the created hard disk logical space, and create the logical space from the target hard disk.
  • the logical space of the hard disk is allocated a corresponding physical space, and the size of the physical space is the same as the size of the first logical space.
  • the storage device When the storage device includes a memory, a processor, and a hard disk, the storage device creates a hard disk logical space in the target hard disk, and the realization process of allocating the corresponding physical space from the target hard disk to the created hard disk logical space can be: the processor runs The operating system installed on the storage device sends a second logical space creation request to the target hard disk, and the second logical space creation request carries the size of the first logical space.
  • the target hard disk receives the second logical space creation request, it can create the hard disk logical space, assign an identifier to the created hard disk logical space, and the physical space corresponding to the created hard disk logical space.
  • the size of the physical space is the same as that of the first logical space.
  • One logical space is equal in size.
  • the target hard disk may send the identifier of the created hard disk logical space to the processor.
  • the size of the data currently stored on different hard disks may be different, that is, the size of the remaining storage space (or physical space) of the multiple hard disks may be different.
  • Logical space size When the target hard disk is determined from the included multiple hard disks, the size of the remaining storage space of each hard disk in the multiple hard disks can be determined, and the size of the remaining storage space can be selected from the multiple hard disks to be greater than or equal to the first The hard disk with the size of the logical space is used as the target hard disk.
  • the storage device may also select a hard disk with a remaining storage space greater than or equal to the first logical space size from the multiple hard disks as the target hard disk according to a load balancing algorithm.
  • the logical space of the hard disk created in the target hard disk corresponds to one or more erase blocks, and the data stored in the one or more erase blocks have the same hot and cold degree or the same life cycle. That is, the size of the physical space allocated by the target hard disk to the created hard disk logical space is an integer multiple of the size of an erase block.
  • the data stored in the one or more erase blocks have the same degree of cold and heat, or the same life cycle, the data in the same erase block will become invalid data at the same time with a high probability, or both are valid data at the same time , It is relatively rare that one part is invalid data and the other part is valid data. In this way, during garbage collection, data movement will be reduced, and write amplification will be reduced.
  • the size of the logical space of the hard disk created in the target hard disk may not be an integral multiple of the size of an erase block.
  • a certain erase block may correspond to two logical spaces of the hard disk.
  • the degree of cold and heat of the data stored in the erase block can also be the same. , Or the same life cycle. That is, the cold and hot degrees of the data corresponding to the logical spaces of the two hard disks may also be the same, or the life cycle may be the same.
  • the target hard disk allocates the corresponding physical space for the two hard disk logical spaces, the physical space corresponding to the two hard disk logical spaces is continuous.
  • the difference between the hot and cold degrees of the data stored in the erase block is less than a certain threshold, or the difference between the life cycles is less than a certain threshold.
  • the write amplification in the garbage collection process can be reduced by the above-mentioned method, but also other methods can be used to reduce it.
  • the size of the logical space of the hard disk in the target hard disk is adjusted so that the size of the logical space of the hard disk is equal to an integer multiple of the size of an erase block.
  • the storage device can determine whether the size of the first logical space is an integer multiple of the size of an erase block. If not, the storage device can determine the size of the second logical space, and the size of the second logical space is equal to an integer multiple of the size of an erase block. Then, according to the size of the second logical space, the target hard disk is determined from the multiple hard disks, and then the hard disk logical space is created in the target hard disk, and the corresponding physical space is allocated from the target hard disk to the created hard disk logical space. That is, the size of the physical space is the same as the size of the second logical space.
  • the storage device can determine whether the size of the first logical space is an integer multiple of the size of an erase block. If not, the storage device may send a configuration recommendation message to the client.
  • the configuration recommendation message carries the second logical space size to be recommended, and the second recommended logical space size is an integer multiple of the size of an erase block.
  • the storage device receives the consent recommendation response sent by the client, it determines the target hard disk from the multiple hard disks according to the size of the second logical space, and then creates the hard disk logical space in the target hard disk, and selects the created hard disk from the target hard disk.
  • the logical space allocates the corresponding physical space. That is, the size of the physical space is the same as the size of the second logical space.
  • the size of the second logical space may be greater than the size of the first logical space, and the difference between the size of the second logical space and the size of the first logical space is less than the size of an erase block.
  • the implementation manner in which the storage device selects the target hard disk according to the second logical space size is the same as the foregoing implementation manner in which the target hard disk is selected according to the first logical space size.
  • the storage device creates hard disk logical space in the target hard disk according to the size of the first logical space, and allocates corresponding physical space to the hard disk logical space, which is the same as the above-mentioned method of creating hard disk logical space in the target hard disk according to the first logical space size.
  • the implementation of allocating the corresponding physical space to the logical space of the hard disk is the same, which is not repeated in the embodiment of the present application.
  • the storage device can be based on data with the same or similar degree of cold and heat, or the same or similar life cycle.
  • the method of storing on the same erase block realizes the reduction of write amplification.
  • this reserved space can be used to place the moved effective data in the garbage collection process.
  • the business logic space is for the client
  • the hard disk logic space is for the hard disk.
  • the client requests the storage device to create the business logic space to facilitate subsequent data access.
  • the storage device may include multiple hard disks. Therefore, in order to ensure the reliability of subsequent data access, after the storage device obtains the identifier of the business logic space and the identifier of the hard disk logic space, the storage device may store the business logic space. Correspondence between the ID of the ID and the ID of the logical space of the hard disk. That is, the corresponding relationship between the business logic space and the hard disk logic space is created.
  • the storage device may also store the corresponding relationship between the identifier of the target hard disk and the identifier of the business logic space. Or, optionally, the storage device may store the identifier of the business logic space, the corresponding relationship between the identifier of the target hard disk and the identifier of the hard disk logical space. Moreover, for the target hard disk, the target hard disk may store the mapping relationship between the logical space of the hard disk and the physical space allocated for the logical space of the hard disk. That is, the mapping relationship between the identifier of the logical space of the hard disk and the address range of the physical space allocated for the logical space of the hard disk is stored.
  • the first logical space creation request needs to carry data protection attributes in addition to the size of the first logical space, and the data protection attributes may include multiple copies , Erasure Code (EC), etc.
  • the data protection attributes may include multiple copies , Erasure Code (EC), etc.
  • EC Erasure Code
  • the selected target hard disks may be multiple, that is, the selected multiple target hard disks correspond to the multiple copies one-to-one.
  • the logical space of the hard disk can be created on each of the multiple target hard disks according to the same method described above.
  • the corresponding relationship between the identifier of the business logic space, the identifier of the target hard disk and the identifier of the hard disk logical space is stored to create the corresponding relationship between the business logic space and the hard disk logical spaces in the multiple target hard disks.
  • the process of creating a logical space for the storage device may be different from the above process, but the main idea is the same. They are all based on the above process, according to different The characteristics of the data protection attributes are appropriately deformed.
  • FIG. 4 is a flowchart of a data access method provided by an embodiment of the present application. The method includes the following steps.
  • Step 401 The storage device receives a first data write request from a client, where the first data write request carries target data to be written and an address of a business logic space corresponding to the target data.
  • the business logic space is created by the storage device when the client needs to store data.
  • the address of the business logic space may include the identifier and offset of the business logic space.
  • the identifier of the business logic space is used to uniquely identify the business logic space
  • the offset is used to indicate the length information of the area where data is currently written in the physical space allocated for the business logic space.
  • Step 402 The storage device determines the target hard disk among the multiple hard disks and determines the address of the hard disk logical space corresponding to the business logic space according to the address of the business logic space.
  • the storage device Since the storage device stores the corresponding relationship between the identifier of the business logic space, the identifier of the target hard disk, and the identifier of the logic space of the hard disk in the process of creating the logical space, the storage device can use the identifier of the business logic space from the corresponding relationship. , To determine the identification of the target hard disk and the identification of the logical space of the hard disk.
  • the address of the logical space of the hard disk may also include the identifier and the offset of the logical space of the hard disk.
  • the offset included in the address of the logical space of the hard disk may be the offset included in the address of the business logical space.
  • Step 403 The storage device writes the target data into the physical space corresponding to the logical space of the hard disk in the target hard disk in an additional writing manner according to the determined address of the logical space of the hard disk.
  • additional writing can be understood as writing data in an additional manner, that is, the additional writing method means that the written data is organized according to the time sequence of writing. Moreover, after a process of a program writes data in this way, the subsequent process will no longer perform write operations on the area where the data is located, but only perform read operations.
  • the offset is used to indicate the length information of the area where data is currently written in the physical space allocated for the business logic space.
  • the address of the hard disk logical space includes the identifier and offset of the hard disk logical space. Therefore, The storage device can determine a starting address from the physical space corresponding to the hard disk logical space in the target hard disk according to the address of the hard disk logical space, and then write the target data from the starting address.
  • the storage device When the storage device includes a memory, a processor, and a hard disk, the storage device writes the target data into the physical space corresponding to the hard disk logical space in the target hard disk in an additional write mode according to the determined address of the hard disk logical space.
  • the process is: the processor runs the operating system installed on the memory to send a second data write request to the target hard disk, and the second data write request carries the target data and the determined address of the logical space of the hard disk.
  • the target hard disk receives the second data write request, according to the address of the hard disk logical space, the target data is written into the physical space corresponding to the hard disk logical space in an additional write manner.
  • the target hard disk Since the target hard disk stores the mapping relationship between the identifier of the logical space of the hard disk and the address range of the physical space allocated for the logical space of the hard disk, when the target hard disk receives the second data write request, it can be based on the identifier of the logical space of the hard disk. From the mapping relationship, determine the address range of the physical space allocated for the logical space of the hard disk. Furthermore, according to the offset included in the address of the logical space of the hard disk, a starting address is determined from the address range, and the target data is written from the starting address.
  • the client accesses the storage device through the address of the business logic space, and the storage device determines the address of the hard disk logic space through the address of the business logic space, and then accesses the target hard disk according to the address of the hard disk logic space.
  • the business logic space is for the client
  • the hard disk logic space is for the target hard disk. Both are logical spaces, but different restrictions are added to facilitate the distinction. Therefore, it can be seen that the client accesses the storage device and the storage device accesses the target hard disk in the same way. Therefore, when the target data is written into the physical space corresponding to the logical space of the hard disk in the target hard disk by means of additional writing, No address conversion in the hard disk is performed. This will save overhead and increase the data write rate.
  • the storage device may also write metadata corresponding to the business logic space on the target hard disk, especially after the business logic space is closed, the metadata needs to be written to the target hard disk, thereby persisting the metadata.
  • the metadata includes information about the logical space of the hard disk, for example, the total size of the logical space of the hard disk, the size of the currently written data, the end position of the currently written data, and so on.
  • the process of writing metadata to the storage device is similar to the process of writing target data described above, which will not be repeated in this embodiment of the present application.
  • the physical space on the target hard disk corresponding to the metadata corresponding to the business logic space may be different from the physical space corresponding to the address of the hard disk logical space on the target hard disk. That is, the storage device can create a logical space in the target hard disk. The physical space corresponding to this logical space is different from the physical space corresponding to the logical space of the hard disk, and the physical space corresponding to this logical space is used to store the elements corresponding to the business logical space. data.
  • the above steps 401-403 are the implementation process of the storage device writing data according to the logical space. Next, the process of reading data from the storage device according to the logical space is introduced.
  • the storage device receives a first data read request from the client, and the first data read request carries the length of the data to be read and the address of the business logic space corresponding to the data to be read. According to the address of the business logic space, the target hard disk among the multiple hard disks is determined, and the address of the hard disk logic space corresponding to the business logic space is determined. After that, the storage device can read data from the physical space corresponding to the logical space of the hard disk in the target hard disk according to the length of the data to be read and the address of the logical space of the hard disk.
  • the address of the business logic space also includes the identifier and offset of the business logic space.
  • the offset is used to indicate the length information between the start address of the data to be read and the start address of the physical space allocated for the business logic space.
  • the storage device determines the target hard disk among the multiple hard disks according to the address of the business logic space, and the method of determining the address of the hard disk logic space corresponding to the business logic space is the same as the method in the above step 402. The embodiment of the present application I won't repeat it here.
  • the storage device reads data from the physical space corresponding to the logical space of the hard disk in the target hard disk according to the length of the data to be read and the address of the logical space of the hard disk. From the physical space corresponding to the logical space of the hard disk in the target hard disk, determine a starting address, and then read data from the starting address according to the length of the data to be read.
  • the storage device determines a starting address from the physical space corresponding to the hard disk logical space in the target hard disk according to the address of the hard disk logical space: processing The device runs an operating system installed on the memory to send a second data read request to the target hard disk.
  • the second data read request carries the length of the data to be read and the address of the determined logical space of the hard disk.
  • a starting address is determined from the physical space corresponding to the hard disk logical space in the target hard disk.
  • the target hard disk Since the target hard disk stores the mapping relationship between the identifier of the logical space of the hard disk and the address range of the physical space allocated for the logical space of the hard disk, when the target hard disk receives the second data read request, it can be based on the identifier of the logical space of the hard disk. From the mapping relationship, determine the address range of the physical space allocated for the logical space of the hard disk. Then, according to the offset included in the address of the logical space of the hard disk, a starting address is determined from the address range.
  • the storage device creates the business logic space and the hard disk logic space
  • the status of the business logic space and the hard disk logic space are opened by default.
  • the client requests to close the business logic space, or the business logic space is closed abnormally
  • the storage device can set the status of the business logic space and the hard disk logic on the target hard disk. The state of the space is closed. In this way, subsequent data cannot be written through the business logic space and the hard disk logical space on the target hard disk, but the data can still be read normally.
  • the storage device Since the target hard disk may maintain resources on a regular basis, the storage device not only sets the state of the business logic space to the off state, but also needs to set the state of the hard disk logical space on the target hard disk to the off state. In this way, when the target hard disk maintains resources, the physical space corresponding to the logical space of the closed hard disk may not be maintained, thereby saving resources.
  • the storage device can set the state of the business logic space and the hard disk logic space to be the deleted state, and release the corresponding physical space. In this way, when garbage collection is performed, the physical space corresponding to the logical space of the hard disk in the deleted state can be erased.
  • this logical space can be called a persistence log (plog), and the method of operating this logical space is called plog. interface. That is, both the processor and the hard disk of the storage device are provided with a plog interface.
  • the hard disk uses solid state drives (SSD) as an example.
  • SSD solid state drives
  • a client is installed on the user host, and the storage device provides a plog interface for the user host.
  • the SSD also provides There is a plog interface.
  • the client when the client needs to access the data in the storage device, the client can interact with the storage device based on the plog interface provided by the storage device for the user host, and the storage device can also perform data transmission based on the plog interface to ensure the access method. It is unified, so there is no need to change the way of data organization, the efficiency of data reading and writing is very high, and the storage device does not need to manage the physical space in the hard disk, and there is no need to deal with complex tasks such as garbage collection, which greatly simplifies the storage system.
  • smart network cards can be set in both the user host and the storage device. In this way, data can be read and written directly through the smart network card without the need for the processor in the storage device. participate. That is, when writing data, the client can send data to the smart network card of the storage device through the smart network card in the user host, and the smart network card of the storage device can identify the received data and write it to the hard disk. The same goes for reading data. In this way, in the process of reading and writing data through the smart network card, the processor of the storage device can also process other tasks in parallel.
  • control level also requires the participation of the processor of the storage device.
  • the creation, deletion, and closing of logical space also requires the processor of the storage device. Participation.
  • the storage device may determine the target hard disk and the address of the hard disk logical space corresponding to the business logic space according to the address of the business logic space carried in the first data write request sent by the client, and then according to the hard disk logic The address of the space to write the target data to the target hard disk. That is, the client accesses the storage device through the address of the business logic space. Inside the storage device, the address of the business logic space is converted to the address of the hard disk logic space, and the hard disk writes data according to the address of the hard disk logic space. This shows that , Only one address conversion is needed, which saves overhead and improves the efficiency of data reading and writing.
  • FIG. 6 is a schematic structural diagram of a data access device provided by an embodiment of the present application.
  • the device is located in a storage device, and the processor 021 calls program codes in the memory 022 for execution.
  • the device can be implemented as part or all of the storage device by software, hardware, or a combination of the two.
  • the storage device may include multiple hard disks. Referring to FIG. 6, the device includes: a receiving module 601, a determining module 602, and a writing module 603.
  • the receiving module 601 is configured to receive a first data write request from a client, where the first data write request carries the target data to be written and the address of the business logic space corresponding to the target data;
  • the determining module 602 is configured to determine the target hard disk among the multiple hard disks and the address of the hard disk logical space corresponding to the business logic space according to the address of the business logic space;
  • the writing module 603 is configured to write the target data in the physical space corresponding to the logical space of the hard disk in the target hard disk in an additional writing manner according to the determined address of the logical space of the hard disk.
  • the device further includes:
  • the creation module is used to create the correspondence between the business logic space and the hard disk logic space.
  • the logical space of the hard disk corresponds to one or more erase blocks, and the data stored in the one or more erase blocks have the same degree of cold and heat, or the same life cycle.
  • the device further includes:
  • the adjustment module is used to adjust the size of the logical space of the hard disk so that the size of the logical space of the hard disk is equal to an integer multiple of the size of an erase block.
  • the storage device may determine the target hard disk and the address of the hard disk logical space corresponding to the business logic space according to the address of the business logic space carried in the first data write request sent by the client, and then according to the hard disk logic The address of the space to write the target data to the target hard disk. That is, the client accesses the storage device through the address of the business logic space. Inside the storage device, the address of the business logic space is converted to the address of the hard disk logic space. The hard disk writes data according to the address of the hard disk logic space. It can be seen that only one address conversion is required, which saves overhead and improves the efficiency of data reading and writing.
  • the data access device provided in the above embodiment accesses data
  • only the division of the above functional modules is used as an example for illustration.
  • the above function allocation can be completed by different functional modules according to needs, i.e.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the data access device provided in the foregoing embodiment and the data access method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, and will not be repeated here.
  • the computer may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example: floppy disk, hard disk, tape), optical medium (for example: digital versatile disc (DVD)) or semiconductor medium (for example: solid state disk (SSD)) Wait.
  • the computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, it may be a non-transitory storage medium.

Landscapes

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

Abstract

本申请公开了一种数据访问方法、装置及存储介质,属于数据存储技术领域。在本申请中,存储设备可以按照客户端发送的第一数据写请求中携带的业务逻辑空间的地址,确定目标硬盘,以及与业务逻辑空间对应的硬盘逻辑空间的地址,进而按照硬盘逻辑空间的地址,将目标数据写入目标硬盘中。也即是,客户端通过业务逻辑空间的地址来访问存储设备,在存储设备内部,将业务逻辑空间的地址转换为硬盘逻辑空间的地址,硬盘根据所述硬盘逻辑空间的地址写入数据,由此可见,只需要进行一次地址转换,节省了开销,也提高了数据读写效率。

Description

数据访问方法、装置及存储介质
本申请要求于2019年11月08日提交的申请号为201911085845.4、发明名称为“一种硬盘及数据处理方法”的中国专利申请的优先权,以及2020年2月25日提交的申请号为202010117250.9、发明名称为“数据访问方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据存储技术领域,特别涉及一种数据访问方法、装置及存储介质。
背景技术
随着大数据的应用,流式计算引擎逐渐成为主流。对流式计算来说,计算过程中数据持续到来,对处理的实时性要求非常高,因此对数据进行顺序读写操作是更加高效的方式。目前,对数据进行读写操作时,需要先经过存储设备的处理,然后才能从硬盘中读写数据。但是当前的存储设备一般用于对块、文件、对象等组织方式的数据进行处理,不能对流式数据进行处理,流式数据是指随着时间的延续而连续到达的数据序列。因此,通过存储设备对数据进行处理之前需要对数据的组织方式进行转换。而且当前大多数硬盘都是采用逻辑块地址(Logical Block Address,LBA)的访问方式,待数据经过存储设备的处理后,需要写入硬盘时,又要进行存储设备内数据的组织方式到硬盘上数据的组织方式的转换。也即是,目前的数据访问过程中,需要将客户端访问的逻辑地址转换为访问存储设备的逻辑地址,以及将访问存储设备的逻辑地址转换为访问硬盘的逻辑地址,这样就会带来两次转换,开销比较大。
发明内容
本申请提供了一种数据访问方法、装置及存储介质,可以节省开销,提高数据读写效率。所述技术方案如下:
第一方面,提供了一种数据方法方法,该方法应用于存储设备中,存储设备包括多个硬盘,该方法包括:存储设备接收来自客户端的第一数据写请求,第一数据写请求携带待写入的目标数据、以及目标数据对应的业务逻辑空间的地址;根据业务逻辑空间的地址,确定该多个硬盘中的目标硬盘、以及确定与业务逻辑空间对应的硬盘逻辑空间的地址;根据确定的硬盘逻辑空间的地址,以追加写的方式将目标数据写入目标硬盘中硬盘逻辑空间所对应的物理空间内。
在本申请中,业务逻辑空间是客户端需要存储数据时,请求存储设备创建的。业务逻辑空间的地址可以包括该业务逻辑空间的标识以及偏移量。其中,该业务逻辑空间的标识用于唯一标识该业务逻辑空间,偏移量用于指示为该业务逻辑空间分配的物理空间中当前已写入数据的区域的长度信息。硬盘逻辑空间的地址也可以包括硬盘逻辑空间的标识以及偏移量。硬盘逻辑空间的地址所包括的偏移量可以为业务逻辑空间的地址中所包括的偏移量。
所谓追加写可以理解为以追加的方式来写入数据,也即是,追加写的方式是指写入的数据按照写入的时间先后顺序组织。并且,当某个程序的进程通过该种方式写入数据之后,后 续该进程将不会再对该数据所在的区域执行写操作,只会进行读操作。
按照上述的描述,偏移量用于指示为该业务逻辑空间分配的物理空间中当前已写入数据的区域的长度信息,硬盘逻辑空间的地址包括硬盘逻辑空间的标识和偏移量,因此,存储设备可以根据该硬盘逻辑空间的地址,从目标硬盘中该硬盘逻辑空间所对应的物理空间中,确定一个起始地址,进而从该起始地址开始写入目标数据。
在本申请中,客户端通过业务逻辑空间的地址来访问存储设备,存储设备通过业务逻辑空间的地址确定硬盘逻辑空间的地址,进而按照硬盘逻辑空间的地址来访问目标硬盘。基于上述描述,业务逻辑空间是针对于客户端而言的,硬盘逻辑空间是针对于目标硬盘而言的,两者都是逻辑空间,只不过为了便于区分,加了不同的限定。因此可以看出,客户端访问存储设备,以及存储设备访问目标硬盘的方式都是相同的,所以以追加写的方式将目标数据写入目标硬盘中该硬盘逻辑空间所对应的物理空间内时,不进行硬盘内的地址转换。这样就会节省开销,提高数据写入速率。
由于业务逻辑空间是针对于客户端而言的,硬盘逻辑空间是针对于硬盘而言的,客户端请求存储设备创建的业务逻辑空间是为了便于后续的数据访问,且通常情况下,存储设备可以包括多个硬盘,因此,为了保证后续数据访问的可靠性,存储设备创建业务逻辑空间和硬盘逻辑空间之后,可以获取业务逻辑空间的标识和硬盘逻辑空间的标识,并存储该业务逻辑空间的标识与硬盘逻辑空间的标识之间的对应关系。也即是,创建该业务逻辑空间与该硬盘逻辑空间的对应关系。
对一些硬盘来说,当某个擦除块内的数据写满之后,必须擦除整个擦除块内的所有数据,才可以写入新的数据。比如,NAND介质的硬盘,当某个擦除块内的数据写满之后,必须擦除整个擦除块内的所有数据,才可以写入新的数据。这样,当目标硬盘进行垃圾回收时,如果一个擦除块内的所有数据都是无效数据,那么可以直接擦除这个擦除块。如果一个擦除块内的部分数据为无效数据,剩余部分数据为有效数据,那么就需要将有效数据进行搬移。由于这部分有效数据原本就写入一次了,这次搬移又写入了一次,这种现象就是所谓的写放大。为了避免垃圾回收过程中的写放大,目标硬盘中创建的硬盘逻辑空间对应一个或多个擦除块,该一个或多个擦除块中存储的数据的冷热程度相同,或者生命周期相同。
也即是,目标硬盘为创建的硬盘逻辑空间分配的物理空间的大小为一个擦除块的大小的整数倍。当这一个或多个擦除块中存储的数据的冷热程度相同,或者生命周期相同时,同一擦除块内的数据就会大概率地同时都变成无效数据,或者同时都是有效数据,相对较少出现一部分为无效数据,另一部分为有效数据的情况,这样,在垃圾回收时,就会减少数据搬移的情况,进而减少写放大。
在本申请实施例中,不仅可以通过上述方法来减少垃圾回收过程中的写放大,还可以通过其他的方法来减少。比如,在目标硬盘中创建硬盘逻辑空间的过程中,调整目标硬盘中该硬盘逻辑空间的大小,使得该硬盘逻辑空间的大小等于一个擦除块的大小的整数倍。
第二方面,提供了一种数据访问装置,所述数据访问装置具有实现上述第一方面中数据访问方法行为的功能。所述数据访问装置包括一个或模块,该一个或多个模块用于实现上述第一方面所提供的数据访问方法。
第三方面,提供了一种存储设备,所述存储设备包括处理器和存储器,所述存储器用于存储执行上述第一方面所提供的数据访问方法的程序,以及存储用于实现上述第一方面所提供的数据访问方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述存储设备的操作装置还可以包括通信总线,该通信总线用于该处理器与存储器之间建立连接。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的数据访问方法。
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的数据访问方法。
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
本申请提供的技术方案至少可以带来以下有益效果:
在本申请实施例中,存储设备可以按照客户端发送的第一数据写请求中携带的业务逻辑空间的地址,确定目标硬盘,以及与业务逻辑空间对应的硬盘逻辑空间的地址,进而按照硬盘逻辑空间的地址,将目标数据写入目标硬盘中。也即是,客户端通过业务逻辑空间的地址来访问存储设备,在存储设备内部,将业务逻辑空间的地址转换为硬盘逻辑空间的地址,硬盘根据所述硬盘逻辑空间的地址写入数据,由此可见,只需要进行一次地址转换,节省了开销,也提高了数据读写效率。
附图说明
图1是本申请实施例提供的一种存储***的架构图;
图2是本申请实施例提供的一种数据擦除过程的示意图;
图3是本申请实施例提供的另一种数据擦除过程的示意图;
图4是本申请实施例提供的一种数据访问方法的流程图;
图5是本申请实施例提供的另一种存储***的架构图;
图6是本申请实施例提供的一种数据访问装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在对本申请实施例提供的数据访问方法进行详细的解释说明之前,先对本申请实施例涉及的实施环境进行介绍。
请参考图1,图1是根据本申请实施例提供的数据访问方法所示出的一种存储***架构图。如图1所示,该***中包括客户端01和存储设备02,客户端01与存储设备02之间建 立有通信连接。
客户端01可以向存储设备02发送数据读请求或数据写请求。
存储设备02可以包括处理器021、存储器022和硬盘023。
处理器021可以是一个通用中央处理器(central processing unit,CPU)、网络处理器(NP)、微处理器、或者可以是一个或多个用于实现本申请方案的集成电路,例如,专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。
在具体实现中,作为一种实施例,存储设备可以包括多个处理器021。这些处理器中的每一个处理器可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或包括有用于处理数据(例如计算机程序指令)的处理核的设备。
存储器022上安装有操作***,处理器021可以通过运行该操作***来实现对数据的读写。除此之外,该存储器022中还可以存储有本申请方案的程序代码,并由处理器021来控制执行。也即是,存储器022用于存储执行本申请方案的程序代码,处理器021可以执行存储器022中存储的程序代码,来实现下文图4实施例提供的数据访问方法。
其中,该存储器022可以是只读存储器(read-only memory,ROM),也可以是随机存取存储器(random access memory,RAM),也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、光盘(包括只读光盘(compact disc read-only memory,CD-ROM)、压缩光盘、激光盘、数字通用光盘、蓝光光盘等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器022可以是独立存在,并与处理器021相连接。存储器022也可以和处理器021集成在一起。
存储设备02可以是一个存储阵列,也可以是一个服务器。当存储设备02是存储阵列时,它包括控制器和若干个硬盘,处理器021和存储器022可以位于存储阵列的控制器中,控制器与若干个硬盘通过后端接口卡连接。当存储设备02是服务器时,处理器021、存储器022和若干个硬盘均位于服务器内部。本实施例并没有限定存储设备02的产品形态,图1仅仅是该设备所包含的部分组件的示意图。
除此之外,存储设备02中还可以包括通信总线和通信接口(图1中未示出)。其中,通信总线用于存储设备02包括的各个组件之间传送信息。
通信接口,用于与其它设备或通信网络通信,如以太网,无线接入网(RAN),无线局域网(Wireless Local Area Networks,WLAN)等。
接下来对本申请实施例提供的数据访问方法进行详细解释说明。本申请实施例提供的方法应用于存储设备中,该存储设备包括多个硬盘。由于本申请实施例主要是通过逻辑空间实现数据访问的,也即是,客户端是通过逻辑空间来访问存储设备中的数据的。因此,为了便于理解,首先对客户端请求创建逻辑空间的过程进行说明。
存储设备接收来自客户端的第一逻辑空间创建请求,第一逻辑空间创建请求携带第一逻辑空间大小。存储设备创建业务逻辑空间,并为该业务逻辑空间分配一个标识,将该业务逻 辑空间的标识发送给客户端。之后,存储设备还可以根据第一逻辑空间大小,从包括的多个硬盘中确定目标硬盘,并在目标硬盘中创建硬盘逻辑空间,为创建的硬盘逻辑空间分配一个标识,从目标硬盘中为创建的硬盘逻辑空间分配对应的物理空间,该物理空间的大小与第一逻辑空间大小相同。
在存储设备包括存储器、处理器和硬盘的情况下,存储设备在目标硬盘中创建硬盘逻辑空间,且从目标硬盘中为创建的硬盘逻辑空间分配对应的物理空间的实现过程可以为:处理器运行存储器上安装的操作***,以向目标硬盘发送第二逻辑空间创建请求,第二逻辑空间创建请求携带第一逻辑空间大小。这样,当目标硬盘接收到第二逻辑空间创建请求之后,可以创建硬盘逻辑空间,为创建的硬盘逻辑空间分配一个标识,以及为创建的硬盘逻辑空间对应的物理空间,该物理空间的大小与第一逻辑空间大小相等。之后,目标硬盘可以将创建的硬盘逻辑空间的标识发送给处理器。
由于存储设备包括的多个硬盘中,不同硬盘当前已存储的数据大小可能不同,也即是,该多个硬盘剩余的存储空间(或者物理空间)大小可能不同,因此,在存储设备根据第一逻辑空间大小,从包括的多个硬盘中确定目标硬盘时,可以确定该多个硬盘中每个硬盘的剩余存储空间的大小,从该多个硬盘中选择剩余存储空间的大小大于或等于第一逻辑空间大小的硬盘作为目标硬盘。
进一步地,由于剩余存储空间的大小大于或等于第一逻辑空间大小的硬盘可能为一个,也可能为多个。如果是多个,那么,存储设备还可以按照负载均衡的算法,从该多个硬盘中选择剩余存储空间的大小大于或等于第一逻辑空间大小的硬盘作为目标硬盘。
对一些硬盘来说,当某个擦除块内的数据写满之后,必须擦除整个擦除块内的所有数据,才可以写入新的数据。比如,NAND介质的硬盘,当某个擦除块内的数据写满之后,必须擦除整个擦除块内的所有数据,才可以写入新的数据。这样,当目标硬盘进行垃圾回收时,如果一个擦除块内的所有数据都是无效数据,那么可以直接擦除这个擦除块。如果一个擦除块内的部分数据为无效数据,剩余部分数据为有效数据,那么就需要将有效数据进行搬移。由于这部分有效数据原本就写入一次了,这次搬移又写入了一次,这种现象就是所谓的写放大。为了避免垃圾回收过程中的写放大,目标硬盘中创建的硬盘逻辑空间对应一个或多个擦除块,该一个或多个擦除块中存储的数据的冷热程度相同,或者生命周期相同。也即是,目标硬盘为创建的硬盘逻辑空间分配的物理空间的大小为一个擦除块的大小的整数倍。当这一个或多个擦除块中存储的数据的冷热程度相同,或者生命周期相同时,同一擦除块内的数据就会大概率地同时都变成无效数据,或者同时都是有效数据,相对较少出现一部分为无效数据,另一部分为有效数据的情况,这样,在垃圾回收时,就会减少数据搬移的情况,进而减少写放大。
需要说明的是,目标硬盘中创建的硬盘逻辑空间的大小可能并不是一个擦除块的大小的整数倍。在这种情况下,某个擦除块可能对应两个硬盘逻辑空间,为了减少垃圾回收过程中数据搬移的情况,进而减少写放大,这个擦除块中存储的数据的冷热程度也可以相同,或者生命周期相同。也即是,这两个硬盘逻辑空间对应的数据的冷热程度也可以相同,或者生命周期相同。换句话说,目标硬盘为这两个硬盘逻辑空间分配对应的物理空间时,这两个硬盘逻辑空间对应的物理空间是连续的。当然,在某些情况下,这个擦除块中存储的数据的冷热程度之间的差值小于一定的阈值,或者生命周期之间的差值小于一定的阈值。
比如,如图2所示,对于一个擦除块,如果这个擦除块中写入同一个业务逻辑空间对应的数据,也即是,这个擦除块中写入的数据的冷热程度相同,那么,在后续释放掉这个业务逻辑空间对应的物理空间之后,可以直接对这个擦除块进行擦除。但是,如图3所示,对于一个擦除块,如果这个擦除块中写入两个业务逻辑空间对应的数据,如果这两个业务逻辑空间对应的数据的冷热程度不同,那么,在后续释放掉一个业务逻辑空间对应的物理空间之后,另一个业务逻辑空间对应的数据还是有效的,那么,此时不能直接对这个擦除块进行擦除。如果想要擦除这个擦除块,就需要将有效数据进行搬移。所以,在本申请实施例中,设置同一擦除块中存储的数据的冷热程度相同或者相近,可以减少垃圾回收过程中的写放大。
在本申请实施例中,不仅可以通过上述方法来减少垃圾回收过程中的写放大,还可以通过其他的方法来减少。比如,在目标硬盘中创建硬盘逻辑空间的过程中,调整目标硬盘中该硬盘逻辑空间的大小,使得该硬盘逻辑空间的大小等于一个擦除块的大小的整数倍。
接下来对调整目标硬盘中该硬盘逻辑空间的大小的两种实现方式进行介绍。
第一种实现方式、当存储设备在目标硬盘中创建硬盘逻辑空间之前,存储设备可以判断第一逻辑空间大小是否为一个擦除块的大小的整数倍。如果不是,那么存储设备可以确定第二逻辑空间大小,第二逻辑空间大小等于一个擦除块的大小的整数倍。之后,按照第二逻辑空间大小,从该多个硬盘中确定目标硬盘,进而在目标硬盘中创建硬盘逻辑空间,并从目标硬盘中为创建的硬盘逻辑空间分配对应的物理空间。也即是,物理空间的大小与第二逻辑空间大小相同。
第二种实现方式、当存储设备在目标硬盘中创建硬盘逻辑空间之前,存储设备可以判断第一逻辑空间大小是否为一个擦除块的大小的整数倍。如果不是,那么存储设备可以向客户端发送配置推荐消息,配置推荐消息中携带待推荐的第二逻辑空间大小,第二推荐逻辑空间大小为一个擦除块的大小的整数倍。如果存储设备接收到客户端发送的同意推荐响应,则根据第二逻辑空间大小,从该多个硬盘中确定目标硬盘,进而在目标硬盘中创建硬盘逻辑空间,并从目标硬盘中为创建的硬盘逻辑空间分配对应的物理空间。也即是,物理空间的大小与第二逻辑空间大小相同。
在上述两种实现方式中,第二逻辑空间大小可以大于第一逻辑空间大小,且与第一逻辑空间大小之间的差值小于一个擦除块的大小。
需要说明的是,上述两种实现方式中,存储设备根据第二逻辑空间大小选择目标硬盘的实现方式,与上述根据第一逻辑空间大小选择目标硬盘的实现方式相同。而且,存储设备根据第一逻辑空间大小在目标硬盘中创建硬盘逻辑空间,以及为硬盘逻辑空间分配对应的物理空间的实现方式,与上述根据第一逻辑空间大小在目标硬盘中创建硬盘逻辑空间,以及为硬盘逻辑空间分配对应的物理空间的实现方式相同,本申请实施例对此不再赘述。
另外,对于上述第二种实现方式,如果客户端不同意按照第二逻辑空间大小来创建硬盘逻辑空间,那么,存储设备可以按照将冷热程度相同或相近的,或者生命周期相同或相近的数据存储在同一擦除块上的方式来实现写放大的减少。
通常情况下,硬盘中都会有预留空间,这个预留空间可以在垃圾回收的过程中用于放置搬移过来的有效数据。但是,如果按照上述方法处理的话,可以避免垃圾回收过程中的有效数据的搬移,这样就可以减少预留空间的大小,从而通过硬盘可以存放更多的数据,降低成本。
基于上述逻辑空间的创建过程可知,业务逻辑空间是针对于客户端而言的,硬盘逻辑空间是针对于硬盘而言的,客户端请求存储设备创建的业务逻辑空间是为了便于后续的数据访问,且通常情况下,存储设备可以包括多个硬盘,因此,为了保证后续数据访问的可靠性,在存储设备获取到业务逻辑空间的标识和硬盘逻辑空间的标识之后,存储设备可以存储该业务逻辑空间的标识与硬盘逻辑空间的标识之间的对应关系。也即是,创建该业务逻辑空间与该硬盘逻辑空间的对应关系。而且在存储设备从该多个硬盘中确定出目标硬盘之后,存储设备还可以存储目标硬盘的标识和该业务逻辑空间的标识的对应关系。或者,可选地,存储设备可以存储业务逻辑空间的标识、目标硬盘的标识与硬盘逻辑空间的标识的对应关系。而且,对于目标硬盘来说,目标硬盘可以存储该硬盘逻辑空间与为该硬盘逻辑空间分配的物理空间的映射关系。也即是,存储该硬盘逻辑空间的标识与为该硬盘逻辑空间分配的物理空间的地址范围的映射关系。
可选地,在客户端请求创建的逻辑空间还存在数据保护属性时,第一逻辑空间创建请求除了携带第一逻辑空间大小之外,还需要携带数据保护属性,该数据保护属性可以包括多副本、纠删码(Erasure Code,EC)等等。以多副本为例,在存储设备按照上述方法创建逻辑空间的过程中,选择出的目标硬盘可以为多个,也即是,选择出的多个目标硬盘与多副本一一对应。之后,可以按照上述相同的方法,在该多个目标硬盘中的每个目标硬盘上创建硬盘逻辑空间。进而存储业务逻辑空间的标识、目标硬盘的标识与硬盘逻辑空间的标识的对应关系,以创建该业务逻辑空间与多个目标硬盘中的硬盘逻辑空间的对应关系。
需要说明的是,当数据保护属性为EC或其他的属性时,存储设备创建逻辑空间的过程与上述过程可能有所不同,但是主要思想是相同的,都是在上述过程的基础上,按照不同的数据保护属性的特性进行适当变形得到的。
对客户端请求创建逻辑空间的过程说明之后,接下来对本申请实施例提供的数据访问方法进行说明。请参考图4,图4是本申请实施例提供的一种数据访问方法的流程图。该方法包括如下步骤。
步骤401:存储设备接收来自客户端的第一数据写请求,第一数据写请求携带待写入的目标数据、以及目标数据对应的业务逻辑空间的地址。
基于上述描述,业务逻辑空间是客户端需要存储数据时,请求存储设备创建的。业务逻辑空间的地址可以包括该业务逻辑空间的标识以及偏移量。其中,该业务逻辑空间的标识用于唯一标识该业务逻辑空间,偏移量用于指示为该业务逻辑空间分配的物理空间中当前已写入数据的区域的长度信息。
步骤402:存储设备根据该业务逻辑空间的地址,确定该多个硬盘中的目标硬盘、以及确定与该业务逻辑空间对应的硬盘逻辑空间的地址。
由于存储设备创建逻辑空间的过程中,存储有业务逻辑空间的标识、目标硬盘的标识与硬盘逻辑空间的标识的对应关系,因此,存储设备可以根据该业务逻辑空间的标识,从该对应关系中,确定目标硬盘的标识和硬盘逻辑空间的标识。
需要说明的是,硬盘逻辑空间的地址也可以包括硬盘逻辑空间的标识以及偏移量。硬盘逻辑空间的地址所包括的偏移量可以为业务逻辑空间的地址中所包括的偏移量。
步骤403:存储设备根据确定的硬盘逻辑空间的地址,以追加写的方式将目标数据写入目标硬盘中该硬盘逻辑空间所对应的物理空间内。
所谓追加写可以理解为以追加的方式来写入数据,也即是,追加写的方式是指写入的数据按照写入的时间先后顺序组织。并且,当某个程序的进程通过该种方式写入数据之后,后续该进程将不会再对该数据所在的区域执行写操作,只会进行读操作。
按照上述的描述,偏移量用于指示为该业务逻辑空间分配的物理空间中当前已写入数据的区域的长度信息,硬盘逻辑空间的地址包括硬盘逻辑空间的标识和偏移量,因此,存储设备可以根据该硬盘逻辑空间的地址,从目标硬盘中该硬盘逻辑空间所对应的物理空间中,确定一个起始地址,进而从该起始地址开始写入目标数据。
在存储设备包括存储器、处理器和硬盘的情况下,存储设备根据确定的硬盘逻辑空间的地址,以追加写的方式将目标数据写入目标硬盘中该硬盘逻辑空间所对应的物理空间内的实现过程为:处理器运行存储器上安装的操作***,以向目标硬盘发送第二数据写请求,第二数据写请求携带目标数据和确定的硬盘逻辑空间的地址。当目标硬盘接收到第二数据写请求之后,根据该硬盘逻辑空间的地址,以追加写的方式将目标数据写入该硬盘逻辑空间所对应的物理空间内。
由于目标硬盘中存储有硬盘逻辑空间的标识与为该硬盘逻辑空间分配的物理空间的地址范围的映射关系,因此,当目标硬盘接收到第二数据写请求之后,可以根据该硬盘逻辑空间的标识,从该映射关系中,确定为该硬盘逻辑空间分配的物理空间的地址范围。进而根据该硬盘逻辑空间的地址包括的偏移量,从该地址范围中确定一个起始地址,并从该起始地址开始写入目标数据。
在本申请实施例中,客户端通过业务逻辑空间的地址来访问存储设备,存储设备通过业务逻辑空间的地址确定硬盘逻辑空间的地址,进而按照硬盘逻辑空间的地址来访问目标硬盘。基于上述描述,业务逻辑空间是针对于客户端而言的,硬盘逻辑空间是针对于目标硬盘而言的,两者都是逻辑空间,只不过为了便于区分,加了不同的限定。因此可以看出,客户端访问存储设备,以及存储设备访问目标硬盘的方式都是相同的,所以以追加写的方式将目标数据写入目标硬盘中该硬盘逻辑空间所对应的物理空间内时,不进行硬盘内的地址转换。这样就会节省开销,提高数据写入速率。
在一些实施例中,存储设备还可以将业务逻辑空间对应的元数据写入目标硬盘上,尤其在业务逻辑空间关闭之后,需要将该元数据写入目标硬盘中,从而持久化元数据。该元数据包括硬盘逻辑空间的相关信息,比如,该硬盘逻辑空间的总大小、当前已写入数据的大小、当前已写入数据的结束位置等等。其中,存储设备写入元数据的过程与上述写入目标数据的过程类似,本申请实施例对此不再赘述。
需要说明的是,业务逻辑空间对应的元数据在目标硬盘上对应的物理空间,可以与目标硬盘上该硬盘逻辑空间的地址所对应的物理空间不同。也即是,存储设备可以在目标硬盘中创建一个逻辑空间,这个逻辑空间对应的物理空间与硬盘逻辑空间对应的物理空间不同,且这个逻辑空间对应的物理空间用于存储业务逻辑空间对应的元数据。
上述步骤401-403是存储设备根据逻辑空间写入数据的实现过程。接下来对存储设备根据逻辑空间读取数据的过程进行介绍。
存储设备接收来自客户端的第一数据读请求,第一数据读请求携带待读取的数据的长度、以及待读取的数据对应的业务逻辑空间的地址。根据该业务逻辑空间的地址,确定该多个硬盘中的目标硬盘,以及确定与该业务逻辑空间对应的硬盘逻辑空间的地址。之后,存储设备 可以根据待读取的数据的长度和该硬盘逻辑空间的地址,从目标硬盘中该硬盘逻辑空间所对应的物理空间内读取数据。
需要说明的是,在数据读取过程中,该业务逻辑空间的地址也是包括业务逻辑空间的标识和偏移量。但是与数据写入过程不同的是,该偏移量用于指示待读取的数据的起始地址与为该业务逻辑空间分配的物理空间的起始地址之间的长度信息。存储设备根据该业务逻辑空间的地址,确定该多个硬盘中的目标硬盘,以及确定与该业务逻辑空间对应的硬盘逻辑空间的地址的方式,与上述步骤402中的方式相同,本申请实施例对此不再赘述。
其中,存储设备根据待读取的数据的长度和该硬盘逻辑空间的地址,从目标硬盘中该硬盘逻辑空间所对应的物理空间内读取数据的实现过程可以为:存储设备根据该硬盘逻辑空间的地址,从目标硬盘中该硬盘逻辑空间所对应的物理空间中,确定一个起始地址,进而按照待读取的数据的长度,从该起始地址开始读取数据。
在存储设备包括存储器、处理器和硬盘的情况下,存储设备根据该硬盘逻辑空间的地址,从目标硬盘中该硬盘逻辑空间所对应的物理空间中,确定一个起始地址的实现过程为:处理器运行存储器上安装的操作***,以向目标硬盘发送第二数据读请求,第二数据读请求携带待读取的数据的长度和确定的硬盘逻辑空间的地址。当目标硬盘接收到第二数据读请求之后,根据该硬盘逻辑空间的地址,从目标硬盘中该硬盘逻辑空间所对应的物理空间中,确定一个起始地址。
由于目标硬盘中存储有硬盘逻辑空间的标识与为该硬盘逻辑空间分配的物理空间的地址范围的映射关系,因此,当目标硬盘接收到第二数据读请求之后,可以根据该硬盘逻辑空间的标识,从该映射关系中,确定为该硬盘逻辑空间分配的物理空间的地址范围。进而根据该硬盘逻辑空间的地址包括的偏移量,从该地址范围中确定一个起始地址。
与数据写入过程同理,从目标硬盘中该硬盘逻辑空间所对应的物理空间内读取数据时,也不进行硬盘内的地址转换,从而节省开销,提高数据读取速率。
需要说明的是,当存储设备创建业务逻辑空间和硬盘逻辑空间之后,业务逻辑空间和硬盘逻辑空间的状态默认为打开状态。但是,当后续硬盘逻辑空间对应的物理空间已写满数据、客户端请求关闭业务逻辑空间、或者因异常关闭业务逻辑空间时,存储设备可以设置该业务逻辑空间的状态和目标硬盘上该硬盘逻辑空间的状态均为关闭状态。这样,后续就不能通过该业务逻辑空间和目标硬盘上该硬盘逻辑空间来写入数据,但是还可以正常读取数据。
由于目标硬盘可能会定期维护资源,因此,存储设备不仅将业务逻辑空间的状态设置为关闭状态,还需要将目标硬盘上该硬盘逻辑空间的状态设置为关闭状态。这样,在目标硬盘维护资源时,可以不对处于关闭状态的硬盘逻辑空间对应的物理空间进行维护,从而节省了资源。
如果客户端请求删除业务逻辑空间,则存储设备可以设置该业务逻辑空间的状态和硬盘逻辑空间的状态均为已删除状态,并释放对应的物理空间。这样,当进行垃圾回收时,可以将处于已删除状态的硬盘逻辑空间对应的物理空间进行擦除。
由于本申请实施例提供的这种逻辑空间和日志有一些类似的特性,因此,可以将这种逻辑空间称为持久性日志(persistence log,plog),对这种逻辑空间操作的方法称为plog接口。也即是,存储设备的处理器和硬盘都提供有plog接口。比如,在图5所示的存储***中,硬盘以固态硬盘(solid state drives,SSD)为例来说明,用户主机上安装有客户端,存储设备为 用户主机提供有plog接口,SSD盘也提供有plog接口。这样,当客户端需要访问存储设备中的数据时,客户端可以基于存储设备为用户主机提供的plog接口与存储设备进行交互,且存储设备内部也可以基于plog接口进行数据传输,保证访问方式的统一,从而不需要进行数据组织方式的转换,数据读写效率非常高,而且存储设备可以不需要管理硬盘内的物理空间,更不需要处理垃圾回收等复杂的任务,极大地简化了存储***。
在一些实施例中,对于图5所示的存储***,用户主机和存储设备中都可以设置智能网卡,这样,后续可以直接通过智能网卡实现数据的读写,而不需要存储设备中处理器的参与。也即是,当写入数据时,客户端可以通过用户主机中的智能网卡发送数据至存储设备的智能网卡,存储设备的智能网卡可以对接收到的数据进行识别,从而写入硬盘中。读取数据也是同理。这样,在通过智能网卡实现数据读写的过程中,存储设备的处理器还可以并行处理其他的任务。
值得注意的是,虽然数据读写可以通过智能网卡来实现,但是控制层面的操作还需要存储设备的处理器的参与,比如,逻辑空间的创建、删除、关闭等操作还需要存储设备的处理器的参与。
在本申请实施例中,存储设备可以按照客户端发送的第一数据写请求中携带的业务逻辑空间的地址,确定目标硬盘,以及与业务逻辑空间对应的硬盘逻辑空间的地址,进而按照硬盘逻辑空间的地址,将目标数据写入目标硬盘中。也即是,客户端通过业务逻辑空间的地址来访问存储设备,在存储设备内部,将业务逻辑空间的地址转换为硬盘逻辑空间的地址,硬盘根据硬盘逻辑空间的地址写入数据,由此可见,只需要进行一次地址转换,节省了开销,也提高了数据读写效率。
图6是本申请实施例提供的一种数据访问装置的结构示意图,该装置位于存储设备中,由处理器021调用存储器022中的程序代码执行。该装置可以由软件、硬件或者两者的结合实现成为存储设备的部分或者全部。该存储设备可以包括多个硬盘。参见图6,该装置包括:接收模块601、确定模块602和写入模块603。
接收模块601,用于接收来自客户端的第一数据写请求,第一数据写请求携带待写入的目标数据、以及目标数据对应的业务逻辑空间的地址;
确定模块602,用于根据业务逻辑空间的地址,确定该多个硬盘中的目标硬盘、以及确定与业务逻辑空间对应的硬盘逻辑空间的地址;
写入模块603,用于根据确定的硬盘逻辑空间的地址,以追加写的方式将目标数据写入目标硬盘中硬盘逻辑空间所对应的物理空间内。
可选地,以追加写的方式将目标数据写入目标硬盘中硬盘逻辑空间所对应的物理空间内时,不进行硬盘内的地址转换。
可选地,该装置还包括:
创建模块,用于创建业务逻辑空间与硬盘逻辑空间的对应关系。
可选地,硬盘逻辑空间对应一个或多个擦除块,一个或多个擦除块中存储的数据的冷热程度相同,或者生命周期相同。
可选地,该装置还包括:
调整模块,用于调整硬盘逻辑空间的大小,使得硬盘逻辑空间的大小等于一个擦除块的 大小的整数倍。
在本申请实施例中,存储设备可以按照客户端发送的第一数据写请求中携带的业务逻辑空间的地址,确定目标硬盘,以及与业务逻辑空间对应的硬盘逻辑空间的地址,进而按照硬盘逻辑空间的地址,将目标数据写入目标硬盘中。也即是,客户端通过业务逻辑空间的地址来访问存储设备,在存储设备内部,将业务逻辑空间的地址转换为硬盘逻辑空间的地址,硬盘根据所述硬盘逻辑空间的地址写入数据,由此可见,只需要进行一次地址转换,节省了开销,也提高了数据读写效率。
需要说明的是:上述实施例提供的数据访问装置在访问数据时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据访问装置与数据访问方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(digital subscriber line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(digital versatile disc,DVD))或半导体介质(例如:固态硬盘(solid state disk,SSD))等。值得注意的是,本申请提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。
应当理解的是,本文提及的“至少一个”是指一个或多个,“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (11)

  1. 一种数据访问方法,其特征在于,所述方法应用于存储设备中,所述存储设备包括多个硬盘,所述方法包括:
    所述存储设备接收来自客户端的第一数据写请求,所述第一数据写请求携带待写入的目标数据、以及所述目标数据对应的业务逻辑空间的地址;
    所述存储设备根据所述业务逻辑空间的地址,确定所述多个硬盘中的目标硬盘、以及确定与所述业务逻辑空间对应的硬盘逻辑空间的地址;
    所述存储设备根据确定的所述硬盘逻辑空间的地址,以追加写的方式将所述目标数据写入所述目标硬盘中所述硬盘逻辑空间所对应的物理空间内。
  2. 如权利要求1所述的方法,其特征在于,所述以追加写的方式将所述目标数据写入所述目标硬盘中所述硬盘逻辑空间所对应的物理空间内时,不进行硬盘内的地址转换。
  3. 如权利要求1所述的方法,其特征在于,所述存储设备接收来自客户端的第一数据写请求之前,还包括:
    创建所述业务逻辑空间与所述硬盘逻辑空间的对应关系。
  4. 如权利要求1-3任一所述的方法,其特征在于,所述硬盘逻辑空间对应一个或多个擦除块,所述一个或多个擦除块中存储的数据的冷热程度相同,或者生命周期相同。
  5. 如权利要求1-3任一所述的方法,其特征在于,所述方法还包括:
    调整所述硬盘逻辑空间的大小,使得所述硬盘逻辑空间的大小等于一个擦除块的大小的整数倍。
  6. 一种数据访问装置,其特征在于,所述装置位于存储设备中,所述存储设备包括多个硬盘,所述装置包括:
    接收模块,用于接收来自客户端的第一数据写请求,所述第一数据写请求携带待写入的目标数据、以及所述目标数据对应的业务逻辑空间的地址;
    确定模块,用于根据所述业务逻辑空间的地址,确定所述多个硬盘中的目标硬盘、以及确定与所述业务逻辑空间对应的硬盘逻辑空间的地址;
    写入模块,用于根据确定的所述硬盘逻辑空间的地址,以追加写的方式将所述目标数据写入所述目标硬盘中所述硬盘逻辑空间所对应的物理空间内。
  7. 如权利要求6所述的装置,其特征在于,所述以追加写的方式将所述目标数据写入所述目标硬盘中所述硬盘逻辑空间所对应的物理空间内时,不进行硬盘内的地址转换。
  8. 如权利要求6所述的装置,其特征在于,所述装置还包括:
    创建模块,用于创建所述业务逻辑空间与所述硬盘逻辑空间的对应关系。
  9. 如权利要求6-8任一所述的装置,其特征在于,所述硬盘逻辑空间对应一个或多个擦除块,所述一个或多个擦除块中存储的数据的冷热程度相同,或者生命周期相同。
  10. 如权利要求6-8任一所述的装置,其特征在于,所述装置还包括:
    调整模块,用于调整所述硬盘逻辑空间的大小,使得所述硬盘逻辑空间的大小等于一个擦除块的大小的整数倍。
  11. 一种计算机可读存储介质,其特征在于,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-5任一所述的方法的步骤。
PCT/CN2020/119935 2019-11-08 2020-10-09 数据访问方法、装置及存储介质 WO2021088587A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20885263.2A EP4044039A4 (en) 2019-11-08 2020-10-09 METHOD AND APPARATUS FOR ACCESSING DATA, AND STORAGE MEDIUM
US17/662,267 US12050539B2 (en) 2019-11-08 2022-05-06 Data access method and apparatus and storage medium

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201911085845 2019-11-08
CN201911085845.4 2019-11-08
CN202010117250.9 2020-02-25
CN202010117250.9A CN112783804A (zh) 2019-11-08 2020-02-25 数据访问方法、装置及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/662,267 Continuation US12050539B2 (en) 2019-11-08 2022-05-06 Data access method and apparatus and storage medium

Publications (1)

Publication Number Publication Date
WO2021088587A1 true WO2021088587A1 (zh) 2021-05-14

Family

ID=75749982

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119935 WO2021088587A1 (zh) 2019-11-08 2020-10-09 数据访问方法、装置及存储介质

Country Status (3)

Country Link
EP (1) EP4044039A4 (zh)
CN (1) CN112783804A (zh)
WO (1) WO2021088587A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277640B (zh) * 2022-07-29 2023-11-24 迈普通信技术股份有限公司 数据处理方法、装置、智能网卡及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540524A (zh) * 2003-10-31 2004-10-27 清华大学 存储区域网络中分布式虚拟化存储的方法
CN101604227A (zh) * 2009-07-17 2009-12-16 杭州华三通信技术有限公司 数据存储的方法及设备
CN101976223A (zh) * 2010-10-09 2011-02-16 成都市华为赛门铁克科技有限公司 自动精简配置方法和装置
US20120079229A1 (en) * 2010-09-28 2012-03-29 Craig Jensen Data storage optimization for a virtual platform
CN104820575A (zh) * 2015-04-27 2015-08-05 西北工业大学 实现存储***自动精简的方法
CN110018966A (zh) * 2018-01-09 2019-07-16 阿里巴巴集团控股有限公司 一种存储器、存储***、主机及数据操作、垃圾回收方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3500972B2 (ja) * 1998-07-24 2004-02-23 日本電気株式会社 ディスク共有型クラスタシステムにおける論理ファイル管理システム
US8918619B2 (en) * 2009-10-04 2014-12-23 Infinidat Ltd. Virtualized storage system and method of operating thereof
WO2012109679A2 (en) * 2011-02-11 2012-08-16 Fusion-Io, Inc. Apparatus, system, and method for application direct virtual memory management
US9251086B2 (en) * 2012-01-24 2016-02-02 SanDisk Technologies, Inc. Apparatus, system, and method for managing a cache
CN104156178A (zh) * 2014-08-11 2014-11-19 四川九成信息技术有限公司 一种嵌入式终端数据访问方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540524A (zh) * 2003-10-31 2004-10-27 清华大学 存储区域网络中分布式虚拟化存储的方法
CN101604227A (zh) * 2009-07-17 2009-12-16 杭州华三通信技术有限公司 数据存储的方法及设备
US20120079229A1 (en) * 2010-09-28 2012-03-29 Craig Jensen Data storage optimization for a virtual platform
CN101976223A (zh) * 2010-10-09 2011-02-16 成都市华为赛门铁克科技有限公司 自动精简配置方法和装置
CN104820575A (zh) * 2015-04-27 2015-08-05 西北工业大学 实现存储***自动精简的方法
CN110018966A (zh) * 2018-01-09 2019-07-16 阿里巴巴集团控股有限公司 一种存储器、存储***、主机及数据操作、垃圾回收方法

Also Published As

Publication number Publication date
EP4044039A4 (en) 2022-12-07
EP4044039A1 (en) 2022-08-17
CN112783804A (zh) 2021-05-11
US20220261354A1 (en) 2022-08-18

Similar Documents

Publication Publication Date Title
US10705974B2 (en) Data processing method and NVME storage device
US10380078B1 (en) Dynamic storage tiering in a virtual environment
WO2017000658A1 (zh) 存储***、存储管理装置、存储器、混合存储装置及存储管理方法
US10871920B2 (en) Storage device and computer system
US20180165014A1 (en) Array controller, solid state disk, and method for controlling solid state disk to write data
US10037161B2 (en) Tiered storage system, storage controller, and method for deduplication and storage tiering
US8924659B2 (en) Performance improvement in flash memory accesses
US20160026566A1 (en) Logical and physical block addressing for efficiently storing data
US9182912B2 (en) Method to allow storage cache acceleration when the slow tier is on independent controller
US11886729B2 (en) Data storage method and apparatus
WO2019062202A1 (zh) 硬盘操作命令的执行方法、硬盘及存储介质
WO2021238260A1 (zh) 一种预读数据缓存方法、装置、设备及存储介质
US20220164316A1 (en) Deduplication method and apparatus
US11709596B2 (en) Method, device and computer program for data storage
WO2021088587A1 (zh) 数据访问方法、装置及存储介质
US11474750B2 (en) Storage control apparatus and storage medium
US20240020014A1 (en) Method for Writing Data to Solid-State Drive
TWI722392B (zh) 記憶裝置
US10891239B2 (en) Method and system for operating NAND flash physical space to extend memory capacity
US12050539B2 (en) Data access method and apparatus and storage medium
CN113918087B (zh) 存储装置以及用于管理存储装置中的命名空间的方法
KR20180133730A (ko) 스토리지 시스템 및 이의 동작 방법
CN110209343B (zh) 数据存储方法、装置、服务器及存储介质
WO2022021280A1 (zh) 存储控制器、存储控制方法、固态硬盘及存储***
WO2023236629A1 (zh) 数据访问方法、装置、存储***及存储介质

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: 20885263

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020885263

Country of ref document: EP

Effective date: 20220511

NENP Non-entry into the national phase

Ref country code: DE