CN116028437B - File reading method and device, RAID card, storage system and storage medium - Google Patents

File reading method and device, RAID card, storage system and storage medium Download PDF

Info

Publication number
CN116028437B
CN116028437B CN202310318544.1A CN202310318544A CN116028437B CN 116028437 B CN116028437 B CN 116028437B CN 202310318544 A CN202310318544 A CN 202310318544A CN 116028437 B CN116028437 B CN 116028437B
Authority
CN
China
Prior art keywords
target file
preset
reading
file
memory pool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310318544.1A
Other languages
Chinese (zh)
Other versions
CN116028437A (en
Inventor
李飞龙
王见
孙明刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310318544.1A priority Critical patent/CN116028437B/en
Publication of CN116028437A publication Critical patent/CN116028437A/en
Application granted granted Critical
Publication of CN116028437B publication Critical patent/CN116028437B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file reading method, a file reading device, a RAID card, a storage system and a storage medium, which belong to the field of storage systems and are used for reading files in the storage system. In consideration of that the read operation does not change the data, even if the read operation reads the target file in the process of using the target file by other tasks, no data error can be generated, so that whether the target file exists in a cache module of the storage system can be judged in response to a read instruction for the target file, if the target file does not exist, the target file read from the disk can be sent to a request end of the target file under the condition that the lock authority of a strip where the target file exists is not applied, the read operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the read operation for a lock function is avoided, and the calculation resources are saved.

Description

File reading method and device, RAID card, storage system and storage medium
Technical Field
The present invention relates to the field of storage systems, and in particular, to a file reading method, and to a file reading device, a RAID card, a storage system, and a computer readable storage medium.
Background
In order to prevent the simultaneous use of data in a certain stripe in a disk, each task needs to acquire the lock authority of the stripe to be used before execution, so that only a unique task thread with the stripe lock authority to be used is ensured to use the data of the stripe to be used, however, in the case, if a plurality of task threads existing at the same time relate to the same stripe to be used, the task threads without the stripe lock authority to be used can only suspend and wait, thereby reducing the data processing efficiency, and a large number of tasks need to use the lock function and consume a large amount of computing resources.
Therefore, how to provide a solution to the above technical problem is a problem that a person skilled in the art needs to solve at present.
Disclosure of Invention
The invention aims to provide a file reading method, which can send a target file read from a disk to a request end of the target file under the condition that the lock authority of a strip where the target file is not applied, so that the read operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the read operation on a lock function is avoided, and the computing resource is saved; another object of the present invention is to provide a file reading device, a RAID card, a storage system, and a computer readable storage medium, which can send a target file read from a disk to a request end of the target file without applying for a lock authority of a stripe where the target file is located, so that a read operation does not need to be suspended again, improving data processing efficiency, avoiding use of a lock function by the read operation, and saving computing resources.
In order to solve the above technical problems, the present invention provides a file reading method, which is applied to a control device in a storage system, and includes:
responding to a reading instruction of a target file, and judging whether the target file exists in a cache module of the storage system;
and if the target file does not exist, under the condition that the lock authority of the stripe where the target file exists is not applied, the target file read from the disk is sent to a request end of the target file.
Preferably, the sending, to the request end of the target file, the target file read from the disk without applying the lock authority of the stripe where the target file is located, specifically includes:
reading the target file from the disk to a preset memory pool;
sending the target file in the preset memory pool to a request end of the target file;
wherein the preset memory pool is independent of the cache module.
Preferably, the sending, to the request end of the target file, the target file read from the disk without applying the lock authority of the stripe where the target file is located, specifically includes:
and in the process of reading the pages of the target file from the disk to a preset memory pool through the first thread, sending the pages of the target file positioned in the preset memory pool to a request end of the target file through the second thread in sequence.
Preferably, in the process of reading the page of the target file from the disk to the preset memory pool through the first thread, sending, by the second thread, the page of the target file located in the preset memory pool to the requesting end of the target file in sequence is specifically:
simultaneously reading a preset window number pages of the target file from a disk to a preset memory pool through a first thread;
marking asynchronous trigger marks for pages in a designated order in a batch of pages which are read at the same time recently;
transmitting a head page at the forefront end of an order which is not sent out in the preset memory pool to a request end of the target file through a second thread, and judging whether the head page which is sent out recently has the asynchronous trigger mark or not;
if so, executing the step of simultaneously reading the pages of the preset window number of the target file from the disk through the first thread to a preset memory pool;
and if the head page does not exist, executing the step of transmitting the head page which is not sent out in the preset memory pool and is positioned at the forefront end of the sequence to the request end of the target file through the second thread, and judging whether the head page which is sent out recently exists the asynchronous trigger mark or not.
Preferably, the step of simultaneously reading, by the first thread, the preset number of pages of the preset window of the target file from the disk to the preset memory pool includes:
when a page is read from a disk for the first time, simultaneously reading a first preset sub-window number of pages of the target file from the disk to a preset memory pool through a first thread;
when the pages are not read from the disk for the first time, simultaneously reading a second preset sub-window number of pages of the target file from the disk to the preset memory pool through the first thread;
the marking of asynchronous trigger marks on pages in a designated order in a batch of pages which are read at the same time recently specifically comprises the following steps:
for pages read simultaneously in the first batch, marking asynchronous trigger marks on pages in a first appointed sub-sequence;
and for pages which are not read first at the same time, marking the asynchronous trigger marks on the pages positioned in the second designated sub-sequence.
Preferably, the first preset number of sub-windows is smaller than the second preset number of sub-windows.
Preferably, the first designated sub-order is the same as the second designated sub-order.
Preferably, the determining, in response to a read instruction for a target file, whether the target file exists in a cache module of the storage system is specifically:
Determining a total data amount of a target file in response to a read instruction for the target file;
determining the number of first preset sub-windows and the number of second preset sub-windows according to the corresponding relation between the preset total data quantity and the number of windows;
and judging whether the target file exists in a cache module of the storage system.
Preferably, the corresponding relation between the preset total data quantity and the window quantity is specifically:
when the total data quantity is smaller than a first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are first value combinations;
when the total data quantity is not smaller than the first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are second valued combinations.
Preferably, after the head page of the front end of the sequence that is not sent out in the preset memory pool is sent to the request end of the target file, the file reading method further includes:
and releasing the recently issued page from the preset memory pool.
Preferably, after determining whether the target file exists in the cache module of the storage system, the file reading method further includes:
and if the target file exists, sending the target file positioned in the cache module to a request end of the target file.
Preferably, the file reading method further includes:
recording the minimum residual capacity in the preset memory pool in the process of processing the reading instruction;
and the control prompter prompts the minimum residual capacity.
Preferably, in the process of processing the read instruction, after recording the minimum remaining capacity in the preset memory pool, the file reading method further includes:
judging whether the minimum residual capacity is lower than a second preset threshold value or not;
if the alarm is lower than the preset value, the alarm is controlled to alarm.
Preferably, the file reading method further includes:
recording the total data volume of the target file corresponding to the received reading instruction;
determining the maximum value of all total data amounts recorded currently;
and controlling a prompter to prompt the maximum value.
Preferably, after determining the maximum value of all the total data amounts currently recorded, the file reading method further includes:
judging whether the maximum value is larger than a third preset threshold value or not;
if the signal is larger than the preset value, the alarm is controlled to alarm.
In order to solve the above technical problem, the present invention further provides a file reading device, which is applied to a control device in a storage system, including:
the judging module is used for responding to a reading instruction of the target file, judging whether the target file exists in a cache module of the storage system, and triggering the executing module if the target file does not exist;
And the execution module is used for sending the target file read from the disk to a request end of the target file under the condition that the lock authority of the strip where the target file is located is not applied.
Preferably, the execution module includes:
the reading module is used for reading the target file from the disk to a preset memory pool;
the sending module is used for sending the target file in the preset memory pool to a request end of the target file;
wherein the preset memory pool is independent of the cache module.
In order to solve the above technical problems, the present invention further provides a RAID card, including:
a memory for storing a computer program;
and a processor for implementing the steps of the file reading method as described above when executing the computer program.
In order to solve the technical problem, the invention also provides a storage system which comprises the RAID card.
To solve the above technical problem, the present invention also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the file reading method as described above.
The invention provides a file reading method, which considers that the reading operation does not change data, so that even if the reading operation reads the target file in the process of using the target file by other tasks, no data error can be generated, therefore, whether the target file exists in a cache module of a storage system can be judged in response to a reading instruction for the target file, and if the target file does not exist, the target file read from a disk can be sent to a request end of the target file under the condition that the lock authority of a strip where the target file exists is not applied, so that the reading operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the reading operation on a lock function is avoided, and the computing resource is saved.
The invention also provides a file reading device, equipment, a storage system and a computer readable storage medium, which have the same beneficial effects as the file reading method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required in the prior art and the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for reading a document according to the present invention;
FIG. 2 is a schematic flow chart of a pre-reading mechanism according to the present invention;
FIG. 3 is a flow chart of another pre-reading mechanism according to the present invention;
FIG. 4 is a schematic diagram of a document reading apparatus according to the present invention;
FIG. 5 is a schematic diagram of a RAID card according to the present invention;
fig. 6 is a schematic structural diagram of a computer readable storage medium according to the present invention.
Detailed Description
The core of the invention is to provide a file reading method, which can send the target file read from the disk to the request end of the target file under the condition that the lock authority of the strip where the target file is not applied, so that the read operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the lock function by the read operation is avoided, and the computing resource is saved; the invention further provides a file reading device, a RAID card, a storage system and a computer readable storage medium, which can send the target file read from the disk to a request end of the target file under the condition that the locking authority of the strip where the target file is located is not applied, so that the read operation does not need to be suspended again, the data processing efficiency is improved, the use of the lock function by the read operation is avoided, and the computing resource is saved.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flow chart of a file reading method provided by the present invention, where the file reading method is applied to a control device in a storage system, and includes:
s101: responding to a reading instruction of the target file, and judging whether the target file exists in a cache module of the storage system;
specifically, considering the technical problem in the background art and considering that the read operation does not change the data, even if the read operation reads the target file in the process of using the target file by other tasks, no data error is generated, so the application is to give special permission to the read operation, so that the application can freely access the data in the disk without considering the limitation of the lock function, that is, whether other task threads hold the lock permission of the target stripe, the read operation can directly read the data of the target stripe, no data error is caused or interference is generated to other task threads with the lock permission of the target stripe, and the cache module stores hot data.
The storage system may be of various types, and embodiments of the present invention are not limited herein.
Specifically, the cache module may be an original cache module in the storage system, which is not limited herein in this embodiment of the present invention.
S102: if the target file does not exist, the target file read from the disk is sent to a request end of the target file under the condition that the locking authority of the stripe where the target file exists is not applied.
Specifically, under the condition that the target file does not exist in the cache module, the target file needs to be acquired from the disk, however, in a storage system with a plurality of tasks, the common practice in the field is to guarantee mutual exclusion of each task thread to a certain stripe in the disk through lock authority, namely, only one task thread can refer to a specific stripe in the disk at the same time.
The invention provides a file reading method, which considers that the reading operation does not change data, so that even if the reading operation reads the target file in the process of using the target file by other tasks, no data error can be generated, therefore, whether the target file exists in a cache module of a storage system can be judged in response to a reading instruction for the target file, and if the target file does not exist, the target file read from a disk can be sent to a request end of the target file under the condition that the lock authority of a strip where the target file exists is not applied, so that the reading operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the reading operation on a lock function is avoided, and the computing resource is saved.
Based on the above embodiments:
as a preferred embodiment, in the case that the lock authority of the stripe where the target file is located is not applied, the request end for sending the target file read from the disk to the target file is specifically:
reading the target file from the disk to a preset memory pool;
transmitting the target file in the preset memory pool to a request end of the target file;
the preset memory pool is independent of the cache module.
Specifically, considering that when the cache module is used by the read task process, lock permission is required to be applied to the memory space in the cache module, the use of the lock function is not avoided, and the special memory pool is combined with the special property of the read operation given by the application, so that the application of the read operation to the lock permission of the memory space in the cache module can be avoided.
As a preferred embodiment, in the case that the lock authority of the stripe where the target file is located is not applied, the request end for sending the target file read from the disk to the target file is specifically:
and in the process of reading the pages of the target file from the disk to the preset memory pool through the first thread, sending the pages of the target file positioned in the preset memory pool to a request end of the target file through the second thread in sequence.
Specifically, considering that in the process of reading the target file from the disk through the preset memory pool, there are two actions of reading the target file from the disk to the preset memory pool and sending the target file from the preset memory pool to the request end, in order to improve the working efficiency, in the embodiment of the invention, in the process of reading the page of the target file from the disk to the preset memory pool through the first thread, the page of the target file in the preset memory pool is sent to the request end of the target file through the second thread in sequence.
The first thread and the second thread are two threads which are independent from each other.
As a preferred embodiment, in the process of reading, by the first thread, a page of a target file from a disk to a preset memory pool, sending, by the second thread, the page of the target file located in the preset memory pool to a requesting end of the target file in order, specifically:
simultaneously reading a preset window number pages of a target file from a disk to a preset memory pool through a first thread;
marking asynchronous trigger marks for pages in a designated order in a batch of pages which are read at the same time recently;
Transmitting a head page at the forefront end of an order which is not sent out in a preset memory pool to a request end of a target file through a second thread, and judging whether an asynchronous trigger mark exists in the head page which is sent out recently;
if so, executing the step of simultaneously reading a preset window number pages of the target file from the disk to a preset memory pool through the first thread;
and if the head page does not exist, executing the step of sending the head page which is not sent out in the preset memory pool and is positioned at the forefront end of the sequence to the request end of the target file through the second thread, and judging whether the head page which is sent out recently has an asynchronous trigger mark or not.
For better explanation of the embodiments of the present invention, please refer to fig. 2 and fig. 3, in which fig. 2 is a schematic flow chart of a pre-reading mechanism provided by the present invention, and fig. 3 is a schematic flow chart of another pre-reading mechanism provided by the present invention.
Specifically, in fig. 2, each rectangular block represents a page data of 4KB in data amount, a rectangular block without diagonal lines represents a blank page where no data exists, and a rectangular block with diagonal lines represents a page where data exists.
Specifically, in fig. 3, stage T0: after a host user sends a file reading command to a RAID card, the RAID card controller wants to read a first page of the file, the page is not in a cache, at this time, the RAID card controller reads a plurality of page data to a preset memory pool through a first thread, and the RAID card controller marks a second page in a read-ahead window as PG_ReadTahead (namely an asynchronous trigger mark);
Stage T1: when a second page with a PG_Readhead mark is read, the RAID card controller triggers the first thread to work, and a plurality of page data are read to a preset memory pool in the background;
t2 and T3 phases: since there are two more pages available in the default memory pool at this time, no pre-read operation is required. Therefore, respectively reading two pages in a preset memory pool in the stages T2 and T3;
stage T4: since the first line Cheng Yuxian read operation in the T1 stage marks a page in the preset window number as pg_readhead, when the RAID card controller encounters the page, a read-ahead operation of the first thread is triggered again;
stage T5, T6, T7, T8: as in the T2, T3 phases, the page in the last pre-read window is read (in the preset memory pool).
Specifically, considering that when data is read from a disk, a plurality of pages can be read at one time so as to reduce the interaction times with the disk and improve the working efficiency, in the embodiment of the invention, the preset window number of the target file can be read from the disk to the preset memory pool through the first thread at one time, and in order to trigger the first thread to work timely, asynchronous trigger marks can be marked for pages in a designated order in a group of pages which are read at the latest, then in the process of sending the pages from the preset memory pool through the second thread according to the sequence, the asynchronous trigger marks on the pages can be triggered while sending a certain page, so that the first thread is triggered to work, and the first thread and the second thread are mutually matched to realize: and in the process of reading the pages of the target file from the disk to the preset memory pool through the first thread, sending the pages of the target file positioned in the preset memory pool to a request end of the target file through the second thread in sequence.
Wherein, the number of the preset windows and the designated order can be set autonomously, and the embodiment of the invention is not limited herein.
As a preferred embodiment, the first thread simultaneously reads the preset number of pages of the preset window of the target file from the disk to the preset memory pool specifically:
when the pages are read from the disk for the first time, simultaneously reading a first preset number of sub-window pages of the target file from the disk to a preset memory pool through a first thread;
when the pages are not read from the disk for the first time, simultaneously reading the pages of the second preset sub-window number of the target file from the disk to a preset memory pool through a first thread;
marking asynchronous trigger marks for pages in a designated order in a group of pages which are read at the same time recently, wherein the method specifically comprises the following steps:
for pages read simultaneously in the first batch, marking asynchronous trigger marks on pages in a first appointed sub-sequence;
for pages that are not first read at the same time, asynchronous trigger marks are marked on pages that are in the second designated sub-order.
Specifically, considering the characteristic that when the page is read from the disk for the first time, no page related to the target file exists in the preset memory pool, different window numbers can be set for the page read from the disk for the first time and the page read from the disk for the non-first time respectively, namely, the first preset sub-window number is set for the page read from the disk for the first time, and the second preset sub-window number is set for the page read from the disk for the non-first time, so that the data processing efficiency is improved.
Specifically, considering that when the pages are read from the disk for the first time, the characteristic that no page related to the target file exists in the preset memory pool is considered, so that different appointed orders (corresponding to the asynchronous trigger marks) can be set for the pages which are read for the first time and the pages which are not read for the first time respectively, namely, for the pages which are read for the first time, the asynchronous trigger marks are marked on the pages which are positioned in the first appointed sub-order; and for pages which are not read in the first batch at the same time, the asynchronous trigger marks are marked on the pages positioned in the second designated sub-sequence, so that the data processing efficiency is further improved.
As a preferred embodiment, the first preset number of sub-windows is smaller than the second preset number of sub-windows.
Specifically, the number of the first preset sub-windows may be smaller than the number of the second preset sub-windows, so that the second thread can start to execute the work as soon as possible, thereby improving the working efficiency.
Of course, the size relationship between the first preset number of sub-windows and the second preset number of sub-windows may be of other specific types, and the embodiments of the present invention are not limited herein.
As a preferred embodiment, the first designated sub-order is the same as the second designated sub-order.
Specifically, in order to maintain the uniformity of the setting, the first designated sub-order and the second designated sub-order may be set to be the same order, and both the first order and the second order are located in the same page batch as far as possible, so as to prevent the situation of data interruption.
Of course, the size relationship between the first designated sub-order and the second designated sub-order may be of other specific types besides this specific case, and embodiments of the present invention are not limited herein.
As a preferred embodiment, in response to a read instruction for a target file, determining whether the target file exists in a cache module of the storage system is specifically:
determining a total data amount of the target file in response to a read instruction for the target file;
determining the number of first preset sub-windows and the number of second preset sub-windows according to the corresponding relation between the preset total data quantity and the number of windows;
and judging whether the target file exists in a cache module of the storage system.
Specifically, considering that for target files with different sizes, the efficiency of data reading work can be ensured by matching different window numbers, so that in the embodiment of the invention, the total data amount of the target file can be determined in response to a reading instruction for the target file, and then the first preset sub-window number and the second preset sub-window number are determined according to the corresponding relation between the preset total data amount and the window number.
As a preferred embodiment, the correspondence between the preset total data amount and the window number is specifically:
when the total data quantity is smaller than a first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are first value combinations;
when the total data quantity is not smaller than the first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are second valued combinations.
Specifically, the file reading work of two levels can be dealt with by considering the number of windows of two levels, so in the corresponding relation between the preset total data quantity and the number of windows provided in the embodiment of the invention, when the total data quantity is smaller than a first preset threshold value, the number of the first preset sub-windows and the number of the second preset sub-windows are first value combinations; when the total data quantity is not smaller than the first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are second valued combinations.
The first preset threshold, the first value combination and the second value combination can be set independently, which is not limited herein.
As a preferred embodiment, after sending the head page of the front end of the sequence that is not sent out in the preset memory pool to the request end of the target file, the file reading method further includes:
And releasing the recently issued page from the preset memory pool.
Specifically, considering that the possibility of re-reading the target file after the target file is read by the read operation is not great, and meanwhile, in order to save the capacity occupied by the preset memory pool, in the embodiment of the invention, after the head page at the forefront end of the sequence which is not sent out in the preset memory pool is sent to the request end of the target file, the recently sent page can be released from the preset memory pool.
As a preferred embodiment, after determining whether the target file exists in the cache module of the storage system, the file reading method further includes:
if the target file exists, the target file in the cache module is sent to a request end of the target file.
Specifically, in order to further improve the data reading efficiency, when it is determined that the target file exists in the cache module of the storage system, the target file located in the cache module may be sent to the request end of the target file.
As a preferred embodiment, the file reading method further includes:
recording the minimum residual capacity in a preset memory pool in the process of processing the reading instruction;
the control prompter prompts the minimum remaining capacity.
Specifically, in order to find out the situation in time, the embodiment of the invention can record the minimum residual capacity in the preset memory pool and control the prompter to prompt the minimum residual capacity in the process of processing the reading instruction, in consideration of the risk that space is available in the preset memory pool in the process of reading the file due to the influence of the capacity of the preset memory pool, the data processing efficiency and the like.
The prompter may be of various types, for example, may be a display or a network terminal, and the embodiment of the present invention is not limited herein.
As a preferred embodiment, after recording the minimum remaining capacity in the preset memory pool during processing the read command, the file reading method further includes:
judging whether the minimum residual capacity is lower than a second preset threshold value or not;
if the alarm is lower than the preset value, the alarm is controlled to alarm.
Specifically, considering that a worker with insufficient experience may not know the meaning of the prompted minimum residual capacity in time, in order to further improve the working efficiency and user experience, the embodiment of the invention can automatically judge whether the minimum residual capacity is lower than a second preset threshold value and control the alarm to alarm when the minimum residual capacity is lower than the second preset threshold value.
The alarm may be of various types, for example, may be a buzzer, etc., and embodiments of the present invention are not limited herein.
Specifically, the second preset threshold may be set autonomously, which is not limited herein.
As a preferred embodiment, the file reading method further includes:
recording the total data volume of the target file corresponding to the received reading instruction;
determining the maximum value of all total data amounts recorded currently;
the control prompter prompts the maximum value.
Specifically, considering the size of the target file corresponding to each read request in the storage system, the method has reference significance for the capacity setting of the preset memory pool, so that the embodiment of the invention can record the total data volume of the target file corresponding to the received read instruction, determine the maximum value of all the total data volumes recorded currently, and then control the prompter to prompt the maximum value.
Of course, the prompter may be controlled to prompt all the total data amounts recorded, and the embodiment of the present invention is not limited herein.
As a preferred embodiment, after determining the maximum value of all total data amounts currently recorded, the file reading method further includes:
Judging whether the maximum value is larger than a third preset threshold value or not;
if the signal is larger than the preset value, the alarm is controlled to alarm.
Specifically, considering that a worker with insufficient experience may not know the meaning of the maximum value of the prompt in time, in order to further improve the working efficiency and the user experience, the embodiment of the invention can automatically judge whether the maximum value is greater than a third preset threshold value and control the alarm to alarm when the maximum value is greater than the third preset threshold value.
Specifically, the third preset threshold may be set autonomously, which is not limited herein.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a file reading device provided by the present invention, where the file reading device is applied to a control device in a storage system, and includes:
a judging module 41, configured to respond to a read instruction for the target file, judge whether the target file exists in a cache module of the storage system, and if the target file does not exist, trigger the executing module;
and the execution module 42 is configured to send the target file read from the disk to the requesting end of the target file without applying the lock authority of the stripe where the target file is located.
As a preferred embodiment, the execution module includes:
the reading module is used for reading the target file from the disk to a preset memory pool;
The sending module is used for sending the target file in the preset memory pool to a request end of the target file;
the preset memory pool is independent of the cache module.
The invention provides a file reading device, which considers that the reading operation does not change data, so that even if the reading operation reads the target file in the process of using the target file by other tasks, no data error can be generated, therefore, whether the target file exists in a cache module of a storage system can be judged in response to a reading instruction for the target file, and if the target file does not exist, the target file read from a disk can be sent to a request end of the target file under the condition that the lock authority of a strip where the target file exists is not applied, so that the reading operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the reading operation on a lock function is avoided, and the computing resource is saved.
For the description of the document reading apparatus provided in the embodiment of the present invention, reference is made to the foregoing embodiments of the document reading method, and the embodiments of the present invention are not repeated.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a RAID card according to the present invention, where the RAID card includes:
A memory 51 for storing a computer program;
a processor 52 for implementing the steps of the file reading method in the previous embodiment when executing the computer program.
Specifically, the memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer readable instructions, and the internal memory provides an environment for the operating system and the execution of the computer readable instructions in the non-volatile storage medium. When the processor executes the computer program stored in the memory, the following steps may be implemented: responding to a reading instruction of the target file, and judging whether the target file exists in a cache module of the storage system; if the target file does not exist, the target file read from the disk is sent to a request end of the target file under the condition that the locking authority of the stripe where the target file exists is not applied.
The invention provides a RAID card, which considers that the read operation does not change data, so that even if the read operation reads the target file in the process of using the target file by other tasks, no data error can be generated, therefore, whether the target file exists in a cache module of a storage system can be judged in response to a read instruction for the target file, and if the target file does not exist, the target file read from a disk can be sent to a request end of the target file under the condition that the lock authority of a strip where the target file exists is not applied, so that the read operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the read operation on a lock function is avoided, and the calculation resource is saved.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: reading the target file from the disk to a preset memory pool;
transmitting the target file in the preset memory pool to a request end of the target file;
the preset memory pool is independent of the cache module.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: and in the process of reading the pages of the target file from the disk to the preset memory pool through the first thread, sending the pages of the target file positioned in the preset memory pool to a request end of the target file through the second thread in sequence.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory:
simultaneously reading a preset window number pages of a target file from a disk to a preset memory pool through a first thread;
marking asynchronous trigger marks for pages in a designated order in a batch of pages which are read at the same time recently;
transmitting a head page at the forefront end of an order which is not sent out in a preset memory pool to a request end of a target file through a second thread, and judging whether an asynchronous trigger mark exists in the head page which is sent out recently;
If so, executing the step of simultaneously reading a preset window number pages of the target file from the disk to a preset memory pool through the first thread;
and if the head page does not exist, executing the step of sending the head page which is not sent out in the preset memory pool and is positioned at the forefront end of the sequence to the request end of the target file through the second thread, and judging whether the head page which is sent out recently has an asynchronous trigger mark or not.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory:
when the pages are read from the disk for the first time, simultaneously reading a first preset number of sub-window pages of the target file from the disk to a preset memory pool through a first thread;
when the pages are not read from the disk for the first time, simultaneously reading the pages of the second preset sub-window number of the target file from the disk to a preset memory pool through a first thread;
for pages read simultaneously in the first batch, marking asynchronous trigger marks on pages in a first appointed sub-sequence;
for pages that are not first read at the same time, asynchronous trigger marks are marked on pages that are in the second designated sub-order.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: the first preset number of sub-windows is smaller than the second preset number of sub-windows.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: the first designated sub-order is the same as the second designated sub-order.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory:
determining a total data amount of the target file in response to a read instruction for the target file;
determining the number of first preset sub-windows and the number of second preset sub-windows according to the corresponding relation between the preset total data quantity and the number of windows;
and judging whether the target file exists in a cache module of the storage system.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: when the total data quantity is smaller than a first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are first value combinations;
when the total data quantity is not smaller than the first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are second valued combinations.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: and releasing the recently issued page from the preset memory pool.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: if the target file exists, the target file in the cache module is sent to a request end of the target file.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: recording the minimum residual capacity in a preset memory pool in the process of processing the reading instruction;
the control prompter prompts the minimum remaining capacity.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: judging whether the minimum residual capacity is lower than a second preset threshold value or not;
if the alarm is lower than the preset value, the alarm is controlled to alarm.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: recording the total data volume of the target file corresponding to the received reading instruction;
determining the maximum value of all total data amounts recorded currently;
the control prompter prompts the maximum value.
As an alternative embodiment, the processor may implement the following steps when executing the computer subroutine stored in the memory: judging whether the maximum value is larger than a third preset threshold value or not;
If the signal is larger than the preset value, the alarm is controlled to alarm.
For the description of the RAID card provided in the embodiment of the present invention, reference is made to the foregoing embodiment of the file reading method, and the embodiment of the present invention is not repeated.
The invention also provides a storage system comprising the RAID card in the embodiment.
The invention provides a storage system, which considers that read operation does not change data, so that even if the read operation reads the target file in the process of using the target file by other tasks, data errors are not generated, therefore, whether the target file exists in a cache module of the storage system can be judged in response to a read instruction for the target file, and if the target file does not exist, the target file read from a disk can be sent to a request end of the target file under the condition that the lock authority of a strip where the target file exists is not applied, so that the read operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the lock function by the read operation is avoided, and the calculation resource is saved.
For the introduction of the memory system card provided in the embodiment of the present invention, reference is made to the foregoing embodiments of the file reading method, and the embodiments of the present invention are not repeated.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a computer readable storage medium provided in the present invention, in which a computer program 61 is stored on the computer readable storage medium 60, and the computer program 61 implements the steps of the file reading method according to the foregoing embodiment when executed by the processor 52.
The invention provides a computer readable storage medium, which considers that read operation does not change data, so that even if other tasks read the target file in the process of using the target file, no data error can be generated, therefore, whether the target file exists in a cache module of a storage system can be judged in response to a read instruction of the target file, if the target file does not exist, the target file read from a disk can be sent to a request end of the target file under the condition that the lock authority of a strip where the target file exists is not applied, so that the read operation does not need to be suspended and waited, the data processing efficiency is improved, the use of the lock function by the read operation is avoided, and the computing resource is saved.
For the description of the computer readable storage medium provided in the embodiment of the present invention, reference is made to the foregoing embodiments of the file reading method, and the embodiments of the present invention are not repeated.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (18)

1. A file reading method, characterized by being applied to a control device in a storage system, comprising:
responding to a reading instruction of a target file, and judging whether the target file exists in a cache module of the storage system;
if the target file does not exist, under the condition that the lock authority of the strip where the target file exists is not applied, the target file read from a disk is sent to a request end of the target file;
under the condition that the lock authority of the strip where the target file is located is not applied, the request end for sending the target file read from the disk to the target file is specifically:
Reading the target file from the disk to a preset memory pool;
sending the target file in the preset memory pool to a request end of the target file;
the preset memory pool is independent of the cache module, and the preset memory Chi Zhuangong is used for read operations in the storage system.
2. The method for reading a file according to claim 1, wherein the sending, to the requesting end of the target file, the target file read from the disk without applying for a lock authority of a stripe where the target file is located, is specifically:
and in the process of reading the pages of the target file from the disk to a preset memory pool through the first thread, sending the pages of the target file positioned in the preset memory pool to a request end of the target file through the second thread in sequence.
3. The method for reading a file according to claim 2, wherein in the process of reading, by the first thread, the page of the target file from the disk to the preset memory pool, sending, by the second thread, the page of the target file located in the preset memory pool to the requesting end of the target file in order is specifically:
Simultaneously reading a preset window number pages of the target file from a disk to a preset memory pool through a first thread;
marking asynchronous trigger marks for pages in a designated order in a batch of pages which are read at the same time recently;
transmitting a head page at the forefront end of an order which is not sent out in the preset memory pool to a request end of the target file through a second thread, and judging whether the head page which is sent out recently has the asynchronous trigger mark or not;
if so, executing the step of simultaneously reading the pages of the preset window number of the target file from the disk through the first thread to a preset memory pool;
and if the head page does not exist, executing the step of transmitting the head page which is not sent out in the preset memory pool and is positioned at the forefront end of the sequence to the request end of the target file through the second thread, and judging whether the head page which is sent out recently exists the asynchronous trigger mark or not.
4. The method for reading a file according to claim 3, wherein the step of simultaneously reading, by the first thread, the preset number of pages of the target file from the disk into the preset memory pool includes:
when a page is read from a disk for the first time, simultaneously reading a first preset sub-window number of pages of the target file from the disk to a preset memory pool through a first thread;
When the pages are not read from the disk for the first time, simultaneously reading a second preset sub-window number of pages of the target file from the disk to the preset memory pool through the first thread;
the marking of asynchronous trigger marks on pages in a designated order in a batch of pages which are read at the same time recently specifically comprises the following steps:
for pages read simultaneously in the first batch, marking asynchronous trigger marks on pages in a first appointed sub-sequence;
and for pages which are not read first at the same time, marking the asynchronous trigger marks on the pages positioned in the second designated sub-sequence.
5. The method of claim 4, wherein the first predetermined number of sub-windows is less than the second predetermined number of sub-windows.
6. The method of reading a document according to claim 4, wherein the first specified sub-order is the same as the second specified sub-order.
7. The method according to claim 4, wherein the determining whether the target file exists in the cache module of the storage system in response to the read instruction for the target file is specifically:
determining a total data amount of a target file in response to a read instruction for the target file;
Determining the number of first preset sub-windows and the number of second preset sub-windows according to the corresponding relation between the preset total data quantity and the number of windows;
and judging whether the target file exists in a cache module of the storage system.
8. The method for reading a file according to claim 7, wherein the correspondence between the preset total data amount and the window amount is specifically:
when the total data quantity is smaller than a first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are first value combinations;
when the total data quantity is not smaller than the first preset threshold value, the first preset number of sub-windows and the second preset number of sub-windows are second valued combinations.
9. The method for reading a file according to claim 3, wherein after the head page of the front end of the sequence that is not sent out in the preset memory pool is sent to the requesting end of the target file, the method for reading a file further comprises:
and releasing the recently issued page from the preset memory pool.
10. The method according to claim 1, wherein after determining whether the target file exists in the cache module of the storage system, the method further comprises:
And if the target file exists, sending the target file positioned in the cache module to a request end of the target file.
11. The document reading method according to claim 1, further comprising:
recording the minimum residual capacity in the preset memory pool in the process of processing the reading instruction;
and the control prompter prompts the minimum residual capacity.
12. The file reading method according to claim 11, wherein after recording the minimum remaining capacity in the preset memory pool in processing the read command, the file reading method further comprises:
judging whether the minimum residual capacity is lower than a second preset threshold value or not;
if the alarm is lower than the preset value, the alarm is controlled to alarm.
13. The document reading method according to any one of claims 1 to 12, wherein the document reading method further comprises:
recording the total data volume of the target file corresponding to the received reading instruction;
determining the maximum value of all total data amounts recorded currently;
and controlling a prompter to prompt the maximum value.
14. The file reading method according to claim 13, wherein after determining the maximum value among all the total data amounts currently recorded, the file reading method further comprises:
Judging whether the maximum value is larger than a third preset threshold value or not;
if the signal is larger than the preset value, the alarm is controlled to alarm.
15. A document reading apparatus, characterized by being applied to a control device in a storage system, comprising:
the judging module is used for responding to a reading instruction of the target file, judging whether the target file exists in a cache module of the storage system, and triggering the executing module if the target file does not exist;
the execution module is used for sending the target file read from the disk to a request end of the target file under the condition that the lock authority of the strip where the target file is located is not applied;
the execution module comprises:
the reading module is used for reading the target file from the disk to a preset memory pool;
the sending module is used for sending the target file in the preset memory pool to a request end of the target file;
the preset memory pool is independent of the cache module, and the preset memory Chi Zhuangong is used for read operations in the storage system.
16. A RAID card, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the file reading method according to any one of claims 1 to 14 when executing said computer program.
17. A storage system comprising the RAID card of claim 16.
18. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the file reading method according to any of claims 1 to 14.
CN202310318544.1A 2023-03-29 2023-03-29 File reading method and device, RAID card, storage system and storage medium Active CN116028437B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310318544.1A CN116028437B (en) 2023-03-29 2023-03-29 File reading method and device, RAID card, storage system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310318544.1A CN116028437B (en) 2023-03-29 2023-03-29 File reading method and device, RAID card, storage system and storage medium

Publications (2)

Publication Number Publication Date
CN116028437A CN116028437A (en) 2023-04-28
CN116028437B true CN116028437B (en) 2023-07-14

Family

ID=86070822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310318544.1A Active CN116028437B (en) 2023-03-29 2023-03-29 File reading method and device, RAID card, storage system and storage medium

Country Status (1)

Country Link
CN (1) CN116028437B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108572876B (en) * 2018-03-07 2020-11-20 北京神州绿盟信息安全科技股份有限公司 Method and device for realizing read-write lock
KR20210078616A (en) * 2019-12-18 2021-06-29 에스케이하이닉스 주식회사 Data processing system
CN111258967A (en) * 2020-02-11 2020-06-09 西安奥卡云数据科技有限公司 Data reading method and device in file system and computer readable storage medium

Also Published As

Publication number Publication date
CN116028437A (en) 2023-04-28

Similar Documents

Publication Publication Date Title
EP0671691B1 (en) Storage controller and bus control method for use therewith
US7562180B2 (en) Method and device for reduced read latency of non-volatile memory
KR102236419B1 (en) Method, apparatus, device and storage medium for managing access request
EP3605341A1 (en) Controlling performance of a solid state drive
US10585822B2 (en) Operation method of host system including storage device and operation method of storage device controller
CN108959118B (en) Data writing method and device
US11868780B2 (en) Central processor-coprocessor synchronization
TWI249703B (en) System and method to coordinate data storage device management operations in a data storage subsystem
US20190369919A1 (en) Task management method and host for electronic storage device
EP2054800A2 (en) Flash memory access circuit
CN105138481A (en) Stored data processing method and apparatus and system
CN116028437B (en) File reading method and device, RAID card, storage system and storage medium
CN106844234B (en) Data writing method and device and double-active system
KR20010050853A (en) Direct access storage device and method for performing write commands
WO2015170702A1 (en) Storage device, information processing system, storage control method and program
JPH07225694A (en) Virtual computer system
JP2006350881A (en) Memory card controller and memory card control system
US20200159667A1 (en) Faster Computer Memory Access By Reducing SLAT Fragmentation
CN111104065A (en) File storage method, device and equipment
CN112650445B (en) Method and device for executing Trim by solid state disk
CN115794750B (en) Method, device and equipment for controlling file opening/closing of asynchronous I/O system
CN108509288B (en) Method, system and equipment for reading and writing data and computer readable storage medium
JP2697254B2 (en) Real-time processing device
CN116204134B (en) Cache management method, device, equipment, storage system and storage medium
CN114328114A (en) Method, device and equipment for recording program exception information and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant