Data access methods, devices and storage media

By introducing the concepts of business logic space and hard disk logical space into storage devices, the problem of multiple address conversions in streaming data processing is solved, data reading and writing efficiency is improved, and write amplification is reduced and improved by rationally allocating hard disk logical space. improve the performance and reliability of storage devices.

CN112783804BActive Publication Date: 2024-10-18HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010117250.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-25
Publication Date
2024-10-18
Estimated Expiration
2040-02-25

AI Technical Summary

Technical Problem

When existing storage devices process streaming data, they need to perform multiple address translations, resulting in low efficiency of data reading and writing, and write amplification is prone to occur during the garbage collection process, affecting storage performance.

Method used

By introducing the concepts of business logic space and hard disk logical space into the storage device, the client accesses the storage device through the business logic space address, and the storage device converts it into the hard disk logical space address for writing, avoiding address conversion within the hard disk and using append writing. And when allocating logical space on the hard disk, ensure that its size is an integral multiple of the erase block size to reduce write amplification.

Benefits of technology

It reduces address translation during data reading and writing, improves data transmission efficiency, reduces write amplification during garbage collection, and improves the performance and reliability of storage devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112783804B_ABST
    Figure CN112783804B_ABST
Patent Text Reader

Abstract

The present application discloses a data access method, device and storage medium, which belongs to the field of data storage technology. In the present application, the storage device can determine the target hard disk and the address of the hard disk logical space corresponding to the business logical space according to the address of the business logical space carried in the first data write request sent by the client, and then write the target data into the target hard disk according to the address of the hard disk logical space. That is, the client accesses the storage device through the address of the business logical space, and inside the storage device, the address of the business logical space is converted into the address of the hard disk logical space, and the hard disk writes data according to the address of the hard disk logical space. It can be seen that only one address conversion is required, which saves overhead and improves data reading and writing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese patent application No. 201911085845.4, filed on November 8, 2019, with invention name “A hard disk and data processing method”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the technical field of data storage, and in particular to a data access method, device and storage medium. Background Art

[0003] With the application of big data, streaming computing engines have gradually become mainstream. For streaming computing, data continues to arrive during the computing process, and the real-time requirements for processing are very high. Therefore, sequential reading and writing of data is a more efficient way. At present, when reading and writing data, it needs to be processed by the storage device before it can be read and written from the hard disk. However, current storage devices are generally used to process data organized in blocks, files, objects, etc., and cannot process streaming data. Streaming data refers to a sequence of data that arrives continuously over time. Therefore, before processing data through storage devices, the organization of data needs to be converted. Moreover, most hard disks currently use the access method of logical block address (Logical Block Address, LBA). After the data is processed by the storage device, when it needs to be written to the hard disk, the organization of the data in the storage device needs to be converted to the organization of the data on the hard disk. That is, in the current data access process, the logical address accessed by the client needs to be converted into the logical address for accessing the storage device, and the logical address for accessing the storage device needs to be converted into the logical address for accessing the hard disk. This will result in two conversions, which is relatively expensive. Summary of the invention

[0004] The present application provides a data access method, device and storage medium, which can save overhead and improve data reading and writing efficiency.

[0005] The technical solution is as follows:

[0006] In a first aspect, a data method is provided, which is applied to a storage device, wherein the storage device includes multiple hard disks, and the method includes: the storage device receives a first data write request from a client, the first data write request carries target data to be written, and an address of a business logical space corresponding to the target data; according to the address of the business logical space, a target hard disk among the multiple hard disks is determined, and the address of a hard disk logical space corresponding to the business logical space is determined; according to the determined address of the hard disk logical space, the target data is written into a physical space corresponding to the hard disk logical space in the target hard disk in an append write manner.

[0007] In the present application, the business logic space is created by requesting 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, and the offset is used to indicate the length information of the area in the physical space allocated for the business logic space where data has been currently written. The address of the hard disk logical space may also include the identifier and offset of the hard disk logical space. The offset included in the address of the hard disk logical space may be the offset included in the address of the business logic space.

[0008] The so-called append write can be understood as writing data in an append manner, that is, the append write method means that the written data is organized in the order of writing time. And, after a program process writes data in this way, the subsequent process will no longer perform write operations on the area where the data is located, but only read operations.

[0009] According to the above description, the offset is used to indicate the length information of the area in the physical space allocated for the business logical space where data has been currently written. 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 based on the address of the hard disk logical space, and then start writing the target data from the starting address.

[0010] In the present application, 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 logical space through the address of the business logic space, and then accesses the target hard disk according to the address of the hard disk logical space. Based on the above description, the business logic space is for the client, and the hard disk logical space is for the target hard disk. Both are logical spaces, but different limitations are added for the convenience of distinction. Therefore, it can be seen that the way the client accesses the storage device and the way the storage device accesses the target hard disk are the same, so when the target data is written to the physical space corresponding to the hard disk logical space in the target hard disk in an append write manner, the address conversion in the hard disk is not performed. This will save overhead and increase the data write rate.

[0011] Since the business logic space is for the client and the hard disk logic space is for the hard disk, the business logic space created by the client requesting the storage device is to facilitate subsequent data access, and usually, the storage device may include 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 identifier of the hard disk logic space, and store the corresponding relationship between the identifier of the business logic space and the identifier of the hard disk logic space. That is, create a corresponding relationship between the business logic space and the hard disk logic space.

[0012] For some hard disks, when the data in a certain erase block is full, all the data in the entire erase block must be erased before new data can be written. For example, for a hard disk with NAND media, when the data in a certain erase block is full, all the data in the entire erase block must be erased before new data can be written. In this way, when the target hard disk performs garbage collection, if all the data in an erase block is invalid data, then the erase block can be directly erased. If part of the data in an erase block is invalid data and the remaining part of the data is valid data, then the valid data needs to be moved. Since this part of the valid data has been written once, it is written again during this move. This phenomenon is called write amplification. In order to avoid write amplification during garbage collection, the hard disk logical space 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 degree of coldness and hotness, or the same life cycle.

[0013] That is, the size of the physical space allocated by the target hard disk for the created hard disk logical space is an integer multiple of the size of an erase block. When the data stored in one or more erase blocks are of the same hotness or coldness, or have the same life cycle, the data in the same erase block will most likely become invalid data at the same time, or all valid data at the same time. It is relatively rare that part of the data is invalid and the other part is valid data. In this way, during garbage collection, data movement will be reduced, thereby reducing write amplification.

[0014] In the embodiment of the present application, the write amplification in the garbage collection process can be reduced not only by the above method, but also by other methods. For example, in the process of creating a hard disk logical space in the target hard disk, the size of the hard disk logical space in the target hard disk is adjusted so that the size of the hard disk logical space is equal to an integer multiple of the size of an erase block.

[0015] In a second aspect, a data access device is provided, which has the function of implementing the data access method in the first aspect. The data access device includes one or more modules, and the one or more modules are used to implement the data access method provided in the first aspect.

[0016] In a third aspect, a storage device is provided, the storage device comprising a processor and a memory, the memory being used to store a program for executing the data access method provided in the first aspect, and storing data involved in implementing the data access method provided in the first aspect. The processor is configured to execute the program stored in the memory. The operating device of the storage device may also include a communication bus, the communication bus being used to establish a connection between the processor and the memory.

[0017] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the data access method described in the first aspect.

[0018] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the data access method described in the first aspect.

[0019] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here.

[0020] The technical solution provided by this application can at least bring the following beneficial effects:

[0021] In an embodiment of the present application, the storage device can determine the target hard disk and the address of the hard disk logical space corresponding to the business logical space according to the address of the business logical space carried in the first data write request sent by the client, and then write the target data into the target hard disk according to the address of the hard disk logical space. That is, the client accesses the storage device through the address of the business logical space, and inside the storage device, the address of the business logical space is converted into the address of the hard disk logical space, and the hard disk writes data according to the address of the hard disk logical space. It can be seen that only one address conversion is required, which saves overhead and improves data reading and writing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is an architecture diagram of a storage system provided in an embodiment of the present application;

[0023] Figure 2 is a schematic diagram of a data erasure process provided by an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of another data erasure process provided by an embodiment of the present application;

[0025] Figure 4 is a flow chart of a data access method provided by an embodiment of the present application;

[0026] Figure 5 is an architecture diagram of another storage system provided in an embodiment of the present application;

[0027] Figure 6 It is a structural diagram of a data access device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0029] Before explaining in detail the data access method provided in the embodiment of the present application, the implementation environment involved in the embodiment of the present application is first introduced.

[0030] Please refer to Figure 1 , Figure 1 FIG. 1 is a storage system architecture diagram showing a data access method provided in an embodiment of the present application. Figure 1 As shown, 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 .

[0031] The client 01 may send a data read request or a data write request to the storage device 02 .

[0032] The storage device 02 may include a processor 021 , a memory 022 , and a hard disk 023 .

[0033] 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 for implementing the solution of the present application, such as an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. 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.

[0034] In a specific implementation, as an embodiment, the storage device may include multiple processors 021. Each of these processors may 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 (e.g., computer program instructions).

[0035] The memory 022 is installed with an operating system, and the processor 021 can read and write data by running the operating system. In addition, the memory 022 can also store the program code of the present application solution, and the processor 021 can control the execution. That is, the memory 022 is used to store the program code for executing the present application solution, and the processor 021 can execute the program code stored in the memory 022 to implement the following Figure 4 The data access method provided by the embodiment.

[0036] The memory 022 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compressed disc, a laser disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 022 may exist independently and be connected to the processor 021. The memory 022 may also be integrated with the processor 021.

[0037] The storage device 02 may be a storage array or a server. When the storage device 02 is a storage array, it 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 the several hard disks are connected via a back-end interface card. When the storage device 02 is a server, the processor 021, the memory 022 and the several hard disks are all located inside the server. This embodiment does not limit the product form of the storage device 02. Figure 1 It is only a schematic diagram of some of the components included in the device.

[0038] In addition, the storage device 02 may also include a communication bus and a communication interface ( Figure 1The communication bus is used to transmit information between the various components included in the storage device 02.

[0039] Communication interface, used to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc.

[0040] Next, the data access method provided by the embodiment of the present application is explained in detail. The method provided by the embodiment of the present application is applied to a storage device, which includes multiple hard disks. Since the embodiment of the present application mainly implements data access through logical space, that is, the client accesses the data in the storage device through the logical space. Therefore, for ease of understanding, the process of the client requesting to create a logical space is first explained.

[0041] The storage device receives a first logical space creation request from a client, and the first logical space creation request carries a first logical space size. The storage device creates a business logical space, assigns an identifier to the business logical space, and sends the identifier of the business logical space to the client. Afterwards, the storage device may also determine a target hard disk from a plurality of hard disks included according to the first logical space size, create a hard disk logical space in the target hard disk, assign an identifier to the created hard disk logical space, and allocate a corresponding physical space from the target hard disk to the created hard disk logical space, the size of the physical space being the same as the size of the first logical space.

[0042] In the case where 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 implementation 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 memory to send a second logical space creation request to the target hard disk, and the second logical space creation request carries the first logical space size. In this way, after the target hard disk receives the second logical space creation request, it can create a hard disk logical space, allocate an identifier to the created hard disk logical space, and a physical space corresponding to the created hard disk logical space, the size of which is equal to the size of the first logical space. Afterwards, the target hard disk can send the identifier of the created hard disk logical space to the processor.

[0043] Since the data sizes currently stored on different hard disks included in the storage device may be different, that is, the sizes of the remaining storage space (or physical space) of the multiple hard disks may be different. Therefore, when the storage device determines the target hard disk from the multiple hard disks included according to the first logical space size, the size of the remaining storage space of each hard disk in the multiple hard disks can be determined, and a hard disk with a remaining storage space size greater than or equal to the first logical space size can be selected from the multiple hard disks as the target hard disk.

[0044] Furthermore, since there may be one or more hard disks whose remaining storage space is greater than or equal to the first logical space size, if there are more than one hard disks, the storage device may also select a hard disk whose remaining storage space is greater than or equal to the first logical space size as the target hard disk from the multiple hard disks according to the load balancing algorithm.

[0045] For some hard disks, when the data in a certain erase block is full, all the data in the entire erase block must be erased before new data can be written. For example, for a hard disk with NAND media, when the data in a certain erase block is full, all the data in the entire erase block must be erased before new data can be written. In this way, when the target hard disk performs garbage collection, if all the data in an erase block is invalid data, then the erase block can be directly erased. If part of the data in an erase block is invalid data and the remaining part of the data is valid data, then the valid data needs to be moved. Since this part of the valid data has been written once, it is written again during this move. This phenomenon is called write amplification. In order to avoid write amplification during garbage collection, the hard disk logical space 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 degree of hotness or the same life cycle. That is, the size of the physical space allocated by the target hard disk for the created hard disk logical space is an integer multiple of the size of an erase block. When the data stored in one or more erase blocks have the same hotness or coldness, or the same life cycle, the data in the same erase block will most likely become invalid data at the same time, or will all be valid data at the same time. It is relatively rare that part of the data is invalid data and the other part is valid data. In this way, during garbage collection, data movement will be reduced, thereby reducing write amplification.

[0046] It should be noted that the size of the hard disk logical space created in the target hard disk may not be an integer multiple of the size of an erase block. In this case, a certain erase block may correspond to two hard disk logical spaces. In order to reduce data movement during garbage collection and thus reduce write amplification, the hotness or coldness of the data stored in this erase block may also be the same, or have the same life cycle. In other words, the hotness or coldness of the data corresponding to the two hard disk logical spaces may also be the same, or have the same life cycle. In other words, when the target hard disk allocates corresponding physical space to the two hard disk logical spaces, the physical space corresponding to the two hard disk logical spaces is continuous. Of course, in some cases, the difference between the hotness or coldness of the data stored in this erase block is less than a certain threshold, or the difference between the life cycles is less than a certain threshold.

[0047] For example, Figure 2 As shown in , for an erase block, if the data corresponding to the same business logic space is written in the erase block, that is, the data written in the erase block has the same degree of hotness and coldness, then after the physical space corresponding to the business logic space is released, the erase block can be directly erased. Figure 3 As shown, for an erase block, if data corresponding to two business logic spaces are written in the erase block, if the data corresponding to the two business logic spaces have different degrees of hotness and coldness, then after the physical space corresponding to one business logic space is subsequently released, the data corresponding to the other business logic space is still valid, so the erase block cannot be directly erased at this time. If you want to erase the erase block, you need to move the valid data. Therefore, in an embodiment of the present application, setting the hotness and coldness of the data stored in the same erase block to be the same or similar can reduce write amplification during garbage collection.

[0048] In the embodiment of the present application, the write amplification in the garbage collection process can be reduced not only by the above method, but also by other methods. For example, in the process of creating a hard disk logical space in the target hard disk, the size of the hard disk logical space in the target hard disk is adjusted so that the size of the hard disk logical space is equal to an integer multiple of the size of an erase block.

[0049] Next, two implementation methods of adjusting the size of the hard disk logical space in the target hard disk are introduced.

[0050] In the first implementation, before the storage device creates a hard disk logical space in the target hard disk, 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, which is equal to an integer multiple of the size of an erase block. Afterwards, according to the second logical space size, the target hard disk is determined from the multiple hard disks, and then a 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.

[0051] The second implementation method is that before the storage device creates a hard disk logical space in the target hard disk, 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 send a configuration recommendation message to the client, and 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. If the storage device receives an agreed recommendation response sent by the client, it determines the target hard disk from the multiple hard disks based on the second logical space size, and then creates a hard disk logical space in the target hard disk, and allocates the corresponding physical space 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.

[0052] In the above two implementations, the size of the second logical space may be larger 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 smaller than the size of an erase block.

[0053] It should be noted that in the above two implementations, the implementation method in which the storage device selects the target hard disk according to the second logical space size is the same as the implementation method in which the target hard disk is selected according to the first logical space size. Moreover, the implementation method in which the storage device creates a hard disk logical space in the target hard disk according to the first logical space size and allocates a corresponding physical space to the hard disk logical space is the same as the implementation method in which the storage device creates a hard disk logical space in the target hard disk according to the first logical space size and allocates a corresponding physical space to the hard disk logical space, and the embodiments of the present application will not be described in detail.

[0054] In addition, for the second implementation method mentioned above, if the client does not agree to create the hard disk logical space according to the second logical space size, then the storage device can reduce write amplification by storing data with the same or similar hotness or coldness, or the same or similar life cycle on the same erase block.

[0055] Usually, there is reserved space in the hard disk, which can be used to store valid data during the garbage collection process. However, if the above method is used, the movement of valid data during the garbage collection process can be avoided, which can reduce the size of the reserved space, so that more data can be stored on the hard disk and the cost can be reduced.

[0056] Based on the creation process of the above logical space, it can be known that the business logical space is for the client, and the hard disk logical space is for the hard disk. The business logical space created by the client requesting the storage device is to facilitate subsequent data access, and usually, 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 logical space and the identifier of the hard disk logical space, the storage device can store the corresponding relationship between the identifier of the business logical space and the identifier of the hard disk logical space. That is, create the corresponding relationship between the business logical space and the hard disk logical space. And after the storage device determines the target hard disk from the multiple hard disks, the storage device can also store the corresponding relationship between the identifier of the target hard disk and the identifier of the business logical space. Or, optionally, the storage device can store the corresponding relationship between the identifier of the business logical space, 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 can store the mapping relationship between the hard disk logical space and the physical space allocated for the hard disk logical space. That is, store the mapping relationship between the identifier of the hard disk logical space and the address range of the physical space allocated for the hard disk logical space.

[0057] Optionally, when the logical space created by the client request also has data protection attributes, the first logical space creation request needs to carry data protection attributes in addition to the size of the first logical space. The data protection attributes may include multiple copies, erasure codes (EC), etc. Taking multiple copies as an example, in the process of creating a logical space by the storage device according to the above method, the selected target hard disks may be multiple, that is, the selected multiple target hard disks correspond one to one with the multiple copies. Afterwards, a hard disk logical space can be created on each of the multiple target hard disks according to the same method as above. Then, the correspondence between the identifier of the business logical space, the identifier of the target hard disk, and the identifier of the hard disk logical space is stored to create a correspondence between the business logical space and the hard disk logical spaces in the multiple target hard disks.

[0058] It should be noted that when the data protection attribute is EC or other attributes, the process of creating logical space by the storage device may be different from the above process, but the main idea is the same, which is obtained by appropriately transforming the above process according to the characteristics of different data protection attributes.

[0059] After describing the process of creating a logical space by a client request, the data access method provided by the embodiment of the present application is described next. Figure 4 , Figure 4 1 is a flow chart of a data access method provided by an embodiment of the present application. The method comprises the following steps.

[0060] 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.

[0061] Based on the above description, the business logic space is created by requesting 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, and the offset is used to indicate the length information of the area in the physical space allocated for the business logic space where data is currently written.

[0062] Step 402: The storage device determines a target hard disk among the multiple hard disks according to the address of the business logical space, and determines the address of the hard disk logical space corresponding to the business logical space.

[0063] Since the storage device stores the correspondence between the business logical space identifier, the target hard disk identifier and the hard disk logical space identifier during the process of creating the logical space, the storage device can determine the target hard disk identifier and the hard disk logical space identifier from the correspondence based on the business logical space identifier.

[0064] It should be noted that the address of the hard disk logical space may also include the identifier and offset of the hard disk logical space. The offset included in the address of the hard disk logical space may be the offset included in the address of the service logical space.

[0065] Step 403: 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 append-write manner according to the determined address of the hard disk logical space.

[0066] The so-called append write can be understood as writing data in an append manner, that is, the append write method means that the written data is organized in the order of writing time. And, after a program process writes data in this way, the subsequent process will no longer perform write operations on the area where the data is located, but only read operations.

[0067] According to the above description, the offset is used to indicate the length information of the area in the physical space allocated for the business logical space where data has been currently written. 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 based on the address of the hard disk logical space, and then start writing the target data from the starting address.

[0068] In the case where 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 append write manner according to the determined address of the hard disk logical space. The implementation process is as follows: 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 hard disk logical space. After the target hard disk receives the second data write request, it writes the target data into the physical space corresponding to the hard disk logical space in an append write manner according to the address of the hard disk logical space.

[0069] Since the target hard disk stores a mapping relationship between the identification of the hard disk logical space and the address range of the physical space allocated for the hard disk logical space, when the target hard disk receives the second data write request, it can determine the address range of the physical space allocated for the hard disk logical space from the mapping relationship according to the identification of the hard disk logical space. Then, according to the offset included in the address of the hard disk logical space, a starting address is determined from the address range, and the target data is written from the starting address.

[0070] In an embodiment of the present application, 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 logical space through the address of the business logic space, and then accesses the target hard disk according to the address of the hard disk logical space. Based on the above description, the business logic space is for the client, and the hard disk logical space is for the target hard disk. Both are logical spaces, but different limitations are added for the convenience of distinction. Therefore, it can be seen that the way the client accesses the storage device and the way the storage device accesses the target hard disk are the same, so when the target data is written to the physical space corresponding to the hard disk logical space in the target hard disk in an append write manner, the address conversion in the hard disk is not performed. This will save overhead and increase the data write rate.

[0071] In some embodiments, the storage device can also write metadata corresponding to the business logic space to the target hard disk. In particular, after the business logic space is closed, the metadata needs to be written to the target hard disk to persist the metadata. The metadata includes relevant information about the hard disk logical space, such as the total size of the hard disk logical space, the size of the currently written data, the end position of the currently written data, etc. Among them, the process of the storage device writing metadata is similar to the above-mentioned process of writing target data, and the embodiments of the present application will not be repeated here.

[0072] It should be noted that the physical space corresponding to the metadata corresponding to the business logical space on the target hard disk 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 may 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 hard disk logical space, and the physical space corresponding to this logical space is used to store the metadata corresponding to the business logical space.

[0073] The above steps 401-403 are the implementation process of the storage device writing data according to the logical space. Next, the process of the storage device reading data according to the logical space is introduced.

[0074] The storage device receives a first data read request from a client, the first data read request carrying 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, a 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. Afterwards, the storage device can read data from the physical space corresponding to the hard disk logic space in the target hard disk according to the length of the data to be read and the address of the hard disk logic space.

[0075] It should be noted that, during the data reading process, the address of the business logic space also includes the identification and offset of the business logic space. However, unlike the data writing process, the offset is used to indicate the length information between the starting address of the data to be read and the starting 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 determines the address of the hard disk logic space corresponding to the business logic space in the same way as in the above step 402, and the embodiments of the present application will not be repeated here.

[0076] Among them, the implementation process of the storage device reading data from the physical space corresponding to the hard disk logical space in the target hard disk according to the length of the data to be read and the address of the hard disk logical space can be: 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, and then starts reading data from the starting address according to the length of the data to be read.

[0077] In the case where the storage device includes a memory, a processor, and a hard disk, 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 as follows: the processor runs the 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 determined address of the hard disk logical space. After the target hard disk receives the second data read request, it 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.

[0078] Since the target hard disk stores a mapping relationship between the identification of the hard disk logical space and the address range of the physical space allocated for the hard disk logical space, when the target hard disk receives the second data read request, the address range of the physical space allocated for the hard disk logical space can be determined from the mapping relationship according to the identification of the hard disk logical space. Then, a starting address can be determined from the address range according to the offset included in the address of the hard disk logical space.

[0079] Similar to the data writing process, when reading data from the physical space corresponding to the logical space of the hard disk in the target hard disk, no address conversion is performed in the hard disk, thereby saving overhead and improving the data reading rate.

[0080] It should be noted that after the storage device creates the business logical space and the hard disk logical space, the status of the business logical space and the hard disk logical space is set to open by default. However, when the physical space corresponding to the subsequent hard disk logical space is full of data, the client requests to close the business logical space, or the business logical space is closed due to an abnormality, the storage device can set the status of the business logical space and the status of the hard disk logical space on the target hard disk to be closed. In this way, data cannot be written through the business logical space and the hard disk logical space on the target hard disk in the future, but data can still be read normally.

[0081] Since the target hard disk may periodically maintain resources, the storage device not only sets the state of the business logical space to the closed state, but also needs to set the state of the hard disk logical space on the target hard disk to the closed state. In this way, when the target hard disk maintains resources, the physical space corresponding to the hard disk logical space in the closed state does not need to be maintained, thereby saving resources.

[0082] If the client requests to delete the business logical space, the storage device can set the state of the business logical space and the state of the hard disk logical space to be deleted, and release the corresponding physical space. In this way, when garbage collection is performed, the physical space corresponding to the hard disk logical space in the deleted state can be erased.

[0083] Since the logical space provided by the embodiment of the present application has some similar characteristics to a log, the logical space can be called a persistence log (plog), and the method for operating the logical space is called a plog interface. That is, the processor and hard disk of the storage device are provided with a plog interface. For example, in Figure 5 In the storage system shown, the hard disk is described by taking a solid state drive (SSD) as an example, a client is installed on the user host, the storage device provides a plog interface for the user host, and the SSD disk also provides a plog interface. In this way, when the client needs to access 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, ensuring the uniformity of the access method, so that there is no need to convert the data organization method, the data reading and writing efficiency is very high, and the storage device does not need to manage the physical space in the hard disk, and does not need to handle complex tasks such as garbage collection, which greatly simplifies the storage system.

[0084] In some embodiments, for Figure 5 In the storage system shown, smart network cards can be set in both the user host and the storage device, so that data can be read and written directly through the smart network card in the future without the participation of the processor in the storage device. 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 is true 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.

[0085] It is worth noting that although data reading and writing can be achieved through smart network cards, operations at the control level still require the participation of the storage device's processor. For example, operations such as creating, deleting, and closing logical space also require the participation of the storage device's processor.

[0086] In an embodiment of the present application, the storage device can determine the target hard disk and the address of the hard disk logical space corresponding to the business logical space according to the address of the business logical space carried in the first data write request sent by the client, and then write the target data into the target hard disk according to the address of the hard disk logical space. That is, the client accesses the storage device through the address of the business logical space, and inside the storage device, the address of the business logical space is converted into the address of the hard disk logical space, and the hard disk writes data according to the address of the hard disk logical space. It can be seen that only one address conversion is required, which saves overhead and improves data reading and writing efficiency.

[0087] Figure 6 021 is a schematic diagram of a data access device provided by an embodiment of the present application. The device is located in a storage device and is executed by calling a program code in a memory 022 by a processor 021. The device can be implemented as part or all of a storage device by software, hardware, or a combination of both. The storage device may include multiple hard disks. Figure 6 The device includes: a receiving module 601, a determining module 602 and a writing module 603.

[0088] The receiving module 601 is used to receive 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;

[0089] A determination module 602 is used to determine a target hard disk among the multiple hard disks according to the address of the business logic space, and to determine the address of the hard disk logic space corresponding to the business logic space;

[0090] The writing module 603 is used to write the target data into the physical space corresponding to the hard disk logical space in the target hard disk in an append writing manner according to the determined address of the hard disk logical space.

[0091] Optionally, when the target data is written into the physical space corresponding to the hard disk logical space in the target hard disk in an append-write manner, no address conversion is performed in the hard disk.

[0092] Optionally, the device further comprises:

[0093] A creation module is used to create a correspondence between business logic space and hard disk logic space.

[0094] Optionally, the hard disk logical space corresponds to one or more erase blocks, and the data stored in the one or more erase blocks have the same degree of coldness or hotness, or the same life cycle.

[0095] Optionally, the device further comprises:

[0096] The adjustment module is used to adjust the size of the hard disk logical space so that the size of the hard disk logical space is equal to an integral multiple of the size of an erase block.

[0097] In an embodiment of the present application, the storage device can determine the target hard disk and the address of the hard disk logical space corresponding to the business logical space according to the address of the business logical space carried in the first data write request sent by the client, and then write the target data into the target hard disk according to the address of the hard disk logical space. That is, the client accesses the storage device through the address of the business logical space, and inside the storage device, the address of the business logical space is converted into the address of the hard disk logical space, and the hard disk writes data according to the address of the hard disk logical space. It can be seen that only one address conversion is required, which saves overhead and improves data reading and writing efficiency.

[0098] It should be noted that: the data access device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when accessing data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data access device provided in the above embodiment and the data access method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0099] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc. It is worth noting that the computer-readable storage medium mentioned in the present application may be a non-volatile storage medium, in other words, a non-transient storage medium.

[0100] It should be understood that the "at least one" mentioned herein refers to one or more, and "multiple" refers to two or more. In the description of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.

[0101] The above-mentioned embodiments are provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data access method, It is characterized in that The method is applied to a storage device, the storage device includes a plurality of hard disks, and the method includes: The storage device receives a first data write request from a client, the first data write request carries target data to be written and an address of a service logic space corresponding to the target data, the service logic space is created by the storage device according to the request of the client, and the client accesses the storage device through the service logic space; The storage device determines a target hard disk among the multiple hard disks according to the address of the service logical space, and determines the address of the hard disk logical space corresponding to the service logical space; 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 append-write manner according to the determined address of the hard disk logical space; Before the storage device receives a first data write request from a client, the storage device further includes: A correspondence between the business logical space and the hard disk logical space is created.

2. The method according to claim 1, It is characterized in that When the target data is written into the physical space corresponding to the hard disk logical space in the target hard disk in the appended writing manner, no address conversion in the hard disk is performed.

3. The method according to any one of claims 1 to 2, It is characterized in that The hard disk logical space corresponds to one or more erase blocks, and the data stored in the one or more erase blocks have the same degree of coldness or the same life cycle.

4. The method according to any one of claims 1 to 2, It is characterized in that The method further comprises: The size of the hard disk logical space is adjusted so that the size of the hard disk logical space is equal to an integral multiple of the size of an erase block.

5. A data access device, It is characterized in that The device is located in a storage device, the storage device includes a plurality of hard disks, and the device includes: a receiving module, configured to receive a first data write request from a client, wherein the first data write request carries target data to be written and an address of a business logic space corresponding to the target data, wherein the business logic space is created by the storage device according to the request of the client, and the client accesses the storage device through the business logic space; A determination module, configured to determine a target hard disk among the multiple hard disks according to the address of the business logic space, and determine the address of the hard disk logic space corresponding to the business logic space; A writing module, used for writing the target data into the physical space corresponding to the hard disk logical space in the target hard disk in an append-write manner according to the determined address of the hard disk logical space; The device also includes: A creation module is used to create a corresponding relationship between the business logical space and the hard disk logical space.

6. The device as claimed in claim 5, It is characterized in that When the target data is written into the physical space corresponding to the hard disk logical space in the target hard disk in the appended writing manner, no address conversion in the hard disk is performed.

7. The device according to any one of claims 5 to 6, It is characterized in that The hard disk logical space corresponds to one or more erase blocks, and the data stored in the one or more erase blocks have the same degree of coldness or the same life cycle.

8. The device according to any one of claims 5 to 6, It is characterized in that The device also includes: The adjustment module is used to adjust the size of the hard disk logical space so that the size of the hard disk logical space is equal to an integral multiple of the size of an erase block.

9. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Logical file management system in disk shared cluster system

    JP2000040026A