Data access method and apparatus for storage device, and electronic device and storage medium
Patent Information
- Application Number
- PCT/CN2025/120479
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-02-27
- Filing Date
- 2025-09-10
- Publication Date
- 2026-09-03
Smart Images

Figure CN2025120479_03092026_PF_FP_ABST
Abstract
Description
Data access methods and apparatus for storage devices, electronic devices and storage media
[0001] Cross-references to related applications
[0002] This application claims priority to Chinese Patent Application No. CN202510227353.3, filed on February 27, 2025, entitled “Data Access Method and Apparatus for Storage Device, Electronic Device and Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of data processing technology, and in particular to a data access method and apparatus for a storage device, an electronic device, and a storage medium. Background Technology
[0004] When a user uses a storage device, they can first create a volume on the storage device and then map the volume to the user's server. Once a volume on the storage device is mapped to the server, it is equivalent to a physical hard drive on the server. The user can then perform operations based on this hard drive, such as mounting file systems or virtualizing it as a C drive, D drive, etc. under the operating system.
[0005] In related technologies, a volume of a storage device can utilize one processor resource of the storage device. When accessing data on a volume of the storage device, the data access is performed serially, taking advantage of the corresponding processor resource. However, the data access methods for storage devices in related technologies suffer from low data access efficiency. Summary of the Invention
[0006] This application provides a data access method and apparatus for a storage device, an electronic device, and a storage medium to at least solve the problem of low data access efficiency in data access methods for storage devices in related technologies.
[0007] According to a first aspect, a data access method for a storage device is provided, comprising: determining multiple storage intervals into which the data volume is divided, wherein, when a data volume on the storage device allows the use of multiple processor resources of the storage device, one of the multiple storage intervals corresponds to one of the multiple processor resources; determining a target storage interval from the multiple storage intervals that corresponds to a data access request for the data volume; and performing a data access operation requested by the data access request on the target storage interval using the processor resource corresponding to the target storage interval.
[0008] According to the second aspect, a data access apparatus for a storage device is also provided, comprising: a first determining unit configured to determine, when a data volume on the storage device is allowed to use multiple processor resources of the storage device, multiple storage intervals into which the data volume is divided, wherein one of the multiple storage intervals corresponds to one of the multiple processor resources; a second determining unit configured to determine, from the multiple storage intervals, a target storage interval corresponding to a data access request for the data volume; and an execution unit configured to use the processor resource corresponding to the target storage interval to perform the data access operation requested by the data access request on the target storage interval.
[0009] According to a third aspect, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the steps of the data access method of any of the aforementioned storage devices through the computer program.
[0010] According to the fourth aspect, a non-volatile readable storage medium is also provided, wherein a computer program is stored in the non-volatile readable storage medium, wherein the computer program is configured to execute the steps of the data access method of any of the above-described storage devices at runtime.
[0011] According to a fifth aspect, a computer program product or computer program is provided, comprising computer instructions stored in a non-volatile readable storage medium. A processor of a computer device reads the computer instructions from the non-volatile readable storage medium and executes the computer instructions, causing the computer device to perform the steps of any of the data access methods for the storage device described above.
[0012] This application addresses the issue of low data access efficiency in storage device data access methods. Since a strategy of dynamically allocating processor resources based on the storage interval corresponding to a data access request is adopted when a data volume on a storage device allows the use of multiple processor resources, this approach splits the data volume into multiple storage intervals and dynamically allocates data access requests to the corresponding processor resources based on the correspondence between storage intervals and processor resources. This allows data access to a single data volume to be scheduled for processing by multiple processor resources, improving processor resource utilization. Furthermore, having multiple processor resources handle data access to the same data volume improves data access efficiency. Therefore, this solution addresses the technical problem of low data access efficiency in related storage device data access methods. Attached Figure Description
[0013] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 is a schematic diagram of an application scenario of a data access method for a storage device according to an embodiment of this application.
[0015] Figure 2 is a flowchart illustrating a data access method for a storage device according to an embodiment of this application.
[0016] Figure 3 is a schematic diagram of a data access method for a storage device according to an embodiment of this application.
[0017] Figure 4 is a schematic diagram of another data access method for a storage device according to an embodiment of this application.
[0018] Figure 5 is a schematic diagram of another data access method for a storage device according to an embodiment of this application.
[0019] Figure 6 is a structural block diagram of a data access device for a storage device according to an embodiment of this application. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0021] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0022] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] According to one aspect of the embodiments of this application, a data access method for a storage device is provided. In some embodiments, the data access method for the storage device described above can be applied, but is not limited to, to a hardware environment including a terminal device 102, a server 104, a storage device 106, and a disk 108 as shown in FIG. 1. The server 104 can be connected to the terminal device 102 and the storage device 106 via a network. The disk 108 can be part of the storage device 106 and can be used for data storage. When the terminal device 102 needs to access data stored on the disk 108 (e.g., read or write data), it can send a data access request to the corresponding storage device 106 through the server 104. The storage device 106 can respond to the data access request and perform a data access operation on the corresponding disk 108.
[0024] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. Terminal device 102 may be, but is not limited to, PC (Personal Computer), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, cloud server, server cluster, or other server types. Disk 108 may include, but is not limited to, at least one of the following: disk, such as hard disk, floppy disk, etc.; non-disk, such as solid-state drive, optical disk, USB flash drive, etc.
[0025] The data access method for the storage device in this embodiment can be executed by the storage device 106, or by the storage device 106 in conjunction with at least one of the terminal device 102 and the server 104. The data access method for the storage device in this embodiment can also be executed by a client installed on the terminal device 102.
[0026] Taking the storage device data access method of this embodiment executed by storage device 106 as an example, FIG2 is a schematic flowchart of a storage device data access method according to an embodiment of the present application. As shown in FIG2, the process of the method may include steps S202 to S206.
[0027] Step S202: If the data volume on the storage device allows the use of multiple processor resources of the storage device, determine the multiple storage intervals into which the data volume is split, wherein one of the multiple storage intervals corresponds to one of the multiple processor resources.
[0028] Step S204: Determine the target storage region corresponding to the data access request of the data volume from multiple storage regions.
[0029] Step S206: Using the processor resources corresponding to the target storage region, perform the data access operation requested by the data access request on the target storage region.
[0030] The data access method for the storage device in this embodiment can be applied to the field of data processing, specifically to scenarios where processor resources are used to process data access requests for data volumes. In the data processing field, when using a storage device, a user can create a data volume on the storage device, and this data volume can be mapped to a server. Once a data volume on the storage device is mapped to the server, it is equivalent to a physical hard drive on the server (similar to a laptop's hard drive). The user can then perform operations based on this hard drive, such as mounting a file system or virtualizing it as a C drive, D drive, etc., under the operating system.
[0031] It's important to note that a data volume is a volume used to store data; it can also be called a volume or storage volume. A storage device can be called storage or a storage system. A storage device can have multiple disks. A storage device can be understood as the part between a server and disks, and it can include memory, cache, and RAID (Redundant Array of Independent Disks) functional modules (which can be implemented in hardware or software). The RAID functional module is used to determine which disk data access should be routed to.
[0032] Based on user configuration or default configuration, multiple disks can be divided into multiple pools (storage resource pools). A data volume can belong to a pool, and its usable space is limited to the disks within its pool, without exceeding the pool's capacity. When a user accesses data on a data volume, they can send a data access request to the server through their terminal device. Since the data disk of the storage device is mapped to the server's physical hard drive, the server forwards the data access request to the storage device (potentially performing some packaging, such as re-encapsulating the request message). The storage device (e.g., its RAID module) can respond to the data access request, determine the disk to which the accessed data belongs, and thus complete the data access.
[0033] When using storage devices, users can create different numbers of data volumes based on their individual needs. For example, if a user requires multiple data volumes, they can create multiple data volumes and map them to the same or multiple servers as multiple physical hard drives. The mapping relationship between data volumes and servers is shown in Figure 3. The storage device includes multiple data volumes, denoted as data volume 1, data volume 2, ..., data volume n. These multiple data volumes are mapped to multiple servers, denoted as server 1, server 2, ..., server n. One server can correspond to one or more data volumes. Conversely, if a user only needs one data volume, it can be mapped to a server as a single physical hard drive. The number of volumes created on the storage device depends on the user's needs.
[0034] In computer systems, data access to storage devices is typically performed through data access requests. These requests can include, but are not limited to, at least one of the following: data read requests and data write requests (data read requests and data write requests can be collectively referred to as I / O (Input / Output)). For storage devices, data access requests require processor resources. These processor resources can be resources on the processor itself, including, but are not limited to, at least one of the following: processor cores (i.e., CPU (Central Processing Unit) cores), cache resources, memory resources, etc. In at least some examples of this embodiment, processor resources are described using processor cores as an example; the processing method for other types of processor resources can be similar.
[0035] In related technologies, to facilitate business processing, a single data volume typically utilizes only one processor core. This allows for simplified business processes across multiple data volumes, leveraging the single-core serial execution capability of the processor. These business processes can be data access. For example, the method of selecting different processor cores for user I / O on a single volume involves using a single processor core for all I / O operations on that volume. However, this data access method on data volumes is inefficient. Furthermore, modern processors are typically multi-core; for instance, industrially used processors can have a dozen or more cores. Multiple processor cores are only utilized when multiple data volumes are established, thus fully leveraging the processor's core capacity. When the number of data volumes is small (e.g., only one data volume), fewer processor cores can be used, failing to fully utilize the processor's performance. In such scenarios, this results in low processor resource utilization and a poor user experience regarding storage performance.
[0036] To at least partially solve the above-mentioned technical problems, in this embodiment, a mode can be configured whereby a data volume on the storage device is allowed to use multiple processor resources of the storage device. In this mode, the data volume is split into multiple storage intervals corresponding to processor resources (i.e., the data volume is split into multiple smaller intervals), and the corresponding processor resources are used to perform data access operations according to the storage interval corresponding to the data access request. This achieves the goal of using multiple processor resources for one data volume, which can not only improve data access efficiency, but also improve the utilization rate of processor resources and reduce the waste of processor performance.
[0037] In this embodiment, the storage device can obtain the number of available processor resources. Taking processor resources as processor cores as an example, firstly, the number of available processor cores in a single-volume (i.e., a single data volume) scenario is determined. This number of available processor cores can be obtained by the storage system's configuration module; these processor cores are the processor cores that the data volume can use in a single-volume scenario. If there are multiple available processor resources on the storage device, then the mode in which the data volume on the storage device uses the storage device's processor resources is determined. The method for determining the mode in which the data volume on the storage device uses the storage device's processor resources can be: determining the mode in which the data volume uses the storage device's processor resources from a first usage mode and a second usage mode, wherein the first usage mode is a mode in which the data volume is allowed to use a single processor resource, and the second usage mode is a mode in which the data volume is allowed to use multiple processor resources of the storage device.
[0038] In some embodiments, the storage device can also obtain the number of data volumes created on the storage device. If there are multiple available processor resources on the storage device, it can be further determined that the number of data volumes on the storage device is greater than a preset threshold. If the number of data volumes on the storage device is greater than the preset threshold, the mode of how the data volumes on the storage device use the storage device's processor resources is then determined. The preset threshold can be a fixed value, which can be related to the number of processor resources on the storage device; for example, it can be half, one-third, etc., of the storage device's processor resources. The preset threshold can also be a non-fixed value, which can be related to the number of available processor resources on the storage device; for example, it can be half, one-third, etc., of the storage device's available processor resources. In this embodiment, the preset threshold is not limited.
[0039] Here, a data volume can be an independent storage unit created by a user on a storage device (i.e., data volumes are independent of each other), which can be mapped to the server's physical hard drive. The collection of disks on the storage device can be divided into one or more storage resource pools, and a data volume can belong to a storage resource pool, allowing the use of the disks within that pool. Through data volumes, users can utilize the disks on the storage device.
[0040] When a data volume on a storage device is allowed to use multiple processor resources of the storage device, the data volume is determined to be split into multiple storage regions. Here, the splitting of the data volume can be based on the logical address of the data volume or on the data volume size. Furthermore, the splitting of the data volume can be performed after it is determined that the data volume on the storage device is allowed to use multiple processor resources of the storage device, or it can be performed in advance. That is, the data volume is split in advance, the splitting result is recorded through configuration information, and after it is determined that the data volume on the storage device is allowed to use multiple processor resources of the storage device, the splitting result is directly determined based on the configuration information. Other methods for determining the splitting result can also be used, which are not limited in this embodiment. The multiple processor resources can be all the processor resources of the storage device or the processor resources available to the storage device. One storage region corresponds to one processor resource among the multiple processor resources, and one processor resource can correspond to one storage region or simultaneously correspond to at least two storage regions.
[0041] Upon receiving a data access request for a data volume, the target storage region corresponding to the data access request can be determined from multiple storage regions. Here, the data access request can be a read request or a write request for the data volume. Regardless of the type of data access request, it requests to perform data access operations on a segment of storage space on the data volume. The storage region to which the aforementioned storage space belongs is the target storage region. The target storage region may include one storage region or at least two storage regions. The storage space requested for access by the data access request can be determined by the address information or address indication information carried in the data access request, or other determination methods can be used, which are not limited in this embodiment.
[0042] After determining the target storage region corresponding to the aforementioned data access request, the processor resource corresponding to the target storage region can be determined based on the correspondence between storage regions and processor resources. The determined processor resource is the processor resource that will process the data access request. Then, the corresponding processor resource can be used to perform access operations on the data requested by the data access request. Since the target storage region can contain one or more storage regions, the number of processor resources corresponding to the aforementioned target storage region can also be one or more.
[0043] It should be noted that there can be one or more data volumes on a storage device. For each data volume, provided it is allowed to use multiple processor resources of the storage device, data access requests can be processed in the same or similar manner as described above. Different data volumes can be allowed to use the same or different processor resources of the storage device. For a data volume, there can be one or more data access requests, and the processing method for different data access requests can be the same or similar to the method described above for processing data access requests.
[0044] The embodiments provided in this application, where a data volume on a storage device is allowed to use multiple processor resources of the storage device, determine that the data volume is divided into multiple storage regions, wherein one of the multiple storage regions corresponds to one of the multiple processor resources; determine the target storage region corresponding to the data access request of the data volume from the multiple storage regions; and use the processor resource corresponding to the target storage region to perform the data access operation requested by the data access request on the target storage region. This solves the technical problem of low data access efficiency in the data access methods of storage devices in related technologies and improves data access efficiency.
[0045] In one exemplary embodiment, when a data volume on a storage device is allowed to use multiple processor resources of the storage device, determining that the data volume is divided into multiple storage intervals includes: determining that the data volume is divided into multiple storage intervals according to a first interval size, when the data volume is allowed to use multiple processor resources.
[0046] In this embodiment, to ensure the rationality and convenience of data volume splitting, the data volume can be split according to a certain interval size. The interval size used to split the data volume can be a first interval size. Correspondingly, if the data volume allows the use of multiple processor resources, multiple storage intervals into which the data volume is split according to the first interval size can be determined. Here, the interval size of each of the multiple storage intervals is less than or equal to the first interval size. The interval size of the multiple storage intervals after the data volume is split should be as equal to the first interval size as possible. If the first interval size cannot divide the data volume equally, the remaining storage interval with an interval size smaller than the first interval size can be used as the last split storage interval.
[0047] In some embodiments, each of the multiple storage regions may have a unique region number, and processing of the storage region may be performed based on the region number. The region number may start from 0 or 1 and increment sequentially, or other numbering methods may be used. Similarly, each of the multiple processor resources may have a unique resource number, and processing of the processor resource may be performed based on the resource number. The resource number may start from 0 or 1 and increment sequentially, or other numbering methods may be used.
[0048] For example, if the first interval size is 10M and the data volume to be split is 1024M, the data volume can be split into 1024 / 10+1 = 103 storage intervals. That is, 102 storage intervals with a size equal to the first interval size of 10M, and 1 storage interval with a size of 4M. Each storage interval has a corresponding number, for example, starting from 0 to N (where N is 102).
[0049] In this embodiment, by splitting the data volume according to the first interval size, multiple storage intervals can be obtained. By using multiple storage intervals with multiple processor resources, the utilization rate of processor resources can be improved, thereby improving data access efficiency.
[0050] In one exemplary embodiment, when the data volume allows the use of multiple processor resources, determining the multiple storage regions into which the data volume is divided according to a first interval size includes: when the data volume allows the use of multiple processor resources, dividing the data volume into multiple storage regions according to the first interval size based on the logical address of the data volume.
[0051] In this embodiment, to reduce the amount of data that needs to be stored, after determining that the data volume can use multiple processor resources, the data volume can be split into multiple storage intervals according to a certain interval size. For example, the data volume can be split into multiple storage intervals according to a first interval size. To facilitate the splitting of the data volume, it can be split into multiple storage intervals according to the logical address of the data volume. For example, based on the logical address of the data volume, the data volume can be split into multiple storage intervals according to a first interval size.
[0052] Here, a logical address is an abstract address used in a storage system to identify and locate data on a data volume. It is typically represented as a linear address space and can be used for data location, data access, and data management. To facilitate the management of multiple storage regions, the linear contiguous nature of logical addresses can be utilized to split logically contiguous address spaces into the same storage region.
[0053] In this embodiment, the data volume is divided into multiple storage ranges based on the logical address of the data volume and a certain range size, which facilitates the management of multiple storage ranges and improves the efficiency of data access.
[0054] In one exemplary embodiment, determining multiple storage regions into which the data volume is divided according to a first interval size, when the data volume allows the use of multiple processor resources, includes: determining multiple storage regions into which the data volume is divided according to a first interval size based on specified configuration information, when the data volume allows the use of multiple processor resources.
[0055] To improve the efficiency and stability of data volume splitting, data volumes can be pre-split, and configuration information can be specified in a configuration file based on the splitting results. This specified configuration information indicates the storage intervals into which the data volume is split, and can include indications of these intervals (e.g., interval number, start address, end address, etc.). For splitting data volumes using multiple interval sizes, the specified configuration information can also include the interval sizes used for splitting. Furthermore, multiple data volumes can be created on the storage device. The specified configuration information for each data volume can be the same, in which case it can also include the data volume's identifier, logical address, etc. Alternatively, the specified configuration information for each data volume can be different, in which case there can be multiple sets of specified configuration information.
[0056] When splitting a data volume according to a first interval size, specified configuration information is used to indicate the storage intervals into which the data volume is split according to the first interval size. After determining that the data volume on the storage device is allowed to use multiple processor resources of the storage device, the multiple storage intervals into which the data volume is split according to the first interval size can be determined based on the specified configuration information. For example, the interval size, interval number, and logical address of each storage interval can be determined. Using the above method, the multiple storage intervals into which the data volume is split according to the first interval size can be directly determined by reading the specified configuration information.
[0057] In this embodiment, by pre-splitting the data volume and recording the information of the split storage intervals through configuration information, the multiple storage intervals into which the data volume is split can be directly determined by reading the above configuration information, which can eliminate the process of splitting the data volume and improve the efficiency and stability of data volume splitting.
[0058] In one exemplary embodiment, after determining that the data volume is divided into multiple storage intervals according to a first interval size, the method further includes: updating the multiple storage intervals to storage intervals divided into the data volume according to a second interval size if the idle rate of the multiple processor resources used during a specified time period is greater than or equal to an idle rate threshold.
[0059] Since the location and size of the data accessed by different data access requests are not fixed, splitting the data volume according to a certain interval size may result in a high idle rate of processor resources. If the idle rate of processor resources is high, the interval size of the data volume split can be reduced, allowing data access requests to select more processor resources for execution.
[0060] Taking processor resources as processor cores and data access requests as I / O as an example, in a single-volume scenario, the current processor core usage can be statistically analyzed. Based on this data, if the idle rate of processor cores is high, the size of the volume partition should be reduced to allow I / O to utilize more processor cores. This is because a high idle rate indicates that the current partition size is limiting the number of cores used for I / O; therefore, the partition size needs to be reduced to ensure that I / O requests entering storage fall within as many partitions as possible, thus maximizing the utilization of processor cores.
[0061] In this embodiment, the idle rate of multiple processor resources can be statistically analyzed within a specified time period. The specified time period can be a period of a certain duration ending at the current time or a specified time, or a period of a certain duration starting at a specified time. The time length can be 5 minutes, 10 minutes, or other durations. If the idle rate is greater than or equal to a preset idle rate threshold, the data volume is re-splittered according to a second interval size smaller than the first interval size. The method of splitting the data volume according to the second interval size is similar to the method of splitting the data volume according to the first interval size in the previous embodiment, and will not be described again in this embodiment.
[0062] It should be noted that the specified configuration information in the foregoing embodiments may include the data volume's splitting scheme under the second interval size. When updating the storage interval, the update can be performed by reading the specified configuration information.
[0063] For example, in a single-volume scenario, the size of the data volume partition storage area can be intelligently adjusted based on processor core usage to ensure that I / O in different scenarios can fully utilize the processor cores. In a single-volume scenario, all processor cores can be used as much as possible for different I / O models to maximize storage performance.
[0064] In this embodiment, when the processor resource idle rate is high, reducing the size of the interval used to split the data volume can increase the number of storage intervals, thereby improving the utilization rate of processor resources and making full use of processor performance.
[0065] In one exemplary embodiment, reducing the interval size can increase the number of storage intervals, thereby making full use of processor resources. However, if the interval size of the split data volume is too small, it will lead to excessively frequent data volume splitting and processor resource switching, impacting performance. Therefore, the range of data volume interval sizes can be limited to N interval sizes. The data volume can be split into storage intervals according to the specified N interval sizes, where N is a positive integer greater than or equal to 2, and the N interval sizes include the first interval size. For the set N interval sizes, it can be ensured that the minimum interval size is not too small. The number of interval sizes N can be set empirically, and the N interval sizes can also be set empirically.
[0066] For example, the range of storage interval sizes can be limited to five levels (i.e., N is 5), with the five levels being 128M, 96M, 64M, 32M, and 16M. Data volumes can be split using any one of these five interval sizes.
[0067] In this embodiment, if there are M interval sizes smaller than the first interval size out of N interval sizes, before updating multiple storage intervals to storage intervals into which the data volume is split according to the second interval size, the interval size used to re-split the data volume, i.e., the second interval size, can be determined first. For the case where M=1, the only interval size smaller than the first interval size can be directly determined as the second interval size.
[0068] For M to be a positive integer greater than or equal to 2, there are several ways to determine the interval size used to re-split the data volume. As one implementation, the largest space size among the M interval sizes can be determined as the second interval size. However, this method of re-determining the interval size may result in situations where the idle rate of processor resources is too high, necessitating a further determination of the interval size used to re-split the data volume.
[0069] As another implementation, if there are M interval sizes smaller than the first interval size among the N interval sizes, the idle rate corresponding to the interval size among the M interval sizes can be estimated based on the usage information of multiple processor resources within a specified time period; if there are interval sizes among the M interval sizes whose corresponding idle rate is less than the idle rate threshold, the largest interval size whose corresponding idle rate is less than the idle rate threshold is determined as the second interval size.
[0070] For M interval sizes smaller than the first interval size, the idle rate corresponding to each of the M interval sizes can be estimated. That is, when the data volume is split into multiple storage intervals according to the interval sizes of the M intervals, the idle rate of the multiple processor resources can be estimated. The idle rate corresponding to each of the M interval sizes can be estimated based on the usage information of the multiple processor resources within a specified time period. This usage information describes the usage of the multiple processor resources within the specified time period. Since the above usage information is related to the storage intervals of the data volume, the idle rate of the multiple processor resources when the data volume is split into multiple storage intervals according to the interval sizes of the M intervals can be estimated based on this usage information.
[0071] If among the M interval sizes, there exists an interval size with a corresponding idle rate less than the idle rate threshold, then the largest interval size with an idle rate less than the idle rate threshold can be selected as the interval size used to re-split the data volume, thus obtaining a second interval size. The split storage intervals are then updated according to this second interval size. Here, multiple storage intervals are storage intervals (or storage areas) obtained by splitting the data volume. Since the interval sizes used to split the data volume differ, the multiple storage intervals will differ. Therefore, if the interval sizes used to split the data volume change, the multiple storage intervals will also be updated. Selecting the largest interval size with an idle rate less than the idle rate threshold avoids excessively frequent data volume splitting and processor resource switching due to excessively small interval sizes, thereby improving storage performance.
[0072] For example, for the aforementioned five tiers, the interval sizes corresponding to the five tiers decrease sequentially. The current tier (i.e., the tier corresponding to the first interval size) is the second tier. Since there are lower tiers, namely the third to fifth tiers, the idle rates corresponding to the third to fifth tiers can be estimated separately. Among them, the idle rates corresponding to the fourth and fifth tiers are both less than the idle rate threshold. In this case, the data volume can be re-splitted using the interval size corresponding to the fourth tier.
[0073] In this embodiment, based on the historical usage of processor resources, the idle rate corresponding to different interval sizes is estimated, and then the largest interval size with an idle rate less than the idle rate threshold is selected as the updated interval size. This can improve storage performance while improving processor resource utilization.
[0074] In one exemplary embodiment, determining the target storage region corresponding to the data access request of the data volume from multiple storage regions includes: determining the target storage region from multiple storage regions based on the starting address and the ending address requested by the data access request.
[0075] When a data access request for a data volume is received, if the storage range partitioning method is fixed, the data access request can directly carry the range identifier (e.g., range number, which can be encapsulated by the server into the data access request). By extracting the range identifier from the data access request, the target storage range can be directly determined. However, this method is neither conducive to improving processor resource utilization nor to reducing the flexibility of processor resource utilization.
[0076] When the storage range partitioning method is not fixed, the data access request can carry the starting address and the ending address to be accessed. Since each storage range has a starting address and an ending address, the target storage range can be determined from multiple storage ranges based on the starting address and the ending address requested by the data access request.
[0077] There are several ways to determine the target storage region from multiple storage regions based on the start address and end address requested by the data access request. For example, each storage region can be traversed sequentially, and the target storage region can be determined based on the start address and end address requested by the data access request, as well as the logical address range of the traversed storage regions. Alternatively, the target storage region can be determined based on the start address and end address requested by the data access request, according to a set correspondence between logical addresses and storage regions. Other determination methods can also be used, but this embodiment does not limit them.
[0078] In this embodiment, by determining the storage range corresponding to the data access request through the start and end addresses of the data access request, the utilization rate of processor resources can be improved, and the flexibility of processor resource utilization can also be increased.
[0079] In one exemplary embodiment, determining a target storage region from multiple storage regions based on the starting address and the ending address requested by the data access request includes: determining a first storage region to which the starting address requested by the data access request belongs; determining a second storage region to which the ending address requested by the data access request belongs; if the first storage region and the second storage region are the same storage region, determining the first storage region as the target storage region; if the first storage region and the second storage region are adjacent storage regions, determining the first storage region and the second storage region as the target storage region; if the first storage region and the second storage region are not adjacent storage regions, determining the first storage region, the second storage region, and the storage region between the first storage region and the second storage region as the target storage region.
[0080] In this embodiment, considering that the storage space requested by the data access request is usually a contiguous segment of storage space, and the logical addresses of multiple storage spaces are usually also contiguous, the target storage address can be determined after determining the storage interval to which the starting address and ending address of the data access request belong. Therefore, a first storage interval to which the starting address of the data access request belongs can be determined from multiple storage intervals, a second storage interval to which the ending address of the data access request belongs can be determined from multiple storage intervals, and the target storage interval is determined based on whether the first and second storage intervals are the same storage interval.
[0081] Storage intervals are divided according to certain interval sizes. Therefore, the starting address requested by a data access request can be determined based on the interval size. If the starting address of the first storage interval is 0, the storage interval to which the requested starting address belongs can be determined by dividing the requested starting address by the interval size (first interval size, second interval size, etc.). If storage intervals are identified by interval numbers starting from 0, the result of dividing the requested starting address by the interval size can be used to determine the storage interval to which the requested starting address belongs. If storage intervals are identified by interval numbers starting from 1, the result of dividing the requested starting address by the interval size plus 1 can be used to determine the storage interval to which the requested starting address belongs. For other cases, a similar calculation method is used to determine the storage interval to which the requested starting address belongs. The method for determining the storage range to which the termination address requested by the data access request belongs is the same as or similar to the method for determining the storage range to which the starting address requested by the data access request belongs, and will not be elaborated here.
[0082] The relationship between the first and second storage intervals can be varied. If the first and second storage intervals are the same, there is no cross-interval issue, and the first storage interval can be designated as the target storage interval. If the first and second storage intervals are adjacent, and the storage space requested by the data access request spans two adjacent intervals, there is a cross-interval issue, and the first and second storage intervals can be designated as the target storage intervals. If the first and second storage intervals are not adjacent, and the storage space requested by the data access request spans more than two intervals, there is also a cross-interval issue, and the first storage interval, the second storage interval, and the storage interval between the first and second storage intervals can be designated as the target storage intervals.
[0083] For example, a data volume with a total size of 1024MB is divided into 103 storage ranges of 10MB each. The logical address of the data volume starts from 0, and the range numbers of the storage ranges also start from 0. For each I / O operation, based on the start and end addresses, the range number of the start address (i.e., the range number of the storage range containing the start address) and the range number of the end address (i.e., the range number of the storage range containing the end address) can be determined: start address / range size = range number of the start address, end address / range size = range number of the end address. This allows us to determine if the I / O operation is within a range. If the range number of the start address equals the range number of the end address, then the I / O operation is considered to have not crossed ranges; otherwise, it is a cross-range I / O operation.
[0084] As shown in Figure 4, interval 0 is the storage interval with interval number 0, interval 1 is the storage interval with interval number 1, and so on, with interval N being the storage interval with interval number N. For the case where the data volume is divided into 103 storage intervals, the value of N is 102. The obtained IOs include: first IO, second IO, and third IO. The storage interval containing the starting address of the first IO is interval 0, and the storage interval containing the ending address of the first IO is interval 2. Therefore, the storage intervals corresponding to the first IO are interval 0, interval 1, and interval 2. The storage interval containing the starting address of the second IO is interval 2, and the storage interval containing the ending address of the second IO is interval 2. Therefore, the storage interval corresponding to the second IO is interval 2. The storage interval containing the starting address of the third IO is interval 3, and the storage interval containing the ending address of the third IO is interval 4. Therefore, the storage intervals corresponding to the third IO are interval 3 and interval 4.
[0085] In this embodiment, by determining the storage ranges to which the start and end addresses of the data access request belong, and thus determining the storage range corresponding to the data access request, the efficiency of data access processing can be improved.
[0086] In one exemplary embodiment, each of the multiple storage regions has a unique region number, and each of the multiple processor resources has a unique resource number. The region number and resource number are similar to those in the previous embodiments and will not be repeated here. To improve the ease of mapping storage regions to processor resources, the storage regions are cyclically mapped to the processor resources according to their region numbers.
[0087] For example, a processor core includes core 0, core 1, and core 2. The storage intervals of a data volume are cyclically mapped to the processor cores according to their interval numbers. The correspondence between the storage intervals of the data volume and the processor cores can be shown in Figure 5. In this figure, interval 0 corresponds to core 0, interval 1 to core 1, interval 2 to core 2, interval 3 to core 0, interval 4 to core 1, interval 5 to core 2, and so on. As another example, assuming the processor has 16 cores, the storage intervals numbered 0-15 correspond to cores 0-15, the storage intervals numbered 16-31 correspond to cores 0-15, and so on.
[0088] Correspondingly, before using the processor resources corresponding to the target storage area to perform the data access operation requested by the data access request, the above method further includes: determining the remainder result obtained by taking the interval number of the target storage area modulo the number of processor resources among the multiple processor resources; and determining the processor resource whose resource number is the remainder result among the multiple processor resources as the processor resource corresponding to the target storage area.
[0089] To quickly determine the corresponding processor resource upon receiving a data access request, and then have that resource process the request, the processor resource corresponding to the target memory region can be directly determined based on its region number. This can be achieved by taking the remainder of the region number divided by the number of processor resources; the resulting value is the resource number of the processor resource used to process the data access request.
[0090] In some embodiments, when the target storage region contains at least two storage regions, each storage region in the target storage region has its corresponding processor resources. Therefore, except for the storage region where the starting address requested by the data access request is located, whose corresponding processor resources are determined using the starting address requested by the data access request, the other storage regions can determine their corresponding processor resources using the starting address of the storage region.
[0091] For example, the algorithm for selecting the processor core for IO can be as follows: divide the starting address by the size of the interval to obtain the interval number of the memory interval to which the IO belongs, and then take the remainder of the interval number by the number of available processor cores. The value obtained is the core number of the processor core to be used by this IO (an example of the resource number of processor resources). The calculation formula can be as shown in formula (1):
[0092] Processor core = I / O start address / range size % number of available processor cores (1)
[0093] Here, in a single-volume scenario, I / O is switched to different processor cores according to its corresponding range number. This changes the previous approach where I / O on a data volume was executed on only one processor core, thus improving IOPS (Input / Output Operations Per Second) in the single-volume scenario. Furthermore, for I / O recovered after a node failure, the same method is used, selecting the corresponding processor core based on the I / O's starting address.
[0094] This embodiment improves the ease of determining processor resources by determining the processor resources corresponding to a storage interval based on the interval number and the number of processor resources.
[0095] In one exemplary embodiment, one of the multiple processor resources may correspond to a request queue (e.g., an I / O data queue), and the request queue of the processor resource among the multiple processor resources can be accessed by threads allocated to the processor resource. The data access operation requested by the processor resource can be implemented by the thread allocated to the processor resource handling the data access request.
[0096] In related technologies, a data volume uses only one processor resource, and the data structure storing data access requests (e.g., a queue) is accessed by only one thread. In this embodiment, a data volume can use multiple processor resources, and the storage of data access requests and control flow data needs to be adapted to multi-threading. To this end, corresponding request queues can be set up for each processor resource that the data volume is allowed to use. Thus, a data volume has multiple queues for access. The original request queues can be split into a queue array (which is also a request queue), and each thread accesses only the corresponding data access request in the corresponding queue array according to the allocated processor resource.
[0097] The target storage region can consist of only one storage region, in which case there is one corresponding processor resource. In this case, data access requests do not span storage regions (i.e., the storage space requested by the data access request belongs to one storage region), and there is also one corresponding request queue. The target storage region can also consist of at least two storage regions, in which case there are at least two corresponding processor resources. In this case, data access requests span storage regions (i.e., the storage space requested by the data access request belongs to at least two storage regions), and there are also at least two corresponding request queues. Different processing methods can be used to process data access requests depending on the different situations.
[0098] In one implementation, when the target storage region contains only one storage region, the processor resource corresponding to the target storage region is used to perform the data access operation requested by the data access request on the target storage region, including: writing the data access request to the request queue of the processor resource corresponding to the target storage region; accessing the data access request in the request queue of the processor resource corresponding to the target storage region through a thread allocated to the processor resource corresponding to the target storage region, and performing the data access operation on the target storage region in response to the data access request.
[0099] In this embodiment, when the target storage region contains only one storage region, the data access request does not cross any regions and can be directly written to the request queue of the processor resource corresponding to the target storage region. The method for determining the processor resource corresponding to the target storage region is similar to that in the previous embodiments and will not be repeated here. Then, the thread allocated to the processor resource corresponding to the target storage region can process the data access requests in the request queue of the processor resource corresponding to the target storage region sequentially, thereby responding to the data access request and performing the corresponding data access operation on the target storage region to complete the processing of the data access request.
[0100] In this embodiment, data access requests are written into corresponding request queues according to their respective storage areas, and then executed by threads allocated to different processor resources, which can improve the processing speed of data access requests.
[0101] As another implementation, when the target storage region contains at least two storage regions, the processor resources corresponding to the target storage region are used to perform the data access operation requested by the data access request on the target storage region. This includes: splitting the data access operation into at least two access requests according to the logical address requested by the data access request; writing each sub-access request into the request queue of the processor resource corresponding to each sub-access request; accessing each sub-access request in the request queue of the processor resource corresponding to each sub-access request through the thread allocated to the processor resource corresponding to each sub-access request; and, in response to each sub-access request, performing a data access operation on the storage region to which the logical address requested by each sub-access request belongs.
[0102] In this embodiment, when the target storage range contains at least two storage ranges, and the data access request spans multiple storage ranges, the cross-range data access request can be split into at least two sub-access requests. The logical address requested by one of the at least two sub-access requests belongs to one of the at least two storage ranges, thus ensuring that each sub-access request does not span multiple storage ranges. Each split sub-access request can be written to the request queue of the processor resource corresponding to each sub-access request. Through this method, the splitting and distribution of data access requests can be completed.
[0103] In some embodiments, after splitting a data access request into sub-access requests that do not cross intervals, the processor resource corresponding to the sub-access request can be determined based on the starting address of the sub-access request. The processor resource corresponding to each sub-access request is the processor resource corresponding to the storage interval to which the logical address requested by each sub-access request belongs. The method for determining the processor resource corresponding to the sub-access request based on the starting address of the sub-access request can be similar to that in the previous embodiments. The starting address of the sub-access request can be divided by the interval size used to split the data volume to obtain the interval number of the storage interval. Then, the interval number of the storage interval is divided by the number of processor resources, and the remainder is the number of the processor resource corresponding to the sub-access request.
[0104] For example, in a single-volume scenario, processor core selection is performed based on the volume range to which each I / O belongs. If an I / O spans multiple ranges, it can be split into multiple sub-I / Os, ensuring that each sub-I / O does not span multiple ranges. After splitting the I / Os that span multiple ranges, the core number of the processor core to be used by each sub-I / O can be calculated based on the starting address of the sub-I / O.
[0105] Each sub-access request can be accessed through the thread allocated to the processor resource corresponding to that sub-access request. Each sub-access request can be responded to by performing data access operations on the memory region containing the logical address requested by each sub-access request. The processing method for each sub-access request is similar to that for data access requests, and will not be elaborated upon here.
[0106] In addition, if the storage interval size of the data volume is too small, it will also lead to excessively frequent IO splits. In the aforementioned method of intelligently adjusting the volume space (i.e., data volume) split range, limiting the interval size range to a certain number can also reduce the frequency of IO splits and avoid the impact of frequent IO splits on storage performance.
[0107] This embodiment solves the problems of low processing efficiency and high latency in cross-memory interval data access operations by splitting cross-memory interval data access requests into sub-access requests for different memory intervals and scheduling each sub-access request to the request queue of the corresponding processor resource for processing, thereby improving the efficiency and stability of data access.
[0108] In one exemplary embodiment, the method further includes: when a silent process on the storage device is triggered, placing the silent process function of the silent process into the thread to which the processor resources corresponding to each sub-access request are allocated, so as to perform silent processing on the thread to which the processor resources corresponding to each sub-access request are allocated.
[0109] The purpose of initiating a silent process is to cancel data access requests waiting in the resource queue, thus avoiding the risk of data corruption or service interruption that may result from data access requests during fault recovery or system maintenance. In related technologies, a data volume uses only one processor resource, and the silent process function only needs to be applied to the request queue of that processor resource to cancel the waiting of data access requests in the request queue.
[0110] In this embodiment, a data volume can use multiple processor resources, so the silent process also needs to be adapted to multi-threading. If the silent process on the storage device is triggered, the silent process function can be placed into the thread allocated to the processor resource corresponding to each sub-access request, based on the number of threads, so that silent processing is performed on the thread allocated to the processor resource corresponding to each sub-access request.
[0111] For example, in scenarios involving single-node failures, the node needs to be silenced first. The silencing process requires canceling the IO waiting for resources from the resource queue. Single-volume multi-threading can cause IO waiting for resources to be on multiple request queues, so the silencing process also needs to be handled by multiple threads: when the silencing process is triggered, the silencing process function is placed on different threads for processing according to the number of threads.
[0112] In this embodiment, by placing the silent process function into each thread, the silent process can be adapted to multi-threaded scenarios, ensuring the security of data in the silent process.
[0113] In one exemplary embodiment, the method further includes: when there is only one data volume on the storage device, skipping the specified lock when a specified lock is executed on the storage device, wherein the specified lock is a lock set to protect critical resources between different data volumes.
[0114] To avoid data corruption and resource conflicts caused by concurrent access to critical resources (such as shared cache, bus, or storage media) between different data volumes on a storage device, specific locks are typically set to protect these resources. When there is only one data volume on the storage device, there is no resource contention between different data volumes, so setting such locks is not only redundant but also affects data access efficiency.
[0115] To reduce unnecessary locking operations, if a scenario with only one volume is identified, the locks (i.e., specified locks) required for protecting critical resources between multiple volumes can be skipped, and subsequent operations can be performed directly. This can reduce the time consumed by acquiring and releasing locks and improve the performance of a single volume (performance when there is only one data volume in the storage device).
[0116] This embodiment allows skipping the locks required for critical resource protection between multiple volumes in a single-volume scenario, thereby reducing latency and improving single-volume performance.
[0117] In one exemplary embodiment, the method by which a data volume uses processor resources can be selected based on the number of data volumes on the storage device; that is, a data volume may be allowed to use multiple processor resources, or a data volume may be allowed to use one processor resource. The processor resources that a data volume is allowed to use may include, but are not limited to, available processor cores.
[0118] As one implementation, the method further includes: determining that a data volume is allowed to use multiple processor resources when the number of data volumes on the storage device is less than or equal to a preset number threshold.
[0119] When the number of data volumes on a storage device is less than or equal to a preset threshold, the number of data volumes is relatively small. If each data volume is only allowed to use one processor resource, the idle rate of processor resources will be high, and processor performance cannot be fully utilized. To fully utilize processor performance and improve processor resource utilization, each data volume can be allowed to use all processor resources on the storage device.
[0120] As another implementation, the method further includes: when the number of data volumes on the storage device is greater than a preset number threshold, determining that the data volumes are allowed to use one of the multiple processor resources.
[0121] When the number of data volumes on a storage device exceeds a preset threshold, and the number of data volumes is relatively small, using all processor resources for each data volume would result in excessive core switching, which could actually degrade performance. Therefore, when there are many data volumes on the storage device, a strategy of using one processor resource per data volume can be adopted. When there are fewer data volumes, a strategy of using multiple processor resources per data volume can be switched to.
[0122] The preset quantity threshold is similar to that in the previous embodiments. It can be a fixed value or a dynamically changing value. It can be related to all processor resources or to the available processor resources. The preset quantity threshold can be set as needed. In this embodiment, the preset quantity threshold is not limited.
[0123] For example, in a multi-volume (i.e., multiple data volumes) scenario, if each data volume still uses all available processor cores, the excessive switching of processor cores will lead to lower performance (compared to using one processor core per data volume). Therefore, the way each data volume uses processor cores can be intelligently adjusted based on the number of data volumes on the storage device to maximize storage performance: if there are many data volumes on the storage device, a strategy of using one processor core per data volume is adopted; if there are few data volumes on the storage device, a strategy of using multiple processor cores per data volume is adopted. Through this method, the way data volumes use processor cores can be intelligently changed. In a multi-volume scenario, each data volume uses only the processor core allocated to it; when there are few data volumes, each data volume can use all available processor cores.
[0124] The way data volumes use processor cores can be intelligently adjusted based on the number of available processor cores. For example, if the number of data volumes created on the storage device is less than one-third of the number of available processor cores, each data volume can use all available processor cores; if the number of data volumes created on the storage device is greater than or equal to one-third of the number of available processor cores, then each data volume uses only one available processor core.
[0125] This embodiment intelligently adjusts the core usage of each data volume based on the number of data volumes on the storage device, maximizing storage performance and improving data access efficiency.
[0126] In one exemplary embodiment, the method further includes: when the number of data volumes on the storage device exceeds a preset number threshold, allocating usable processor resources to the data volumes from multiple processor resources based on the historical resource utilization rate of the data volumes.
[0127] In this embodiment, when the number of data volumes exceeds a preset threshold, in order to improve the utilization of processor resources, different amounts of processor resources can be allocated to different data volumes based on the historical resource utilization rate of the data volumes. That is, the allowed processor resources are allocated to the data volumes from multiple processor resources. Here, the historical resource utilization rate of the data volumes can describe the use of processor resources by the data volumes in a historical time period.
[0128] After allocating allowed processor resources to data volumes, the allowed processor resources differ between data volumes (i.e., one processor resource will not be allocated to two data volumes). Some data volumes are allowed to use only one processor resource, while others are allowed to use at least two processor resources. Data volumes allowed to use only one processor resource are those with historically low resource utilization, while those allowed to use at least two processor resources are those with historically high resource utilization. To facilitate processor resource allocation, another group of data volumes may be allowed to use two processor resources.
[0129] Through this embodiment, by intelligently allocating processor resources, differentiated processor resource support can be provided for different data volumes, ensuring that each data volume can obtain a better resource allocation according to event requirements, thereby improving the processing speed of data access requests and the overall response efficiency of the storage system.
[0130] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0131] According to another aspect of the embodiments of this application, a data access device for a storage device is also provided. This data access device can be used to implement the data access method for the storage device provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0132] Figure 6 is a structural block diagram of a data access device for a storage device according to an embodiment of the present application. As shown in Figure 6, the data access device for the storage device includes a first determining unit 602, a second determining unit 604, and an execution unit 606.
[0133] The first determining unit 602 is configured to determine multiple storage intervals into which the data volume is split, provided that the data volume on the storage device is allowed to use multiple processor resources of the storage device, wherein one of the multiple storage intervals corresponds to one of the multiple processor resources.
[0134] The second determining unit 604 is configured to determine the target storage region corresponding to the data access request of the data volume from a plurality of storage regions.
[0135] Execution unit 606 is configured to use the processor resources corresponding to the target memory region to perform the data access operation requested by the data access request to the target memory region.
[0136] It should be noted that in this embodiment, the first determining unit 602 is configured to execute the above step S202, the second determining unit 604 is configured to execute the above step S204, and the execution unit 606 is configured to execute the above step S206.
[0137] The embodiments provided in this application, where a data volume on a storage device is allowed to use multiple processor resources of the storage device, determine that the data volume is divided into multiple storage regions, wherein one of the multiple storage regions corresponds to one of the multiple processor resources; determine the target storage region corresponding to the data access request of the data volume from the multiple storage regions; and use the processor resource corresponding to the target storage region to perform the data access operation requested by the data access request on the target storage region. This solves the technical problem of low data access efficiency in the data access methods of storage devices in related technologies and improves data access efficiency.
[0138] In one exemplary embodiment, the first determining unit includes: a first determining module, configured to determine, when the data volume is allowed to use multiple processor resources, multiple storage intervals into which the data volume is divided according to a first interval size, wherein the interval size of each of the multiple storage intervals is less than or equal to the first interval size.
[0139] In one exemplary embodiment, the first determining module includes a splitting submodule configured to split the data volume into multiple storage intervals based on the logical address of the data volume and according to a first interval size, provided that the data volume allows the use of multiple processor resources.
[0140] In one exemplary embodiment, the first determining module includes: a first determining submodule, configured to determine, based on specified configuration information, multiple storage intervals into which the data volume is divided according to a first interval size, when the data volume is allowed to use multiple processor resources, wherein the specified configuration information is used to indicate the storage intervals into which the data volume is divided according to the first interval size.
[0141] In one exemplary embodiment, the apparatus further includes an updating unit, configured to, after determining that the data volume is divided into multiple storage intervals according to a first interval size, update the multiple storage intervals to storage intervals divided into the data volume according to a second interval size, wherein the second interval size is smaller than the first interval size, if the idle rate of the multiple processor resources used within a specified time period is greater than or equal to an idle rate threshold.
[0142] In one exemplary embodiment, the data volume can be split into storage intervals according to specified N interval sizes, where N is a positive integer greater than or equal to 2; the apparatus further includes: an estimation unit, configured to, before updating the multiple storage intervals to storage intervals into which the data volume is split according to the second interval size, if there are M interval sizes smaller than the first interval size among the N interval sizes, estimate the idle rate corresponding to the interval sizes among the M interval sizes based on the usage information of multiple processor resources within a specified time period, wherein the idle rate corresponding to the interval sizes among the M interval sizes is the idle rate of the multiple processor resources used when the data volume is split into multiple storage intervals according to the interval sizes among the M interval sizes, and M is a positive integer greater than or equal to 2; and a third determination unit, configured to, if there are interval sizes among the M interval sizes whose corresponding idle rate is less than the idle rate threshold, determine the largest interval size whose corresponding idle rate is less than the idle rate threshold as the second interval size.
[0143] In one exemplary embodiment, the second determining unit includes a second determining module configured to determine a target storage region from multiple storage regions based on the starting address and the ending address requested by the data access request.
[0144] In one exemplary embodiment, the second determining module includes: a second determining submodule configured to determine, from a plurality of storage intervals, a first storage interval to which the starting address requested by the data access request belongs; a third determining submodule configured to determine, from a plurality of storage intervals, a second storage interval to which the ending address requested by the data access request belongs; a fourth determining submodule configured to determine, if the first storage interval and the second storage interval are the same storage interval, the first storage interval as the target storage interval; a fifth determining submodule configured to determine, if the first storage interval and the second storage interval are adjacent storage intervals, the first storage interval and the second storage interval as the target storage interval; and a sixth determining submodule configured to determine, if the first storage interval and the second storage interval are not adjacent storage intervals, the first storage interval, the second storage interval, and the storage interval between the first storage interval and the second storage interval as the target storage interval.
[0145] In one exemplary embodiment, the storage intervals among the plurality of storage intervals have unique interval numbers, and the processor resources among the plurality of processor resources have unique resource numbers. The storage intervals among the plurality of storage intervals correspond cyclically to the processor resources among the plurality of processor resources according to their interval numbers. The apparatus further includes: a fourth determining unit, configured to determine, before performing the data access operation requested by the data access request on the target storage interval using the processor resource corresponding to the target storage interval, the remainder result obtained by taking the interval number of the target storage interval modulo the number of processor resources among the plurality of processor resources; and a fifth determining unit, configured to determine the processor resource among the plurality of processor resources whose resource number is the remainder result as the processor resource corresponding to the target storage interval.
[0146] In one exemplary embodiment, one of the multiple processor resources corresponds to a request queue, and the request queue of the processor resource among the multiple processor resources allows access by threads allocated to the processor resource among the multiple processor resources; the execution unit includes: a first writing module, configured to write a data access request to the request queue of the processor resource corresponding to the target storage region when the target storage region contains only one storage region; and a first execution module, configured to access the data access request in the request queue of the processor resource corresponding to the target storage region through a thread allocated to the processor resource corresponding to the target storage region, and to perform a data access operation on the target storage region in response to the data access request.
[0147] In one exemplary embodiment, the execution unit further includes: a splitting module, configured to split a data access operation into at least two access requests according to the logical address requested by the data access request when the target storage area contains at least two storage areas, wherein the logical address requested by each of the at least two sub-access requests belongs to one of the at least two storage areas; a second writing module, configured to write each sub-access request to a request queue of the processor resource corresponding to each sub-access request, wherein the processor resource corresponding to each sub-access request is the processor resource corresponding to the storage area to which the logical address requested by each sub-access request belongs; and a second execution module, configured to access each sub-access request in the request queue of the processor resource corresponding to each sub-access request through a thread allocated to the processor resource corresponding to each sub-access request, and to perform a data access operation on the storage area to which the logical address requested by each sub-access request belongs in response to each sub-access request.
[0148] In one exemplary embodiment, the apparatus further includes: a placement unit configured to, when a silent process is triggered on the storage device, place the silent process function of the silent process into the thread to which the processor resources corresponding to each sub-access request are allocated, so as to perform silent processing on the thread to which the processor resources corresponding to each sub-access request are allocated.
[0149] In one exemplary embodiment, the above apparatus further includes: a skipping unit configured to skip a specified lock when a specified lock is executed on the storage device when there is only one data volume on the storage device, wherein the specified lock is a lock set to protect critical resources between different data volumes.
[0150] In one exemplary embodiment, the apparatus further includes a sixth determining unit, configured to determine that a data volume is allowed to use multiple processor resources when the number of data volumes on the storage device is less than or equal to a preset number threshold, wherein the multiple processor resources are processor cores available on the storage device.
[0151] In one exemplary embodiment, the apparatus further includes a seventh determining unit, configured to determine that, if the number of data volumes on the storage device is greater than a preset number threshold, the data volumes are allowed to use one of the multiple processor resources.
[0152] In one exemplary embodiment, the apparatus further includes: an allocation unit configured to allocate usable processor resources to the data volumes from multiple processor resources based on the historical resource utilization rate of the data volumes when the number of data volumes on the storage device exceeds a preset number threshold; wherein the usable processor resources for different data volumes are different, some data volumes are allowed to use only one processor resource, and other data volumes are allowed to use at least two processor resources.
[0153] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0154] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above-described embodiments of the data access method for a storage device.
[0155] According to another aspect of the embodiments of this application, a non-volatile readable storage medium is also provided, wherein a computer program is stored in the non-volatile readable storage medium, wherein the computer program is configured to execute the steps in the data access method embodiments of any of the above storage devices when running.
[0156] In one exemplary embodiment, the aforementioned non-volatile readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0157] According to another aspect of the embodiments of this application, a computer program product is also provided, the computer program product including a computer program, which, when executed by a processor, implements the steps in the data access method embodiments of any of the above-described storage devices.
[0158] Embodiments of this application also provide another computer program product, including a non-volatile readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described data access method embodiments of a storage device.
[0159] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0160] The foregoing has provided a detailed description of data access for a storage device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A data access method for a storage device, characterized in that, include: When a data volume on the storage device allows the use of multiple processor resources of the storage device, the data volume is determined to be divided into multiple storage intervals, wherein one of the multiple storage intervals corresponds to one of the multiple processor resources; Determine the target storage region corresponding to the data access request of the data volume from the plurality of storage regions; Using the processor resources corresponding to the target storage region, perform the data access operation requested by the data access request on the target storage region.
2. The method according to claim 1, characterized in that, In the case where the data volume on the storage device allows the use of multiple processor resources of the storage device, determining that the data volume is divided into multiple storage regions includes: If the data volume allows the use of the plurality of processor resources, the plurality of storage intervals into which the data volume is divided according to a first interval size are determined, wherein the interval size of each of the plurality of storage intervals is less than or equal to the first interval size.
3. The method according to claim 2, characterized in that, When the data volume allows the use of the multiple processor resources, determining the multiple storage intervals into which the data volume is divided according to the first interval size includes: If the data volume allows the use of the multiple processor resources, the data volume is divided into the multiple storage intervals according to the first interval size, based on the logical address of the data volume.
4. The method according to claim 2, characterized in that, When the data volume allows the use of the multiple processor resources, determining the multiple storage intervals into which the data volume is divided according to the first interval size includes: When the data volume allows the use of the plurality of processor resources, the plurality of storage intervals into which the data volume is divided according to the first interval size are determined according to the specified configuration information, wherein the specified configuration information is used to indicate the storage intervals into which the data volume is divided according to the first interval size.
5. The method according to claim 2, characterized in that, After determining the plurality of storage regions into which the data volume is divided according to the first interval size, the method further includes: If the idle rate of the multiple processor resources is greater than or equal to the idle rate threshold within a specified time period, the multiple storage intervals are updated to storage intervals into which the data volume is divided according to the second interval size, wherein the second interval size is smaller than the first interval size.
6. The method according to claim 5, characterized in that, The data volume can be split into storage intervals according to a specified N interval size, where N is a positive integer greater than or equal to 2; Before updating the plurality of storage intervals to the storage intervals into which the data volume is divided according to the second interval size, the method further includes: If there are M interval sizes smaller than the first interval size among the N interval sizes, the idle rate corresponding to the interval size among the M interval sizes is estimated based on the usage information of the multiple processor resources within the specified time period. The idle rate corresponding to the interval size among the M interval sizes is the idle rate of the multiple processor resources when the data volume is split into the multiple storage intervals according to the interval size among the M interval sizes, and M is a positive integer greater than or equal to 2. If there is an interval size among the M interval sizes where the idle rate is less than the idle rate threshold, the largest interval size with an idle rate less than the idle rate threshold is determined as the second interval size.
7. The method according to claim 1, characterized in that, Determining the target storage region corresponding to the data access request of the data volume from the plurality of storage regions includes: Based on the starting address and the ending address requested by the data access request, the target storage region is determined from the plurality of storage regions.
8. The method according to claim 7, characterized in that, Determining the target storage region from the plurality of storage regions based on the starting address and the ending address requested by the data access request includes: From the plurality of storage intervals, determine the first storage interval to which the starting address requested by the data access request belongs; Determine the second storage interval to which the termination address requested by the data access request belongs from the plurality of storage intervals; If the first storage region and the second storage region are the same storage region, the first storage region is determined as the target storage region; If the first storage interval and the second storage interval are adjacent storage intervals, the first storage interval and the second storage interval are determined as the target storage interval; If the first storage interval and the second storage interval are not adjacent storage intervals, the first storage interval, the second storage interval, and the storage interval between the first storage interval and the second storage interval are determined as the target storage interval.
9. The method according to claim 1, characterized in that, The storage intervals among the plurality of storage intervals have unique interval numbers, and the processor resources among the plurality of processor resources have unique resource numbers. The storage intervals among the plurality of storage intervals correspond cyclically with the processor resources among the plurality of processor resources according to the interval numbers. Before using the processor resources corresponding to the target storage region to perform the data access operation requested by the data access request on the target storage region, the method further includes: The remainder result is obtained by taking the interval number of the target storage interval as a remainder of the number of processor resources among the plurality of processor resources; Among the plurality of processor resources, the processor resource with the resource number corresponding to the remainder result is determined as the processor resource corresponding to the target storage region.
10. The method according to claim 1, characterized in that, One of the plurality of processor resources corresponds to a request queue, and the request queue of the processor resource in the plurality of processor resources can be accessed by the thread allocated to the processor resource in the plurality of processor resources. The step of using processor resources corresponding to the target storage region to perform the data access operation requested by the data access request on the target storage region includes: If the target storage area contains only one storage area, the data access request is written to the request queue of the processor resource corresponding to the target storage area; The thread that accesses the data access request in the request queue of the processor resource corresponding to the target memory region is allocated the processor resource corresponding to the target memory region, and the data access operation is performed on the target memory region in response to the data access request.
11. The method according to claim 10, characterized in that, The step of using processor resources corresponding to the target storage region to perform the data access operation requested by the data access request on the target storage region further includes: When the target storage area contains at least two storage areas, the data access operation is split into at least two access requests according to the logical address requested by the data access request, wherein the logical address requested by each of the at least two sub-access requests belongs to one of the at least two storage areas. Each sub-access request is written into the request queue of the processor resource corresponding to each sub-access request, wherein the processor resource corresponding to each sub-access request is the processor resource corresponding to the storage range to which the logical address requested by each sub-access request belongs; Each sub-access request is accessed in the request queue of the processor resource corresponding to each sub-access request by the thread allocated to the processor resource corresponding to each sub-access request, and in response to each sub-access request, the data access operation is performed on the storage range to which the logical address requested by each sub-access request belongs.
12. The method according to claim 11, characterized in that, The method further includes: When a silent process is triggered on the storage device, the silent process function of the silent process is placed into the thread to which the processor resources corresponding to each sub-access request are allocated, so as to perform silent processing on the thread to which the processor resources corresponding to each sub-access request are allocated.
13. The method according to claim 1, characterized in that, The method further includes: When there is only one data volume on the storage device, when a specified lock is executed on the storage device, the specified lock is skipped, wherein the specified lock is a lock set to protect critical resources between different data volumes.
14. The method according to any one of claims 1 to 13, characterized in that, The method further includes: If the number of data volumes on the storage device is less than or equal to a preset number threshold, it is determined that the data volumes are allowed to use the plurality of processor resources, wherein the plurality of processor resources are processor cores available on the storage device.
15. The method according to claim 14, characterized in that, The method further includes: If the number of data volumes on the storage device is greater than the preset number threshold, it is determined that the data volume is allowed to use one of the plurality of processor resources.
16. The method according to claim 14, characterized in that, The method further includes: If the number of data volumes on the storage device is greater than the preset number threshold, allowable processor resources are allocated to the data volumes from the plurality of processor resources based on the historical resource utilization rate of the data volumes. The different data volumes allow different processor resources to be used; some data volumes allow only one processor resource, while others allow at least two processor resources.
17. A data access device for a storage device, characterized in that, include: The first determining unit is configured to determine multiple storage intervals into which the data volume is split, provided that the data volume on the storage device is allowed to use multiple processor resources of the storage device, wherein one of the multiple storage intervals corresponds to one of the multiple processor resources; The second determining unit is configured to determine, from the plurality of storage intervals, the target storage interval corresponding to the data access request of the data volume; The execution unit is configured to use the processor resources corresponding to the target memory region to perform the data access operation requested by the data access request on the target memory region.
18. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data access method for a storage device as described in any one of claims 1 to 16 when executing the computer program.
19. A non-volatile readable storage medium, characterized in that, The non-volatile readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data access method for the storage device as described in any one of claims 1 to 16.
20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data access method for the storage device as described in any one of claims 1 to 16.