Data access control method and device
By generating parallel access processes and allocating cache areas in the storage controller, the problem of low data access efficiency of storage devices is solved and a faster data access rate is achieved.
Patent Information
- Application Number
- CN202411046714.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-07-31
AI Technical Summary
In the prior art, the data access efficiency of storage devices is low, and multiple access processes sequentially call data cache devices, resulting in a long target data access time.
By configuring data cache space in the storage controller, generating multiple access processes and allocating data cache areas to each process, these processes are used to perform data access operations in parallel, compressing call latency and shortening target data access time.
The data access rate and efficiency of storage devices are improved, and the problem of low data access efficiency of storage devices is solved.
Smart Images

Figure CN119025032B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a method and apparatus for controlling access to data. Background Art
[0002] With the development of data storage technology, in order to optimize the data access rate of storage devices, related technologies configure high-speed data cache devices for storage devices. When the system performs IO (Input / Output) data transmission, the data is first written to the data cache device, and then the data is integrated in the data cache device before being transmitted to the storage device, rather than directly storing the data in the storage device. In this way, the system can directly return to the next operation after writing the data to the data cache device, without waiting for the data to be written to the storage device, reducing the waiting time and thus improving the performance of the storage device. With the increase in the demand for data storage, the data access process for storage devices is relatively complex. Sometimes, in order to complete the access to the target data in the storage device, it is necessary to call multiple data access processes in succession. Multiple access processes call the data cache device in turn to complete the data access to the storage device, thereby realizing the access operation to the target data of the storage device. As a result, the execution time of the access process to the target data of the storage device is longer and the data access efficiency is lower. Summary of the Invention
[0003] The embodiments of the present application provide a data access control method and apparatus to at least solve the problem of low data access efficiency to storage devices in the related art.
[0004] According to one embodiment of the present application, a data access control method is provided, which is applied to a storage controller, the storage controller being connected to a storage device, the storage controller being configured with a data cache space, the data cache space being used to cache access data of the storage device, and comprising: receiving a target access request, wherein the target access request is used to request execution of target data access on the storage device;
[0005] In response to the target access request, generating a plurality of access processes for the target data access according to the access information of the target data access, wherein the access information is used to indicate an access method for the target data access request to access the target data in the storage device, and the plurality of access processes are used to implement data access logic for accessing the target data in the storage device according to the storage method for storing data in the storage device;
[0006] Allocating a data cache area for each access process in the data cache space according to process information corresponding to the access process, wherein the process information is used to indicate a data access mode of the corresponding access process to the storage device;
[0007] The access process calls the corresponding data cache area to perform a data access operation on the storage device, wherein the data access operation is used to access the target data in the storage device.
[0008] Optionally, generating multiple access processes for the target data access according to the access information of the target data access includes:
[0009] When the access information indicates that the target data access is to store the target data in the storage device, acquiring data storage information of the storage device, wherein the data storage information indicates a storage method of the data stored in the storage device;
[0010] A plurality of access processes are generated according to the data storage information for writing the target data into the storage device according to the data storage method indicated by the storage device.
[0011] Optionally, generating, according to the data storage information, a plurality of access processes for writing the target data into the storage device in accordance with the data storage manner indicated by the storage device, includes:
[0012] In a case where the data storage information is used to indicate that the storage device is a device that stores data based on verification information, constructing a write process for the target data according to the data storage information of the storage device, wherein the write process is used to instruct that the target data be written to the storage device according to the write method corresponding to the data storage information, and the verification information is used to indicate data storage conditions in multiple storage spaces included in the storage device;
[0013] Extracting a first access operation, a second access operation, a third access operation, and a fourth access operation included in the write process, wherein the first access operation is used to read first verification information stored in the storage device from the storage device, the first verification information being used to indicate data storage conditions in multiple storage spaces included in the storage device before writing the data to be written to the storage device, the second access operation being used to read data stored in the storage device before writing the data to be written, the third access operation being used to write second verification information to the storage device, the second verification information being used to indicate data storage conditions in the multiple storage spaces included in the storage device after writing the data to be written, and the fourth access operation being used to write the data to be written to the storage device;
[0014] Create a first process for calling the data cache space to perform the first access operation on the storage device, create a second process for calling the data cache space to perform the second access operation on the storage device, create a third process for calling the data cache space to perform the third access operation on the storage device, and create a fourth process for calling the data cache space to perform the fourth access operation on the storage device, wherein the access process includes the first process, the second process, the third process and the fourth process.
[0015] Optionally, generating, according to the data storage information, a plurality of access processes for writing the target data into the storage device in accordance with the data storage manner indicated by the storage device, includes:
[0016] If the data storage information indicates that the storage device is not a device that stores data based on verification information, splitting the target data into a plurality of sub-data, wherein the verification information is used to indicate data storage conditions in a plurality of storage spaces included in the storage device;
[0017] The access process is generated for calling the data cache space to store the sub-data in the storage device.
[0018] Optionally, allocating a data cache area for each access process in the data cache space according to the process information corresponding to the access process includes:
[0019] Classifying the plurality of access processes according to data types of the data accessed by the access processes to obtain process categories included in the plurality of access processes;
[0020] In a case where the process category is used to indicate that the plurality of access processes are all processes for accessing data included in the target data, the cache area of the data cache space is evenly divided according to the number of the plurality of access processes to obtain the data cache area corresponding to each access process;
[0021] In a case where the process category is used to indicate that a plurality of access processes include processes of a first process type and processes of a second process type, a first cache area is allocated from the data cache space to the process of the first process type, and a second cache area is allocated from the data cache space to the process of the second process type, wherein the process of the first process type is used to call the first cache area to access verification information in the storage device, and the verification information is used to indicate the data storage status in the plurality of storage spaces included in the storage device, and the process of the second process type is used to call the second cache area to access data in the storage device, and the data cache area includes the first cache area and the second cache area.
[0022] Optionally, performing a data access operation on the storage device by calling the corresponding data cache area through the access process includes:
[0023] In a case where the multiple access processes include a verification information access process and a data access process, initial verification information is read from the storage device and stored in a first cache area through the verification information access process, and initial data is read from the storage device and stored in a second cache area through the data access process, wherein the verification information access process is used to perform a verification information access operation on the storage device, and the data access process is used to perform a data access operation on the storage device, and the initial verification information is used to indicate the data storage status of the multiple data storage spaces included in the storage device before the target data is accessed on the storage device, the first cache area is a cache area allocated in the data cache space for the verification information access process, and the second cache area is a cache area allocated in the data cache space for the data access process, and the data cache area includes the first cache area and the second cache area;
[0024] generating target verification information of the storage device according to the initial data, the initial verification information, and the target data, wherein the target verification information is used to indicate data storage conditions in the plurality of storage spaces included in the storage device after the storage device completes access to the target data;
[0025] caching the target verification information in the first buffer area, and caching the target data in the second buffer area;
[0026] The target verification information cached in the first cache area is stored in the storage device through the verification information access process, and the target data cached in the second cache area is written to the storage device through the data access process.
[0027] Optionally, generating target verification information of the storage device according to the initial data, the initial verification information, and the target data includes:
[0028] Creating a third cache area in the data cache space for running a target program, wherein the target program records calculation logic for calculating verification information;
[0029] storing the target program in the third buffer area;
[0030] The target program is called in the third cache area to calculate the initial data, the initial verification information and the target data to obtain the target verification information.
[0031] According to another embodiment of the present application, a data access control device is provided, which is applied to a storage controller, the storage controller being connected to a storage device, the storage controller being configured with a data cache space, the data cache space being used to cache access data of the storage device, and comprising: a receiving module, being used to receive a target access request, wherein the target access request is used to request execution of target data access on the storage device;
[0032] a generation module, configured to respond to the target access request and generate a plurality of access processes for the target data access according to access information of the target data access, wherein the access information is used to indicate an access method for the target data access request to access the target data in the storage device, and the plurality of access processes are used to implement data access logic for accessing the target data in the storage device according to the storage method for storing data on the storage device;
[0033] an allocation module, configured to allocate a data cache area in the data cache space for each access process according to process information corresponding to the access process, wherein the process information is used to indicate a data access mode of the corresponding access process to the storage device;
[0034] An execution module is used to call the corresponding data cache area through the access process to perform a data access operation on the storage device, wherein the data access operation is used to access the target data in the storage device.
[0035] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.
[0036] According to another embodiment of the present application, an electronic device is 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 execute the steps in any one of the above method embodiments.
[0037] Through this application, multiple access processes are generated for target data access based on access information of the target data. The multiple access processes are used to implement data access logic for accessing the target data in the storage device according to the storage device's data storage method. Then, a corresponding data cache area is allocated to each access process in the data cache space based on the process information corresponding to the access process. Thus, the access process can call the corresponding cache area to perform data access operations on the storage device, compressing the call delay of calling the data cache space between multiple access processes, thereby shortening the time required to access the target data on the storage device, thereby improving the data access rate of the storage device. This can solve the problem of low data access efficiency of the storage device in the related art and achieve the effect of improving the data access efficiency of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a hardware structure block diagram of a server device for a data access control method according to an embodiment of the present application;
[0039] Figure 2 is a flow chart of a data access control method according to an embodiment of the present application;
[0040] Figure 3 This is an optional data access schematic according to an embodiment of the present application. Figure 1 ;
[0041] Figure 4 This is an optional data access schematic according to an embodiment of the present application. Figure 2 ;
[0042] Figure 5 is an optional data access flow chart according to an embodiment of the present application;
[0043] Figure 6 4 is a structural block diagram of a data access control device according to an embodiment of the present application. DETAILED DESCRIPTION
[0044] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0045] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0046] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure diagram of a server device of a data access control method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 for communication functions and an input and output device 108. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0047] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data access control method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to a server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0048] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by a communication provider of the server device. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0049] In this embodiment, a data access control method is provided. Figure 2Flowchart of a data access control method according to an embodiment of the present application, which is applied to a storage controller, wherein the storage controller is connected to a storage device, and a data cache space is configured in the storage controller, wherein the data cache space is used to cache access data of the storage device, such as Figure 2 As shown, the process includes the following steps:
[0050] Step S202: receiving a target access request, wherein the target access request is used to request target data access to the storage device;
[0051] Step S204: In response to the target access request, a plurality of access processes are generated for the target data access according to the access information of the target data access, wherein the access information is used to indicate an access method for the target data access request to access the target data in the storage device, and the plurality of access processes are used to implement data access logic for accessing the target data in the storage device according to the storage method for storing data in the storage device;
[0052] Step S206, allocating a data cache area in the data cache space for each access process according to process information corresponding to the access process, wherein the process information is used to indicate a data access mode of the corresponding access process to the storage device;
[0053] Step 5208: Call the corresponding data cache area through the access process to perform a data access operation on the storage device, wherein the data access operation is used to access the target data in the storage device.
[0054] Through the above steps, multiple access processes are generated for target data access based on the access information of the target data access. The multiple access processes are used to implement the data access logic for accessing the target data in the storage device according to the storage device's data storage method. Then, a corresponding data cache area is allocated to each access process in the data cache space based on the process information corresponding to the access process. Thus, the corresponding cache area can be called by each access process to perform data access operations on the storage device, which reduces the call delay of calling the data cache space between multiple access processes, thereby shortening the time required to access the target data on the storage device, thereby improving the data access rate of the storage device. This can solve the problem of low data access efficiency of the storage device in the related art and achieve the effect of improving the data access efficiency of the storage device.
[0055] In the above embodiment, the storage device is a device for storing data. The storage device may be, but is not limited to, a RAID (Redundant Arrays of Independent Disks) composed of one or more storage disks.
[0056] Optionally, in an embodiment of the present application, the data cache space in the storage controller can be, but is not limited to, a location where the storage device exchanges data with an external bus. The storage control line transmits data to the cache, which then exchanges data with the external data bus. The data cache space can be a memory chip on the storage controller, which has extremely fast access speeds compared to the hard disk platters on the storage device. The main function of the storage controller is to speed up data reading and writing, improve the efficiency of the storage device, avoid unnecessary waiting time, reduce delays caused by operations, improve system performance, and achieve better response time.
[0057] In the embodiment provided in the above step S202, target data access may include, but is not limited to, writing target data into a storage device or reading target data from a storage device, which is not limited in this solution.
[0058] Optionally, in an embodiment of the present application, the storage device may be, but is not limited to, a disk array composed of multiple disks, the disk array may be, but is not limited to, an independent redundant disk array, the storage device may be, but is not limited to, configured to store data in a storage method based on verification information, or to store data in a storage method not based on verification. When a data storage method based on verification information is adopted, the multiple disks included in the storage device store data and verification information of the multiple disks. The verification information is obtained by calculating and encrypting the data stored in the storage device. The verification information may be, but is not limited to, parity data. The data storage method based on verification information may be, but is not limited to, RAID5 and RAID6, involving a process of writing parity data; when receiving a write IO command, it will first read the data D0 before modification in the data block of the address to be entered, and then read the verification information P0 in the current stripe. Next, it calculates the parity information P1 of the stripe after the data is written based on the three sets of data D0, P0, and D1, and finally issues two write IO commands, one to write D1 and the other to write the parity information P1. It can be seen that in actual operation, the array requires a total of 4 IOs (read, read, write, write) to complete a write IO operation. Similarly, RAID 6 divides a command into three reads and three writes, for a total of 6 IO commands.
[0059] In the embodiment provided in the above step S204, the multiple access processes may be, but are not limited to, processes for implementing data access operations at different access stages of target data access. Therefore, the method of generating multiple access processes for target data access may be, but is not limited to, parsing the access stages required for target data access, and then configuring access processes for implementing access operations at the access stages. For example, when the storage device adopts a data storage method based on parity data, the target data access is to store the target data in the storage device. In order to complete the storage of the target data in the storage device, it is necessary to access the parity data in the storage device and access the storage data stored in the storage device. Therefore, the target data access can be converted into a parity data access process and a storage data access process. Further, the parity data access process can be configured as a parity data reading process and a parity data writing process. The parity data reading process is used to read parity data from the storage device and store it in the data cache space. The parity data writing process is used to write the parity data stored in the data cache space to the storage device. Similarly, the storage data access process can be configured as a data reading process and a data writing process, and this solution does not limit this.
[0060] Optionally, in an embodiment of the present application, multiple access processes can also be access processes for multiple sub-data included in the target data required to access the target data, and the method of generating multiple access processes for target data access can be to split the target data process to obtain multiple sub-data, and configure each sub-data with a corresponding access process. The access process is used to implement access operations on the corresponding sub-data in the data cache space. This solution does not limit this.
[0061] In the embodiment provided in the above step S206, each access process is allocated a corresponding data cache area in the data cache space. During allocation, the data cache area and the access process can be in a one-to-one correspondence, that is, one access process uniquely corresponds to one data cache area. At the same time, multiple access processes with the same data access method to the storage device can also be allocated to share a data cache space, which is not limited in this article.
[0062] Optionally, in an embodiment of the present application, the process information may include, but is not limited to, information indicating the type of data that the access process needs to access, or may also be information indicating the type of operation that the access process performs on the data, such as allocating the same data cache area to access processes with the same type of data that the access process needs to access, or allocating the same data cache area to access processes with the same type of access operation performed on the data. This solution does not limit this.
[0063] In the embodiment provided in the above step S208, the data access operation performed by the access process calling the data cache area may include, but is not limited to, writing the content stored in the data cache to the storage device, or reading the content stored in the storage device from the storage device and caching it in the data cache area. This solution does not limit this.
[0064] As an optional embodiment, converting the target data access into multiple access processes according to the access information of the target data access includes:
[0065] When the access information indicates that the target data access is to store the target data in the storage device, acquiring data storage information of the storage device, wherein the data storage information indicates a storage method of the data stored in the storage device;
[0066] A plurality of access processes are generated according to the data storage information for writing the target data into the storage device according to the data storage method indicated by the storage device.
[0067] Optionally, in an embodiment of the present application, if the storage device stores data in a different manner, the data access process during process data access is different, and therefore, the method of generating an access process for target data access is also different. For example, when the data storage information indicates that the storage device adopts a data storage method based on verification information, in order to write the target data into the target memory, it is necessary to first read the current first verification information of the storage device from the storage device, and then read the first data currently stored in the storage device from the storage device. The process generates second verification information based on the first verification information, the first data, and the target data, and then stores the second verification information to the storage device and stores the target data to the storage device. Therefore, the target data access can be converted into a first process for reading the first verification information, a second process for reading the first data, a third process for writing the second verification information, and a fourth process for writing the target data. The processes can then be classified according to the execution sequence of the first process, the second process, the third process, and the fourth process, so that the first process and the second process are configured to be executed in parallel, and the third process and the fourth process are configured to be executed in parallel, thereby compressing the time required for executing the access operation. In order to further speed up the execution time of the data access operation, each process can also be split into multiple sub-processes, that is, the first verification information is split into multiple first sub-verification information according to the size of the first verification information, and a first sub-process is configured for each first sub-verification information. The first data is split into multiple first sub-data according to the data information of the first data (for example, the process is split based on the data size of the first data, and the first data is split based on the storage location of the first data in the storage device, and the data stored in the same storage location is determined as a first sub-data). Then, a second sub-process is assigned to each first sub-data. Similarly, the third process can be split into multiple third sub-processes, and the fourth process can be split into multiple fourth sub-processes. Then, the multiple first sub-processes and the multiple second sub-processes are determined to be executed in parallel, and the multiple third sub-processes and the multiple fourth sub-processes are configured as processes executed in parallel. Therefore, the data storage space can be split into multiple data storage areas according to the memory usage of the first sub-process and the second sub-process, and each data storage area uniquely corresponds to a sub-process. After the first process and the second process are executed, the data cache area is split into multiple data storage areas again according to the memory usage of the third sub-process and the fourth sub-process. Through the above content, by splitting the process and executing the sub-processes in parallel according to the execution sequence, the execution time of target data access can be compressed to the greatest extent and the data access rate can be improved.
[0068] Through the above content, when it is necessary to write target data to the storage device, by obtaining the data storage information of the storage device, an access process is generated for the target data access according to the storage method of the storage device storing data, thereby improving the accuracy of the generated access process and improving the data access efficiency of the storage device.
[0069] As an optional embodiment, the generating, based on the data storage information, a plurality of access processes for writing the target data into the storage device according to the data storage mode indicated by the storage device includes:
[0070] In a case where the data storage information is used to indicate that the storage device is a device that stores data based on verification information, constructing a write process for the target data according to the data storage information of the storage device, wherein the write process is used to instruct that the target data be written to the storage device according to the write method corresponding to the data storage information, and the verification information is used to indicate data storage conditions in multiple storage spaces included in the storage device;
[0071] Extracting a first access operation, a second access operation, a third access operation, and a fourth access operation included in the write process, wherein the first access operation is used to read first verification information stored in the storage device from the storage device, the first verification information being used to indicate data storage conditions in multiple storage spaces included in the storage device before writing the data to be written to the storage device, the second access operation being used to read data stored in the storage device before writing the data to be written, the third access operation being used to write second verification information to the storage device, the second verification information being used to indicate data storage conditions in the multiple storage spaces included in the storage device after writing the data to be written, and the fourth access operation being used to write the data to be written to the storage device;
[0072] Create a first process for calling the data cache space to perform the first access operation on the storage device, create a second process for calling the data cache space to perform the second access operation on the storage device, create a third process for calling the data cache space to perform the third access operation on the storage device, and create a fourth process for calling the data cache space to perform the fourth access operation on the storage device, wherein the access process includes the first process, the second process, the third process and the fourth process.
[0073] Through the above content, by constructing a write process for writing target data in a data storage device based on verification information, the data access operations at various stages required to write the target data to the storage device according to the storage method based on verification information are determined according to the write process, and then an access process for calling the data cache space is created for each data access operation, so as to determine that the access process can fully cover the required data access operations in the data storage scenario based on verification information, and thus an access process for calling the data cache space is created for each access operation, thereby realizing the allocation of a data cache space to multiple access processes for parallel calling, thereby improving the utilization rate of the cache in the data cache space while speeding up the execution speed of data access operations.
[0074] As an optional embodiment, the generating, based on the data storage information, a plurality of access processes for writing the target data into the storage device according to the data storage mode indicated by the storage device includes:
[0075] If the data storage information indicates that the storage device is not a device that stores data based on verification information, splitting the target data into a plurality of sub-data, wherein the verification information is used to indicate data storage conditions in a plurality of storage spaces included in the storage device;
[0076] The access process is generated for calling the data cache space to store the sub-data in the storage device.
[0077] Optionally, in an embodiment of the present application, the target data may be split into multiple sub-data by splitting the target data into multiple sub-data with the target granularity according to the target data granularity, or the target data may be divided according to the storage location of the data included in the target data in the storage device, such as determining multiple data segments stored on the same disk as one sub-data, which is not limited in this solution.
[0078] Through the above content, when the storage device is not a device that stores data based on verification information, the target data can be split into multiple sub-data, so that the original sequential writing operation of multiple sub-data to the storage device is converted into parallel writing of multiple sub-data to the storage device, shortening the writing time of the target data and improving the data writing efficiency.
[0079] As an optional embodiment, allocating a data cache area for each access process in the data cache space according to the process information corresponding to the access process includes:
[0080] Classifying the plurality of access processes according to data types of the data accessed by the access processes to obtain process categories included in the plurality of access processes;
[0081] In a case where the process category is used to indicate that the plurality of access processes are all processes for accessing data included in the target data, the cache area of the data cache space is evenly divided according to the number of the plurality of access processes to obtain the data cache area corresponding to each access process;
[0082] In a case where the process category is used to indicate that a plurality of access processes include processes of a first process type and processes of a second process type, a first cache area is allocated from the data cache space to the process of the first process type, and a second cache area is allocated from the data cache space to the process of the second process type, wherein the process of the first process type is used to call the first cache area to access verification information in the storage device, and the verification information is used to indicate the data storage status in the plurality of storage spaces included in the storage device, and the process of the second process type is used to call the second cache area to access data in the storage device, and the data cache area includes the first cache area and the second cache area.
[0083] Optionally, in an embodiment of the present application, when the process category indicates that multiple access processes access the data included in the target data, the multiple data access processes are access processes that can be executed in parallel, so a cache area can be allocated to each access process, thereby realizing parallel execution of multiple access processes.
[0084] Optionally, in an embodiment of the present application, the cache sizes of the first cache area and the second cache can be allocated based on the data cache requirements of the process of the first process type and the data cache requirements of the second process, that is, the first cache area is allocated based on the data cache requirements of the first process, and the second cache area is allocated based on the data cache requirements of the second process, thereby avoiding the waste of data cache space resources due to the allocated cache area being too large, and the saved cache space can be used to execute other data access situations, thereby improving the corresponding efficiency of data access requests.
[0085] Through the above content, by classifying the data type processes accessed by the access processes, the data accessing the same data type can be divided into one category. Since accessing the same type of data to the storage device is not executed in parallel, the access processes are classified according to the data type and the processes of the same type are allocated a data cache area, thereby improving the utilization rate of the data cache area.
[0086] As an optional embodiment, performing a data access operation on the storage device by calling the corresponding data cache area through the access process includes:
[0087] In a case where the multiple access processes include a verification information access process and a data access process, initial verification information is read from the storage device and stored in a first cache area through the verification information access process, and initial data is read from the storage device and stored in a second cache area through the data access process, wherein the verification information access process is used to perform a verification information access operation on the storage device, and the data access process is used to perform a data access operation on the storage device, and the initial verification information is used to indicate the data storage status of the multiple data storage spaces included in the storage device before the target data is accessed on the storage device, the first cache area is a cache area allocated in the data cache space for the verification information access process, and the second cache area is a cache area allocated in the data cache space for the data access process, and the data cache area includes the first cache area and the second cache area;
[0088] generating target verification information of the storage device according to the initial data, the initial verification information, and the target data, wherein the target verification information is used to indicate data storage conditions in the plurality of storage spaces included in the storage device after the storage device completes access to the target data;
[0089] caching the target verification information in the first buffer area, and caching the target data in the second buffer area;
[0090] The target verification information cached in the first cache area is stored in the storage device through the verification information access process, and the target data cached in the second cache area is written to the storage device through the data access process.
[0091] Optionally, in an embodiment of the present application, the target verification information can be obtained by calculating the initial data, initial verification information and target data by the storage controller, or it can be obtained by allocating a cache area in the data cache space for running the verification information calculation program, and sending the verification information calculation program to the cache area, controlling the verification information calculation program to run in the cache area, thereby obtaining the calculated target verification information.
[0092] Optionally, in an embodiment of the present application, in order to avoid repeated calls to the same cache area by access processes with different running times, a target identifier can be configured for the cache area, and the target identifier is used to represent the occupancy status of whether the cache area is occupied. Then, when it is detected that the target identifier of the cache area is the first identifier, information or data can be written to the cache area, and then written to the storage device. When the data or information is extracted from the cache area, the cache area is in an unoccupied state, and the next access process can call the cache area.
[0093] Through the above, by using the verification information access process to call the first cache area to alternately perform operations of reading verification information from the storage device and writing verification information to the storage device, and by using the data access process to call the second cache area to alternately perform operations of reading data from the storage device and writing data to the storage device, the cache area occupancy rate is improved. Furthermore, by executing the verification information access process and the data access process in parallel, the access time of the target data is shortened, thereby improving data access efficiency.
[0094] As an optional embodiment, generating target verification information of the storage device according to the initial data, the initial verification information, and the target data includes:
[0095] Creating a third cache area in the data cache space for running a target program, wherein the target program records calculation logic for calculating verification information;
[0096] storing the target program in the third buffer area;
[0097] The target program is called in the third cache area to calculate the initial data, the initial verification information and the target data to obtain the target verification information.
[0098] In order to improve the access efficiency of storage devices to data, the present application divides the data cache space of the storage controller into multiple cache areas, so that each access process can perform corresponding data access operations on the storage device by calling the corresponding cache area. In this process, the access process's calls to the cache area can be executed in parallel, thereby speeding up the execution rate of the access operation and avoiding the problem of low data access operation execution rate due to the access process waiting for the calling permission of the cache space when calling the cache space as a whole in the related technology, as well as the problem of waste of cache space resources. The embodiment of the present application takes the cache space (cache) being divided into two cache areas as an example (i.e., a dual-core cache), that is, the cache space is allocated to cache area A and cache area B, and a flag bit is set for cache area A and B respectively, and the problem of data conflict is avoided by whether the flag bit is in place.
[0099] The IO data mode of the storage device is divided into two cases, namely, the case with XOR data verification such as RAID5 and RAID6, and the case without data verification.
[0100] For storage devices that need to store data through data verification, Figure 3 This is an optional data access schematic according to an embodiment of the present application. Figure 1 ,like Figure 3As shown, the storage control device includes a host and a cache space. The above-mentioned data access control method can be configured to run on the host, but is not limited to being configured to run on the host. At this time, the host receives a data write request (i.e., a target access request) to write data D1 to the storage device. First, cache area A reads the data D0 before modification in the data block of the address to be written. Simultaneously, the host determines whether the flag bit of cache area B is '1'. If not, cache area B already has data to execute and is in an inoperable state, and needs to wait for the next timing to arrive. If it is '1', it is in an operable state, and cache area B is used to read the parity information P0 in the current stripe at the same time. Next, the parity information P1 of the stripe after the data is written is calculated based on the three groups of data D0, P0, and D1, and the calculated P1 is placed in cache area B. The flag bits of cache areas A and B are determined by the timing signal. If both are in an operable state, the data D1 is written to the hard disk through cache area A, and the parity data P1 is written to the hard disk by cache area B. It can be concluded that in actual I / O data operations, there are buffer area A reads, buffer area B reads, buffer area A writes, and buffer area B writes. Each buffer area is read and written twice, performing two I / O operations.
[0101] For storage devices that do not require data verification for data storage, Figure 4 This is an optional data access schematic according to an embodiment of the present application. Figure 2 ,like Figure 4 As shown, the HOST will implement a parallel I / O processing method through dual-way buffers, namely the buffer exchange method. The HOST writes the I / O into buffer A and buffer B respectively, generating write times TA and TB; then buffer A and buffer B write to the hard disk respectively, generating write time T M and T N .
[0102] Figure 5 This is an optional data access flow chart according to an embodiment of the present application, such as Figure 5 As shown, it at least includes the following steps:
[0103] S501, when the server needs to perform an I / O write operation, it sends a target operation request to the storage controller (needs to write a 4k audio file to strip 3 of the RAID5 array, and the default strip size is 128k).
[0104] S502: The storage controller determines whether there is a data verification situation.
[0105] S503, determining whether the flag bits of cache A and cache B are "1" and whether they are in an operable state.
[0106] S504, if it is "1", it is in operational state, and the RAID card uses cache A to obtain the existing data (D0) in strip 3 of the RAID5 array; and uses buffer B to read the parity information (P0) in the current stripe.
[0107] S505 , calculating new parity information of the stripe according to the 4k audio file, the information in the read current stripe, and the parity information.
[0108] S506 , buffer area A writes the 4k audio file into stripe 3 , and buffer area B writes the generated new parity information into stripe 3 .
[0109] S507: Cache A is inoperable, and step S503 is executed after waiting for a clock signal.
[0110] S508: When verification information is not required and the target operation request needs to write a 4KB audio file to stripe 1 of the RAID1 array of two disks (disk 0 and disk 1), the default strip size is 128KB. The host writes the 4KB audio file to cache A and copies the data in cache A to cache B.
[0111] S509, buffer A writes the 4k audio file to stripe 1 of disk 0 in the RAID 1 array, and buffer B writes the 4k audio file to stripe 1 of disk 1 at the same time.
[0112] S510: Complete one data I / O.
[0113] Through the above, by introducing a dual-core cache approach, the cache status is determined dynamically using clock signals to identify flag bits, thereby improving storage link performance. This significantly improves the overall performance of the server storage link and enhances product competitiveness.
[0114] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0115] In this embodiment, a data access control device is also provided. The device is used to implement the above-mentioned embodiments and preferred embodiments. The details that have been described will not be repeated here. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0116] Figure 6 1 is a block diagram of a data access control device according to an embodiment of the present application, which is applied to a storage controller, wherein the storage controller is connected to a storage device, and a data cache space is configured in the storage controller, wherein the data cache space is used to cache access data of the storage device, such as Figure 6 As shown, the apparatus includes: a receiving module, configured to receive a target access request, wherein the target access request is used to request target data access to the storage device;
[0117] a generation module, configured to respond to the target access request and generate a plurality of access processes for the target data access according to access information of the target data access, wherein the access information is used to indicate an access method for the target data access request to access the target data in the storage device, and the plurality of access processes are used to implement data access logic for accessing the target data in the storage device according to the storage method for storing data on the storage device;
[0118] an allocation module, configured to allocate a data cache area in the data cache space for each access process according to process information corresponding to the access process, wherein the process information is used to indicate a data access mode of the corresponding access process to the storage device;
[0119] An execution module is used to call the corresponding data cache area through the access process to perform a data access operation on the storage device, wherein the data access operation is used to access the target data in the storage device.
[0120] Through the above content, multiple access processes are generated for target data access based on the access information of the target data access. The multiple access processes are used to implement the data access logic of accessing the target data in the storage device according to the data storage method of the storage device. Then, a corresponding data cache area is allocated to each access process in the data cache space according to the process information corresponding to the access process. Therefore, the access process can call the corresponding cache area to perform data access operations on the storage device, compressing the call delay of calling the data cache space between multiple access processes, thereby shortening the time required to access the target data on the storage device, thereby improving the data access rate of the storage device. This can solve the problem of low data access efficiency of the storage device in the related art and achieve the effect of improving the data access efficiency of the storage device.
[0121] Optionally, the generating module includes:
[0122] an acquiring unit, configured to acquire data storage information of the storage device when the access information indicates that the target data access is to store the target data in the storage device, wherein the data storage information indicates a storage method in which the data is stored in the storage device;
[0123] A generating unit is configured to generate, based on the data storage information, a plurality of access processes for implementing writing of the target data into the storage device in accordance with the data storage manner indicated by the storage device.
[0124] Optionally, the generating unit is configured to:
[0125] In a case where the data storage information is used to indicate that the storage device is a device that stores data based on verification information, constructing a write process for the target data according to the data storage information of the storage device, wherein the write process is used to instruct that the target data be written to the storage device according to the write method corresponding to the data storage information, and the verification information is used to indicate data storage conditions in multiple storage spaces included in the storage device;
[0126] Extracting a first access operation, a second access operation, a third access operation, and a fourth access operation included in the write process, wherein the first access operation is used to read first verification information stored in the storage device from the storage device, the first verification information being used to indicate data storage conditions in multiple storage spaces included in the storage device before writing the data to be written to the storage device, the second access operation being used to read data stored in the storage device before writing the data to be written, the third access operation being used to write second verification information to the storage device, the second verification information being used to indicate data storage conditions in the multiple storage spaces included in the storage device after writing the data to be written, and the fourth access operation being used to write the data to be written to the storage device;
[0127] Create a first process for calling the data cache space to perform the first access operation on the storage device, create a second process for calling the data cache space to perform the second access operation on the storage device, create a third process for calling the data cache space to perform the third access operation on the storage device, and create a fourth process for calling the data cache space to perform the fourth access operation on the storage device, wherein the access process includes the first process, the second process, the third process and the fourth process.
[0128] Optionally, the generating unit is configured to:
[0129] If the data storage information indicates that the storage device is not a device that stores data based on verification information, splitting the target data into a plurality of sub-data, wherein the verification information is used to indicate data storage conditions in a plurality of storage spaces included in the storage device;
[0130] The access process is generated for calling the data cache space to store the sub-data in the storage device.
[0131] Optionally, the allocation module includes:
[0132] a classification unit, configured to classify the plurality of access processes according to data types of the data accessed by the access processes, to obtain process categories included in the plurality of access processes;
[0133] a processing unit configured to, when the process category indicates that the plurality of access processes are all processes for accessing data included in the target data, evenly divide the cache area of the data cache space according to the number of the plurality of access processes to obtain the data cache area corresponding to each access process;
[0134] An allocation unit is configured to allocate a first cache area from the data cache space to a process of the first process type, and to allocate a second cache area from the data cache space to a process of the second process type, when the process category is used to indicate that a plurality of access processes include processes of a first process type and a second process type, wherein the process of the first process type is used to call the first cache area to access verification information in the storage device, and the verification information is used to indicate data storage conditions in a plurality of storage spaces included in the storage device, and the process of the second process type is used to call the second cache area to access data in the storage device, and the data cache area includes the first cache area and the second cache area.
[0135] Optionally, the execution module includes:
[0136] a reading unit for, in a case where the plurality of access processes include a verification information access process and a data access process, reading initial verification information from the storage device through the verification information access process and storing it in a first cache area, and reading initial data from the storage device through the data access process and storing it in a second cache area, wherein the verification information access process is used to perform a verification information access operation on the storage device, the data access process is used to perform a data access operation on the storage device, the initial verification information is used to indicate the data storage status of the plurality of data storage spaces included in the storage device before the target data is accessed on the storage device, the first cache area is a cache area in the data cache space allocated for the verification information access process, the second cache area is a cache area in the data cache space allocated for the data access process, and the data cache area includes the first cache area and the second cache area;
[0137] a generating unit, configured to generate target verification information of the storage device based on the initial data, the initial verification information, and the target data, wherein the target verification information is used to indicate data storage conditions in the plurality of storage spaces included in the storage device after the storage device completes access to the target data;
[0138] a cache unit, configured to cache the target verification information in the first cache area, and cache the target data in the second cache area;
[0139] A processing unit is used to store the target verification information cached in the first cache area into the storage device through the verification information access process, and to write the target data cached in the second cache area into the storage device through the data access process.
[0140] Optionally, the generating unit is configured to:
[0141] Creating a third cache area in the data cache space for running a target program, wherein the target program records calculation logic for calculating verification information;
[0142] storing the target program in the third buffer area;
[0143] The target program is called in the third cache area to calculate the initial data, the initial verification information and the target data to obtain the target verification information.
[0144] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0145] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when run.
[0146] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0147] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0148] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0149] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0150] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices, they can be implemented using program code executable by the computing device, and thus, they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0151] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A data access control method, characterized in that: Applied to a storage controller, the storage controller is connected to a storage device, the storage controller is configured with a data cache space, the data cache space is used to cache access data of the storage device, the method includes: receiving a target access request, wherein the target access request is used to request target data access on the storage device; in response to the target access request, generating a plurality of access processes for the target data access according to access information of the target data access, wherein the access information is used to indicate an access method for the target data access request to access target data in the storage device, and the plurality of access processes are used to implement data access logic for accessing the target data in the storage device according to the storage method for storing data on the storage device; A data cache area is allocated to each access process in the data cache space according to the process information corresponding to the access process, wherein the process information is used to indicate the data access method of the corresponding access process to the storage device; and a data access operation is performed on the storage device by calling the corresponding data cache area through the access process, wherein the data access operation is used to access the target data in the storage device.
2. The method according to claim 1, characterized in that Generating a plurality of access processes for the target data access according to the access information of the target data access includes: When the access information indicates that the target data access is to store the target data in the storage device, acquiring data storage information of the storage device, wherein the data storage information indicates a storage method of the data stored in the storage device; A plurality of access processes are generated according to the data storage information for writing the target data into the storage device according to the data storage method indicated by the storage device.
3. The method according to claim 2, characterized in that Generating, according to the data storage information, a plurality of access processes for writing the target data into the storage device in accordance with the data storage method indicated by the storage device, includes: In a case where the data storage information is used to indicate that the storage device is a device that stores data based on verification information, constructing a write process for the target data according to the data storage information of the storage device, wherein the write process is used to instruct that the target data be written to the storage device according to the write method corresponding to the data storage information, and the verification information is used to indicate data storage conditions in multiple storage spaces included in the storage device; Extracting a first access operation, a second access operation, a third access operation, and a fourth access operation included in the write process, wherein the first access operation is used to read first verification information stored in the storage device from the storage device, the first verification information being used to indicate data storage conditions in multiple storage spaces included in the storage device before writing the data to be written to the storage device, the second access operation being used to read data stored in the storage device before writing the data to be written, the third access operation being used to write second verification information to the storage device, the second verification information being used to indicate data storage conditions in the multiple storage spaces included in the storage device after writing the data to be written, and the fourth access operation being used to write the data to be written to the storage device; Create a first process for calling the data cache space to perform the first access operation on the storage device, create a second process for calling the data cache space to perform the second access operation on the storage device, create a third process for calling the data cache space to perform the third access operation on the storage device, and create a fourth process for calling the data cache space to perform the fourth access operation on the storage device, wherein the access process includes the first process, the second process, the third process and the fourth process.
4. The method according to claim 2, characterized in that Generating, according to the data storage information, a plurality of access processes for writing the target data into the storage device in accordance with the data storage method indicated by the storage device, includes: If the data storage information indicates that the storage device is not a device that stores data based on verification information, splitting the target data into a plurality of sub-data, wherein the verification information is used to indicate data storage conditions in a plurality of storage spaces included in the storage device; The access process is generated for calling the data cache space to store the sub-data in the storage device.
5. The method according to claim 1, wherein Allocating a data cache area for each access process in the data cache space according to the process information corresponding to the access process includes: Classifying the plurality of access processes according to data types of the data accessed by the access processes to obtain process categories included in the plurality of access processes; In a case where the process category is used to indicate that the plurality of access processes are all processes for accessing data included in the target data, the cache area of the data cache space is evenly divided according to the number of the plurality of access processes to obtain the data cache area corresponding to each access process; In a case where the process category is used to indicate that a plurality of access processes include processes of a first process type and processes of a second process type, a first cache area is allocated from the data cache space to the process of the first process type, and a second cache area is allocated from the data cache space to the process of the second process type, wherein the process of the first process type is used to call the first cache area to access verification information in the storage device, and the verification information is used to indicate the data storage status in the plurality of storage spaces included in the storage device, and the process of the second process type is used to call the second cache area to access data in the storage device, and the data cache area includes the first cache area and the second cache area.
6. The method according to claim 1, characterized in that The performing a data access operation on the storage device by calling the corresponding data cache area through the access process includes: In a case where the multiple access processes include a verification information access process and a data access process, initial verification information is read from the storage device and stored in a first cache area through the verification information access process, and initial data is read from the storage device and stored in a second cache area through the data access process, wherein the verification information access process is used to perform a verification information access operation on the storage device, and the data access process is used to perform a data access operation on the storage device, and the initial verification information is used to indicate the data storage status of the multiple data storage spaces included in the storage device before the target data is accessed on the storage device, the first cache area is a cache area allocated in the data cache space for the verification information access process, and the second cache area is a cache area allocated in the data cache space for the data access process, and the data cache area includes the first cache area and the second cache area; generating target verification information of the storage device according to the initial data, the initial verification information, and the target data, wherein the target verification information is used to indicate data storage conditions in the plurality of storage spaces included in the storage device after the storage device completes access to the target data; caching the target verification information in the first buffer area, and caching the target data in the second buffer area; The target verification information cached in the first cache area is stored in the storage device through the verification information access process, and the target data cached in the second cache area is written to the storage device through the data access process.
7. The method according to claim 6, characterized in that Generating target verification information of the storage device according to the initial data, the initial verification information, and the target data includes: Creating a third cache area in the data cache space for running a target program, wherein the target program records calculation logic for calculating verification information; storing the target program in the third buffer area; The target program is called in the third cache area to calculate the initial data, the initial verification information and the target data to obtain the target verification information.
8. A data access control device, characterized in that: Applied to a storage controller, the storage controller is connected to a storage device, the storage controller is configured with a data cache space, the data cache space is used to cache access data of the storage device, the device comprises: A receiving module, configured to receive a target access request, wherein the target access request is used to request target data access to the storage device; a generation module, configured to respond to the target access request and generate a plurality of access processes for the target data access according to access information of the target data access, wherein the access information is used to indicate an access method for the target data access request to access the target data in the storage device, and the plurality of access processes are used to implement data access logic for accessing the target data in the storage device according to the storage method for storing data on the storage device; an allocation module, configured to allocate a data cache area in the data cache space for each access process according to process information corresponding to the access process, wherein the process information is used to indicate a data access mode of the corresponding access process to the storage device; An execution module is used to call the corresponding data cache area through the access process to perform a data access operation on the storage device, wherein the data access operation is used to access the target data in the storage device.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and device for implementing data access
CN102541773A
Memory pool management
CN116069240A